]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/volume.c
remove case insensitive option
[netatalk.git] / etc / afpd / volume.c
index 9c5272458c9b108fee8834aeaa3c4fe2c974978a..fac12624cbc7976c26d2b535dfecbae9228e7ff5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.68 2006-09-29 09:39:16 didg Exp $
+ * $Id: volume.c,v 1.71 2008-08-31 13:25:59 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -172,7 +172,6 @@ static const _vol_opt_name vol_opt_names[] = {
                                          * maybe because it will be mounted later in preexec */
     {AFPVOL_UNIX_PRIV,  "UNIXPRIV"},    /* support unix privileges */
     {AFPVOL_NODEV,      "NODEV"},       /* always use 0 for device number in cnid calls */
-    {AFPVOL_CASEINSEN,  "CASEINSENSITIVE"}, /* volume is case insensitive */
     {AFPVOL_EILSEQ,     "ILLEGALSEQ"},     /* encode illegal sequence */
     {AFPVOL_CACHE,      "CACHEID"},     /* Use adouble v2 CNID caching, default don't use it */
     {0, NULL}
@@ -315,7 +314,11 @@ static char *volxlate(AFPObj *obj, char *dest, size_t destlen,
             } else
                 q = obj->options.hostname;
         } else if (is_var(p, "$u")) {
-            q = obj->username;
+            char* sep = NULL;
+            if ( obj->options.ntseparator && (sep = strchr(obj->username, obj->options.ntseparator[0])) != NULL)
+                q = sep+1;
+            else
+                q = obj->username;
         } else if (is_var(p, "$v")) {
             if (volname) {
                 q = volname;
@@ -481,8 +484,6 @@ static void volset(struct vol_option *options, struct vol_option *save,
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_UNIX_PRIV;
             else if (strcasecmp(p, "nodev") == 0)
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_NODEV;
-            else if (strcasecmp(p, "caseinsensitive") == 0)
-                options[VOLOPT_FLAGS].i_value |= AFPVOL_CASEINSEN;
             else if (strcasecmp(p, "illegalseq") == 0)
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_EILSEQ;
             else if (strcasecmp(p, "cachecnid") == 0)
@@ -1599,6 +1600,7 @@ int       ibuflen _U_, *rbuflen;
     char        path[ MAXPATHLEN + 1];
     char        *vol_uname;
     char        *vol_mname;
+    char        *volname_tmp;
 
     ibuf += 2;
     memcpy(&bitmap, ibuf, sizeof( bitmap ));
@@ -1611,6 +1613,10 @@ int      ibuflen _U_, *rbuflen;
 
     len = (unsigned char)*ibuf++;
     volname = obj->oldtmp;
+
+    if ((volname_tmp = strchr(volname,'+')) != NULL)
+        volname = volname_tmp+1;
+
     namelen = convert_string( (utf8_encoding()?CH_UTF8_MAC:obj->options.maccharset), CH_UCS2,
                               ibuf, len, volname, sizeof(obj->oldtmp));
     if ( namelen <= 0){