]> arthur.barton.de Git - netatalk.git/commitdiff
Merge branch 'product-2-2' of git://github.com/franklahm/Netatalk into alex-master
authorAlexander Barton <alex@barton.de>
Thu, 3 Jan 2013 13:56:35 +0000 (14:56 +0100)
committerAlexander Barton <alex@barton.de>
Thu, 3 Jan 2013 13:56:35 +0000 (14:56 +0100)
* 'product-2-2' of git://github.com/franklahm/Netatalk:
  Configurable symlink behaviour
  Trying to create an EA that already existed returned the wrong AFP error code
  Add become_root() capability to nfsv4_chmod()
  Fix an error where catalog search gave incomplete results
  2.2.5dev
  Add missing source afp_asp.c
  Version 2.2.4

configure.ac
etc/afpd/desktop.c
etc/afpd/volume.c
libatalk/cnid/cdb/cnid_cdb_close.c
libatalk/cnid/cnid.c
libatalk/cnid/dbd/cnid_dbd.c
macros/cups.m4
macros/quota-check.m4
macros/zeroconf.m4

index 176c03b144f3af0aeca66efbbdb94d8c6b5c6e28..cad6b2b70ebbcd3c87c9ffc26ab82870bdd40fc6 100644 (file)
@@ -847,7 +847,7 @@ fi
 dnl ------ Check for sendfile() --------
 netatalk_cv_search_sendfile=yes
 AC_ARG_ENABLE(sendfile,
-    [  --disable-sendfile       disable sendfile syscall],
+    [  --disable-sendfile      disable sendfile syscall],
     [if test x"$enableval" = x"no"; then
             netatalk_cv_search_sendfile=no
         fi]
index 8446a848b26baed169f915f280ef4f88e3b97b5d..da39e9b124e4df74be91592d3c0a81a35221e5f1 100644 (file)
 #include "mangle.h"
 
 
+typedef struct _U2MMAP {
+    char *mname;
+    char *uname;
+} U2MMAP;
+
+U2MMAP u2mmap[] = {
+    { "Network Trash Folder", ".AppleTrash" },
+    { "Temporary Items", ".AppleTemp" },
+    { "TheVolumeSettingsFolder", ".AppleVolumeSettings" },
+    { "TheFindByContentFolder", ".AppleFindByContent" },
+    { 0L, 0L } /* end of list */
+};
+
+
 int afp_opendt(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
 {
     struct vol *vol;
@@ -598,6 +612,7 @@ char *mtoupath(const struct vol *vol, char *mpath, cnid_t did, int utf8)
     size_t       inplen;
     size_t       outlen;
     u_int16_t   flags;
+    U2MMAP       *u2m;
         
     if ( *mpath == '\0' ) {
         strcpy(upath, ".");
@@ -615,6 +630,14 @@ char *mtoupath(const struct vol *vol, char *mpath, cnid_t did, int utf8)
     m = mpath;
     u = upath;
 
+    u2m = u2mmap;
+    while(u2m->mname) {
+        if (strcmp(m, u2m->mname) == 0) {
+            m = u2m->uname;
+        }
+        u2m++;
+    }
+
     inplen = strlen(m);
     outlen = MAXPATHLEN;
 
@@ -638,6 +661,7 @@ char *utompath(const struct vol *vol, char *upath, cnid_t id, int utf8)
     char        *m, *u;
     u_int16_t    flags;
     size_t       outlen;
+    U2MMAP       *u2m;
 
     m = mpath;
     outlen = strlen(upath);
@@ -651,12 +675,21 @@ char *utompath(const struct vol *vol, char *upath, cnid_t id, int utf8)
         LOG(log_error, logtype_afpd, "Conversion from %s to %s for %s (%u) failed.", vol->v_volcodepage, vol->v_maccodepage, u, ntohl(id));
        goto utompath_error;
     }
+    mpath[outlen] = 0;
 
     flags = !!(flags & CONV_REQMANGLE);
 
     if (utf8)
         flags |= 2;
 
+    u2m = u2mmap;
+    while(u2m->mname) {
+        if (strcmp(mpath, u2m->uname) == 0) {
+            strcpy(mpath, u2m->mname);
+        }
+        u2m++;
+    }
+
     m = mangle(vol, mpath, outlen, upath, id, flags);
 
 #ifdef DEBUG
index 50945539cffa78c09fc8e2d46e18a370c2611fea..8079966310bf68a37cad2285e278545eab23652d 100644 (file)
@@ -146,10 +146,10 @@ typedef struct _special_folder {
 } _special_folder;
 
 static const _special_folder special_folders[] = {
-    {"Network Trash Folder",     1,  0777,  1},
-    {"Temporary Items",          1,  0777,  1},
     {".AppleDesktop",            1,  0777,  0},
 #if 0
+    {"Network Trash Folder",     1,  0777,  1},
+    {"Temporary Items",          1,  0777,  1},
     {"TheFindByContentFolder",   0,     0,  1},
     {"TheVolumeSettingsFolder",  0,     0,  1},
 #endif
@@ -426,7 +426,7 @@ static void volset(struct vol_option *options, struct vol_option *save,
         setoption(options, save, VOLOPT_ROLIST, val);
 
     } else if (optionok(tmp, "codepage:", val)) {
-        LOG (log_error, logtype_afpd, "The old codepage system has been removed. Please make sure to read the documentation !!!!");
+        LOG (log_error, logtype_afpd, "The old codepage system has been removed. Please make sure to read the documentation!");
         /* Make sure we don't screw anything */
         exit (EXITERR_CONF);
     } else if (optionok(tmp, "volcharset:", val)) {
index 92f8ce6846c65ff9448e482623d6732fffc18eb0..04ae46cf50d67aa9b727ba33f51d56d3bf665998 100644 (file)
@@ -13,8 +13,8 @@ void cnid_cdb_close(struct _cnid_db *cdb) {
     CNID_private *db;
 
     if (!cdb) {
-           LOG(log_error, logtype_afpd, "cnid_close called with NULL argument !");
-           return;
+        LOG(log_error, logtype_afpd, "cnid_close called with NULL argument!");
+        return;
     }
 
     if (!(db = cdb->_private)) {
index 8bb6373ee373e91acd57912a71414b3eebaafc30..09d9107ff158c9356f8621a97196a146a6874c52 100644 (file)
@@ -46,7 +46,7 @@ void cnid_register(struct _cnid_module *module)
     /* Check if our module is already registered. */
     list_for_each(ptr, &modules)
         if (0 == strcmp(list_entry(ptr, cnid_module, db_list)->name, module->name)) {
-        LOG(log_error, logtype_afpd, "Module with name [%s] is already registered !", module->name);
+        LOG(log_error, logtype_afpd, "Module with name [%s] is already registered!", module->name);
         return;
     }
 
@@ -202,7 +202,7 @@ void cnid_close(struct _cnid_db *db)
 u_int32_t flags;
 
     if (NULL == db) {
-        LOG(log_error, logtype_afpd, "Error: cnid_close called with NULL argument !");
+        LOG(log_error, logtype_afpd, "Error: cnid_close called with NULL argument!");
         return;
     }
     /* cnid_close free db */
index ded82431fae704beeaa06f352f61f36b05500cff..e2f8f39813cbc8ba2c0f9206ff2f0f7390e08ef2 100644 (file)
@@ -520,7 +520,7 @@ void cnid_dbd_close(struct _cnid_db *cdb)
     CNID_private *db;
 
     if (!cdb) {
-        LOG(log_error, logtype_cnid, "cnid_close called with NULL argument !");
+        LOG(log_error, logtype_cnid, "cnid_close called with NULL argument!");
         return;
     }
 
index 5507aa4dac49e37e57cc378863e1524bab5a2fdb..61e83aa5209ea3a467f0e2cf217ef64aacf87da2 100644 (file)
@@ -42,7 +42,7 @@ AC_DEFUN([NETATALK_AC_CUPS], [
 
 
        AC_ARG_WITH(spooldir,
-               [  --with-spooldir=PATH     path for spooldir used for CUPS support (LOCALSTATEDIR/spool/netatalk)],[
+       [  --with-spooldir=PATH    path for spooldir used for CUPS support (LOCALSTATEDIR/spool/netatalk)],[
 
                if test "$withval" = "no"; then
                       if test x"$spool_required" = x"yes"; then
index 44e89bc966840548c411952f21f3286d8ead543c..3f7ce9b40242aaddc06ffe9e8694e1b45db5f20f 100644 (file)
@@ -4,7 +4,7 @@ dnl FIXME: This is in now way complete.
 
 AC_DEFUN([AC_CHECK_QUOTA], [
        AC_ARG_ENABLE(quota,
-       [  --enable-quota           Turn on quota support (default=auto)])
+       [  --enable-quota          Turn on quota support (default=auto)])
 
        if test x$enable_quota != xno; then
        QUOTA_LIBS=""
index 2adc84285d6a74a20edb0f553828a9c824e8ef72..8a64b10e6b54fc6804f918900b44bf4c92772b6a 100644 (file)
@@ -7,7 +7,7 @@ AC_DEFUN([NETATALK_ZEROCONF], [
        zeroconf_dir=""
 
        AC_ARG_ENABLE(zeroconf,
-               [  --enable-zeroconf[[=DIR]]   enable Zeroconf support [[auto]]],
+               [  --enable-zeroconf[[=DIR]] enable Zeroconf support [[auto]]],
                [zeroconf=$enableval],
                [zeroconf=try]
        )