NetBSD Problem Report #23832
Received: (qmail 9017 invoked by uid 605); 21 Dec 2003 20:22:23 -0000
Message-Id: <20031221202223.9016.qmail@mail.netbsd.org>
Date: 21 Dec 2003 20:22:23 -0000
From: Christian Biere <christianbiere@gmx.de>
Sender: gnats-bugs-owner@NetBSD.org
To: gnats-bugs@gnats.netbsd.org
Subject: Wrong behaviour of setmode() WRT the sticky bit
X-Send-Pr-Version: 3.95
>Number: 23832
>Category: lib
>Synopsis: Wrong behaviour of setmode() WRT the sticky bit
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Dec 21 20:23:00 +0000 2003
>Closed-Date:
>Last-Modified:
>Originator: Christian Biere
>Release: NetBSD 1.6ZG
>Organization:
>Environment:
System: NetBSD cyclonus 1.6ZG NetBSD 1.6ZG (STARSCREAM) #0: Tue Dec 16 17:11:50 CET 2003 bin@cyclonus:/usr/build/arch/i386/compile/STARSCREAM i386
Architecture: i386
Machine: i386
>Description:
setmode() doesn't handle the sticky bit properly which affects e.g.,
/bin/chmod. The sticky bit must not be modified if the who" argument
is 'u' or 'g'. [ If I read correctly, this seems to have changed to
"behaviour is undefined". ] Without a "who" argument or 'a' as "who"
argument, the sticky bit should be respected.
The problem occured to me when I did "chmod a=rx dir" and I noticed
that the sticky bit wasn't reset. I think the source of this is
setmode().
>How-To-Repeat:
I've tested these on Solaris 2.8, Tru64 UNIX and IRIX. IMO, NetBSD
does the wrong thing although the sticky bit special case and NetBSD
might not follow XSI but apply different behaviour WRT the sticky bit.
$ mkdir xxx
$ chmod 1755 xxx
$ ls -ld xxx
drwxr-xr-t 2 chris wheel 512 Dec 21 20:54 xxx
This one should be a bug:
$ chmod a=rx xxx
dr-xr-xr-t 2 chris wheel 512 Dec 21 20:54 xxx
$ # The sticky bit should have been cleared
This next one is not necessarily a bug, if NetBSD has decided to stick to
"undefined behaviour" for 't' in combination with 'g' or 'u':
$ chmod g-t xxx
dr-xr-xr-x 2 chris wheel 512 Dec 21 20:54 xxx
$ # The sticky bit should have not been modified
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.