]> arthur.barton.de Git - netatalk.git/commitdiff
use the right test for file/dir invisible attribute bit modification and parent direc...
authordidg <didg>
Tue, 26 Jan 2010 20:39:52 +0000 (20:39 +0000)
committerdidg <didg>
Tue, 26 Jan 2010 20:39:52 +0000 (20:39 +0000)
etc/afpd/directory.c
etc/afpd/file.c

index db3ed8cd2bb3cafae4ad19b695fc5a777a88e331..11c6de7ea47142af52964e5d7e6778d0d5a5402e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.130 2010-01-26 08:14:09 didg Exp $
+ * $Id: directory.c,v 1.131 2010-01-26 20:39:52 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -2025,7 +2025,7 @@ int setdirparams(struct vol *vol,
     int         bit, isad = 1;
     int                 cdate, bdate;
     int                 owner, group;
-    u_int16_t       ashort, bshort;
+    u_int16_t       ashort, bshort, oshort;
     int                 err = AFP_OK;
     int                 change_mdate = 0;
     int                 change_parent_mdate = 0;
@@ -2181,14 +2181,14 @@ int setdirparams(struct vol *vol,
         case DIRPBIT_ATTR :
             if (isad) {
                 ad_getattr(&ad, &bshort);
-                if ((bshort & htons(ATTRBIT_INVISIBLE)) !=
-                    (ashort & htons(ATTRBIT_INVISIBLE) & htons(ATTRBIT_SETCLR)) )
-                    change_parent_mdate = 1;
+                oshort = bshort;
                 if ( ntohs( ashort ) & ATTRBIT_SETCLR ) {
                     bshort |= htons( ntohs( ashort ) & ~ATTRBIT_SETCLR );
                 } else {
                     bshort &= ~ashort;
                 }
+                if ((bshort & htons(ATTRBIT_INVISIBLE)) != (oshort & htons(ATTRBIT_INVISIBLE)))
+                    change_parent_mdate = 1;
                 ad_setattr(&ad, bshort);
             }
             break;
index 1e45f19182321f3468357b28170a0077979b5eca..82c7739dc155d51ffa42cf7a9c88f3f1854fb5e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.130 2010-01-06 14:05:15 franklahm Exp $
+ * $Id: file.c,v 1.131 2010-01-26 20:39:52 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -737,7 +737,7 @@ int setfilparams(struct vol *vol,
     int                        bit, isad = 1, err = AFP_OK;
     char                *upath;
     u_char              achar, *fdType, xyy[4]; /* uninitialized, OK 310105 */
-    u_int16_t          ashort, bshort;
+    u_int16_t          ashort, bshort, oshort;
     u_int32_t          aint;
     u_int32_t          upriv;
     u_int16_t           upriv_bit = 0;
@@ -885,14 +885,14 @@ int setfilparams(struct vol *vol,
         switch(  bit ) {
         case FILPBIT_ATTR :
             ad_getattr(adp, &bshort);
-            if ((bshort & htons(ATTRBIT_INVISIBLE)) !=
-                (ashort & htons(ATTRBIT_INVISIBLE) & htons(ATTRBIT_SETCLR)) )
-                change_parent_mdate = 1;
+            oshort = bshort;
             if ( ntohs( ashort ) & ATTRBIT_SETCLR ) {
                 bshort |= htons( ntohs( ashort ) & ~ATTRBIT_SETCLR );
             } else {
                 bshort &= ~ashort;
             }
+            if ((bshort & htons(ATTRBIT_INVISIBLE)) != (oshort & htons(ATTRBIT_INVISIBLE)))
+                change_parent_mdate = 1;
             ad_setattr(adp, bshort);
             break;
         case FILPBIT_CDATE :