Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 2017 04:13:07 +0000
From:      Glen Barber <gjb@FreeBSD.org>
To:        "Rodney W. Grimes" <freebsd-rwg@pdx.rh.CN85.dnsmgr.net>
Cc:        Chris Sinjakli <chris@sinjakli.co.uk>, freebsd-hackers@freebsd.org, "Rodney W. Grimes" <rgrimes@FreeBSD.org>
Subject:   Re: A historical curiosity in su(1)
Message-ID:  <20170322041307.GB42680@FreeBSD.org>
In-Reply-To: <201703212312.v2LNCN7A071745@pdx.rh.CN85.dnsmgr.net>
References:  <CAN-H%2BybmipbPq59HGVsfouS_8v-ezDbU%2B4PKtiTwj3tv-LjOyw@mail.gmail.com> <201703212312.v2LNCN7A071745@pdx.rh.CN85.dnsmgr.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--WhfpMioaduB5tiZL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 21, 2017 at 04:12:23PM -0700, Rodney W. Grimes wrote:
> > Jumping back to the point I made in the talk, the result of getlogin ca=
n often
> > be surprising. For example, a daemon restarted by a supervisor (e.g. up=
start)
> > will be associated with the user that issued the restart (i.e. getlogin=
 would
> > return "chris" if I restarted it, rather than something like "daemon-us=
er"). Any
> > daemon that calls su will run into this behaviour.
>=20
> su - should resolve that behavior.
>=20

For clarification with special characters, this is 'su -', which indeed
does resolve the behavior described.  From the su(1) manual page:

     su -l foo
            Simulate a login for user foo.
     su - foo
            Same as above.
     su -   Simulate a login for root.

Glen


--WhfpMioaduB5tiZL
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCAAGBQJY0fnTAAoJEAMUWKVHj+KTQuYQAISgvJQLcgtSfcFZwOSLPuVu
eTWJ7cl4VUKR3Q7c6yp6gyEg7DLa5Ba2RMLFzOxNgvTaTblnIFTGpypN4brerCdW
AU4ofPOc5m95t5WHkWmNx9eAP+EvYWsTlNF/28ko8bK3beyX3sGs0PXSRrN5+J5K
TZsvJpLS7+emC0sRvfXjWhBfCfh9JI4VCVaONkzcphSeTgmyJVo/BZHPYDqec1xi
Vq5m9Xqsn9o5IO5DIAGWroJXHhA9Kl4R/7m1iVQiUu98m4VIhZQbe5Nk7tHNriCW
HKNLwcuIysauNEq/p7EVxN8kBNN/77abS4ePCkyjBidwGF+BBv3orslydlUsVrDw
OobXdygPGUyK5xA9D/9cH4aCg49SDtGZrh+1RJLyFcRgUqD4EDpLxiLqqys5eXN1
FKHPCRFw0kXtG4/Bes/SpIJ8mfmKUYEZVp7mp+TjS923tDiOuIXIvWOYBqAnAF65
e6nA9d9jQbSOMst+YfYoaMhxD/WMpVXU7ZwKAbELUEvud/HhDcIENYwRwy6GAY0K
gw3/bpj1Bb8twJRnaEHAbyoBbz9gibons5WR+LqYM7k+AdV90Vev1sQM6wPVM70F
I8iWlNjZjpoQSUwUnA+psx8YLJ5Od0nZoQSi7hRKva+kJfozTj9f30Xc5akZF+Cv
wLEwa8oDvlLmWRm5vAYO
=gRA7
-----END PGP SIGNATURE-----

--WhfpMioaduB5tiZL--



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