[Bug 262334] su(1) does not set correct argv[0]

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 04 Mar 2022 06:14:55 UTC

            Bug ID: 262334
           Summary: su(1) does not set correct argv[0]
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: rajeev_v_pillai@yahoo.com

Created attachment 232243
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=232243&action=edit
patch to set correct argv[0] in invoked shell

su(1) does not set the correct argv[0]. It should set argv[0] corresponding to
shell that will be invoked instead of always setting it to "su"/"-su"/"_su".

$ su
root@x202e:/tmp # echo $0
root@x202e:/tmp # ^D
$ su -l
root@x202e:~ # echo $0
root@x202e:~ # ^D

The attached patch sets argv[0] to "shell"/"-shell" according to the invoked

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