From 0fff7ba143022d36064433e4494d83f9ba7d9944 Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 2 Mar 2007 05:58:22 +0000 Subject: r21648: Start a UNIX extensions test set. Add a test for the SMBWhoami query. (This used to be commit ca89683dc28104a8cee23b0c1428350f22a68c99) --- source4/torture/unix/unix.c | 39 +++++ source4/torture/unix/whoami.c | 342 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 381 insertions(+) create mode 100644 source4/torture/unix/unix.c create mode 100644 source4/torture/unix/whoami.c (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix.c b/source4/torture/unix/unix.c new file mode 100644 index 0000000000..57d804ab6f --- /dev/null +++ b/source4/torture/unix/unix.c @@ -0,0 +1,39 @@ +/* + UNIX Extensions test registration. + + Copyright (C) 2006 James Peach + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "torture/torture.h" +#include "torture/unix/proto.h" + +NTSTATUS torture_unix_init(void) +{ + struct torture_suite *suite = + torture_suite_create(talloc_autofree_context(), "UNIX"); + + suite->description = + talloc_strdup(suite, "CIFS UNIX extensions tests"); + + torture_suite_add_simple_test(suite, + "WHOAMI", apple_torture_unix_whoami); + + return (torture_register_suite(suite)) ? NT_STATUS_OK + : NT_STATUS_UNSUCCESSFUL; + +} diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c new file mode 100644 index 0000000000..7adb344eac --- /dev/null +++ b/source4/torture/unix/whoami.c @@ -0,0 +1,342 @@ +/* + Test the SMB_WHOAMI Unix extension. + + Copyright (C) 2007 James Peach + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "torture/torture.h" +#include "torture/basic/proto.h" +#include "libcli/libcli.h" +#include "libcli/raw/interfaces.h" +#include "lib/cmdline/popt_common.h" +#include "auth/credentials/credentials.h" + +#define SMB_QUERY_POSIX_WHOAMI 0x202 + +/* Size (in bytes) of the required fields in the SMBwhoami response. */ +#define WHOAMI_REQUIRED_SIZE 40 + +enum smb_whoami_flags { + SMB_WHOAMI_GUEST = 0x1 /* Logged in as (or squashed to) guest */ +}; + +/* + SMBWhoami - Query the user mapping performed by the server for the + connected tree. This is a subcommand of the TRANS2_QFSINFO. + + Returns: + 4 bytes unsigned - mapping flags (smb_whoami_flags) + 4 bytes unsigned - flags mask + + 8 bytes unsigned - primary UID + 8 bytes unsigned - primary GID + 4 bytes unsigned - number of supplementary GIDs + 4 bytes unsigned - number of SIDs + 4 bytes unsigned - SID list byte count + 4 bytes - pad / reserved (must be zero) + + 8 bytes unsigned[] - list of GIDs (may be empty) + DOM_SID[] - list of SIDs (may be empty) +*/ + +struct smb_whoami +{ + uint32_t mapping_flags; + uint32_t mapping_mask; + uint64_t server_uid; + uint64_t server_gid; + uint32_t num_gids; + uint32_t num_sids; + uint32_t num_sid_bytes; + uint32_t reserved; /* Must be zero */ + uint64_t * gid_list; + struct dom_sid ** sid_list; +}; + +static struct smbcli_state *connect_to_server(void *mem_ctx) +{ + NTSTATUS status; + struct smbcli_state *cli; + + const char *host = lp_parm_string(-1, "torture", "host"); + const char *share = lp_parm_string(-1, "torture", "share"); + + status = smbcli_full_connection(mem_ctx, &cli, + host, share, NULL, + cmdline_credentials, NULL); + + if (!NT_STATUS_IS_OK(status)) { + printf("failed to connect to //%s/%s: %s\n", + host, share, nt_errstr(status)); + return NULL; + } + + return cli; +} + +static BOOL sid_parse(void *mem_ctx, + struct torture_context *torture, + DATA_BLOB *data, size_t *offset, + struct dom_sid **psid) +{ + size_t remain = data->length - *offset; + int i; + + *psid = talloc_zero(mem_ctx, struct dom_sid); + torture_assert(torture, *psid != NULL, "out of memory"); + + torture_assert(torture, remain >= 8, + "invalid SID format"); + + (*psid)->sid_rev_num = CVAL(data->data, *offset); + (*psid)->num_auths = CVAL(data->data, *offset + 1); + memcpy((*psid)->id_auth, data->data + *offset + 2, 6); + + (*offset) += 8; + remain = data->length - *offset; + + torture_assert(torture, remain >= ((*psid)->num_auths * 4), + "invalid sub_auth byte count"); + torture_assert(torture, (*psid)->num_auths >= 0, + "invalid sub_auth value"); + torture_assert(torture, (*psid)->num_auths <= 15, + "invalid sub_auth value"); + + (*psid)->sub_auths = talloc_array(mem_ctx, uint32_t, + (*psid)->num_auths); + torture_assert(torture, (*psid)->sub_auths != NULL, + "out of memory"); + + for (i = 0; i < (*psid)->num_auths; i++) { + (*psid)->sub_auths[i] = IVAL(data->data, *offset); + (*offset) += 4; + } + + return True; +} + +static BOOL smb_raw_query_posix_whoami(void *mem_ctx, + struct torture_context *torture, + struct smbcli_state *cli, + struct smb_whoami *whoami, + unsigned max_data) +{ + struct smb_trans2 tp; + NTSTATUS status; + size_t offset; + int i; + + uint16_t setup = TRANSACT2_QFSINFO; + uint16_t info_level; + + ZERO_STRUCTP(whoami); + + tp.in.max_setup = 0; + tp.in.flags = 0; + tp.in.timeout = 0; + tp.in.setup_count = 1; + tp.in.max_param = 10; + tp.in.max_data = (uint16_t)max_data; + tp.in.setup = &setup; + tp.in.trans_name = NULL; + SSVAL(&info_level, 0, SMB_QUERY_POSIX_WHOAMI); + tp.in.params = data_blob_talloc(mem_ctx, &info_level, 2); + tp.in.data = data_blob_talloc(mem_ctx, NULL, 0); + + status = smb_raw_trans2(cli->tree, mem_ctx, &tp); + torture_assert_ntstatus_equal(torture, status, NT_STATUS_OK, + "doing SMB_QUERY_POSIX_WHOAMI"); + + /* Make sure we got back all the required fields. */ + torture_assert(torture, tp.out.params.length == 0, + "trans2 params should be empty"); + torture_assert(torture, tp.out.data.length >= WHOAMI_REQUIRED_SIZE, + "checking for required response fields"); + + whoami->mapping_flags = IVAL(tp.out.data.data, 0); + whoami->mapping_mask = IVAL(tp.out.data.data, 4); + whoami->server_uid = BVAL(tp.out.data.data, 8); + whoami->server_gid = BVAL(tp.out.data.data, 16); + whoami->num_gids = IVAL(tp.out.data.data, 24); + whoami->num_sids = IVAL(tp.out.data.data, 28); + whoami->num_sid_bytes = IVAL(tp.out.data.data, 32); + whoami->reserved = IVAL(tp.out.data.data, 36); + + /* The GID list and SID list are optional, depending on the count + * and length fields. + */ + if (whoami->num_sids != 0) { + torture_assert(torture, whoami->num_sid_bytes != 0, + "SID count does not match byte count"); + } + + printf("\tmapping_flags=0x%08x mapping_mask=0x%08x\n", + whoami->mapping_flags, whoami->mapping_mask); + printf("\tserver UID=%lld GID=%lld\n", + whoami->server_uid, whoami->server_gid); + printf("\t%u GIDs, %u SIDs, %u SID bytes\n", + whoami->num_gids, whoami->num_sids, + whoami->num_sid_bytes); + + offset = WHOAMI_REQUIRED_SIZE; + + torture_assert_int_equal(torture, whoami->reserved, 0, + "invalid reserved field"); + + if (tp.out.data.length == offset) { + /* No SIDs or GIDs returned */ + torture_assert_int_equal(torture, whoami->num_gids, 0, + "invalid GID count"); + torture_assert_int_equal(torture, whoami->num_sids, 0, + "invalid SID count"); + torture_assert_int_equal(torture, whoami->num_sid_bytes, 0, + "invalid SID byte count"); + return True; + } + + if (whoami->num_gids != 0) { + int remain = tp.out.data.length - offset; + int gid_bytes = whoami->num_gids * 8; + + if (whoami->num_sids == 0) { + torture_assert_int_equal(torture, remain, gid_bytes, + "GID count does not match data length"); + } else { + torture_assert(torture, remain > gid_bytes, + "invalid GID count"); + } + + whoami->gid_list = talloc_array(mem_ctx, uint64_t, whoami->num_gids); + torture_assert(torture, whoami->gid_list != NULL, "out of memory"); + + for (i = 0; i < whoami->num_gids; ++i) { + whoami->gid_list[i] = BVAL(tp.out.data.data, offset); + offset += 8; + } + } + + /* Check if there should be data left for the SID list. */ + if (tp.out.data.length == offset) { + torture_assert_int_equal(torture, whoami->num_sids, 0, + "invalid SID count"); + return True; + } + + /* All the remaining bytes must be the SID list. */ + torture_assert_int_equal(torture, + whoami->num_sid_bytes, (tp.out.data.length - offset), + "invalid SID byte count"); + + if (whoami->num_sids != 0) { + + whoami->sid_list = talloc_array(mem_ctx, struct dom_sid *, + whoami->num_sids); + torture_assert(torture, whoami->sid_list != NULL, + "out of memory"); + + for (i = 0; i < whoami->num_sids; ++i) { + if (!sid_parse(mem_ctx, torture, + &tp.out.data, &offset, + &whoami->sid_list[i])) { + return False; + } + + } + } + + /* We should be at the end of the response now. */ + torture_assert_int_equal(torture, tp.out.data.length, offset, + "trailing garbage bytes"); + + return True; +} + +BOOL apple_torture_unix_whoami(struct torture_context *torture) +{ + struct smbcli_state *cli; + struct smb_whoami whoami; + void *mem_ctx; + + mem_ctx = talloc_init("smb_query_posix_whoami"); + torture_assert(torture, mem_ctx != NULL, "malloc failed"); + + if (!(cli = connect_to_server(mem_ctx))) { + goto fail; + } + + /* Test basic authenticated mapping. */ + printf("calling SMB_QUERY_POSIX_WHOAMI on an authenticated connection\n"); + if (!smb_raw_query_posix_whoami(mem_ctx, torture, + cli, &whoami, 0xFFFF)) { + smbcli_tdis(cli); + goto fail; + } + + /* Test that the server drops the UID and GID list. */ + printf("calling SMB_QUERY_POSIX_WHOAMI with a small buffer\n"); + if (!smb_raw_query_posix_whoami(mem_ctx, torture, + cli, &whoami, 0x40)) { + smbcli_tdis(cli); + goto fail; + } + + torture_assert_int_equal(torture, whoami.num_gids, 0, + "invalid GID count"); + torture_assert_int_equal(torture, whoami.num_sids, 0, + "invalid SID count"); + torture_assert_int_equal(torture, whoami.num_sid_bytes, 0, + "invalid SID bytes count"); + + smbcli_tdis(cli); + cli_credentials_set_anonymous(cmdline_credentials); + + if (!(cli = connect_to_server(mem_ctx))) { + goto fail; + } + + printf("calling SMB_QUERY_POSIX_WHOAMI on an anonymous connection\n"); + if (!smb_raw_query_posix_whoami(mem_ctx, torture, + cli, &whoami, 0xFFFF)) { + smbcli_tdis(cli); + goto fail; + } + + smbcli_tdis(cli); + + /* Check that our anonymous login mapped us to guest on the server, but + * only if the server supports this. + */ + if (whoami.mapping_mask & SMB_WHOAMI_GUEST) { + printf("checking whether we were logged in as guest... %s\n", + whoami.mapping_flags & SMB_WHOAMI_GUEST ? "YES" : "NO"); + torture_assert(torture, whoami.mapping_flags & SMB_WHOAMI_GUEST, + "anonymous login did not map to guest"); + } else { + printf("server does not support SMB_WHOAMI_GUEST flag\n"); + } + + talloc_free(mem_ctx); + return True; + +fail: + talloc_free(mem_ctx); + return False; + +} + +/* vim: set sts=8 sw=8 : */ -- cgit From 737454d6a07ad08cc244e9d98cafc95a7565e87b Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 2 Mar 2007 17:47:58 +0000 Subject: r21659: Rename functions. (This used to be commit 6e645577a60bc79431a962b6522e8592b7c50e98) --- source4/torture/unix/unix.c | 2 +- source4/torture/unix/whoami.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix.c b/source4/torture/unix/unix.c index 57d804ab6f..0182ffc14d 100644 --- a/source4/torture/unix/unix.c +++ b/source4/torture/unix/unix.c @@ -31,7 +31,7 @@ NTSTATUS torture_unix_init(void) talloc_strdup(suite, "CIFS UNIX extensions tests"); torture_suite_add_simple_test(suite, - "WHOAMI", apple_torture_unix_whoami); + "WHOAMI", torture_unix_whoami); return (torture_register_suite(suite)) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 7adb344eac..25f9b11bee 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -266,7 +266,7 @@ static BOOL smb_raw_query_posix_whoami(void *mem_ctx, return True; } -BOOL apple_torture_unix_whoami(struct torture_context *torture) +BOOL torture_unix_whoami(struct torture_context *torture) { struct smbcli_state *cli; struct smb_whoami whoami; -- cgit From fcaeedeff3c7d65f65da19440eb7b1ac01481167 Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 2 Mar 2007 23:24:27 +0000 Subject: r21668: Add SMB_QFS_POSIX_WHOAMI to trans2.h so it's easy to find. Add convenience API to create an anonymous credential. Don't clobber cmdline_credentials in the UNIX-WHOAMI test. (This used to be commit 73cea4e0c66f57057ed12b07bbb94b4e783ba6bf) --- source4/torture/unix/whoami.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 25f9b11bee..4e846ffdcc 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -26,8 +26,6 @@ #include "lib/cmdline/popt_common.h" #include "auth/credentials/credentials.h" -#define SMB_QUERY_POSIX_WHOAMI 0x202 - /* Size (in bytes) of the required fields in the SMBwhoami response. */ #define WHOAMI_REQUIRED_SIZE 40 @@ -68,7 +66,8 @@ struct smb_whoami struct dom_sid ** sid_list; }; -static struct smbcli_state *connect_to_server(void *mem_ctx) +static struct smbcli_state *connect_to_server(void *mem_ctx, + struct cli_credentials *creds) { NTSTATUS status; struct smbcli_state *cli; @@ -78,7 +77,7 @@ static struct smbcli_state *connect_to_server(void *mem_ctx) status = smbcli_full_connection(mem_ctx, &cli, host, share, NULL, - cmdline_credentials, NULL); + creds, NULL); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", @@ -154,13 +153,13 @@ static BOOL smb_raw_query_posix_whoami(void *mem_ctx, tp.in.max_data = (uint16_t)max_data; tp.in.setup = &setup; tp.in.trans_name = NULL; - SSVAL(&info_level, 0, SMB_QUERY_POSIX_WHOAMI); + SSVAL(&info_level, 0, SMB_QFS_POSIX_WHOAMI); tp.in.params = data_blob_talloc(mem_ctx, &info_level, 2); tp.in.data = data_blob_talloc(mem_ctx, NULL, 0); status = smb_raw_trans2(cli->tree, mem_ctx, &tp); torture_assert_ntstatus_equal(torture, status, NT_STATUS_OK, - "doing SMB_QUERY_POSIX_WHOAMI"); + "doing SMB_QFS_POSIX_WHOAMI"); /* Make sure we got back all the required fields. */ torture_assert(torture, tp.out.params.length == 0, @@ -269,18 +268,19 @@ static BOOL smb_raw_query_posix_whoami(void *mem_ctx, BOOL torture_unix_whoami(struct torture_context *torture) { struct smbcli_state *cli; + struct cli_credentials *anon_credentials; struct smb_whoami whoami; void *mem_ctx; mem_ctx = talloc_init("smb_query_posix_whoami"); torture_assert(torture, mem_ctx != NULL, "malloc failed"); - if (!(cli = connect_to_server(mem_ctx))) { + if (!(cli = connect_to_server(mem_ctx, cmdline_credentials))) { goto fail; } /* Test basic authenticated mapping. */ - printf("calling SMB_QUERY_POSIX_WHOAMI on an authenticated connection\n"); + printf("calling SMB_QFS_POSIX_WHOAMI on an authenticated connection\n"); if (!smb_raw_query_posix_whoami(mem_ctx, torture, cli, &whoami, 0xFFFF)) { smbcli_tdis(cli); @@ -288,7 +288,7 @@ BOOL torture_unix_whoami(struct torture_context *torture) } /* Test that the server drops the UID and GID list. */ - printf("calling SMB_QUERY_POSIX_WHOAMI with a small buffer\n"); + printf("calling SMB_QFS_POSIX_WHOAMI with a small buffer\n"); if (!smb_raw_query_posix_whoami(mem_ctx, torture, cli, &whoami, 0x40)) { smbcli_tdis(cli); @@ -303,13 +303,14 @@ BOOL torture_unix_whoami(struct torture_context *torture) "invalid SID bytes count"); smbcli_tdis(cli); - cli_credentials_set_anonymous(cmdline_credentials); - if (!(cli = connect_to_server(mem_ctx))) { + printf("calling SMB_QFS_POSIX_WHOAMI on an anonymous connection\n"); + anon_credentials = cli_credentials_init_anon(mem_ctx); + + if (!(cli = connect_to_server(mem_ctx, anon_credentials))) { goto fail; } - printf("calling SMB_QUERY_POSIX_WHOAMI on an anonymous connection\n"); if (!smb_raw_query_posix_whoami(mem_ctx, torture, cli, &whoami, 0xFFFF)) { smbcli_tdis(cli); -- cgit From 754d416ea54e1e520aa035a759ec8e3975ab5354 Mon Sep 17 00:00:00 2001 From: James Peach Date: Mon, 5 Mar 2007 22:26:38 +0000 Subject: r21710: Add client support for the UNIX_INFO2 info level in the QueryFile, QueryPath and FindFirst calls. Add a new torture test to verify the server side. (This used to be commit 7f56da2d1fa0718e5282bb4aea7d9a63a62f0bc7) --- source4/torture/unix/unix.c | 4 +- source4/torture/unix/unix_info2.c | 457 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 460 insertions(+), 1 deletion(-) create mode 100644 source4/torture/unix/unix_info2.c (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix.c b/source4/torture/unix/unix.c index 0182ffc14d..b1c1a056b6 100644 --- a/source4/torture/unix/unix.c +++ b/source4/torture/unix/unix.c @@ -1,7 +1,7 @@ /* UNIX Extensions test registration. - Copyright (C) 2006 James Peach + Copyright (C) 2007 James Peach This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +32,8 @@ NTSTATUS torture_unix_init(void) torture_suite_add_simple_test(suite, "WHOAMI", torture_unix_whoami); + torture_suite_add_simple_test(suite, + "INFO2", unix_torture_unix_info2); return (torture_register_suite(suite)) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c new file mode 100644 index 0000000000..66ec96bfd9 --- /dev/null +++ b/source4/torture/unix/unix_info2.c @@ -0,0 +1,457 @@ +/* + Test the SMB_QUERY_FILE_UNIX_INFO2 Unix extension. + + Copyright (C) 2007 James Peach + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "libcli/libcli.h" +#include "libcli/raw/interfaces.h" +#include "libcli/raw/raw_proto.h" +#include "torture/torture.h" +#include "torture/util.h" +#include "torture/basic/proto.h" +#include "lib/cmdline/popt_common.h" +#include "auth/credentials/credentials.h" + +struct unix_info2 { + uint64_t end_of_file; + uint64_t num_bytes; + NTTIME status_change_time; + NTTIME access_time; + NTTIME change_time; + uint64_t uid; + uint64_t gid; + uint32_t file_type; + uint64_t dev_major; + uint64_t dev_minor; + uint64_t unique_id; + uint64_t permissions; + uint64_t nlink; + NTTIME create_time; + uint32_t file_flags; + uint32_t flags_mask; +}; + +static struct smbcli_state *connect_to_server(void *mem_ctx) +{ + NTSTATUS status; + struct smbcli_state *cli; + + const char *host = lp_parm_string(-1, "torture", "host"); + const char *share = lp_parm_string(-1, "torture", "share"); + + status = smbcli_full_connection(mem_ctx, &cli, + host, share, NULL, + cmdline_credentials, NULL); + + if (!NT_STATUS_IS_OK(status)) { + printf("failed to connect to //%s/%s: %s\n", + host, share, nt_errstr(status)); + return NULL; + } + + return cli; +} + +static BOOL check_unix_info2(struct torture_context *torture, + struct unix_info2 *info2) +{ + printf("\tcreate_time=0x%016llu flags=0x%08x mask=0x%08x\n", + (unsigned long long)info2->create_time, + info2->file_flags, info2->flags_mask); + + if (info2->file_flags == 0) { + return True; + } + + /* If we have any file_flags set, they must be within the range + * defined by flags_mask. + */ + if ((info2->flags_mask & info2->file_flags) == 0) { + torture_result(torture, TORTURE_FAIL, + __location__"%s: UNIX_INFO2 flags field 0x%08x, " + "does not match mask 0x%08x\n", + info2->file_flags, info2->flags_mask); + } + + return True; +} + +static NTSTATUS set_path_info2(void *mem_ctx, + struct smbcli_state *cli, + const char *fname, + struct unix_info2 *info2) +{ + union smb_setfileinfo sfinfo; + + sfinfo.generic.level = RAW_SFILEINFO_UNIX_INFO2; + sfinfo.generic.in.file.path = fname; + + sfinfo.unix_info2.in.end_of_file = info2->end_of_file; + sfinfo.unix_info2.in.num_bytes = info2->num_bytes; + sfinfo.unix_info2.in.status_change_time = info2->status_change_time; + sfinfo.unix_info2.in.access_time = info2->access_time; + sfinfo.unix_info2.in.change_time = info2->change_time; + sfinfo.unix_info2.in.uid = info2->uid; + sfinfo.unix_info2.in.gid = info2->gid; + sfinfo.unix_info2.in.file_type = info2->file_type; + sfinfo.unix_info2.in.dev_major = info2->dev_major; + sfinfo.unix_info2.in.dev_minor = info2->dev_minor; + sfinfo.unix_info2.in.unique_id = info2->unique_id; + sfinfo.unix_info2.in.permissions = info2->permissions; + sfinfo.unix_info2.in.nlink = info2->nlink; + sfinfo.unix_info2.in.create_time = info2->create_time; + sfinfo.unix_info2.in.file_flags = info2->file_flags; + sfinfo.unix_info2.in.flags_mask = info2->flags_mask; + + return smb_raw_setpathinfo(cli->tree, &sfinfo); +} + +static BOOL query_file_path_info2(void *mem_ctx, + struct torture_context *torture, + struct smbcli_state *cli, + int fnum, + const char *fname, + struct unix_info2 *info2) +{ + NTSTATUS result; + union smb_fileinfo finfo; + + finfo.generic.level = RAW_FILEINFO_UNIX_INFO2; + + if (fname) { + finfo.generic.in.file.path = fname; + result = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo); + } else { + finfo.generic.in.file.fnum = fnum; + result = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo); + } + + torture_assert_ntstatus_equal(torture, result, NT_STATUS_OK, + smbcli_errstr(cli->tree)); + + info2->end_of_file = finfo.unix_info2.out.end_of_file; + info2->num_bytes = finfo.unix_info2.out.num_bytes; + info2->status_change_time = finfo.unix_info2.out.status_change_time; + info2->access_time = finfo.unix_info2.out.access_time; + info2->change_time = finfo.unix_info2.out.change_time; + info2->uid = finfo.unix_info2.out.uid; + info2->gid = finfo.unix_info2.out.gid; + info2->file_type = finfo.unix_info2.out.file_type; + info2->dev_major = finfo.unix_info2.out.dev_major; + info2->dev_minor = finfo.unix_info2.out.dev_minor; + info2->unique_id = finfo.unix_info2.out.unique_id; + info2->permissions = finfo.unix_info2.out.permissions; + info2->nlink = finfo.unix_info2.out.nlink; + info2->create_time = finfo.unix_info2.out.create_time; + info2->file_flags = finfo.unix_info2.out.file_flags; + info2->flags_mask = finfo.unix_info2.out.flags_mask; + + if (!check_unix_info2(torture, info2)) { + return False; + } + + return True; +} + +static BOOL query_file_info2(void *mem_ctx, + struct torture_context *torture, + struct smbcli_state *cli, + int fnum, + struct unix_info2 *info2) +{ + return query_file_path_info2(mem_ctx, torture, cli, + fnum, NULL, info2); +} + +static BOOL query_path_info2(void *mem_ctx, + struct torture_context *torture, + struct smbcli_state *cli, + const char *fname, + struct unix_info2 *info2) +{ + return query_file_path_info2(mem_ctx, torture, cli, + -1, fname, info2); +} + +static BOOL search_callback(void *private, const union smb_search_data *fdata) +{ + struct unix_info2 *info2 = (struct unix_info2 *)private; + + info2->end_of_file = fdata->unix_info2.end_of_file; + info2->num_bytes = fdata->unix_info2.num_bytes; + info2->status_change_time = fdata->unix_info2.status_change_time; + info2->access_time = fdata->unix_info2.access_time; + info2->change_time = fdata->unix_info2.change_time; + info2->uid = fdata->unix_info2.uid; + info2->gid = fdata->unix_info2.gid; + info2->file_type = fdata->unix_info2.file_type; + info2->dev_major = fdata->unix_info2.dev_major; + info2->dev_minor = fdata->unix_info2.dev_minor; + info2->unique_id = fdata->unix_info2.unique_id; + info2->permissions = fdata->unix_info2.permissions; + info2->nlink = fdata->unix_info2.nlink; + info2->create_time = fdata->unix_info2.create_time; + info2->file_flags = fdata->unix_info2.file_flags; + info2->flags_mask = fdata->unix_info2.flags_mask; + + return True; +} + +static BOOL find_single_info2(void *mem_ctx, + struct torture_context *torture, + struct smbcli_state *cli, + const char *fname, + struct unix_info2 *info2) +{ + union smb_search_first search; + NTSTATUS status; + + /* Set up a new search for a single item, not using resume keys. */ + ZERO_STRUCT(search); + search.t2ffirst.level = RAW_SEARCH_TRANS2; + search.t2ffirst.data_level = SMB_FIND_UNIX_INFO2; + search.t2ffirst.in.max_count = 1; + search.t2ffirst.in.flags = FLAG_TRANS2_FIND_CLOSE; + search.t2ffirst.in.pattern = fname; + + status = smb_raw_search_first(cli->tree, mem_ctx, + &search, info2, search_callback); + torture_assert_ntstatus_equal(torture, status, NT_STATUS_OK, + smbcli_errstr(cli->tree)); + + torture_assert_int_equal(torture, search.t2ffirst.out.count, 1, + "expected exactly one result"); + torture_assert_int_equal(torture, search.t2ffirst.out.end_of_search, 1, + "expected end_of_search to be true"); + + return check_unix_info2(torture, info2); +} + +#define ASSERT_FLAGS_MATCH(info2, expected) \ + if ((info2)->file_flags != (1 << i)) { \ + torture_result(torture, TORTURE_FAIL, \ + __location__": INFO2 flags field was 0x%08x, "\ + "expected 0x%08x\n",\ + (info2)->file_flags, expected); \ + } + +static void set_no_metadata_change(struct unix_info2 *info2) +{ + info2->uid = SMB_UID_NO_CHANGE; + info2->gid = SMB_GID_NO_CHANGE; + info2->permissions = SMB_MODE_NO_CHANGE; + + info2->end_of_file = + ((uint64_t)SMB_SIZE_NO_CHANGE_HI << 32) | SMB_SIZE_NO_CHANGE_LO; + + info2->status_change_time = + info2->access_time = + info2->change_time = + info2->create_time = + ((uint64_t)SMB_SIZE_NO_CHANGE_HI << 32) | SMB_SIZE_NO_CHANGE_LO; +} + +static BOOL verify_setinfo_flags(void *mem_ctx, + struct torture_context *torture, + struct smbcli_state *cli, + const char *fname) +{ + struct unix_info2 info2; + uint32_t smb_fmask; + int i; + + BOOL ret = True; + NTSTATUS status; + + if (!query_path_info2(mem_ctx, torture, cli, fname, &info2)) { + return False; + } + + smb_fmask = info2.flags_mask; + + /* For each possible flag, ask to set exactly 1 flag, making sure + * that flag is in our requested mask. + */ + for (i = 0; i < 32; ++i) { + info2.file_flags = (1 << i); + info2.flags_mask = smb_fmask | info2.file_flags; + + set_no_metadata_change(&info2); + status = set_path_info2(mem_ctx, cli, fname, &info2); + + if (info2.file_flags & smb_fmask) { + torture_assert_ntstatus_equal(torture, + status, NT_STATUS_OK, + "setting UNIX_INFO2 flags"); + + if (!query_path_info2(mem_ctx, torture, cli, + fname, &info2)) { + return False; + } + + ASSERT_FLAGS_MATCH(&info2, 1 << i); + + + } else { + /* We tried to set a flag the server doesn't + * understand. + */ + torture_assert_ntstatus_equal(torture, + status, NT_STATUS_INVALID_PARAMETER, + "setting UNIX_INFO2 flags"); + } + } + + /* Make sure that a zero flags field does nothing. */ + set_no_metadata_change(&info2); + info2.file_flags = 0xFFFFFFFF; + info2.flags_mask = 0; + status = set_path_info2(mem_ctx, cli, fname, &info2); + torture_assert_ntstatus_equal(torture, status, NT_STATUS_OK, + "setting empty flags mask"); + + return ret; + +} + +static int create_file(struct smbcli_state *cli, const char * fname) +{ + + return smbcli_nt_create_full(cli->tree, fname, 0, + SEC_FILE_READ_DATA|SEC_FILE_WRITE_DATA, FILE_ATTRIBUTE_NORMAL, + NTCREATEX_SHARE_ACCESS_NONE, NTCREATEX_DISP_OPEN_IF, + 0, 0); +} + +static BOOL match_info2(struct torture_context *torture, + const struct unix_info2 *pinfo, + const struct unix_info2 *finfo) +{ + printf("checking results match\n"); + + torture_assert_u64_equal(torture, finfo->end_of_file, 0, + "end_of_file should be 0"); + torture_assert_u64_equal(torture, finfo->num_bytes, 0, + "num_bytes should be 0"); + + torture_assert_u64_equal(torture, finfo->end_of_file, + pinfo->end_of_file, "end_of_file mismatch"); + torture_assert_u64_equal(torture, finfo->num_bytes, pinfo->num_bytes, + "num_bytes mismatch"); + + /* Don't match access_time. */ + + torture_assert_u64_equal(torture, finfo->status_change_time, + pinfo->status_change_time, + "status_change_time mismatch"); + torture_assert_u64_equal(torture, finfo->change_time, + pinfo->change_time, "change_time mismatch"); + + torture_assert_u64_equal(torture, finfo->uid, pinfo->uid, + "UID mismatch"); + torture_assert_u64_equal(torture, finfo->gid, pinfo->gid, + "GID mismatch"); + torture_assert_int_equal(torture, finfo->file_type, pinfo->file_type, + "file_type mismatch"); + torture_assert_u64_equal(torture, finfo->dev_major, pinfo->dev_major, + "dev_major mismatch"); + torture_assert_u64_equal(torture, finfo->dev_minor, pinfo->dev_minor, + "dev_minor mismatch"); + torture_assert_u64_equal(torture, finfo->unique_id, pinfo->unique_id, + "unique_id mismatch"); + torture_assert_u64_equal(torture, finfo->permissions, + pinfo->permissions, "permissions mismatch"); + torture_assert_u64_equal(torture, finfo->nlink, pinfo->nlink, + "nlink mismatch"); + torture_assert_u64_equal(torture, finfo->create_time, pinfo->create_time, + "create_time mismatch"); + + return True; +} + + +#define FILENAME "\\smb_unix_info2.txt" + +BOOL unix_torture_unix_info2(struct torture_context *torture) +{ + void *mem_ctx; + struct smbcli_state *cli; + int fnum; + + struct unix_info2 pinfo, finfo; + + mem_ctx = talloc_init("smb_query_unix_info2"); + torture_assert(torture, mem_ctx != NULL, "out of memory"); + + if (!(cli = connect_to_server(mem_ctx))) { + talloc_free(mem_ctx); + return False; + } + + smbcli_unlink(cli->tree, FILENAME); + + fnum = create_file(cli, FILENAME); + torture_assert(torture, fnum != -1, smbcli_errstr(cli->tree)); + + printf("checking SMB_QFILEINFO_UNIX_INFO2 for QueryFileInfo\n"); + if (!query_file_info2(mem_ctx, torture, cli, fnum, &finfo)) { + goto fail; + } + + printf("checking SMB_QFILEINFO_UNIX_INFO2 for QueryPathInfo\n"); + if (!query_path_info2(mem_ctx, torture, cli, FILENAME, &pinfo)) { + goto fail; + } + + if (!match_info2(torture, &pinfo, &finfo)) { + goto fail; + } + + printf("checking SMB_FIND_UNIX_INFO2 for FindFirst\n"); + if (!find_single_info2(mem_ctx, torture, cli, FILENAME, &pinfo)) { + goto fail; + } + + if (!match_info2(torture, &pinfo, &finfo)) { + goto fail; + } + + /* XXX: should repeat this test with SetFileInfo. */ + printf("checking SMB_SFILEINFO_UNIX_INFO2 for SetPathInfo\n"); + if (!verify_setinfo_flags(mem_ctx, torture, cli, FILENAME)) { + goto fail; + } + + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, FILENAME); + torture_close_connection(cli); + talloc_free(mem_ctx); + return True; + +fail: + + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, FILENAME); + torture_close_connection(cli); + talloc_free(mem_ctx); + return False; + +} + +/* vim: set sts=8 sw=8 : */ -- cgit From c61db93c7e2d46ac0fd1a0f98199c111fd416a9b Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 23 Mar 2007 19:24:21 +0000 Subject: r21949: After discussion with the Apple and Linux client maintainers, changing the FindFirst response for the UNIX_INFO2 level to include a length field before the name. The name is not required to be null terminated. the lenght field does not count any null. (This used to be commit eef672bfff6b112ceceec2a58c78042352e83276) --- source4/torture/unix/unix_info2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index 66ec96bfd9..8c642c1d8d 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -298,7 +298,7 @@ static BOOL verify_setinfo_flags(void *mem_ctx, if (info2.file_flags & smb_fmask) { torture_assert_ntstatus_equal(torture, status, NT_STATUS_OK, - "setting UNIX_INFO2 flags"); + "setting valid UNIX_INFO2 flag"); if (!query_path_info2(mem_ctx, torture, cli, fname, &info2)) { @@ -314,7 +314,7 @@ static BOOL verify_setinfo_flags(void *mem_ctx, */ torture_assert_ntstatus_equal(torture, status, NT_STATUS_INVALID_PARAMETER, - "setting UNIX_INFO2 flags"); + "setting invalid UNIX_INFO2 flag"); } } -- cgit From 90d8786d051f79ca100a211640b1bf9c737ec358 Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 23 Mar 2007 20:28:45 +0000 Subject: r21951: Hopefully fix valgrind warning. (This used to be commit e5d0487f3196da4e5aa79a6f285b3f3d23d303ca) --- source4/torture/unix/unix_info2.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index 8c642c1d8d..9bbeddb4a3 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -99,6 +99,7 @@ static NTSTATUS set_path_info2(void *mem_ctx, { union smb_setfileinfo sfinfo; + ZERO_STRUCT(sfinfo.basic_info.in); sfinfo.generic.level = RAW_SFILEINFO_UNIX_INFO2; sfinfo.generic.in.file.path = fname; -- cgit From 714b5df833c88563c2d010d195880cfcec0bfbfe Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 12 Apr 2007 10:35:21 +0000 Subject: r22188: fix formating bug metze (This used to be commit e40912a2fd011351c6f0e7112f2984763bc53cb6) --- source4/torture/unix/unix_info2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index 9bbeddb4a3..64b7613df3 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -84,7 +84,7 @@ static BOOL check_unix_info2(struct torture_context *torture, */ if ((info2->flags_mask & info2->file_flags) == 0) { torture_result(torture, TORTURE_FAIL, - __location__"%s: UNIX_INFO2 flags field 0x%08x, " + __location__": UNIX_INFO2 flags field 0x%08x, " "does not match mask 0x%08x\n", info2->file_flags, info2->flags_mask); } -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/torture/unix/unix.c | 5 ++--- source4/torture/unix/unix_info2.c | 5 ++--- source4/torture/unix/whoami.c | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix.c b/source4/torture/unix/unix.c index b1c1a056b6..05ea27db02 100644 --- a/source4/torture/unix/unix.c +++ b/source4/torture/unix/unix.c @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index 64b7613df3..4c47179099 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 4e846ffdcc..28e220d363 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From dfa4e5f78440e375a9c47eab913c5980c1aa640b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 23 Aug 2007 02:10:17 +0000 Subject: r24631: Fix up format warnings, found on my Fedora 7 x86_64 workstation. Andrew Bartlett (This used to be commit 3d74d178bfd89127ff387939e848b240e638cc35) --- source4/torture/unix/whoami.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 28e220d363..8322e57bd1 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -185,8 +185,8 @@ static BOOL smb_raw_query_posix_whoami(void *mem_ctx, printf("\tmapping_flags=0x%08x mapping_mask=0x%08x\n", whoami->mapping_flags, whoami->mapping_mask); - printf("\tserver UID=%lld GID=%lld\n", - whoami->server_uid, whoami->server_gid); + printf("\tserver UID=%llu GID=%llu\n", + (unsigned long long)whoami->server_uid, (unsigned long long)whoami->server_gid); printf("\t%u GIDs, %u SIDs, %u SID bytes\n", whoami->num_gids, whoami->num_sids, whoami->num_sid_bytes); -- cgit From 2fefa818a95138fc7d6508093f426cb4ed92138f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 28 Aug 2007 00:16:58 +0000 Subject: r24728: Use more stock torture functions. (This used to be commit da3a7ee407a2b41bd01f45072cad12bf29250b33) --- source4/torture/unix/unix_info2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index 4c47179099..1e063fbe8f 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -46,15 +46,15 @@ struct unix_info2 { uint32_t flags_mask; }; -static struct smbcli_state *connect_to_server(void *mem_ctx) +static struct smbcli_state *connect_to_server(struct torture_context *tctx) { NTSTATUS status; struct smbcli_state *cli; - const char *host = lp_parm_string(-1, "torture", "host"); - const char *share = lp_parm_string(-1, "torture", "share"); + const char *host = torture_setting_string(tctx, "host", NULL); + const char *share = torture_setting_string(tctx, "share", NULL); - status = smbcli_full_connection(mem_ctx, &cli, + status = smbcli_full_connection(tctx, &cli, host, share, NULL, cmdline_credentials, NULL); @@ -399,7 +399,7 @@ BOOL unix_torture_unix_info2(struct torture_context *torture) mem_ctx = talloc_init("smb_query_unix_info2"); torture_assert(torture, mem_ctx != NULL, "out of memory"); - if (!(cli = connect_to_server(mem_ctx))) { + if (!(cli = connect_to_server(torture))) { talloc_free(mem_ctx); return False; } -- cgit From ffeee68e4b72dd94fee57366bd8d38b8c284c3d4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 12:42:09 +0000 Subject: r25026: Move param/param.h out of includes.h (This used to be commit abe8349f9b4387961ff3665d8c589d61cd2edf31) --- source4/torture/unix/whoami.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 8322e57bd1..80431f5ac5 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -24,6 +24,7 @@ #include "libcli/raw/interfaces.h" #include "lib/cmdline/popt_common.h" #include "auth/credentials/credentials.h" +#include "param/param.h" /* Size (in bytes) of the required fields in the SMBwhoami response. */ #define WHOAMI_REQUIRED_SIZE 40 -- cgit From 98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 16:46:30 +0000 Subject: r25035: Fix some more warnings, use service pointer rather than service number in more places. (This used to be commit df9cebcb97e20564359097148665bd519f31bc6f) --- source4/torture/unix/whoami.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 80431f5ac5..aea1ee19e0 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -72,8 +72,8 @@ static struct smbcli_state *connect_to_server(void *mem_ctx, NTSTATUS status; struct smbcli_state *cli; - const char *host = lp_parm_string(-1, "torture", "host"); - const char *share = lp_parm_string(-1, "torture", "share"); + const char *host = lp_parm_string(NULL, "torture", "host"); + const char *share = lp_parm_string(NULL, "torture", "share"); status = smbcli_full_connection(mem_ctx, &cli, host, share, NULL, -- cgit From 60a1046c5c5783799bd64fe18e03534670f83d82 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 29 Sep 2007 18:00:19 +0000 Subject: r25430: Add the loadparm context to all parametric options. (This used to be commit fd697d77c9fe67a00939a1f04b35c451316fff58) --- source4/torture/unix/whoami.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index aea1ee19e0..bc2f4382bb 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -72,8 +72,8 @@ static struct smbcli_state *connect_to_server(void *mem_ctx, NTSTATUS status; struct smbcli_state *cli; - const char *host = lp_parm_string(NULL, "torture", "host"); - const char *share = lp_parm_string(NULL, "torture", "share"); + const char *host = lp_parm_string(global_loadparm, NULL, "torture", "host"); + const char *share = lp_parm_string(global_loadparm, NULL, "torture", "share"); status = smbcli_full_connection(mem_ctx, &cli, host, share, NULL, -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/torture/unix/unix_info2.c | 42 +++++++++++++++++++-------------------- source4/torture/unix/whoami.c | 20 +++++++++---------- 2 files changed, 31 insertions(+), 31 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index 1e063fbe8f..882dc7a084 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -67,7 +67,7 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx) return cli; } -static BOOL check_unix_info2(struct torture_context *torture, +static bool check_unix_info2(struct torture_context *torture, struct unix_info2 *info2) { printf("\tcreate_time=0x%016llu flags=0x%08x mask=0x%08x\n", @@ -75,7 +75,7 @@ static BOOL check_unix_info2(struct torture_context *torture, info2->file_flags, info2->flags_mask); if (info2->file_flags == 0) { - return True; + return true; } /* If we have any file_flags set, they must be within the range @@ -88,7 +88,7 @@ static BOOL check_unix_info2(struct torture_context *torture, info2->file_flags, info2->flags_mask); } - return True; + return true; } static NTSTATUS set_path_info2(void *mem_ctx, @@ -122,7 +122,7 @@ static NTSTATUS set_path_info2(void *mem_ctx, return smb_raw_setpathinfo(cli->tree, &sfinfo); } -static BOOL query_file_path_info2(void *mem_ctx, +static bool query_file_path_info2(void *mem_ctx, struct torture_context *torture, struct smbcli_state *cli, int fnum, @@ -163,13 +163,13 @@ static BOOL query_file_path_info2(void *mem_ctx, info2->flags_mask = finfo.unix_info2.out.flags_mask; if (!check_unix_info2(torture, info2)) { - return False; + return false; } - return True; + return true; } -static BOOL query_file_info2(void *mem_ctx, +static bool query_file_info2(void *mem_ctx, struct torture_context *torture, struct smbcli_state *cli, int fnum, @@ -179,7 +179,7 @@ static BOOL query_file_info2(void *mem_ctx, fnum, NULL, info2); } -static BOOL query_path_info2(void *mem_ctx, +static bool query_path_info2(void *mem_ctx, struct torture_context *torture, struct smbcli_state *cli, const char *fname, @@ -189,7 +189,7 @@ static BOOL query_path_info2(void *mem_ctx, -1, fname, info2); } -static BOOL search_callback(void *private, const union smb_search_data *fdata) +static bool search_callback(void *private, const union smb_search_data *fdata) { struct unix_info2 *info2 = (struct unix_info2 *)private; @@ -210,10 +210,10 @@ static BOOL search_callback(void *private, const union smb_search_data *fdata) info2->file_flags = fdata->unix_info2.file_flags; info2->flags_mask = fdata->unix_info2.flags_mask; - return True; + return true; } -static BOOL find_single_info2(void *mem_ctx, +static bool find_single_info2(void *mem_ctx, struct torture_context *torture, struct smbcli_state *cli, const char *fname, @@ -267,7 +267,7 @@ static void set_no_metadata_change(struct unix_info2 *info2) ((uint64_t)SMB_SIZE_NO_CHANGE_HI << 32) | SMB_SIZE_NO_CHANGE_LO; } -static BOOL verify_setinfo_flags(void *mem_ctx, +static bool verify_setinfo_flags(void *mem_ctx, struct torture_context *torture, struct smbcli_state *cli, const char *fname) @@ -276,11 +276,11 @@ static BOOL verify_setinfo_flags(void *mem_ctx, uint32_t smb_fmask; int i; - BOOL ret = True; + bool ret = true; NTSTATUS status; if (!query_path_info2(mem_ctx, torture, cli, fname, &info2)) { - return False; + return false; } smb_fmask = info2.flags_mask; @@ -302,7 +302,7 @@ static BOOL verify_setinfo_flags(void *mem_ctx, if (!query_path_info2(mem_ctx, torture, cli, fname, &info2)) { - return False; + return false; } ASSERT_FLAGS_MATCH(&info2, 1 << i); @@ -339,7 +339,7 @@ static int create_file(struct smbcli_state *cli, const char * fname) 0, 0); } -static BOOL match_info2(struct torture_context *torture, +static bool match_info2(struct torture_context *torture, const struct unix_info2 *pinfo, const struct unix_info2 *finfo) { @@ -382,13 +382,13 @@ static BOOL match_info2(struct torture_context *torture, torture_assert_u64_equal(torture, finfo->create_time, pinfo->create_time, "create_time mismatch"); - return True; + return true; } #define FILENAME "\\smb_unix_info2.txt" -BOOL unix_torture_unix_info2(struct torture_context *torture) +bool unix_torture_unix_info2(struct torture_context *torture) { void *mem_ctx; struct smbcli_state *cli; @@ -401,7 +401,7 @@ BOOL unix_torture_unix_info2(struct torture_context *torture) if (!(cli = connect_to_server(torture))) { talloc_free(mem_ctx); - return False; + return false; } smbcli_unlink(cli->tree, FILENAME); @@ -442,7 +442,7 @@ BOOL unix_torture_unix_info2(struct torture_context *torture) smbcli_unlink(cli->tree, FILENAME); torture_close_connection(cli); talloc_free(mem_ctx); - return True; + return true; fail: @@ -450,7 +450,7 @@ fail: smbcli_unlink(cli->tree, FILENAME); torture_close_connection(cli); talloc_free(mem_ctx); - return False; + return false; } diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index bc2f4382bb..f45d2345db 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -88,7 +88,7 @@ static struct smbcli_state *connect_to_server(void *mem_ctx, return cli; } -static BOOL sid_parse(void *mem_ctx, +static bool sid_parse(void *mem_ctx, struct torture_context *torture, DATA_BLOB *data, size_t *offset, struct dom_sid **psid) @@ -126,10 +126,10 @@ static BOOL sid_parse(void *mem_ctx, (*offset) += 4; } - return True; + return true; } -static BOOL smb_raw_query_posix_whoami(void *mem_ctx, +static bool smb_raw_query_posix_whoami(void *mem_ctx, struct torture_context *torture, struct smbcli_state *cli, struct smb_whoami *whoami, @@ -205,7 +205,7 @@ static BOOL smb_raw_query_posix_whoami(void *mem_ctx, "invalid SID count"); torture_assert_int_equal(torture, whoami->num_sid_bytes, 0, "invalid SID byte count"); - return True; + return true; } if (whoami->num_gids != 0) { @@ -233,7 +233,7 @@ static BOOL smb_raw_query_posix_whoami(void *mem_ctx, if (tp.out.data.length == offset) { torture_assert_int_equal(torture, whoami->num_sids, 0, "invalid SID count"); - return True; + return true; } /* All the remaining bytes must be the SID list. */ @@ -252,7 +252,7 @@ static BOOL smb_raw_query_posix_whoami(void *mem_ctx, if (!sid_parse(mem_ctx, torture, &tp.out.data, &offset, &whoami->sid_list[i])) { - return False; + return false; } } @@ -262,10 +262,10 @@ static BOOL smb_raw_query_posix_whoami(void *mem_ctx, torture_assert_int_equal(torture, tp.out.data.length, offset, "trailing garbage bytes"); - return True; + return true; } -BOOL torture_unix_whoami(struct torture_context *torture) +bool torture_unix_whoami(struct torture_context *torture) { struct smbcli_state *cli; struct cli_credentials *anon_credentials; @@ -332,11 +332,11 @@ BOOL torture_unix_whoami(struct torture_context *torture) } talloc_free(mem_ctx); - return True; + return true; fail: talloc_free(mem_ctx); - return False; + return false; } -- cgit From bbdfbf8d9d486aee51117976b8f825759a4c4a37 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 3 Dec 2007 00:28:22 +0100 Subject: r26238: Add a loadparm context parameter to torture_context, remove more uses of global_loadparm. (This used to be commit a33a5530545086b81a3b205aa109dff11c546926) --- source4/torture/unix/whoami.c | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index f45d2345db..422e2abcbf 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -66,16 +66,16 @@ struct smb_whoami struct dom_sid ** sid_list; }; -static struct smbcli_state *connect_to_server(void *mem_ctx, +static struct smbcli_state *connect_to_server(struct torture_context *tctx, struct cli_credentials *creds) { NTSTATUS status; struct smbcli_state *cli; - const char *host = lp_parm_string(global_loadparm, NULL, "torture", "host"); - const char *share = lp_parm_string(global_loadparm, NULL, "torture", "share"); + const char *host = torture_setting_string(tctx, "host", NULL); + const char *share = torture_setting_string(tctx, "share", NULL); - status = smbcli_full_connection(mem_ctx, &cli, + status = smbcli_full_connection(tctx, &cli, host, share, NULL, creds, NULL); @@ -270,29 +270,25 @@ bool torture_unix_whoami(struct torture_context *torture) struct smbcli_state *cli; struct cli_credentials *anon_credentials; struct smb_whoami whoami; - void *mem_ctx; - mem_ctx = talloc_init("smb_query_posix_whoami"); - torture_assert(torture, mem_ctx != NULL, "malloc failed"); - - if (!(cli = connect_to_server(mem_ctx, cmdline_credentials))) { - goto fail; + if (!(cli = connect_to_server(torture, cmdline_credentials))) { + return false; } /* Test basic authenticated mapping. */ printf("calling SMB_QFS_POSIX_WHOAMI on an authenticated connection\n"); - if (!smb_raw_query_posix_whoami(mem_ctx, torture, + if (!smb_raw_query_posix_whoami(torture, torture, cli, &whoami, 0xFFFF)) { smbcli_tdis(cli); - goto fail; + return false; } /* Test that the server drops the UID and GID list. */ printf("calling SMB_QFS_POSIX_WHOAMI with a small buffer\n"); - if (!smb_raw_query_posix_whoami(mem_ctx, torture, + if (!smb_raw_query_posix_whoami(torture, torture, cli, &whoami, 0x40)) { smbcli_tdis(cli); - goto fail; + return false; } torture_assert_int_equal(torture, whoami.num_gids, 0, @@ -305,16 +301,16 @@ bool torture_unix_whoami(struct torture_context *torture) smbcli_tdis(cli); printf("calling SMB_QFS_POSIX_WHOAMI on an anonymous connection\n"); - anon_credentials = cli_credentials_init_anon(mem_ctx); + anon_credentials = cli_credentials_init_anon(torture); - if (!(cli = connect_to_server(mem_ctx, anon_credentials))) { - goto fail; + if (!(cli = connect_to_server(torture, anon_credentials))) { + return false; } - if (!smb_raw_query_posix_whoami(mem_ctx, torture, + if (!smb_raw_query_posix_whoami(torture, torture, cli, &whoami, 0xFFFF)) { smbcli_tdis(cli); - goto fail; + return false; } smbcli_tdis(cli); @@ -331,13 +327,7 @@ bool torture_unix_whoami(struct torture_context *torture) printf("server does not support SMB_WHOAMI_GUEST flag\n"); } - talloc_free(mem_ctx); return true; - -fail: - talloc_free(mem_ctx); - return false; - } /* vim: set sts=8 sw=8 : */ -- cgit From 4b0199a5493ea2b88558cc40871e63c1dc8dbb56 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 12 Dec 2007 02:15:29 +0100 Subject: r26409: Pass smb ports along. (This used to be commit 2833f320de1f1fd39c710ad0a61c3fa1bb1df31f) --- source4/torture/unix/unix_info2.c | 6 ++++-- source4/torture/unix/whoami.c | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index 882dc7a084..d5fe8bc260 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -26,6 +26,7 @@ #include "torture/basic/proto.h" #include "lib/cmdline/popt_common.h" #include "auth/credentials/credentials.h" +#include "param/param.h" struct unix_info2 { uint64_t end_of_file; @@ -54,8 +55,9 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx) const char *host = torture_setting_string(tctx, "host", NULL); const char *share = torture_setting_string(tctx, "share", NULL); - status = smbcli_full_connection(tctx, &cli, - host, share, NULL, + status = smbcli_full_connection(tctx, &cli, host, + lp_smb_ports(tctx->lp_ctx), + share, NULL, cmdline_credentials, NULL); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 422e2abcbf..412a256da7 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -75,8 +75,9 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx, const char *host = torture_setting_string(tctx, "host", NULL); const char *share = torture_setting_string(tctx, "share", NULL); - status = smbcli_full_connection(tctx, &cli, - host, share, NULL, + status = smbcli_full_connection(tctx, &cli, host, + lp_smb_ports(tctx->lp_ctx), + share, NULL, creds, NULL); if (!NT_STATUS_IS_OK(status)) { -- cgit From 771b347f9b185895390445be96081c781e28a26d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Jan 2008 18:39:01 -0600 Subject: r26644: Janitorial: Pass resolve_context explicitly to various SMB functions, should help fix the build for OpenChange. (This used to be commit 385ffe4f4cc9a21a760c0f00410f56e2592fd507) --- source4/torture/unix/unix_info2.c | 4 +++- source4/torture/unix/whoami.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index d5fe8bc260..9fa0d55c9e 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -26,6 +26,7 @@ #include "torture/basic/proto.h" #include "lib/cmdline/popt_common.h" #include "auth/credentials/credentials.h" +#include "libcli/resolve/resolve.h" #include "param/param.h" struct unix_info2 { @@ -58,7 +59,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx) status = smbcli_full_connection(tctx, &cli, host, lp_smb_ports(tctx->lp_ctx), share, NULL, - cmdline_credentials, NULL); + cmdline_credentials, + lp_resolve_context(tctx->lp_ctx), NULL); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 412a256da7..4477713bfe 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -25,6 +25,7 @@ #include "lib/cmdline/popt_common.h" #include "auth/credentials/credentials.h" #include "param/param.h" +#include "libcli/resolve/resolve.h" /* Size (in bytes) of the required fields in the SMBwhoami response. */ #define WHOAMI_REQUIRED_SIZE 40 @@ -78,7 +79,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx, status = smbcli_full_connection(tctx, &cli, host, lp_smb_ports(tctx->lp_ctx), share, NULL, - creds, NULL); + creds, lp_resolve_context(tctx->lp_ctx), + NULL); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", -- cgit From dcc282590b34537fc1ead61c3300172528273b44 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 3 Jan 2008 17:22:12 -0600 Subject: r26654: libcli/smb_composite: Rather than specifying each of the gazillion options for SMB individually, just specify the smbcli_options struct. (This used to be commit 8a97886e24a4b969aa91409c06f423b71a45f6eb) --- source4/torture/unix/unix_info2.c | 6 +++++- source4/torture/unix/whoami.c | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index 9fa0d55c9e..c14be9e2d0 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -55,12 +55,16 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx) const char *host = torture_setting_string(tctx, "host", NULL); const char *share = torture_setting_string(tctx, "share", NULL); + struct smbcli_options options; + + lp_smbcli_options(tctx->lp_ctx, &options); status = smbcli_full_connection(tctx, &cli, host, lp_smb_ports(tctx->lp_ctx), share, NULL, cmdline_credentials, - lp_resolve_context(tctx->lp_ctx), NULL); + lp_resolve_context(tctx->lp_ctx), NULL, + &options); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 4477713bfe..3203f91bc0 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -75,12 +75,15 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx, const char *host = torture_setting_string(tctx, "host", NULL); const char *share = torture_setting_string(tctx, "share", NULL); + struct smbcli_options options; + + lp_smbcli_options(tctx->lp_ctx, &options); status = smbcli_full_connection(tctx, &cli, host, lp_smb_ports(tctx->lp_ctx), share, NULL, creds, lp_resolve_context(tctx->lp_ctx), - NULL); + NULL, &options); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", -- cgit From afe3e8172ddaa5e4aa811faceecda4f943d6e2ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 04:53:27 +0200 Subject: Install public header files again and include required prototypes. (This used to be commit 47ffbbf67435904754469544390b67d34c958343) --- source4/torture/unix/whoami.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 3203f91bc0..a1333ac5bd 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -22,6 +22,7 @@ #include "torture/basic/proto.h" #include "libcli/libcli.h" #include "libcli/raw/interfaces.h" +#include "libcli/raw/raw_proto.h" #include "lib/cmdline/popt_common.h" #include "auth/credentials/credentials.h" #include "param/param.h" -- cgit From 4e83011f72ba3df387512755a17760b42a7bf2f2 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 21 Apr 2008 17:58:23 -0400 Subject: Remove more event_context_init() uses from function calls within deep down the code. Make sure we pass around the event_context where we need it instead. All test but a few python ones fail. Jelmer promised to fix them. (This used to be commit 3045d391626fba169aa26be52174883e18d323e9) --- source4/torture/unix/unix_info2.c | 4 ++-- source4/torture/unix/whoami.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index c14be9e2d0..d7482ddcf1 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -63,8 +63,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx) lp_smb_ports(tctx->lp_ctx), share, NULL, cmdline_credentials, - lp_resolve_context(tctx->lp_ctx), NULL, - &options); + lp_resolve_context(tctx->lp_ctx), + tctx->ev, &options); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index a1333ac5bd..d4f19bb57a 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -84,7 +84,7 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx, lp_smb_ports(tctx->lp_ctx), share, NULL, creds, lp_resolve_context(tctx->lp_ctx), - NULL, &options); + tctx->ev, &options); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", -- cgit From 1e973565b6c0cb738b25a2d9439d5acb441701f4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 27 Apr 2008 14:02:46 +0100 Subject: Move subunit infrastructure code into lib/torture. (This used to be commit 5b44d8121de7735d69e6238a1442aff034a8ebd3) --- source4/torture/unix/unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/unix.c b/source4/torture/unix/unix.c index 05ea27db02..661e337270 100644 --- a/source4/torture/unix/unix.c +++ b/source4/torture/unix/unix.c @@ -18,7 +18,7 @@ */ #include "includes.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "torture/unix/proto.h" NTSTATUS torture_unix_init(void) -- cgit From d6130413965b53baa07b7b93c9b0d5199cff4437 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 9 Sep 2008 13:01:34 +0200 Subject: UNIX-WHOAMI: fix compiler warnings metze (This used to be commit ec5d8ddadb76ff0d2cb72872e4d145a7527f0ec6) --- source4/torture/unix/whoami.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/unix') diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index d4f19bb57a..39d0a12ab1 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -18,11 +18,11 @@ */ #include "includes.h" -#include "torture/torture.h" -#include "torture/basic/proto.h" #include "libcli/libcli.h" #include "libcli/raw/interfaces.h" #include "libcli/raw/raw_proto.h" +#include "torture/torture.h" +#include "torture/basic/proto.h" #include "lib/cmdline/popt_common.h" #include "auth/credentials/credentials.h" #include "param/param.h" -- cgit