s3: smbd: Remove bool dfs_pathnames paramter from resolve_dfspath_wcard().
[kai/samba-autobuild/.git] / source3 / smbd / trans2.c
index 923fed4ef8e944aa86a459607710b1566c567c3d..14f605210999f3886850abfd788db4db4bcc91e6 100644 (file)
@@ -2456,7 +2456,8 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
                               int space_remaining,
                               bool *got_exact_match,
                               int *_last_entry_off,
-                              struct ea_list *name_list)
+                              struct ea_list *name_list,
+                              struct file_id *file_id)
 {
        const char *p;
        const char *mask = NULL;
@@ -2537,6 +2538,11 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
                DEBUG(1,("Conversion error: illegal character: %s\n",
                         smb_fname_str_dbg(smb_fname)));
        }
+
+       if (file_id != NULL) {
+               *file_id = vfs_file_id_from_sbuf(conn, &smb_fname->st);
+       }
+
        TALLOC_FREE(fname);
        TALLOC_FREE(smb_fname);
        if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
@@ -2584,7 +2590,7 @@ static NTSTATUS get_lanman2_dir_entry(TALLOC_CTX *ctx,
                                         ppdata, base_data, end_data,
                                         space_remaining,
                                         got_exact_match,
-                                        last_entry_off, name_list);
+                                        last_entry_off, name_list, NULL);
 }
 
 /****************************************************************************
@@ -3504,6 +3510,12 @@ NTSTATUS smbd_do_qfsinfo(struct smbXsrv_connection *xconn,
 cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)st.st_ex_dev, (unsigned int)bsize, (unsigned int)sectors_per_unit,
                                (unsigned int)bytes_per_sector, (unsigned int)dsize, (unsigned int)dfree));
 
+                       /*
+                        * For large drives, return max values and not modulo.
+                        */
+                       dsize = MIN(dsize, UINT32_MAX);
+                       dfree = MIN(dfree, UINT32_MAX);
+
                        SIVAL(pdata,l1_idFileSystem,st.st_ex_dev);
                        SIVAL(pdata,l1_cSectorUnit,sectors_per_unit);
                        SIVAL(pdata,l1_cUnit,dsize);
@@ -6956,15 +6968,16 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
        DEBUG(10,("smb_file_rename_information: got name |%s|\n",
                                newname));
 
-       status = resolve_dfspath_wcard(ctx, conn,
-                                      req->flags2 & FLAGS2_DFS_PATHNAMES,
+       if (req->flags2 & FLAGS2_DFS_PATHNAMES) {
+               status = resolve_dfspath_wcard(ctx, conn,
                                       newname,
                                       UCF_COND_ALLOW_WCARD_LCOMP,
                                       !conn->sconn->using_smb2,
                                       &newname,
                                       &dest_has_wcard);
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               if (!NT_STATUS_IS_OK(status)) {
+                       return status;
+               }
        }
 
        /* Check the new name has no '/' characters. */