Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  sudo --login does not set LOGIN env var

    Posted Fri August 24, 2018 11:50 AM

    Originally posted by: Edward Davignon


    sudo --login does not set the LOGIN envirnmont variable on AIX like the login process does.

     

    $ rpm -q sudo

    sudo-1.8.21p2-1.ppc

    $ sudo --login env | grep '^LOG'

    LOGNAME=root

    $ sudo su - -c env | grep '^LOG'

    LOGIN=root

    LOGNAME=root

    $ su - -c env | grep '^LOG'

    root's Password:

    LOGIN=root

    LOGNAME=root
    $ sudo --help | grep -e --login

      -i, --login                   run login shell as the target user; a command may also be specified

    $ man login | grep -p 'LOGIN .* environment variables'

           When a user logs in successfully, the login command makes entries in the /etc/utmp file that

           tracks current user logins and the /var/adm/wtmp file that is used for accounting purposes. The

           login command also sets the LOGIN and LOGNAME environment variables.

    $ oslevel -s

    7200-02-02-1832

    $ oslevel -sg $(oslevel -s)

    Fileset                                 Actual Level       Service Pack Level

    -----------------------------------------------------------------------------

    devices.vdevice.IBM.vfc-client.rte      7.2.2.16           7.2.2.15

    rsct.core.rmc                           3.2.3.2            3.2.3.1

    rsct.core.utils                         3.2.3.2            3.2.3.1

    rsct.opt.storagerm                      3.2.3.2            3.2.3.1

    $

     


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 2.  Re: sudo --login does not set LOGIN env var

    Posted Tue August 28, 2018 03:06 AM

    Originally posted by: AyappanP


    AIX Toolbox Sudo being a Opensource tool can't be expected to do the same as AIX native "su" tool. This is not an issue.

     

     


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 3.  Re: sudo --login does not set LOGIN env var

    Posted Tue August 28, 2018 01:55 PM

    Originally posted by: Edward Davignon


    This would probably be better handled upstream.

    I opened Bug 848 - -i / --login on AIX does not initialize LOGIN environment variable like su -

    https://bugzilla.sudo.ws/show_bug.cgi?id=848


    #AIXOpenSource
    #AIX-Open-Source-Software