Lines Matching refs:thisuser
120 static struct passwd thisuser, nouser;
148 memcpy(&thisuser, &nouser, sizeof(thisuser));
153 thisuser.pw_uid = pwd->pw_uid;
154 thisuser.pw_gid = pwd->pw_gid;
156 if (!(thisuser.pw_name = malloc(strlen(pwd->pw_name) + 1)))
158 strcpy(thisuser.pw_name, pwd->pw_name);
160 if (!(thisuser.pw_dir = malloc(strlen(pwd->pw_dir) + 1)))
162 strcpy(thisuser.pw_dir, pwd->pw_dir);
164 if (!(thisuser.pw_shell = malloc(strlen(pwd->pw_shell) + 1)))
166 strcpy(thisuser.pw_shell, pwd->pw_shell);
177 if (!(thisuser.pw_passwd = malloc(strlen(pwd->pw_passwd) + 1)))
179 strcpy(thisuser.pw_passwd, pwd->pw_passwd);
184 return ((thisuser.pw_passwd[0] == '*') || (thisuser.pw_passwd[0] == '#'));
190 memcpy(&thisuser, &nouser, sizeof(thisuser));
354 if (thisuser.pw_uid == 0) {
372 if (!thisuser.pw_passwd[0] || getuid() == 0)
376 if (!opiealways(thisuser.pw_dir)) {
394 printf("%s's system password: ", thisuser.pw_name);
403 printf("%s's response: ", thisuser.pw_name);
412 printf("%s's password: ", thisuser.pw_name);
420 printf(" (echo on)\n%s's password: ", thisuser.pw_name);
428 if (!strcmp(crypt(pbuf, thisuser.pw_passwd), thisuser.pw_passwd))
458 if (setgid(thisuser.pw_gid) < 0) {
462 if (initgroups(user, thisuser.pw_gid)) {
466 if (setuid(thisuser.pw_uid) < 0) {
470 if (thisuser.pw_shell && *thisuser.pw_shell)
471 shell = thisuser.pw_shell;
480 lsetenv("USER", thisuser.pw_name, userbuf);
482 lsetenv("HOME", thisuser.pw_dir, homebuf);
495 if (chdir(thisuser.pw_dir) < 0) {