From owner-freebsd-bugs Thu May 2 14:38:35 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id OAA27444 for bugs-outgoing; Thu, 2 May 1996 14:38:35 -0700 (PDT) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id OAA27436 for ; Thu, 2 May 1996 14:38:31 -0700 (PDT) Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id XAA06171; Thu, 2 May 1996 23:38:02 +0200 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id XAA01302; Thu, 2 May 1996 23:38:02 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.7.5/8.6.9) id WAA14464; Thu, 2 May 1996 22:01:09 +0200 (MET DST) From: J Wunsch Message-Id: <199605022001.WAA14464@uriah.heep.sax.de> Subject: Re: Bug: 2.1.0: chmod +s To: freebsd-bugs@FreeBSD.org (FreeBSD bugs list) Date: Thu, 2 May 1996 22:01:08 +0200 (MET DST) Cc: babbleon@mercury.interpath.com (Brian T. Schellenberger) Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199605020521.BAA12293@mercury.interpath.com> from "Brian T. Schellenberger - Personal Account" at "May 2, 96 01:21:18 am" X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E X-Mailer: ELM [version 2.4ME+ PL15 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-bugs@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk As Brian T. Schellenberger - Personal Account wrote: > > The +s option to 2.1.0's chmod is broken; the numerical equivalent works > just fine. (Just do a chmod +s to a file; ls -l; then do a chmod 6755 or > whatever, and ls -l). Not specifying the `who' for +s seems to be a bit senseless to me, but you're probably right, this is a minor nit in the implementation of setmode(3). I've re-read Posix.2 for this, and it's not fully clear what to do. I've thought about modifying it, but the result will be that specifying ``+s'' would always be treated as ``ug+s'', since the setuid and setgid bits are always clear in the umask. While this is more in the line of Posix (well, if you interpret it to the letter), i consider it rather dangerous since an innocent attempt to turn on some set*id bit without verification will most likely always result in making the file setuid _and_ setgid. This is most likely _never_ what has been intended. Unless somebody really thinks we should change the current behaviour, i'm more for keeping it as it is (even though i've now spent half an hour in investigating this, and have the patch ready). For those who are interested, it's in src/lib/libc/gen/setmode.c, lines 257 ff. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)