Subject: kern/3491: chflags problems
To: None <>
From: None <>
List: netbsd-bugs
Date: 04/14/1997 16:57:42
>Number:         3491
>Category:       kern
>Synopsis:       several problems with chflags and it's docs.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 14 08:05:01 1997
>Originator:     Paul Boven
Paul Boven, <>  PE1NUT  QRV 145.575 JO32KF
          Lynx users have a "Right to follow a link", too!
>Release:        April 4th kernel, apr 6th chflags
System: NetBSD 1.2D NetBSD 1.2D (ELC) #1: Fri Apr 4 18:52:03 CEST 1997 sparc

There are several issues with chflags. Some are documentation-related, some
are kernel-related. 
First of all, using the chflags command itself, no error is reported when
trying to change flags one does not have permission to change, while an
EPERM ought to be returned.
Secondly, the chflags(2) manpage does not give all of the flags that can
be used, UF_OPAQUE and SF_ARCHIVED are omitted.
Thirdly, the chfllags(1) manpage does not say that the archived flag can
only be set by the superuser, though experience and <sys/stat.h> say root
privileges are needed there. 
This poor support of flags is also affecting, for instance, commands like
I sent this pr to the kern-category, as I think the major problem here is
in the namei/lookup/stat areas of the kernel.
touch foo; chflags arch foo; ls -lo foo; su; chflags arch foo; ls -lo foo
This illustrates both that one needs to be root to set the archived-flag, 
and that no error-messages get generated.
Sorry, no fix except for the docs as suggested above.