s3-auth: Split out get_user_sid_info3_and_extra() from create_local_nt_token_from_info3()
[amitay/samba.git] / source3 / modules / vfs_recycle.c
index 4981f558a824d86d3c4df6ffa643b72014506308..dfc3b9cc0f352f841c48c3f11d86f73fee191653 100644 (file)
@@ -186,10 +186,12 @@ static mode_t recycle_subdir_mode(vfs_handle_struct *handle)
 
 static bool recycle_directory_exist(vfs_handle_struct *handle, const char *dname)
 {
-       SMB_STRUCT_STAT st;
+       struct smb_filename smb_fname = {
+                       .base_name = discard_const_p(char, dname)
+       };
 
-       if (vfs_stat_smb_basename(handle->conn, dname, &st) == 0) {
-               if (S_ISDIR(st.st_ex_mode)) {
+       if (SMB_VFS_STAT(handle->conn, &smb_fname) == 0) {
+               if (S_ISDIR(smb_fname.st.st_ex_mode)) {
                        return True;
                }
        }
@@ -299,7 +301,8 @@ static bool recycle_create_dir(vfs_handle_struct *handle, const char *dname)
                        smb_fname = synthetic_smb_fname(talloc_tos(),
                                                new_dir,
                                                NULL,
-                                               NULL);
+                                               NULL,
+                                               0);
                        if (smb_fname == NULL) {
                                goto done;
                        }
@@ -587,8 +590,11 @@ static int recycle_unlink(vfs_handle_struct *handle,
        }
 
        /* Create smb_fname with final base name and orig stream name. */
-       smb_fname_final = synthetic_smb_fname(talloc_tos(), final_name,
-                                             smb_fname->stream_name, NULL);
+       smb_fname_final = synthetic_smb_fname(talloc_tos(),
+                                       final_name,
+                                       smb_fname->stream_name,
+                                       NULL,
+                                       smb_fname->flags);
        if (smb_fname_final == NULL) {
                rc = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
                goto done;