{"thread":{"id":"28680","subject":"[PATCH] t1304: fall back to $USER if $LOGNAME is not defined","startedAt":"2011-10-14T17:44:45Z","lastAt":"2011-10-14T20:54:28Z","messageCount":3,"participants":["René Scharfe","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"177656","messageId":"4E98750D.1020106@lsrfire.ath.cx","threadId":"28680","inReplyTo":null,"subject":"[PATCH] t1304: fall back to $USER if $LOGNAME is not defined","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2011-10-14T17:44:45Z","receivedAt":"2011-10-14T17:44:45Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"For some reason $LOGNAME is not set anymore for me after an upgrade from\nUbuntu 11.04 to 11.10.  Use $USER in such a case.\n\nSigned-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\nThe only other use of $LOGNAME is in git-cvsimport, which does the same.\n\n t/t1304-default-acl.sh |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t1304-default-acl.sh b/t/t1304-default-acl.sh\nindex b5d89a2..2b962cf 100755\n--- a/t/t1304-default-acl.sh\n+++ b/t/t1304-default-acl.sh\n@@ -25,6 +25,11 @@ else\n \ttest_set_prereq SETFACL\n fi\n \n+if test -z \"$LOGNAME\"\n+then\n+\tLOGNAME=$USER\n+fi\n+\n check_perms_and_acl () {\n \ttest -r \"$1\" &&\n \tgetfacl \"$1\" > actual &&\n-- \n1.7.7\n"},{"id":"177663","messageId":"7vobxjza9t.fsf@alter.siamese.dyndns.org","threadId":"28680","inReplyTo":"4E98750D.1020106@lsrfire.ath.cx","subject":"Re: [PATCH] t1304: fall back to $USER if $LOGNAME is not defined","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-14T18:41:02Z","receivedAt":"2011-10-14T18:41:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:\n\n> For some reason $LOGNAME is not set anymore for me after an upgrade from\n> Ubuntu 11.04 to 11.10.  Use $USER in such a case.\n>\n> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n> ---\n> The only other use of $LOGNAME is in git-cvsimport, which does the same.\n\nWhile the change to assign $USER to $LOGNAME when the latter is not set is\nnot wrong per-se, I have to wonder (1) why this test should use LOGNAME\nnot USER in the first place, and (2) why you lost LOGNAME.\n\nLOGNAME\nThe system shall initialize this variable at the time of login to be the\nuser's login name. See <pwd.h> . For a value of LOGNAME to be portable\nacross implementations of POSIX.1-2008, the value should be composed of\ncharacters from the portable filename character set.\n\nWill apply anyway. Thanks.\n"},{"id":"177679","messageId":"4E98A184.2040908@lsrfire.ath.cx","threadId":"28680","inReplyTo":"7vobxjza9t.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t1304: fall back to $USER if $LOGNAME is not defined","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2011-10-14T20:54:28Z","receivedAt":"2011-10-14T20:54:28Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 14.10.2011 20:41, schrieb Junio C Hamano:\n> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:\n> \n>> For some reason $LOGNAME is not set anymore for me after an upgrade from\n>> Ubuntu 11.04 to 11.10.  Use $USER in such a case.\n>>\n>> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n>> ---\n>> The only other use of $LOGNAME is in git-cvsimport, which does the same.\n> \n> While the change to assign $USER to $LOGNAME when the latter is not set is\n> not wrong per-se, I have to wonder (1) why this test should use LOGNAME\n> not USER in the first place, and (2) why you lost LOGNAME.\n> \n> LOGNAME\n> The system shall initialize this variable at the time of login to be the\n> user's login name. See <pwd.h> . For a value of LOGNAME to be portable\n> across implementations of POSIX.1-2008, the value should be composed of\n> characters from the portable filename character set.\n> \n> Will apply anyway. Thanks.\n\nCommon practise (on Linux at least) seems to be to set both $LOGNAME\n(from Sys-V) and $USER (from BSD) to the same value, so either could be\nused.  The portable way is to check both.\n\nBoth were set before the upgrade on my system, and $LOGNAME is _still_\nset if I log onto the console or use sudo or su, but it's _not_ set in a\nplain Gnome Terminal with bash.  I also wonder why that may be.\n\nRené\n"}]}