From owner-freebsd-bugs Wed Sep 22 4: 3:54 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from relay.ucb.crimea.ua (relay.ucb.crimea.ua [212.110.138.1]) by hub.freebsd.org (Postfix) with ESMTP id 6D75414D98 for ; Wed, 22 Sep 1999 04:02:45 -0700 (PDT) (envelope-from ru@ucb.crimea.ua) Received: (from ru@localhost) by relay.ucb.crimea.ua (8.9.3/8.9.3/UCB) id NAA53016; Wed, 22 Sep 1999 13:50:33 +0300 (EEST) (envelope-from ru) Date: Wed, 22 Sep 1999 13:50:32 +0300 From: Ruslan Ermilov To: Sheldon Hearn 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> Mail-Followup-To: Sheldon Hearn , freebsd-bugs@FreeBSD.ORG References: <199909220740.AAA79146@freefall.freebsd.org> <50471.937993197@axl.noc.iafrica.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=CE+1k2dSO48ffgeK X-Mailer: Mutt 0.95.3i In-Reply-To: <50471.937993197@axl.noc.iafrica.com>; from Sheldon Hearn on Wed, Sep 22, 1999 at 11:39:57AM +0200 X-Operating-System: FreeBSD 3.2-STABLE i386 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --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