Do not return -1 on error from the display functions; the caller

expects a return value >= 0.
This commit is contained in:
Todd C. Miller
2010-09-04 08:42:08 -04:00
parent e7d56e16e2
commit 27f6558df9
2 changed files with 10 additions and 6 deletions

View File

@@ -1149,7 +1149,7 @@ sudo_ldap_display_defaults(struct sudo_nss *nss, struct passwd *pw,
int rc, count = 0;
if (ld == NULL)
return(-1);
goto done;
for (base = ldap_conf.base; base != NULL; base = base->next) {
result = NULL;
@@ -1173,6 +1173,7 @@ sudo_ldap_display_defaults(struct sudo_nss *nss, struct passwd *pw,
if (result)
ldap_msgfree(result);
}
done:
return(count);
}
@@ -1352,7 +1353,7 @@ sudo_ldap_display_privs(struct sudo_nss *nss, struct passwd *pw,
int rc, do_netgr, count = 0;
if (ld == NULL)
return(-1);
goto done;
/*
* Okay - time to search for anything that matches this user
@@ -1394,6 +1395,7 @@ sudo_ldap_display_privs(struct sudo_nss *nss, struct passwd *pw,
}
efree(filt);
}
done:
return(count);
}