[Bug 263188] pw accepts and "illegal option" but completes the command without error
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 263188] pw accepts an "illegal option" but completes the command without error"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 263188] pw accepts an "illegal option" but completes the command without error"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 263188] pw accepts an "illegal option" but completes the command without error"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 263188] pw accepts an "illegal option" but completes the command without error"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 263188] pw accepts an "illegal option" but completes the command without error"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 263188] pw accepts an "illegal option" but completes the command without error"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 263188] pw accepts an "illegal option" but completes the command without error"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 263188] pw accepts an "illegal option" but completes the command without error"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 263188] pw accepts an "illegal option" but completes the command without error"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 09 Apr 2022 22:19:27 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263188 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 : 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# 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# 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 : 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# 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. -- Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional -- You are receiving this mail because: You are the assignee for the bug.