Summary: | util-linux mount uses wrong default umask for fat filesystem | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Clock <clock> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dsd, stian |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Don't set umask in mount |
Description
Clock
2005-05-23 04:37:20 UTC
This is not a mount bug, but a kernel-bug. umask=nnn is passed along other user-flags to the mount syscall as a string, and the kernel-filesystem driver parses the string and denies the syscall if a syntax-error occures. Not all filesystems supports umask, so umask is not sent unless spesified. If the mount man-page claims that umask is defaulted to the current shell umask setting, the kernel-driver needs to take this into account when umask isn't found in the string it receives from user-space. Just my 5 cent about this bug sounds convincing to me :) iirc, last time i tried using umask, ntfs suffered from similar issues ... but that was a while ago mount bug. Attaching patch against util-linux which I will send upstream for comments. Created attachment 64688 [details, diff]
Don't set umask in mount
Patch does make sense (if the default is to use current process's umask, it should not explicitly set it to 022 ...) ... Daniel, did they get back to you? i havent looked through the code but wouldnt the best change be to set umask(022) if the user did not specify the umask option ? The reason it was added was to prevent the temporary files (e.g. /etc/mtab~) being writable because this can lead to the user getting a root shell. However, I went through the code, and theres only one place where theres a chance of a writable file being created, and the umask is already controlled (it sets to 022, creates file, then restores the umask). I've had no response from the upstream maintainer but just sent another email. Adrian Bunk (upstream maintainer) replies: "sorry, this patch is still part of the big batch of util-linux emails I have to go through." I think its safe to assume this patch is valid. Please include in the ebuild. added to 2.12q-r1 |