]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/util/netatalk_conf.c
"valid users" options and friends only use ',' as field delimiter
[netatalk.git] / libatalk / util / netatalk_conf.c
index dee04aa791cd0a84abfb2beabeec15010676305a..067ed45436781e08d38b23bd24518d1b96c12f55 100644 (file)
@@ -402,7 +402,7 @@ static char *volxlate(const AFPObj *obj,
  * check access list
  *
  * this function wants something of the following form:
- * "@group,name,name2,@group2,name3" or "@group name name2 @group2 name3"
+ * "@group,name,name2,@group2,name3".
  * A NULL argument allows everybody to have access.
  * We return three things:
  *     -1: no list
@@ -418,7 +418,7 @@ static int accessvol(const AFPObj *obj, const char *args, const char *name)
         return -1;
 
     strlcpy(buf, args, sizeof(buf));
-    if ((p = strtok(buf, ", ")) == NULL) /* nothing, return okay */
+    if ((p = strtok(buf, ",")) == NULL) /* nothing, return okay */
         return -1;
 
     while (p) {
@@ -564,7 +564,7 @@ static struct vol *creatvol(AFPObj *obj,
     struct vol  *volume = NULL;
     size_t      current_pathlen, another_pathlen;
     int         i, suffixlen, vlen, tmpvlen, u8mvlen, macvlen;
-    char        *tmpname;
+    char        tmpname[AFPVOL_U8MNAMELEN+1];
     char        path[MAXPATHLEN + 1];
     ucs2_t      u8mtmpname[(AFPVOL_U8MNAMELEN+1)*2], mactmpname[(AFPVOL_MACNAMELEN+1)*2];
     char        suffix[6]; /* max is #FFFF */
@@ -670,7 +670,7 @@ static struct vol *creatvol(AFPObj *obj,
     EC_NULL( volume->v_maccodepage = strdup(obj->options.maccodepage) );
 
     vlen = strlen(name);
-    tmpname = strdup(name);
+    strlcpy(tmpname, name, sizeof(tmpname));
     for(i = 0; i < vlen; i++)
         if(tmpname[i] == '/') tmpname[i] = ':';