From nobody Sat Apr 09 22:19:27 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E720C1A95E29 for ; Sat, 9 Apr 2022 22:19:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KbV0H4Rynz4n9k for ; Sat, 9 Apr 2022 22:19:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 764B9222EE for ; Sat, 9 Apr 2022 22:19:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 239MJR8q091522 for ; Sat, 9 Apr 2022 22:19:27 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 239MJR0U091521 for bugs@FreeBSD.org; Sat, 9 Apr 2022 22:19:27 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 263188] pw accepts and "illegal option" but completes the command without error Date: Sat, 09 Apr 2022 22:19:27 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: dclarke@blastwave.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649542767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YgaaVEYtDwBIsx5Cqt34n+6GvIFdI7lQnTJ8/FB6uLI=; b=nqi0REPYHCHxymCPob0uCNHBfu/okTQlg+ieHM2AyP5q8HwwSNPoK5SC+l5aomIAqVLB1W thGBwscpO42ETBLh0ewF0CW4JbSPl3j2XNLs3TXJBSR0H1aTlG9KqAqC+vW8Xq/mHfytrV 3ateeR2eOh1QYQWvdtld0LII1JTdLFrVYkMzuBBrnOmaLtRQllsFHWzu0Ih/komLJIkbgn 2FKthBxXrqJ/+C1gCWMzU9oi/D0HrxBw5oWeyGgKFrweHyXimgHJi6WohZhyy1NSzYtwuB wMHTzxVuBgvspSZPY6KKyUjM1Y2dqkDUbpnbfkeOoeforPUT2jUUqu61UP/lPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649542767; a=rsa-sha256; cv=none; b=L7nwocwGasJlHhLzo/meZwLGle+KKTcZSuihmZQr8rl4/62BWIaR3dc2E7WgWDx7KSA5Pt pTAd58daH8eZBvV2KFW8Uj6dmSnlURe5j9ReRwN+bUCL06VphtQAysAxJnngigz279hXJH VB8E3/eeOoCdhv2XTULfziBrxIRcWE8o+xkc/p4Vo0aroiBwami/PKXGtZxhxbDyCj1NTo Ig9WJG1Mna4olDcJJrj72iMqSbTZWvFBbj+9KC332sJxX/j62EUdO2Vnd4QtcNit6Ql3uI T2Tw7PSLNLNGngyFfHSHHn8paZZWneVl7GFm6KoJssgzrJdM2rfV22GbOe7e8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N 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.=