Re: [OT] util-linux 2.13-pre1

From: Daniel Drake
Date: Thu Aug 04 2005 - 05:25:09 EST


Adrian,

Adrian Bunk wrote:
util-linux 2.13-pre1 is available at
ftp://ftp.kernel.org/pub/linux/utils/util-linux/testing/util-linux-2.13-pre1.tar.gz

Any comments on the mount patch I sent to you?

Attaching it again now. Please apply.

Thanks,
Daniel
From: Daniel Drake <dsd@xxxxxxxxxx>

Some filesystems such as FAT will default to using the umask of the current
process if the user did not specify a umask option.

Currently, mount.c calls umask(022) early on, removing the possibility of the
user-specified umask (at shell level) being used by default.

Removing the umask(022) call solves the problem.

This appears safe to do, because the code which creates files already does this
safely (saves umask, sets umask 022, creates file, restores umask).

Please apply.

--- util-linux-2.13-pre1/mount/mount.c.orig 2005-08-04 11:00:50.000000000 +0100
+++ util-linux-2.13-pre1/mount/mount.c 2005-08-04 11:00:58.000000000 +0100
@@ -1466,8 +1466,6 @@ main(int argc, char *argv[]) {
if ((p = strrchr(progname, '/')) != NULL)
progname = p+1;

- umask(022);
-
/* People report that a mount called from init without console
writes error messages to /etc/mtab
Let us try to avoid getting fd's 0,1,2 */