]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/volume.c
Merge master
[netatalk.git] / etc / afpd / volume.c
index 7437f58b6a6fad9a86b7d13bf4dd1cac89cb7446..716387925373fb38e0c7d69515318e39505a63b1 100644 (file)
@@ -1619,8 +1619,8 @@ static int getvolparams( uint16_t bitmap, struct vol *vol, struct stat *st, char
      * For MacOS8.x support we need to create the
      * .Parent file here if it doesn't exist. */
 
-    ad_init(&ad, vol->v_adouble, vol->v_ad_options);
-    if (ad_open(&ad, vol->v_path, ADFLAGS_HF | ADFLAGS_DIR, O_RDWR | O_CREAT, 0666) != 0 ) {
+    ad_init(&ad, vol);
+    if (ad_open(&ad, vol->v_path, ADFLAGS_HF | ADFLAGS_DIR | ADFLAGS_RDWR | ADFLAGS_CREATE, 0666) != 0 ) {
         isad = 0;
         vol->v_ctime = AD_DATE_FROM_UNIX(st->st_mtime);
 
@@ -1797,7 +1797,7 @@ static int getvolparams( uint16_t bitmap, struct vol *vol, struct stat *st, char
         data += aint;
     }
     if ( isad ) {
-        ad_close_metadata( &ad);
+        ad_close(&ad, ADFLAGS_HF);
     }
     *buflen = data - buf;
     return( AFP_OK );
@@ -2604,8 +2604,8 @@ int afp_setvolparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf
     if (bitmap != (1 << VOLPBIT_BDATE))
         return AFPERR_BITMAP;
 
-    ad_init(&ad, vol->v_adouble, vol->v_ad_options);
-    if ( ad_open(&ad,  vol->v_path, ADFLAGS_HF|ADFLAGS_DIR, O_RDWR) < 0 ) {
+    ad_init(&ad, vol);
+    if ( ad_open(&ad,  vol->v_path, ADFLAGS_HF | ADFLAGS_DIR | ADFLAGS_RDWR) < 0 ) {
         if (errno == EROFS)
             return AFPERR_VLOCK;
 
@@ -2699,8 +2699,8 @@ static int create_special_folder (const struct vol *vol, const struct _special_f
 
     if ( !ret && folder->hide) {
         /* Hide it */
-        ad_init(&ad, vol->v_adouble, vol->v_ad_options);
-        if (ad_open(&ad, p, ADFLAGS_HF | ADFLAGS_DIR, O_RDWR | O_CREAT, 0666) != 0) {
+        ad_init(&ad, vol);
+        if (ad_open(&ad, p, ADFLAGS_HF | ADFLAGS_DIR | ADFLAGS_RDWR | ADFLAGS_CREATE, 0666) != 0) {
             free(p);
             free(q);
             return (-1);
@@ -2719,8 +2719,8 @@ static int create_special_folder (const struct vol *vol, const struct _special_f
             memcpy(ad_entry(&ad, ADEID_FINDERI) + FINDERINFO_FRFLAGOFF,&attr, sizeof(attr));
         }
 
-        ad_flush( &ad );
-        ad_close_metadata( &ad);
+        ad_flush(&ad);
+        ad_close(&ad, ADFLAGS_HF);
     }
     free(p);
     free(q);