]> arthur.barton.de Git - netatalk.git/commitdiff
don't remove x perms, from exanet works, slightly modified.
authordidg <didg>
Wed, 25 May 2005 18:19:33 +0000 (18:19 +0000)
committerdidg <didg>
Wed, 25 May 2005 18:19:33 +0000 (18:19 +0000)
etc/afpd/unix.c
include/atalk/adouble.h

index c6bc78882a987b04e7d91316add197f0f5a39bee..8f2b4cd4ae79ca8822670160b7ca6ab83e8f6c32 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unix.c,v 1.46 2005-04-28 20:49:45 bfernhomberg Exp $
+ * $Id: unix.c,v 1.47 2005-05-25 18:19:33 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -416,14 +416,14 @@ mode_t mode;
 struct stat *st;
 {
 struct stat sb;
-mode_t mask = S_IRUSR |S_IWUSR | S_IRGRP | S_IWGRP |S_IROTH | S_IWOTH;
+mode_t mask = S_IRWXU | S_IRWXG | S_IRWXO;  /* rwx for owner group and other, by default */
 
     if (!st) {
         if (stat(name, &sb) != 0)
             return -1;
         st = &sb;
     }
-   mode &= mask;       /* keep only rw-rw-rw in mode */
+   
    mode |= st->st_mode & ~mask; /* keep other bits from previous mode */
    if ( chmod( name,  mode & ~default_options.umask ) < 0 && errno != EPERM ) {
        return -1;
index 56d392a117b10f1135838475b2011febc495df32..c12924f2753dcfc2844be06c80e5eedaa40266b3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: adouble.h,v 1.26 2005-05-14 12:54:55 didg Exp $
+ * $Id: adouble.h,v 1.27 2005-05-25 18:19:33 didg Exp $
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -417,7 +417,8 @@ extern int ad_metadata    __P((const char *, int, struct adouble *));
 #define ad_flush_metadata(adp) ad_flush( (adp), ADFLAGS_HF)
 #define ad_close_metadata(adp) ad_close( (adp), ADFLAGS_HF)
 
-/* extend header to RW if R or W (W if R for locking),
+/* build a resource fork mode from the data fork mode:
+ * remove X mode and extend header to RW if R or W (W if R for locking),
  */ 
 #ifndef ATACC
 #ifndef __inline__
@@ -425,9 +426,7 @@ extern int ad_metadata    __P((const char *, int, struct adouble *));
 #endif
 static __inline__ mode_t ad_hf_mode (mode_t mode)
 {
-#if 0
-    mode |= S_IRUSR;
-#endif    
+    mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH);
     /* fnctl lock need write access */
     if ((mode & S_IRUSR))
         mode |= S_IWUSR;