]> arthur.barton.de Git - netatalk.git/commitdiff
Ensure CNID info is set in metadata
authorRalph Boehme <sloowfranklin@gmail.com>
Wed, 5 Dec 2012 12:06:27 +0000 (13:06 +0100)
committerRalph Boehme <sloowfranklin@gmail.com>
Wed, 5 Dec 2012 12:06:27 +0000 (13:06 +0100)
etc/afpd/file.c

index bc336a4e2b0cd721c678402ad83bd65b9dce2cd1..8036c300bb717311e4d3c591b765b486a1a5e815 100644 (file)
@@ -980,6 +980,12 @@ int setfilparams(const AFPObj *obj, struct vol *vol,
         isad = 0;
     } else if ((ad_get_MD_flags( adp ) & O_CREAT) ) {
         ad_setname(adp, path->m_name);
+        cnid_t id;
+        if ((id = get_id(vol, adp, &path->st, curdir->d_did, upath, strlen(upath))) == CNID_INVALID) {
+            LOG(log_error, logtype_afpd, "afp_createfile(\"%s\"): CNID error", upath);
+            return AFPERR_MISC;
+        }
+        (void)ad_setid(adp, path->st.st_dev, path->st.st_ino, id, curdir->d_did, vol->v_stamp);
     }
     
     bit = 0;