We ran into a similar situation in the past with uv on hpux
Although @LOGNAME is documented as a readonly value, we found out that
it is possible to change it ( and other readonly system variables ) by
passing it as an argument to a subroutine - the subroutine can then
change the value.  I guess uv doesn't actually mark the variable as
readonly in any way at run time - readonliness is a compile time
attribute - so a subroutine has no idea that its calling args are
readonly system variables - so in effect they aren't.

Look for any subroutines called with @LOGNAME as an argument then check
that the sub doesn't alter that argument.

Given :
        ...
        CALL *SOMESUB( @LOGNAME )
        ...
        DEFINE SUBROUTINE SOMESUB ( ARG )
                ...
                * this will change the argument value in the calling
routine
                * including 'readonly' system variables
                ARG="Something" 
                ...
        END

Pass temp variable instead of @LOGNAME :
        CALL *SOMESUB( @LOGNAME:"" )
-or-
        CALL *SOMESUB( (@LOGNAME) )
-or-
Ensure that argument is never modified in the routine --
        DEFINE SUBROUTINE SOMESUB ( ARG.IN )
                ARG=ARG.IN ;* the only place IARG is ever used
                ...
                ARG="SomethingElse"
                ...
        END

Note that this also applies to functions and routines called via SUBR()
and once the variable is changed it is changed for the lifetime of the
current session not just for the current program.

Gerry



-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Jeffrey
Butera
Sent: June 17, 2010 02:04 PM
To: U2 Users List
Subject: [U2] @LOGNAME on Unidata

We recently migrated from Unidata 7.1.8 on Solaris to Unidata 7.2.5 on 
RedHat.

We make use of @LOGNAME quite a bit to determine a person's username.  
Since our migration, however, we've documented some cases where @LOGNAME

is not returning the proper username - it returns someone else's.    
What's bizarre is that most of the time it's right, but occasionally 
it's not.

Has anyone seen or heard of this?

When we had a report of this (with documentation) I thought it was 
weird.  Today we just got a call about a different problem which I'm 99%

sure is tied to this since it makes use of @LOGNAME.  Like the above, 
sometimes it's correct, sometime it's wrong.

-- 
Jeff Butera, Ph.D.
Manager of ERP Systems
Hampshire College
jbut...@hampshire.edu
413-559-5556

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to