]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/unix.c
Merge master
[netatalk.git] / etc / afpd / unix.c
index 8f1fca20aa47e673425360a2d3a79389ed6ce256..232fb30349e328b366bdfd1758c6b3c1a38645b5 100644 (file)
@@ -9,24 +9,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-
-/* STDC check */
-#ifdef STDC_HEADERS
 #include <string.h>
-#else /* STDC_HEADERS */
-
-#ifndef HAVE_STRCHR
-#define strchr index
-#define strrchr index
-#endif /* HAVE_STRCHR */
-char *strchr (), *strrchr ();
-
-#ifndef HAVE_MEMCPY
-#define memcpy(d,s,n) bcopy ((s), (d), (n))
-#define memmove(d,s,n) bcopy ((s), (d), (n))
-#endif /* ! HAVE_MEMCPY */
-#endif /* STDC_HEADERS */
-
 #include <errno.h>
 #include <limits.h>
 #include <sys/param.h>
@@ -157,6 +140,7 @@ mode_t mode;
 }
 
 #ifdef accessmode
+
 #undef accessmode
 #endif
 /*
@@ -331,9 +315,6 @@ int setfilunixmode (const struct vol *vol, struct path* path, mode_t mode)
 /* --------------------- */
 int setdirunixmode(const struct vol *vol, const char *name, mode_t mode)
 {
-
-    int dropbox = (vol->v_flags & AFPVOL_DROPBOX);
-
     LOG(log_debug, logtype_afpd, "setdirunixmode('%s', mode:%04o) {v_dperm:%04o}",
         fullpathname(name), mode, vol->v_dperm);
 
@@ -341,14 +322,14 @@ int setdirunixmode(const struct vol *vol, const char *name, mode_t mode)
 
     if (dir_rx_set(mode)) {
        /* extending right? dir first then .AppleDouble in rf_setdirmode */
-       if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 )
+       if ( stickydirmode(name, DIRBITS | mode, 0, vol->v_umask) < 0 )
                return -1;
     }
     if (vol->vfs->vfs_setdirunixmode(vol, name, mode, NULL) < 0 && !vol_noadouble(vol)) {
         return  -1 ;
     }
     if (!dir_rx_set(mode)) {
-       if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 )
+       if ( stickydirmode(name, DIRBITS | mode, 0, vol->v_umask) < 0 )
             return -1;
     }
     return 0;
@@ -361,14 +342,13 @@ int setdirmode(const struct vol *vol, const char *name, mode_t mode)
     struct dirent      *dirp;
     DIR                        *dir;
     mode_t              hf_mode;
-    int                 dropbox = (vol->v_flags & AFPVOL_DROPBOX);
     
     mode |= vol->v_dperm;
     hf_mode = ad_hf_mode(mode);
 
     if (dir_rx_set(mode)) {
        /* extending right? dir first */
-       if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 )
+       if ( stickydirmode(name, DIRBITS | mode, 0, vol->v_umask) < 0 )
                return -1;
     }
     
@@ -401,7 +381,7 @@ int setdirmode(const struct vol *vol, const char *name, mode_t mode)
     }
 
     if (!dir_rx_set(mode)) {
-       if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 )
+       if ( stickydirmode(name, DIRBITS | mode, 0, vol->v_umask) < 0 )
                return -1;
     }
     return( 0 );