]> andersk Git - gssapi-openssh.git/blobdiff - openssh/misc.c
The man2html from jbasney on pkilab2 works whereas the standard one doesn't.
[gssapi-openssh.git] / openssh / misc.c
index 143dbf0e2d019aa097e642d9854e60c5274a080e..c447d234cc3f83a7e360fb5ca280a7b1dde91799 100644 (file)
@@ -155,11 +155,14 @@ set_nodelay(int fd)
 #define WHITESPACE " \t\r\n"
 #define QUOTE  "\""
 
+/* Characters considered as quotations. */
+#define QUOTES "'\""
+
 /* return next token in configuration line */
 char *
 strdelim(char **s)
 {
-       char *old;
+       char *old, *p, *q;
        int wspace = 0;
 
        if (*s == NULL)
@@ -167,6 +170,21 @@ strdelim(char **s)
 
        old = *s;
 
+        if ((q=strchr(QUOTES, (int) *old)) && *q)
+        {
+            /* find next quote character, point old to start of quoted
+             * string */
+            for (p = ++old;*p && *p!=*q; p++)
+                 ;
+            
+            /* find start of next token */
+            *s = (*p) ? p + strspn(p + 1, WHITESPACE) + 1 : NULL;
+            
+            /* terminate 'old' token */
+            *p = '\0';
+            return (old);
+        }
+
        *s = strpbrk(*s, WHITESPACE QUOTE "=");
        if (*s == NULL)
                return (old);
@@ -219,6 +237,20 @@ pwcopy(struct passwd *pw)
        return copy;
 }
 
+void
+pwfree(struct passwd *pw)
+{
+       xfree(pw->pw_name);
+       xfree(pw->pw_passwd);
+       xfree(pw->pw_gecos);
+#ifdef HAVE_PW_CLASS_IN_PASSWD
+       xfree(pw->pw_class);
+#endif
+       xfree(pw->pw_dir);
+       xfree(pw->pw_shell);
+       xfree(pw);
+}
+
 /*
  * Convert ASCII string to TCP/IP port number.
  * Port must be >=0 and <=65535.
This page took 0.0506 seconds and 4 git commands to generate.