]> arthur.barton.de Git - netatalk.git/commitdiff
Remove remaining caseinsensitive stuff
authorFrank Lahm <franklahm@googlemail.com>
Wed, 21 Mar 2012 14:14:45 +0000 (15:14 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Wed, 21 Mar 2012 14:14:45 +0000 (15:14 +0100)
etc/afpd/directory.c
etc/afpd/directory.h
etc/afpd/filedir.c
include/atalk/volume.h

index 5e4ffbb88badcf3d3d1c908e7bede9ba0b18851a..0c7f62723dbf9330a46f0c54e944fcc9de7f3804 100644 (file)
@@ -707,86 +707,6 @@ exit:
 
 #define ENUMVETO "./../Network Trash Folder/TheVolumeSettingsFolder/TheFindByContentFolder/:2eDS_Store/Contents/Desktop Folder/Trash/Benutzer/"
 
-int caseenumerate(const struct vol *vol, struct path *path, struct dir *dir)
-{
-    DIR               *dp;
-    struct dirent     *de;
-    int               ret;
-    static uint32_t  did = 0;
-    static char       cname[MAXPATHLEN];
-    static char       lname[MAXPATHLEN];
-    ucs2_t        u2_path[MAXPATHLEN];
-    ucs2_t        u2_dename[MAXPATHLEN];
-    char          *tmp, *savepath;
-
-    if (!(vol->v_flags & AFPVOL_CASEINSEN))
-        return -1;
-
-    if (veto_file(ENUMVETO, path->u_name))
-        return -1;
-
-    savepath = path->u_name;
-
-    /* very simple cache */
-    if ( dir->d_did == did && strcmp(lname, path->u_name) == 0) {
-        path->u_name = cname;
-        path->d_dir = NULL;
-        if (of_stat( path ) == 0 ) {
-            return 0;
-        }
-        /* something changed, we cannot stat ... */
-        did = 0;
-    }
-
-    if (NULL == ( dp = opendir( "." )) ) {
-        LOG(log_debug, logtype_afpd, "caseenumerate: opendir failed: %s", dir->d_u_name);
-        return -1;
-    }
-
-
-    /* LOG(log_debug, logtype_afpd, "caseenumerate: for %s", path->u_name); */
-    if ((size_t) -1 == convert_string(vol->v_volcharset, CH_UCS2, path->u_name, -1, u2_path, sizeof(u2_path)) )
-        LOG(log_debug, logtype_afpd, "caseenumerate: conversion failed for %s", path->u_name);
-
-    /*LOG(log_debug, logtype_afpd, "caseenumerate: dir: %s, path: %s", dir->d_u_name, path->u_name); */
-    ret = -1;
-    for ( de = readdir( dp ); de != NULL; de = readdir( dp )) {
-        if (NULL == check_dirent(vol, de->d_name))
-            continue;
-
-        if ((size_t) -1 == convert_string(vol->v_volcharset, CH_UCS2, de->d_name, -1, u2_dename, sizeof(u2_dename)) )
-            continue;
-
-        if (strcasecmp_w( u2_path, u2_dename) == 0) {
-            tmp = path->u_name;
-            strlcpy(cname, de->d_name, sizeof(cname));
-            path->u_name = cname;
-            path->d_dir = NULL;
-            if (of_stat( path ) == 0 ) {
-                LOG(log_debug, logtype_afpd, "caseenumerate: using dir: %s, path: %s", de->d_name, path->u_name);
-                strlcpy(lname, tmp, sizeof(lname));
-                did = dir->d_did;
-                ret = 0;
-                break;
-            }
-            else
-                path->u_name = tmp;
-        }
-
-    }
-    closedir(dp);
-
-    if (ret) {
-        /* invalidate cache */
-        cname[0] = 0;
-        did = 0;
-        path->u_name = savepath;
-    }
-    /* LOG(log_debug, logtype_afpd, "caseenumerate: path on ret: %s", path->u_name); */
-    return ret;
-}
-
-
 /*!
  * @brief Construct struct dir
  *
index 0ef2426ed8d44e7c7a21bbe094c67e16fea0b8a9..7f3e8c56a1cd135c2405abb5fb3af61a700222dd 100644 (file)
@@ -124,7 +124,6 @@ extern int         for_each_dirent(const struct vol *, char *, dir_loop , void *
 extern int         check_access(const AFPObj *obj, struct vol *, char *name , int mode);
 extern int         file_access(const AFPObj *obj, struct vol *vol, struct path *path, int mode);
 extern int         netatalk_unlink (const char *name);
-extern int         caseenumerate (const struct vol *, struct path *, struct dir *);
 
 /* from enumerate.c */
 extern char        *check_dirent (const struct vol *, char *);
index 8f1109c9efea834d53752530d176c83f2988937b..a04776fae35148b85735549221f22f0f2e479722 100644 (file)
@@ -333,7 +333,7 @@ static int moveandrename(const struct vol *vol,
             goto exit;
         }
 
-        if (stat(upath, st) == 0 || caseenumerate(vol, &path, curdir) == 0) {
+        if (stat(upath, st) == 0) {
             if (!stat(oldunixname, &nst) && !(nst.st_dev == st->st_dev && nst.st_ino == st->st_ino) ) {
                 /* not the same file */
                 rc = AFPERR_EXIST;
@@ -341,7 +341,7 @@ static int moveandrename(const struct vol *vol,
             }
             errno = 0;
         }
-    } else if (stat(upath, st ) == 0 || caseenumerate(vol, &path, curdir) == 0) {
+    } else if (stat(upath, st ) == 0) {
         rc = AFPERR_EXIST;
         goto exit;
     }
index 010dcfde039c9295dfdc5e19a068624bcedb2bed..d8948500e8eb86d57df8fc95236d7790016fd0f0 100644 (file)
@@ -123,7 +123,6 @@ struct vol {
                                      * help if device number is notconsistent across reboot
                                      * NOTE symlink to a different device will return an ACCESS error
                                      */
-#define AFPVOL_CASEINSEN (1 << 19)  /* volume is case insensitive */
 #define AFPVOL_EILSEQ    (1 << 20)  /* encode illegal sequence 'asis' UCS2, ex "\217-", which is not
                                        a valid SHIFT-JIS char, is encoded  as U\217 -*/
 #define AFPVOL_INV_DOTS  (1 << 22)   /* dots files are invisible */