Password Verification
IBM
tli at Morgan.COM
Wed Jun 19 07:30:51 AEST 1991
>Yes ! yes ! yes and more yes !
>One more time AIX is the problem.......
>
>IBM : Why not to do it standard ????
>
>Why so many troubles ???
Let me explain my modifications.
tli>modified xlock.c getPassword() to read:
tli>
tli>XWindowAttributes xgwa;
tli>int y, /* moved the int declaration aft xgwa */
tli> left,
tli> done;
I want to keep the declarations together, so I moved them.
My customer do not want to depend on the env var USERNAME; therefore,
I used getuid() to see who is executing this prog.
tli>#ifdef _AIX
tli> uid_t uuid;
tli> char user[10];
tli> uuid = getuid();
tli> pw = getpwuid(uuid);
tli> strcpy(user,pw->pw_name);
tli> strcpy(userpass, pw->pw_passwd);
tli>#else
tli> char *user = getenv(USERNAME);
tli>#endif
tli>..
tli>..
tli>..
tli>/* added if not def since user and userpass was set at start of getPassword */
As the comment states, I did not have to call getpwnam(), since I got all the
information I need from the first #ifdef _AIX.
tli>#ifndef _AIX
tli> pw = getpwnam(user);
tli> strcpy(userpass, pw->pw_passwd);
tli>#endif
tli>
===============================================================
Thomas Y. Li Email: tli at nycvmic4.iinus1.ibm.com
IBM Corporation tli%nycvmic4 at iinus1.ibm.com
33 Maiden Lane 10th Floor tli at morgan.com
New York, NY 10038
(212) 493-2516 T/L 340 VNET: tli at nycvmic4
More information about the Comp.unix.aix
mailing list