public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] unrestricted_chown : userspace part
@ 2008-12-09  4:32 Niraj Kumar
  2008-12-09  9:36 ` James Youngman
  0 siblings, 1 reply; 3+ messages in thread
From: Niraj Kumar @ 2008-12-09  4:32 UTC (permalink / raw)
  To: util-linux-ng, linux-fsdevel; +Cc: hch, nick.couchman



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.

Signed-off-by: Niraj Kumar <niraj17@gmail.com>



diff -Naurp util-linux-ng-2.14.1.orig/mount/mount.c util-linux-ng-2.14.1/mount/mount.c
--- util-linux-ng-2.14.1.orig/mount/mount.c	2008-09-10 14:32:43.000000000 +0530
+++ util-linux-ng-2.14.1/mount/mount.c	2008-12-09 09:37:19.000000000 +0530
@@ -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 */
diff -Naurp util-linux-ng-2.14.1.orig/mount/mount_constants.h util-linux-ng-2.14.1/mount/mount_constants.h
--- util-linux-ng-2.14.1.orig/mount/mount_constants.h	2008-05-29 04:31:02.000000000 +0530
+++ util-linux-ng-2.14.1/mount/mount_constants.h	2008-12-09 09:37:19.000000000 +0530
@@ -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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] unrestricted_chown : userspace part
  2008-12-09  4:32 [PATCH] unrestricted_chown : userspace part Niraj Kumar
@ 2008-12-09  9:36 ` James Youngman
       [not found]   ` <c5df85930812090136v7a3bdce8o7a8b70c25ab2827b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: James Youngman @ 2008-12-09  9:36 UTC (permalink / raw)
  To: Niraj Kumar
  Cc: util-linux-ng-u79uwXL29TY76Z2rM5mHXA,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, hch-jcswGhMUV9g,
	nick.couchman-nV4p5R2ZCaoAvxtiuMwx3w

On Tue, Dec 9, 2008 at 4:32 AM, Niraj Kumar <niraj17-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>
> 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] unrestricted_chown : userspace part
       [not found]   ` <c5df85930812090136v7a3bdce8o7a8b70c25ab2827b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2008-12-09 10:56     ` Karel Zak
  0 siblings, 0 replies; 3+ messages in thread
From: Karel Zak @ 2008-12-09 10:56 UTC (permalink / raw)
  To: James Youngman
  Cc: Niraj Kumar, util-linux-ng-u79uwXL29TY76Z2rM5mHXA,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, hch-jcswGhMUV9g,
	nick.couchman-nV4p5R2ZCaoAvxtiuMwx3w

On Tue, Dec 09, 2008 at 09:36:54AM +0000, James Youngman wrote:
> On Tue, Dec 9, 2008 at 4:32 AM, Niraj Kumar <niraj17-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> >
> > 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.

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

    Karel

-- 
 Karel Zak  <kzak-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-09 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-09  4:32 [PATCH] unrestricted_chown : userspace part Niraj Kumar
2008-12-09  9:36 ` James Youngman
     [not found]   ` <c5df85930812090136v7a3bdce8o7a8b70c25ab2827b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-12-09 10:56     ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox