smbd: Fix a typo in a few places
[samba.git] / source3 / modules / vfs_xattr_tdb.c
index 261ebc2b2136c6f72b96c36e4a1e690c934e4b7e..447d868924d1042d7b93f45a271b3c2984ff81a5 100644 (file)
@@ -525,10 +525,9 @@ static int xattr_tdb_mkdirat(vfs_handle_struct *handle,
                mode_t mode)
 {
        struct xattr_tdb_config *config = NULL;
-       TALLOC_CTX *frame = NULL;
        struct file_id fileid;
+       struct stat_ex sbuf = { .st_ex_nlink = 0, };
        int ret;
-       struct smb_filename *full_fname = NULL;
 
        if (!xattr_tdb_init(handle, &config)) {
                return -1;
@@ -542,33 +541,21 @@ static int xattr_tdb_mkdirat(vfs_handle_struct *handle,
                return ret;
        }
 
-       frame = talloc_stackframe();
+       ret = SMB_VFS_NEXT_FSTATAT(
+               handle, dirfsp, smb_fname, &sbuf, AT_SYMLINK_NOFOLLOW);
 
-       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
-                                                 dirfsp,
-                                                 smb_fname);
-       if (full_fname == NULL) {
-               errno = ENOMEM;
-               return -1;
-       }
-
-       /* Always use LSTAT here - we just created the directory. */
-       ret = SMB_VFS_LSTAT(handle->conn, full_fname);
        if (ret == -1) {
                /* Rename race. Let upper level take care of it. */
-               TALLOC_FREE(frame);
                return -1;
        }
-       if (!S_ISDIR(full_fname->st.st_ex_mode)) {
+       if (!S_ISDIR(sbuf.st_ex_mode)) {
                /* Rename race. Let upper level take care of it. */
-               TALLOC_FREE(frame);
                return -1;
        }
 
-       fileid = SMB_VFS_FILE_ID_CREATE(handle->conn, &full_fname->st);
+       fileid = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
 
        xattr_tdb_remove_all_attrs(config->db, &fileid);
-       TALLOC_FREE(frame);
        return 0;
 }