Date: Wed, 22 Sep 1999 13:50:32 +0300 From: Ruslan Ermilov <ru@FreeBSD.ORG> To: Sheldon Hearn <sheldonh@uunet.co.za> Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/13889: /usr/bin/chmod +t and /usr/bin/chmod +s have no effect Message-ID: <19990922135032.A50196@relay.ucb.crimea.ua> In-Reply-To: <50471.937993197@axl.noc.iafrica.com>; from Sheldon Hearn on Wed, Sep 22, 1999 at 11:39:57AM %2B0200 References: <199909220740.AAA79146@freefall.freebsd.org> <50471.937993197@axl.noc.iafrica.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii On Wed, Sep 22, 1999 at 11:39:57AM +0200, Sheldon Hearn wrote: > > The submitter did not properly describe the problem. What he meant for > the sticky case was this: > > $ mkdir /tmp/somedir > $ ls -ld /tmp/somedir > drwxr-xr-x 2 sheldonh wheel 512 Sep 22 11:38 /tmp/somedir > $ chmod +t /tmp/somedir > $ ls -ld /tmp/somedir > drwxr-xr-x 2 sheldonh wheel 512 Sep 22 11:38 /tmp/somedir > The following patch will do the trick. -- Ruslan Ermilov Sysadmin and DBA of the ru@ucb.crimea.ua United Commercial Bank, ru@FreeBSD.org FreeBSD committer, +380.652.247.647 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: setmode.c =================================================================== RCS file: /usr/FreeBSD-CVS/src/lib/libc/gen/setmode.c,v retrieving revision 1.3 diff -u -r1.3 setmode.c --- setmode.c 1995/10/22 14:36:51 1.3 +++ setmode.c 1999/09/22 10:38:33 @@ -255,12 +255,12 @@ break; case 's': /* If only "other" bits ignore set-id. */ - if (who & ~S_IRWXO) + if (!who || who & ~S_IRWXO) perm |= S_ISUID|S_ISGID; break; case 't': /* If only "other" bits ignore sticky. */ - if (who & ~S_IRWXO) { + if (!who || who & ~S_IRWXO) { who |= S_ISTXT; perm |= S_ISTXT; } --CE+1k2dSO48ffgeK-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990922135032.A50196>