Skip to contentSkip to conversation

unrestricted_chown : userspace part

PATCH In review Niraj Kumar 3 participants 3 messages Dec 9, 2008 1 message not in the archive VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 unrestricted_chown : userspace part

Unrestricted chown: Userspace patch for mount program

This patch adds "unrestricted_chown" option to
mount program. This option is used to disable
the Posix _POSIX_CHOWN_RESTRICTED chown option on a given filesystem which forbids non-privilegued users to give away files.

This is currently implemented by XFS as a sysctl, but making it per filesystem and available not just for XFS makes more sense. This has also been requested in http://oss.sgi.com/bugzilla/show_bug.cgi?id=768.

See http://www.opengroup.org/onlinepubs/009695399/functions/chown.html
for details.

Another patch for kernel changes is also being posted.

mount/mount.c +1 -0
diff -Naurp util-linux-ng-2.14.1.orig/mount/mount.c util-linux-ng-2.14.1/mount/mount.c
@@ -132,6 +132,7 @@ static const struct opt_map opt_map[] = 
   { "sync",	0, 0, MS_SYNCHRONOUS},	/* synchronous I/O */
   { "async",	0, 1, MS_SYNCHRONOUS},	/* asynchronous I/O */
   { "dirsync",	0, 0, MS_DIRSYNC},	/* synchronous directory modifications */
+  { "unrestricted_chown",	0, 0, MS_UNRESTRICTED_CHOWN},/* Unrestricted Chown */
   { "remount",  0, 0, MS_REMOUNT},      /* Alter flags of mounted FS */
   { "bind",	0, 0, MS_BIND   },	/* Remount part of tree elsewhere */
   { "rbind",	0, 0, MS_BIND|MS_REC }, /* Idem, plus mounted subtrees */
mount/mount_constants.h +3 -0
diff -Naurp util-linux-ng-2.14.1.orig/mount/mount_constants.h util-linux-ng-2.14.1/mount/mount_constants.h
@@ -22,6 +22,9 @@
 #ifndef MS_DIRSYNC
 #define MS_DIRSYNC	128	/* Directory modifications are synchronous */
 #endif
+#ifndef MS_UNRESTRICTED_CHOWN
+#define MS_UNRESTRICTED_CHOWN	256	/* Unrestricted chown */
+#endif
 #ifndef MS_NOATIME
 #define MS_NOATIME	0x400	/* 1024: Do not update access times. */
 #endif
#1 lore raw
Quoted 8 lines · Niraj Kumar

Unrestricted chown: Userspace patch for mount program

This patch adds "unrestricted_chown" option to
mount program. This option is used to disable
the Posix _POSIX_CHOWN_RESTRICTED chown option on a given filesystem which forbids non-privilegued users to give away files.

The name [no]restrict_chown would be more in keeping with the names of
the existing mount options. Failing that perhaps chown=restricted.

James.
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): c5df85930812090136v7a3bdce8o7a8b70c25ab2827b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#3 lore raw
Quoted 5 lines · James Youngman
Quoted 4 lines · Niraj Kumar

Unrestricted chown: Userspace patch for mount program

Quoted 7 lines
Quoted 4 lines

This patch adds "unrestricted_chown" option to
mount program. This option is used to disable
the Posix _POSIX_CHOWN_RESTRICTED chown option on a given filesystem which forbids non-privilegued users to give away files.

The name [no]restrict_chown would be more in keeping with the names of
the existing mount options. Failing that perhaps chown=restricted.

Yeah, the proposed name "unrestricted_chown" is ugly and terribly long.

Karel

Signature · 5 lines
 Karel Zak  <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html