NetBSD Problem Report #117

From gnats  Thu Feb 10 01:59:31 1994
Received: from theotp9.physik.uni-ulm.de (theotp9.physik.uni-ulm.de [134.60.10.149]) by sun-lamp.cs.berkeley.edu (8.6.5/8.6.5) with ESMTP id BAA11864 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Thu, 10 Feb 1994 01:59:19 -0800
Message-Id: <199402100959.KAA00333@theotp9.physik.uni-ulm.de>
Date: Thu, 10 Feb 1994 10:59:04 +0100
From: daeh@physik.uni-ulm.de (Harald Daeubler)
Reply-To: daeh@physik.uni-ulm.de
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: setmode(3) doesn't work
X-Send-Pr-Version: 3.2

>Number:         117
>Category:       lib
>Synopsis:       setmode(3) doesn't work
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 10 02:05:07 +0000 1994
>Closed-Date:    Thu Feb 24 01:18:29 +0000 1994
>Last-Modified:  Sun Mar 03 17:41:43 +0000 2013
>Originator:     Harald Daeubler
>Release:        NetBSD-current
>Organization:
	Universitaet Ulm
>Environment:
	m68k-port NetBSD 0.9a
System: NetBSD theotp9 0.9 THEOTP#1 i386


>Description:
setmode(3) doesnt work correctly for file modes with 'u', 'g' or 'o' on the
rhs of an '=', for example go=u-w.

>How-To-Repeat:
	Try chmod go=u-w file
>Fix:
The bug was introduced recently by a change to src/lib/libc/gen/setmode.c
(see diffs). I couldnt figure out why that change was made, but undoing it
would fix this problem (and perhaps cause others ??)

*** setmode.c	Wed Feb  9 12:56:54 1994
--- setmode.c.old	Wed Feb  9 11:36:25 1994
***************
*** 322,328 ****
  				 * to flush out any partial mode that we have,
  				 * and then do the copying of the mode bits.
  				 */
! 				if (perm || op == '=') {
  					ADDCMD(op, who, perm, mask);
  					perm = 0;
  				}
--- 321,327 ----
  				 * to flush out any partial mode that we have,
  				 * and then do the copying of the mode bits.
  				 */
! 				if (perm) {
  					ADDCMD(op, who, perm, mask);
  					perm = 0;
  				}
***************
*** 338,344 ****
  				 * Add any permissions that we haven't already
  				 * done.
  				 */
! 				if (perm || op == '=') {
  					ADDCMD(op, who, perm, mask);
  					perm = 0;
  				}
--- 337,343 ----
  				 * Add any permissions that we haven't already
  				 * done.
  				 */
! 				if (perm) {
  					ADDCMD(op, who, perm, mask);
  					perm = 0;
  				}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: cgd 
State-Changed-When: Thu Feb 10 15:51:22 PST 1994 
State-Changed-Why:  
fixed it.  the user-supplied patch is *very* bogus; it breaks "chmod g= file" 
State-Changed-From-To: feedback->closed 
State-Changed-By: cgd 
State-Changed-When: Wed Feb 23 17:18:29 PST 1994 
State-Changed-Why:  
i fixed it.  further posixifications coming soon, from work done by me for 
4.4BSD, but not here yet. 

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.