version 1.287, 2018/05/22 00:13:26 |
version 1.288, 2018/06/01 03:33:53 |
|
|
const char *ruser; |
const char *ruser; |
int r, port, this_result, result = 1, attributes = 0, negate; |
int r, port, this_result, result = 1, attributes = 0, negate; |
char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV]; |
char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV]; |
|
char uidstr[32]; |
|
|
/* |
/* |
* Configuration is likely to be incomplete at this point so we |
* Configuration is likely to be incomplete at this point so we |
|
|
strlcpy(shorthost, thishost, sizeof(shorthost)); |
strlcpy(shorthost, thishost, sizeof(shorthost)); |
shorthost[strcspn(thishost, ".")] = '\0'; |
shorthost[strcspn(thishost, ".")] = '\0'; |
snprintf(portstr, sizeof(portstr), "%d", port); |
snprintf(portstr, sizeof(portstr), "%d", port); |
|
snprintf(uidstr, sizeof(uidstr), "%llu", |
|
(unsigned long long)pw->pw_uid); |
|
|
cmd = percent_expand(arg, |
cmd = percent_expand(arg, |
"L", shorthost, |
"L", shorthost, |
|
|
"p", portstr, |
"p", portstr, |
"r", ruser, |
"r", ruser, |
"u", pw->pw_name, |
"u", pw->pw_name, |
|
"i", uidstr, |
(char *)NULL); |
(char *)NULL); |
if (result != 1) { |
if (result != 1) { |
/* skip execution if prior predicate failed */ |
/* skip execution if prior predicate failed */ |