Re: [U2] Unidata @LOGNAME
At 08:12 AM 4/17/2008, you wrote: Under Unidata 7.1.x on Solaris (9/10) we're seeing @LOGNAME truncated to 8 characters. Others on different OSes are not seeing this behavior. Does anyone know if this is a Unidata setting or how Unidata is interacting with a system call (eg: and therefor cannot be changed)? Sorry I am a little late in replying. Here is a bit of information I was able to gather from a IBM engineer some time ago when we encountered problems with the value returned as well. @LOGNAME is implemented as a global variable for the udt process. It returns the same value in both ECL and UniBasic. And it is implemented the same on all Unix platforms. @LOGNAME is set by calling cuserid(LOGNAME). However, we have implemented our own cuserid()function since 08/08/94. static int U_myuidflag = 0; static char U_myuidbuf[256] = {0}; char *cuserid(buffer) d_char buffer[]; { int uid; char *p; struct passwd *pw; if (U_myuidflag == 0) { if ((p = getlogin()) == (char *) 0 || p[0] == '\0') { uid = getuid(); pw = getpwuid(uid); if (pw != (struct passwd *) 0) p = pw-pw_name; else p = (char *) 0; } if (p != (char *) 0) strcpy(U_myuidbuf, p); else U_myuidbuf[0] = '\0'; U_myuidflag = 1; } if (buffer != (char *) 0) { strcpy(buffer, U_myuidbuf); return (buffer); } else { return (U_myuidbuf); } } Here is output from man page aboput getlogin: DESCRIPTION The getlogin() function returns a pointer to the login name as found in /var/adm/utmp. It may be used in conjunction with getpwnam(3C) to locate the correct password file entry when the same user ID is shared by several login names. If getlogin() is called within a process that is not attached to a terminal, it returns a null pointer. The correct procedure for determining the login name is to call cuserid(3S), or to call getlogin() and if it fails to call getpwuid(3C) BTW, the implmentation on NT is different and it is much more complex to describe here. HTH, Doug Miller --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Unidata @LOGNAME
If I remember correctly, Solaris only looks at the first 8 characters as the user name and the password. If you have a password longer than 8 characters you're wasting keystrokes. I don't know if there is a setting to change it. Jerry Banker Senior Programmer Analyst IBM Certified Solutions Expert -Original Message- From: [EMAIL PROTECTED] [mailto:owner-u2- [EMAIL PROTECTED] On Behalf Of Jeffrey Butera Sent: Thursday, April 17, 2008 8:12 AM To: u2-users@listserver.u2ug.org Subject: [U2] Unidata @LOGNAME Under Unidata 7.1.x on Solaris (9/10) we're seeing @LOGNAME truncated to 8 characters. Others on different OSes are not seeing this behavior. Does anyone know if this is a Unidata setting or how Unidata is interacting with a system call (eg: and therefor cannot be changed)? -- Jeff Butera, Ph.D. Administrative Systems Hampshire College [EMAIL PROTECTED] 413-559-5556 Consultants don't necessarily know more than you, they just get paid more than you. Me --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Unidata @LOGNAME
quote who='JPB-U2UG' date='Thursday 17 April 2008' If I remember correctly, Solaris only looks at the first 8 characters as the user name and the password. If you have a password longer than 8 characters you're wasting keystrokes. I don't know if there is a setting to change it. You're correct on the password but since Solaris allows usernames longer than 8 we were surprised that @LOGNAME wasn't returning them. I'll assume it a Solaris system call that Unidata is using to populate @LOGNAME. -- Jeff Butera, Ph.D. Administrative Systems Hampshire College [EMAIL PROTECTED] 413-559-5556 Consultants don't necessarily know more than you, they just get paid more than you. Me --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/