]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__ivaliduser): Allow '#' as comment character.
authorUlrich Drepper <drepper@redhat.com>
Wed, 12 Aug 1998 12:28:52 +0000 (12:28 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 12 Aug 1998 12:28:52 +0000 (12:28 +0000)
inet/rcmd.c

index a5f79f41aeb0693a5b72e3035f73b9d1f164d6a1..f15282c6e1de366f1ac3e6b35b6ad9c737d24ba3 100644 (file)
@@ -426,11 +426,18 @@ __ivaliduser(hostf, raddr, luser, ruser)
        register char *user, *p;
        int ch;
        char *buf = NULL;
+       char *cp;
        size_t bufsize = 0;
        ssize_t nread;
 
        while ((nread = __getline (&buf, &bufsize, hostf)) > 0) {
                buf[bufsize - 1] = '\0'; /* Make sure it's terminated.  */
+               /* Because the file format does not know any form of quoting we
+                  can search forward for the next '#' character and if found
+                  make it terminating the line.  */
+               cp = strchr (buf, '#');
+               if (cp != NULL)
+                 *cp = '\0';
                p = buf;
                while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
                        *p = isupper(*p) ? tolower(*p) : *p;