static char sccsid
[] = "@(#)getpwinfo.c 5.3 (Berkeley) %G%";
* get passwd file info for uid
* return codes: SUCCESS | FAIL
register char *path
, *name
;
register struct passwd
*pwd
;
struct passwd
*getpwuid(), *getpwnam();
char *getlogin(), *getenv(), *l
;
if ((l
= getlogin()) == NULL
) {
if (pwd
!= NULL
&& pwd
->pw_uid
== uid
)
if ((pwd
= getpwuid(uid
)) == NULL
) {
/* can not find uid in passwd file */
strcpy(path
, pwd
->pw_dir
);
strcpy(name
, pwd
->pw_name
);
* get passwd file info for name
* return codes: SUCCESS | FAIL
register struct passwd
*pwd
;
struct passwd
*getpwnam();
if ((pwd
= getpwnam(name
)) == NULL
) {
/* can not find name in passwd file */
strcpy(path
, pwd
->pw_dir
);