]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix samba3.raw.samba3hide test - ensure we set up POSIX capabilities
authorJeremy Allison <jra@samba.org>
Wed, 18 Apr 2012 19:38:06 +0000 (12:38 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 18 Apr 2012 21:14:40 +0000 (23:14 +0200)
before doing POSIX calls like chmod.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Apr 18 23:14:40 CEST 2012 on sn-devel-104

source4/torture/raw/samba3hide.c

index 5ecf4f682dbff09b9bf085fd9f27f9d5fce7d4df..c3a572c21cf7608af0d7ad201b914b2fffe64768 100644 (file)
@@ -114,6 +114,36 @@ static bool smbcli_file_exists(struct smbcli_tree *tree, const char *fname)
        return NT_STATUS_IS_OK(smbcli_getatr(tree, fname, NULL, NULL, NULL));
 }
 
+static NTSTATUS smbcli_setup_unix(struct smbcli_tree *tree)
+{
+       union smb_fsinfo fsinfo;
+       union smb_setfsinfo set_fsinfo;
+       NTSTATUS status;
+
+       ZERO_STRUCT(fsinfo);
+       ZERO_STRUCT(set_fsinfo);
+
+       fsinfo.generic.level = RAW_QFS_UNIX_INFO;
+       status = smb_raw_fsinfo(tree, NULL, &fsinfo);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("smb_raw_fsinfo failed %s\n",
+                       nt_errstr(status));
+               return status;
+       }
+
+       set_fsinfo.generic.level = RAW_SETFS_UNIX_INFO;
+       set_fsinfo.unix_info.in.major_version = fsinfo.unix_info.out.major_version;
+       set_fsinfo.unix_info.in.minor_version = fsinfo.unix_info.out.minor_version;
+       set_fsinfo.unix_info.in.capability = fsinfo.unix_info.out.capability;
+
+       status = smb_raw_setfsinfo(tree, NULL, &set_fsinfo);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("smb_raw_setfsinfo failed %s\n",
+                       nt_errstr(status));
+       }
+       return status;
+}
+
 static NTSTATUS smbcli_chmod(struct smbcli_tree *tree, const char *fname,
                             uint64_t permissions)
 {
@@ -139,6 +169,13 @@ bool torture_samba3_hide(struct torture_context *torture)
                torture_fail(torture, "torture_open_connection_share failed\n");
        }
 
+       status = smbcli_setup_unix(cli->tree);
+       if (!NT_STATUS_IS_OK(status)) {
+               torture_fail(torture,
+                       talloc_asprintf(torture, "smbcli_setup_unix failed %s\n",
+                               nt_errstr(status)));
+       }
+
        status = torture_second_tcon(torture, cli->session, "hideunread",
                                     &hideunread);
        torture_assert_ntstatus_ok(torture, status, "second_tcon(hideunread) failed\n");