summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-04-18 12:38:06 -0700
committerJeremy Allison <jra@samba.org>2012-04-18 23:14:40 +0200
commit916297e0454317cbfe400b2d7fa60073bcccb8d6 (patch)
treec0cf63713ebae4ccc6aea5c18ffd0dbe91106f03 /source4
parentc1dbbbc40ce6f4f522603078979d6e44dfaf7b36 (diff)
downloadsamba-916297e0454317cbfe400b2d7fa60073bcccb8d6.tar.gz
samba-916297e0454317cbfe400b2d7fa60073bcccb8d6.tar.bz2
samba-916297e0454317cbfe400b2d7fa60073bcccb8d6.zip
Fix samba3.raw.samba3hide test - ensure we set up POSIX capabilities
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
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/raw/samba3hide.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source4/torture/raw/samba3hide.c b/source4/torture/raw/samba3hide.c
index 5ecf4f682d..c3a572c21c 100644
--- a/source4/torture/raw/samba3hide.c
+++ b/source4/torture/raw/samba3hide.c
@@ -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");