version 1.14, 2007/07/26 16:10:15 |
version 1.15, 2008/01/07 14:10:08 |
|
|
#include "sudo.h" |
#include "sudo.h" |
|
|
#ifndef lint |
#ifndef lint |
__unused static const char rcsid[] = "$Sudo: check.c,v 1.223.2.9 2007/07/06 19:52:13 millert Exp $"; |
__unused static const char rcsid[] = "$Sudo: check.c,v 1.223.2.10 2008/01/05 23:59:42 millert Exp $"; |
#endif /* lint */ |
#endif /* lint */ |
|
|
/* Status codes for timestamp_status() */ |
/* Status codes for timestamp_status() */ |
|
|
len += strlen(user_host) - 2; |
len += strlen(user_host) - 2; |
subst = 1; |
subst = 1; |
break; |
break; |
|
case 'p': |
|
p++; |
|
if (def_rootpw) |
|
len += 2; |
|
else if (def_targetpw || def_runaspw) |
|
len += strlen(*user_runas) - 2; |
|
else |
|
len += strlen(user_name) - 2; |
|
subst = 1; |
|
break; |
case 'u': |
case 'u': |
p++; |
p++; |
len += strlen(user_name) - 2; |
len += strlen(user_name) - 2; |
|
|
n = strlcpy(np, user_host, np - endp); |
n = strlcpy(np, user_host, np - endp); |
if (n >= np - endp) |
if (n >= np - endp) |
goto oflow; |
goto oflow; |
|
np += n; |
|
continue; |
|
case 'p': |
|
p++; |
|
if (def_rootpw) |
|
n = strlcpy(np, "root", np - endp); |
|
else if (def_targetpw || def_runaspw) |
|
n = strlcpy(np, *user_runas, np - endp); |
|
else |
|
n = strlcpy(np, user_name, np - endp); |
|
if (n >= np - endp) |
|
goto oflow; |
np += n; |
np += n; |
continue; |
continue; |
case 'u': |
case 'u': |