]> arthur.barton.de Git - netatalk.git/commitdiff
try to get the directory's cnid from the adouble header when adding it to the cache...
authordidg <didg>
Thu, 21 Jan 2010 12:10:19 +0000 (12:10 +0000)
committerdidg <didg>
Thu, 21 Jan 2010 12:10:19 +0000 (12:10 +0000)
etc/afpd/directory.c

index 0ffdf698eaf60aad9211eb266b07c73598ff99a7..f03e22621d7c123a1e4cb5d8d8be9aba842d4fe3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.128 2010-01-18 11:45:37 franklahm Exp $
+ * $Id: directory.c,v 1.129 2010-01-21 12:10:19 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -986,13 +986,24 @@ adddir(struct vol *vol, struct dir *dir, struct path *path)
     char        *upath;
     struct stat *st;
     int         deleted;
+    struct adouble  ad;
+    struct adouble *adp = NULL;
     cnid_t      id;
 
     upath = path->u_name;
     st    = &path->st;
     upathlen = strlen(upath);
 
-    id = get_id(vol, NULL, st, dir->d_did, upath, upathlen);
+    /* get_id needs adp for reading CNID from adouble file */
+    ad_init(&ad, vol->v_adouble, vol->v_ad_options);
+    if ((ad_open_metadata(upath, ADFLAGS_DIR, 0, &ad)) == 0)
+        adp = &ad;
+
+    id = get_id(vol, adp, st, dir->d_did, upath, upathlen);
+
+    if (adp)
+        ad_close_metadata(adp);
+
     if (id == 0) {
         return NULL;
     }