From: didg Date: Tue, 26 Jan 2010 20:39:52 +0000 (+0000) Subject: use the right test for file/dir invisible attribute bit modification and parent direc... X-Git-Tag: branch-dircache-rewrite-start~3 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=9b4a84a500eeddaed4a13c3fce4387a390b932aa use the right test for file/dir invisible attribute bit modification and parent directory modification date update --- diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index db3ed8cd..11c6de7e 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -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; diff --git a/etc/afpd/file.c b/etc/afpd/file.c index 1e45f191..82c7739d 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -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 :