Created attachment 173036 [details]
Patch for su.c and su.1
POSIX 1003.1 states:
The system shall initialize this variable at the time of login to be the user's login name. See <pwd.h>. For a value of LOGNAME to be portable across implementations of POSIX.1-2008, the value should be composed of characters from the portable filename character set."
"su -l" Simulate a full login. But LOGNAME is unset after "su -l".
samba port depends on this variable during some operations (see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=175544) but samba's developer refuses to do anything about it (see https://bugzilla.samba.org/show_bug.cgi?id=9592).
IMHO "su -l" shall set this variable since it's part of POSIX standard.