]> granicus.if.org Git - sudo/commitdiff
Ignore empty ipa_hostname
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 5 Jun 2016 20:42:54 +0000 (14:42 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 5 Jun 2016 20:42:54 +0000 (14:42 -0600)
plugins/sudoers/sssd.c

index 19bc16c403aaaddb2b97ee8f6cf72c210cef6e04..cc30e559b122fd376beb33ccf72c9e0705280231 100644 (file)
@@ -326,12 +326,16 @@ get_ipa_hostname(char **shostp, char **lhostp)
             */
            if (strncmp(cp, "ipa_hostname", 12) == 0) {
                cp += 12;
+               /* Trim " = " after "ipa_hostname" */
                while (isblank((unsigned char)*cp))
                    cp++;
                if (*cp++ != '=')
                    continue;
                while (isblank((unsigned char)*cp))
                    cp++;
+               /* Ignore empty value */
+               if (*cp == '\0')
+                   continue;
                lhost = strdup(cp);
                if (lhost != NULL && (cp = strchr(lhost, '.')) != NULL) {
                    shost = strndup(lhost, (size_t)(cp - lhost));