From: Todd C. Miller Date: Fri, 19 Mar 2010 12:17:09 +0000 (-0400) Subject: display_bound_defaults() stub should return 0, not 1 since it is a count, X-Git-Tag: SUDO_1_8_0~784 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5fb6784ab1588661f0905ec465f90b2f74d743b8;p=sudo display_bound_defaults() stub should return 0, not 1 since it is a count, not a boolean. --- diff --git a/plugins/sudoers/ldap.c b/plugins/sudoers/ldap.c index 016c83113..d07e99d6d 100644 --- a/plugins/sudoers/ldap.c +++ b/plugins/sudoers/ldap.c @@ -1150,7 +1150,10 @@ sudo_ldap_display_defaults(nss, pw, lbuf) if (rc == LDAP_SUCCESS && (entry = ldap_first_entry(ld, result))) { bv = ldap_get_values_len(ld, entry, "sudoOption"); if (bv != NULL) { - prefix = " "; + if (lbuf->len == 0 || isspace((unsigned char)lbuf->buf[lbuf->len - 1])) + prefix = " "; + else + prefix = ", "; for (p = bv; *p != NULL; p++) { lbuf_append(lbuf, prefix, (*p)->bv_val, NULL); prefix = ", "; @@ -1173,7 +1176,7 @@ sudo_ldap_display_bound_defaults(nss, pw, lbuf) struct passwd *pw; struct lbuf *lbuf; { - return(1); + return(0); } /*