On 23.12.2018 14:23, Rony G. Flatscher wrote:
> Musing with my Ubuntu installation did the following experiments as user 
> "rony":
... cut ...
>
> Maybe a strategy could be: if determining that ooRexx executes as "root" 
> (e.g. comparing $LOGNAME
> to "root"), then create the two special files in the root's homedirectory 
> "/root". Otherwise, if
> running without the XDG* environment variables set, then maybe in the user's 
> home directory $HOME
> (like on MacOSX)?
>
Just as an appendix the ooRexx Unix installation code (for setting up 
BSF4ooRexx which needs to run
with root privileges when installing it globally) which determines the real 
user name (for the
installation logfile):

    ... cut ...
    setupBSF.rex-   -- get and save logName and sudoUser-Name
    setupBSF.rex-   cmd.eLogName  = value('LOGNAME',    ,'ENVIRONMENT')  -- get 
current logname, could be 'root' if sudo'ing
    setupBSF.rex:   cmd.eSudoUser = value('SUDO_USER',  ,'ENVIRONMENT')  -- 
maybe sudo'ing, then who is the sudo user
    setupBSF.rex-
    setupBSF.rex-   if cmd.eLogName="root", cmd.eSudoUser<>"" then
    setupBSF.rex-      cmd.eRealUserName=cmd.eSudoUser
    setupBSF.rex-   else
    setupBSF.rex-      cmd.eRealUserName=cmd.eLogName
    ... cut ...

---rony

_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to