Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Apr 2022 22:19:27 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 263188] pw accepts and "illegal option" but completes the command without error
Message-ID:  <bug-263188-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263188

            Bug ID: 263188
           Summary: pw accepts and "illegal option" but completes the
                    command without error
           Product: Base System
           Version: 13.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: dclarke@blastwave.org

This may seem trivial but goes against basic UNIX concepts. I have a
list of users on a system and they all have home directories :=20

blastwave# ls -lap /home
total 212
drwxr-xr-x   7 root     devl     7 Apr  9 22:08 ./
drwxr-xr-x  23 root     wheel   32 Apr  1 15:00 ../
drwxrwx---   6 dasbot   dasbot  20 Mar 28 10:03 dasbot/
drwx------   7 dclarke  devl    32 Apr  9 05:16 dclarke/
drwx------   5 debug    devl    15 Mar  8 16:43 debug/
drwxr-xr-x   6 nsonack  devl    20 Mar 28 20:56 nsonack/
blastwave#=20

I choose to remove the user "debug" as well as the home directory :

blastwave# pw userdel -n debug -t
pw: illegal option -- t
blastwave# echo $?
0
blastwave#=20

Above we see that there is an error message? Is that an error? The pw
command seems to issue no error status and simply ignores the faulty
option "-t" with the result being that indeed the user "debug" is gone
but the home directory remains :=20

blastwave# ls -lap /home
total 178
drwxr-xr-x   6 root     devl     6 Apr  9 22:08 ./
drwxr-xr-x  23 root     wheel   32 Apr  1 15:00 ../
drwxrwx---   6 dasbot   dasbot  20 Mar 28 10:03 dasbot/
drwx------   7 dclarke  devl    32 Apr  9 05:16 dclarke/
drwx------   5 10001    devl    15 Mar  8 16:43 debug/
drwxr-xr-x   6 nsonack  devl    20 Mar 28 20:56 nsonack/
blastwave#=20

This is bad voodoo. If there is an error message then indicate that it
is an "error" or a "warning". Regardless one should not be astonished by
the results. I disagree with a baseline UNIX command that surprises the
user with strange results and strange output.


--=20
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-263188-227>