/*
like perl's join(sep,@ARGS)
*/
-char *
+char *
_ldap_join_values(sep,v)
char *sep;
char **v;
* Walks through search result and returns true if we have a
* command match
*/
-int
+int
sudo_ldap_add_match(ld,entry)
LDAP *ld;
LDAPMessage *entry;
/* if we are not collecting matches, then don't print them */
if (printmatches != TRUE) return 1;
-
+
/* collect the dn, only show the rdn */
dn=ldap_get_dn(ld,entry);
edn=dn ? ldap_explode_dn(dn,1) : NULL;
if (pwflag && ldap_user_matches && ldap_host_matches){
/*
* Handle verifypw & listpw
- *
+ *
* To be extra paranoid, since we haven't read any NOPASSWD options
* in /etc/sudoers yet, but we have to make the decission now, lets
* assume the worst and prefer to prompt for password unless the setting
/* Same logic with noexec */
if (def_noexec) SET(ret,FLAG_NOEXEC);
} else {
- /* we do not have a match */
+ /* we do not have a match */
ret=VALIDATE_NOT_OK;
if (!ldap_user_matches) SET(ret,FLAG_NO_USER);
else if (!ldap_host_matches) SET(ret,FLAG_NO_HOST);
/*
* Maximum number of characters to log per entry. The syslogger
* will log this much, after that, it truncates the log line.
- * We need this here to make sure that we continue with another
+ * We need this here to make sure that we continue with another
* syslog(3) call if the internal buffer is more than 1023 characters.
*/
#ifndef MAXSYSLOGLEN
# define MAXSYSLOGLEN 960
#endif
-
+
void log_auth __P((int, int));
void log_error __P((int flags, const char *fmt, ...));
RETSIGTYPE reapchild __P((int));
return(FALSE);
pw_gid = pw->pw_gid;
- if ((grp = getgrnam(group)) == NULL)
+ if ((grp = getgrnam(group)) == NULL)
return(FALSE);
/* check against user's primary (passwd file) gid */
char *s;
{
char *t;
-
+
for (t = s; *t; t++) {
if (*t == '\\' || *t == '?' || *t == '*' || *t == '[' || *t == ']')
return(TRUE);
%token <tok> ERROR
/*
- * NOTE: these are not true booleans as there are actually 4 possible values:
+ * NOTE: these are not true booleans as there are actually 4 possible values:
* 1) TRUE (positive match)
* 0) FALSE (negative match due to a '!' somewhere)
* -1) NOMATCH (don't change the value of *_matches)
void
list_matches()
{
- size_t count;
+ size_t count;
char *p;
struct generic_alias *ga, key;
match = NULL;
top = 0;
parse_error = FALSE;
- errorlineno = -1;
- sudolineno = 1;
+ errorlineno = -1;
+ sudolineno = 1;
}
/* Allocate space for the matching stack. */
log_error(USE_ERRNO|MSG_ONLY, "can't get hostname");
set_runaspw(*user_runas); /* may call log_error() */
- if (*user_runas[0] == '#' && runas_pw->pw_name && runas_pw->pw_name[0])
+ if (*user_runas[0] == '#' && runas_pw->pw_name && runas_pw->pw_name[0])
*user_runas = estrdup(runas_pw->pw_name);
/*
char *s;
{
char *t;
-
+
for (t = s; *t; t++) {
if (*t == '\\' || *t == '?' || *t == '*' || *t == '[' || *t == ']')
return(TRUE);
if (cmnd == NULL)
return(FALSE);
- if ((args = strchr(path, ' ')))
+ if ((args = strchr(path, ' ')))
*args++ = '\0';
if (has_meta(path)) {
mask.s_addr <<= i;
mask.s_addr = htonl(mask.s_addr);
}
- *(m - 1) = '/';
+ *(m - 1) = '/';
for (i = 0; i < num_interfaces; i++)
if ((interfaces[i].addr.s_addr & mask.s_addr) == addr.s_addr)
char *lhost;
char *pattern;
{
- if (has_meta(pattern)) {
- if (strchr(pattern, '.'))
+ if (has_meta(pattern)) {
+ if (strchr(pattern, '.'))
return(fnmatch(pattern, lhost, FNM_CASEFOLD));
else
return(fnmatch(pattern, shost, FNM_CASEFOLD));
if (*group++ != '%')
return(FALSE);
- if ((grp = getgrnam(group)) == NULL)
+ if ((grp = getgrnam(group)) == NULL)
return(FALSE);
/*
return;
}
-int
+int
set_runaspw(user)
char *user;
{
return(TRUE);
-}
+}
void
init_envtables()