dhill5
15th April 2004, 15:34
In our environment, the users are connecting using a bwc which is set-up with a 'BaanLogin' log-in method.
Unfortunately, it appears that using this method of access means that the Unix $LOGNAME environmental variable is set to 'root', not the log-in id of the user. We access $LOGNAME in many places in our customised scripts using the getenv function.
It works OK using the Rexec method of connection, but we can't use this method for technical reasons.
Does anyone know of a simple way round this problem, which won't involve code changes?
Also, does anyone know how the pre-defined Baan variable logname$ is set? Is it the same as the $LOGNAME value?
Thanks in advance,
David Hill
mark_h
15th April 2004, 15:40
Have you tried setting LOGNAME in the client? Try using -- -set LOGNAME=someuser and logging in. Then again this would cause each user to have a unique .bwc file.
Mark
dhill5
15th April 2004, 15:59
Nice idea. Unfortunately, we don't want to have to create individual bwc's - too many clients.
However, I wonder if there is a way of setting a variable using the "-set" option in a dynamic way? For example, to the value of another (Unix) environmental variable.
mark_h
15th April 2004, 16:43
I tried a few times after your post and could not seem to get it to work. If you figure it out please post the answer. I know tried something like this one other time and could not get it resolved.
Mark
lbencic
15th April 2004, 17:17
I'm not sure on the rest, but logname$ gets the user's login id in Baan, regardless of the Unix / OS login. This is the variable I use. I know that would involve a coding change for you.
Hitesh Shah
15th April 2004, 18:08
U can try get.resource$("unixuser") . It will give u the unix user name in user profile in $BSE/lib/user.
NPRao
16th April 2004, 01:54
Unfortunately, it appears that using this method of access means that the Unix $LOGNAME environmental variable is set to 'root', not the log-in id of the user. We access $LOGNAME in many places in our customised scripts using the getenv function.
David,
Log in as root at the Baan Unix server because you must have root permission to start the BaanLogin daemon.
You can say that the feature/pre-requisite.
You might try to user the $USER
dhill5
19th April 2004, 11:32
We received this reply from Baan:
With porting set 6.1c.06.06 and the Baan login method, the variable LOGNAME always comes back with root.
SOLUTION DESCRIPTION:
The problem with variables is solved with porting set 6.1c.07 and higher.
As we are unable to change the porting set at the present moment, we have had to make a code change. Substituting with the predefined variable logname$ appears to work OK. However, I think the suggestion of accessing $USER would have worked as well.
Thank you all for your help.
Alick Wilson
25th May 2004, 11:19
BaaN have a solution about using a wrapper script to set environment variables.
However, on AIX the LOGNAME variable can not normally be changed by a standard user so on the last line of the wrapper script where you call the bshell, set the BaaN variable as follows:
bshell6.1 $* -set LOGNAME=$USER