EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Unreachable code in makeBaseApp.pl?
From: Andrew Johnson <[email protected]>
To: Stephen Molloy <[email protected]>
Cc: [email protected]
Date: Fri, 8 Jul 2016 11:11:28 -0500
Hi Steve,

On 07/08/2016 08:40 AM, Stephen Molloy wrote:
>>> $user= $opt_u|| $ENV{USER}|| $ENV{USERNAME}|| Win32::LoginName();
>> 
>> I agree that doesn't look terribly robust, but for a Linux environment
>> to not define $USER seems rather unusual. Does this one-liner output the
>> username correctly?
>>     perl -e 'printf "%s\n", getlogin();’
> 
> That also results in a blank.

Ok, I guess we don't have to get a definitive answer from the OS in this
case given the code that follows the above line, as long as that prompt
gets triggered.

Does making this change result in you being prompted for a user-name?

> === modified file 'src/makeBaseApp/makeBaseApp.pl'
> --- src/makeBaseApp/makeBaseApp.pl      2016-05-22 03:43:09 +0000
> +++ src/makeBaseApp/makeBaseApp.pl      2016-07-08 15:44:43 +0000
> @@ -418,7 +418,8 @@
>  }
>  
>  sub GetUser {
> -    $user = $opt_u || $ENV{USER} || $ENV{USERNAME} || Win32::LoginName();
> +    $user = $opt_u || $ENV{USER} || $ENV{USERNAME} || getlogin();
> +    $user = Win32::LoginName() if !$user && $^ eq 'MSWin32';
>  
>      unless ($user) {
>         print "Strange, I cannot figure out your user name!\n";

If not I'll ask you work out how to fix this and send us your suggested
patch instead.

> To be honest, I don’t think that this would be the best way of using
> Docker for this task, but I thought that it was worth reporting
> something that looked like a bit of a weakness in makeBaseApp.

Thanks, every little helps!

- Andrew

-- 
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon

Replies:
Re: Unreachable code in makeBaseApp.pl? Stephen Molloy
References:
Re: Unreachable code in makeBaseApp.pl? Stephen Molloy

Navigate by Date:
Prev: Re: Unreachable code in makeBaseApp.pl? Ralph Lange
Next: Re: Unreachable code in makeBaseApp.pl? Stephen Molloy
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Unreachable code in makeBaseApp.pl? Ralph Lange
Next: Re: Unreachable code in makeBaseApp.pl? Stephen Molloy
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·