From 330d04de27d4dc0126614ebb9c702e10d3f89ffb Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Fri, 8 Nov 2013 13:56:23 +0100 Subject: [PATCH 01/15] vfstest: fix uninitialised variable usage in open The vfstest open command currently fails intermittently due to a read of a potentially uninitialised status variable. Signed-off-by: David Disseldorp Reviewed-by: Jeremy Allison (cherry picked from commit c7aab6e5205b78f00f84492cc1a0fd4b67ef917a) --- source3/torture/cmd_vfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 1b20208..f923ed5 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -347,6 +347,7 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c return NT_STATUS_UNSUCCESSFUL; } + status = NT_STATUS_OK; ret = SMB_VFS_FSTAT(fsp, &smb_fname->st); if (ret == -1) { /* If we have an fd, this stat should succeed. */ @@ -359,7 +360,7 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c errno = EISDIR; status = NT_STATUS_FILE_IS_A_DIRECTORY; } - + if (!NT_STATUS_IS_OK(status)) { SMB_VFS_CLOSE(fsp); TALLOC_FREE(fsp); @@ -1780,7 +1781,7 @@ struct cmd_set vfs_commands[] = { { "mkdir", cmd_mkdir, "VFS mkdir()", "mkdir " }, { "rmdir", cmd_pathfunc, "VFS rmdir()", "rmdir " }, { "closedir", cmd_closedir, "VFS closedir()", "closedir" }, - { "open", cmd_open, "VFS open()", "open " }, + { "open", cmd_open, "VFS open()", "open " }, { "close", cmd_close, "VFS close()", "close " }, { "read", cmd_read, "VFS read()", "read " }, { "write", cmd_write, "VFS write()", "write " }, -- 1.8.5 From 0b2673ad2fd07be4846bc84fca2eedbf0b256f57 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:47 +0100 Subject: [PATCH 02/15] s4-libcli: Add smb2_util_handle_empty(). Will be used in the next commit. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit 9d53d9f7e55e07bb079d3e91018e6c407c91573a) --- source4/libcli/smb2/util.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source4/libcli/smb2/util.c b/source4/libcli/smb2/util.c index 8b4a86f..e28c910 100644 --- a/source4/libcli/smb2/util.c +++ b/source4/libcli/smb2/util.c @@ -230,3 +230,12 @@ bool smb2_util_handle_equal(const struct smb2_handle h1, { return (h1.data[0] == h2.data[0]) && (h1.data[1] == h2.data[1]); } + +bool smb2_util_handle_empty(const struct smb2_handle h) +{ + struct smb2_handle empty; + + ZERO_STRUCT(empty); + + return smb2_util_handle_equal(h, empty); +} -- 1.8.5 From cc901e7dc8f99b17a27722266132b5c837e2feaa Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:48 +0100 Subject: [PATCH 03/15] s4-torture: Make sure the handles are not used uninitialized. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit 13e33ab98e8c7ffa5b9a6fd8089688c6be961ffb) --- source4/torture/smb2/streams.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source4/torture/smb2/streams.c b/source4/torture/smb2/streams.c index 608b397..6077c5b 100644 --- a/source4/torture/smb2/streams.c +++ b/source4/torture/smb2/streams.c @@ -603,6 +603,9 @@ static bool test_stream_delete(struct torture_context *tctx, goto done; } + ZERO_STRUCT(h); + ZERO_STRUCT(h1); + sname1 = talloc_asprintf(mem_ctx, "%s:%s", fname, "Stream One"); /* clean slate .. */ @@ -696,6 +699,7 @@ static bool test_stream_delete(struct torture_context *tctx, CHECK_STATUS(status, NT_STATUS_DELETE_PENDING); smb2_util_close(tree, h1); + ZERO_STRUCT(h1); /* * After closing the stream the file is really gone. @@ -707,7 +711,9 @@ static bool test_stream_delete(struct torture_context *tctx, CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); done: - smb2_util_close(tree, h1); + if (!smb2_util_handle_empty(h1)) { + smb2_util_close(tree, h1); + } smb2_util_unlink(tree, fname); smb2_deltree(tree, DNAME); talloc_free(mem_ctx); -- 1.8.5 From ec04b80f909459ea0089347059eeff0f0641f108 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:49 +0100 Subject: [PATCH 04/15] s4-torture: Make sure the handles are initialized correctly. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit ef2cd51586a359d192ae1d07898d9e10cb5fb1b0) --- source4/torture/rpc/winreg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 55164cd..d3c3d05 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -2577,7 +2577,10 @@ static bool test_volatile_keys(struct torture_context *tctx, int hkey) { struct policy_handle new_handle, hive_handle; - enum winreg_CreateAction action_taken; + enum winreg_CreateAction action_taken = REG_ACTION_NONE; + + ZERO_STRUCT(new_handle); + ZERO_STRUCT(hive_handle); torture_comment(tctx, "Testing VOLATILE key\n"); -- 1.8.5 From 7e47a53a6c2985bab3181fd0b3882c2659773e5f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:50 +0100 Subject: [PATCH 05/15] s4-torture: Make sure handles are correctly initialized. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit 09cc58c1a7ffa29b509a688ab011503ebc7fd660) --- source4/torture/rpc/spoolss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 4c84bc0..f47a0a9 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -4943,7 +4943,7 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx, struct policy_handle *hive_handle, const char *server_name_slash) { - WERROR result; + WERROR result = WERR_OK; union spoolss_DriverInfo info; const char *driver_key; struct policy_handle key_handle; @@ -4960,6 +4960,8 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx, const char *driver_version; const char *inbox_driver_version; + ZERO_STRUCT(key_handle); + torture_comment(tctx, "Testing Driver Info and winreg consistency\n"); driver_key = talloc_asprintf(tctx, "%s\\%s\\Drivers\\Version-%d\\%s", -- 1.8.5 From 2256672b19aa98517eb817af778e57c9d57a35c9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:51 +0100 Subject: [PATCH 06/15] s4-torture: Fix some compile warnings in spoolss. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit 3b3b52c013bdf61fdf58c9725eb4a0843a1a1fb6) --- source4/torture/rpc/spoolss.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index f47a0a9..a94f174 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -585,7 +585,7 @@ static bool test_EnumPrinterDrivers_findone(struct torture_context *tctx, "failed to enumerate printer drivers"); for (i=0; i < count; i++) { - const char *driver_name_ret; + const char *driver_name_ret = ""; switch (level) { case 1: driver_name_ret = info[i].info1.driver_name; @@ -1439,8 +1439,6 @@ static bool test_PrinterInfo(struct torture_context *tctx, bool ret = true; int i; - torture_skip(tctx, "Printer Info test is currently broken, skipping"); - uint32_t status_list[] = { /* these do not stick PRINTER_STATUS_PAUSED, @@ -1519,6 +1517,9 @@ static bool test_PrinterInfo(struct torture_context *tctx, 0x80000000 */ }; + torture_skip(tctx, "Printer Info test is currently broken, skipping"); + + ZERO_STRUCT(devmode_ctr); ZERO_STRUCT(secdesc_ctr); @@ -2132,7 +2133,6 @@ static bool test_devicemode_full(struct torture_context *tctx, { struct spoolss_SetPrinter s; struct spoolss_GetPrinter q; - struct spoolss_GetPrinter q0; struct spoolss_SetPrinterInfoCtr info_ctr; struct spoolss_SetPrinterInfo8 info8; union spoolss_PrinterInfo info; @@ -2184,7 +2184,6 @@ static bool test_devicemode_full(struct torture_context *tctx, q.in.handle = handle; q.out.info = &info; - q0 = q; #if 0 const char *devicename;/* [charset(UTF16)] */ -- 1.8.5 From 717bdce5068f04914c68717af3611eaa9704a798 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:52 +0100 Subject: [PATCH 07/15] s3-torture: Comment out dead code in spoolss test. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit 34f498525cb7f6007c7d757e58fcaed7a607a4a2) --- source4/torture/rpc/spoolss.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index a94f174..f2dc389 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -3109,6 +3109,7 @@ static bool test_GetJob_args(struct torture_context *tctx, return true; } +#if 0 static bool test_GetJob(struct torture_context *tctx, struct dcerpc_binding_handle *b, struct policy_handle *handle, @@ -3125,6 +3126,7 @@ static bool test_GetJob(struct torture_context *tctx, return true; } +#endif static bool test_SetJob(struct torture_context *tctx, struct dcerpc_binding_handle *b, @@ -6902,7 +6904,7 @@ static bool test_EnumPrinters_servername(struct torture_context *tctx, return true; } - +#if 0 static bool test_GetPrinterDriver(struct torture_context *tctx, struct dcerpc_binding_handle *b, struct policy_handle *handle, @@ -6937,6 +6939,7 @@ static bool test_GetPrinterDriver(struct torture_context *tctx, return true; } +#endif static bool test_GetPrinterDriver2_level(struct torture_context *tctx, struct dcerpc_binding_handle *b, @@ -7637,6 +7640,7 @@ static bool compose_local_driver_directory(struct torture_context *tctx, return true; } +#if 0 static struct spoolss_DeviceMode *torture_devicemode(TALLOC_CTX *mem_ctx, const char *devicename) { @@ -7677,6 +7681,7 @@ static struct spoolss_DeviceMode *torture_devicemode(TALLOC_CTX *mem_ctx, return r; } +#endif static bool test_architecture_buffer(struct torture_context *tctx, void *private_data) @@ -8008,6 +8013,7 @@ static bool torture_rpc_spoolss_printerexwkn_setup(struct torture_context *tctx, return torture_rpc_spoolss_printer_setup_common(tctx, t); } +#if 0 static bool torture_rpc_spoolss_printerdm_setup(struct torture_context *tctx, void **data) { struct torture_printer_context *t; @@ -8021,6 +8027,7 @@ static bool torture_rpc_spoolss_printerdm_setup(struct torture_context *tctx, vo return torture_rpc_spoolss_printer_setup_common(tctx, t); } +#endif static bool torture_rpc_spoolss_printer_teardown_common(struct torture_context *tctx, struct torture_printer_context *t) { -- 1.8.5 From ad70f47dc8958f51902f5e30304787d858b9c07b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:53 +0100 Subject: [PATCH 08/15] s4-torture: Fix out of bound array access. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit b871c3907afe666ff7195c2906b43011138e4bf7) --- source4/torture/rpc/spoolss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index f2dc389..39247d2 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -681,7 +681,7 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx, for (j=0;jdriver_count[level - 1];j++) { union spoolss_DriverInfo *cur = &ctx->drivers[level - 1][j]; - union spoolss_DriverInfo *ref = &ctx->drivers[8][j]; + union spoolss_DriverInfo *ref = &ctx->drivers[7][j]; switch (level) { case 1: -- 1.8.5 From ffcd3359b3eab45beb96a2499877ec80b67b27c2 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:54 +0100 Subject: [PATCH 09/15] s4-torture: Use talloc for asprintf. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit 4f06c681b91446f4e85d7e46bdb20b25bf222aad) --- source4/torture/raw/setfileinfo.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/source4/torture/raw/setfileinfo.c b/source4/torture/raw/setfileinfo.c index 95ce060..a08191d 100644 --- a/source4/torture/raw/setfileinfo.c +++ b/source4/torture/raw/setfileinfo.c @@ -36,7 +36,6 @@ torture_raw_sfileinfo_base(struct torture_context *torture, struct smbcli_state bool ret = true; int fnum = -1; char *fnum_fname; - char *fnum_fname_new; char *path_fname; char *path_fname_new; union smb_fileinfo finfo1, finfo2; @@ -47,10 +46,9 @@ torture_raw_sfileinfo_base(struct torture_context *torture, struct smbcli_state bool check_fnum; int n = time(NULL) % 100; - asprintf(&path_fname, BASEDIR "\\fname_test_%d.txt", n); - asprintf(&path_fname_new, BASEDIR "\\fname_test_new_%d.txt", n); - asprintf(&fnum_fname, BASEDIR "\\fnum_test_%d.txt", n); - asprintf(&fnum_fname_new, BASEDIR "\\fnum_test_new_%d.txt", n); + path_fname = talloc_asprintf(torture, BASEDIR "\\fname_test_%d.txt", n); + path_fname_new = talloc_asprintf(torture, BASEDIR "\\fname_test_new_%d.txt", n); + fnum_fname = talloc_asprintf(torture, BASEDIR "\\fnum_test_%d.txt", n); torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); @@ -481,13 +479,13 @@ torture_raw_sfileinfo_rename(struct torture_context *torture, const char *call_name; bool check_fnum; int n = time(NULL) % 100; - - asprintf(&path_fname, BASEDIR "\\fname_test_%d.txt", n); - asprintf(&path_fname_new, BASEDIR "\\fname_test_new_%d.txt", n); - asprintf(&fnum_fname, BASEDIR "\\fnum_test_%d.txt", n); - asprintf(&fnum_fname_new, BASEDIR "\\fnum_test_new_%d.txt", n); - asprintf(&path_dname, BASEDIR "\\dname_test_%d", n); - asprintf(&path_dname_new, BASEDIR "\\dname_test_new_%d", n); + + path_fname = talloc_asprintf(torture, BASEDIR "\\fname_test_%d.txt", n); + path_fname_new = talloc_asprintf(torture, BASEDIR "\\fname_test_new_%d.txt", n); + fnum_fname = talloc_asprintf(torture, BASEDIR "\\fnum_test_%d.txt", n); + fnum_fname_new = talloc_asprintf(torture, BASEDIR "\\fnum_test_new_%d.txt", n); + path_dname = talloc_asprintf(torture, BASEDIR "\\dname_test_%d", n); + path_dname_new = talloc_asprintf(torture, BASEDIR "\\dname_test_new_%d", n); torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); -- 1.8.5 From 02cbe9f0845664f827e7e388c7325fd4bbdb6c66 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:55 +0100 Subject: [PATCH 10/15] s3-utils: Fix a memory leak in smbget. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit c5e73bccd5af8404df8bfaf2e6a40e93ead47f2e) --- source3/utils/smbget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c index 5cb6849..28d5647 100644 --- a/source3/utils/smbget.c +++ b/source3/utils/smbget.c @@ -159,6 +159,7 @@ static int smb_download_dir(const char *base, const char *name, int resume) char *newname; if(!strcmp(dirent->name, ".") || !strcmp(dirent->name, ".."))continue; if (asprintf(&newname, "%s/%s", tmpname, dirent->name) == -1) { + free(tmpname); return 1; } switch(dirent->smbc_type) { -- 1.8.5 From 1fcceeeabdb5f45d4ec3c82ef8edbf2ed4aada53 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:56 +0100 Subject: [PATCH 11/15] s3-torture: Fix several memory leaks in delete_fn(). Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit 1d7b909bd2fec8b0c2f7056b61d9ca5d6776ed7d) --- source3/torture/nbio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c index 0c918c1..519955d 100644 --- a/source3/torture/nbio.c +++ b/source3/torture/nbio.c @@ -323,6 +323,7 @@ static NTSTATUS delete_fn(const char *mnt, struct file_info *finfo, n = SMB_STRDUP(name); n[strlen(n)-1] = 0; if (asprintf(&s, "%s%s", n, finfo->name) == -1) { + free(n); printf("asprintf failed\n"); return NT_STATUS_NO_MEMORY; } @@ -330,12 +331,15 @@ static NTSTATUS delete_fn(const char *mnt, struct file_info *finfo, char *s2; if (asprintf(&s2, "%s\\*", s) == -1) { printf("asprintf failed\n"); + free(s); + free(n); return NT_STATUS_NO_MEMORY; } status = cli_list(c, s2, FILE_ATTRIBUTE_DIRECTORY, delete_fn, NULL); + free(s2); if (!NT_STATUS_IS_OK(status)) { + free(s); free(n); - free(s2); return status; } nb_rmdir(s); -- 1.8.5 From 5f21c90fca806a43d2f9fbb4a855efb78dd71c04 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:57 +0100 Subject: [PATCH 12/15] s3-torture: Make sure status is used initialized. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit 143907025b19ced780e7b1a3455de80d96eb0432) --- source3/torture/cmd_vfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index f923ed5..1ccdfe3 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -1489,6 +1489,7 @@ static NTSTATUS cmd_set_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a return NT_STATUS_UNSUCCESSFUL; } + status = NT_STATUS_OK; ret = SMB_VFS_FSTAT(fsp, &smb_fname->st); if (ret == -1) { /* If we have an fd, this stat should succeed. */ @@ -1545,7 +1546,6 @@ static NTSTATUS cmd_sys_acl_get_fd(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv) { int fd; - NTSTATUS status; SMB_ACL_T acl; char *acl_text; @@ -1567,7 +1567,7 @@ static NTSTATUS cmd_sys_acl_get_fd(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, acl = SMB_VFS_SYS_ACL_GET_FD(vfs->files[fd], talloc_tos()); if (!acl) { printf("sys_acl_get_fd failed (%s)\n", strerror(errno)); - return status; + return NT_STATUS_UNSUCCESSFUL; } acl_text = sys_acl_to_text(acl, NULL); printf("%s", acl_text); @@ -1579,7 +1579,6 @@ static NTSTATUS cmd_sys_acl_get_fd(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, static NTSTATUS cmd_sys_acl_get_file(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv) { - NTSTATUS status; SMB_ACL_T acl; char *acl_text; int type; @@ -1592,7 +1591,7 @@ static NTSTATUS cmd_sys_acl_get_file(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, acl = SMB_VFS_SYS_ACL_GET_FILE(vfs->conn, argv[1], type, talloc_tos()); if (!acl) { printf("sys_acl_get_file failed (%s)\n", strerror(errno)); - return status; + return NT_STATUS_UNSUCCESSFUL; } acl_text = sys_acl_to_text(acl, NULL); printf("%s", acl_text); -- 1.8.5 From 73d0566f5d07d9f54a281399065a1e915a4d3982 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:58 +0100 Subject: [PATCH 13/15] s3-libsmb: Fix a memory leak in get_pdc_ip(). Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit 1461d873a49fbc02b809d804e52627760a8714f7) --- source3/libsmb/namequery.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index d86c0ed..8eef1f6 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -2976,6 +2976,7 @@ bool get_pdc_ip(const char *domain, struct sockaddr_storage *pss) &count, lp_name_resolve_order()); if (!NT_STATUS_IS_OK(status)) { + SAFE_FREE(ip_list); return false; } } -- 1.8.5 From 5fec01221c6aeab7b9117a372bf49bf3d70ac082 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:01:59 +0100 Subject: [PATCH 14/15] krb5_wrap: Move function declaration outside the function. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam (cherry picked from commit 5f92c81fb67687cc4586e675e722192350745971) --- lib/krb5_wrap/krb5_samba.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c index 024e188..b218437 100644 --- a/lib/krb5_wrap/krb5_samba.c +++ b/lib/krb5_wrap/krb5_samba.c @@ -1334,6 +1334,15 @@ static krb5_error_code smb_krb5_get_credentials_for_user_opt(krb5_context contex #endif /* HAVE_KRB5_GET_CREDS_OPT_SET_IMPERSONATE */ #ifdef HAVE_KRB5_GET_CREDENTIALS_FOR_USER + +#if !HAVE_DECL_KRB5_GET_CREDENTIALS_FOR_USER +krb5_error_code KRB5_CALLCONV +krb5_get_credentials_for_user(krb5_context context, krb5_flags options, + krb5_ccache ccache, krb5_creds *in_creds, + krb5_data *subject_cert, + krb5_creds **out_creds); +#endif /* !HAVE_DECL_KRB5_GET_CREDENTIALS_FOR_USER */ + static krb5_error_code smb_krb5_get_credentials_for_user(krb5_context context, krb5_ccache ccache, krb5_principal me, @@ -1344,14 +1353,6 @@ static krb5_error_code smb_krb5_get_credentials_for_user(krb5_context context, krb5_error_code ret; krb5_creds in_creds; -#if !HAVE_DECL_KRB5_GET_CREDENTIALS_FOR_USER -krb5_error_code KRB5_CALLCONV -krb5_get_credentials_for_user(krb5_context context, krb5_flags options, - krb5_ccache ccache, krb5_creds *in_creds, - krb5_data *subject_cert, - krb5_creds **out_creds); -#endif /* !HAVE_DECL_KRB5_GET_CREDENTIALS_FOR_USER */ - ZERO_STRUCT(in_creds); if (impersonate_princ) { -- 1.8.5 From 0f337b895ce0e9e15e042aa51ab2338fce3e2549 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Dec 2013 14:02:00 +0100 Subject: [PATCH 15/15] s3-torture: Call cli_flush(). Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam Autobuild-User(master): Michael Adam Autobuild-Date(master): Fri Dec 6 03:07:32 CET 2013 on sn-devel-104 (cherry picked from commit 30231b256d8b14337a7ffe04fc031cf5693110f4) --- source3/torture/nbio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c index 519955d..fba83ea 100644 --- a/source3/torture/nbio.c +++ b/source3/torture/nbio.c @@ -306,7 +306,8 @@ void nb_flush(int fnum) { int i; i = find_handle(fnum); - /* hmmm, we don't have cli_flush() yet */ + + cli_flush(NULL, c, i); } static int total_deleted; -- 1.8.5