]> arthur.barton.de Git - netatalk.git/commitdiff
m_name was not set which gave a crash in ad_setname
authorFrank Lahm <franklahm@googlemail.com>
Mon, 16 May 2011 09:35:00 +0000 (11:35 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 16 May 2011 09:35:00 +0000 (11:35 +0200)
etc/afpd/directory.c

index 7bea8b2f604a5526cf604fe94ecbe4a3a115bc47..a8ae9e1080709bfe9782b99ac0ab91e6dd9c027f 100644 (file)
@@ -1489,6 +1489,17 @@ int getdirparams(const struct vol *vol,
             isad = 1;
             if (ad.ad_md->adf_flags & O_CREAT) {
                 /* We just created it */
+                if (s_path->m_name == NULL) {
+                    if ((s_path->m_name = utompath(vol,
+                                                   upath,
+                                                   dir->d_did,
+                                                   utf8_encoding())) == NULL) {
+                        LOG(log_error, logtype_afpd,
+                            "getdirparams(\"%s\"): can't assign macname",
+                            cfrombstr(dir->d_fullpath));
+                        return AFPERR_MISC;
+                    }
+                }
                 ad_setname(&ad, s_path->m_name);
                 ad_setid( &ad,
                           s_path->st.st_dev,