The branch, v3-4-test has been updated via 942d47e5ed583e29afaa005f9ca6251373db8e2f (commit) via d5c6ff96fd89b87c7331f264044e931b100b3a1a (commit) via 492b5cfea364c60376245962a8777e04e31e8392 (commit) via c89fdbed5286806d9a9b0b4a5d35870f7989baf7 (commit) from d5da80b175b8e7e12070577abdab4f57917727a3 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test - Log ----------------------------------------------------------------- commit 942d47e5ed583e29afaa005f9ca6251373db8e2f Author: Günther Deschner <g...@samba.org> Date: Thu Apr 30 23:37:26 2009 +0200 s3-netapi: Fix Bug #6309: support remote unjoining of Windows 2003 or greater. Found by David Markey <ad...@dmarkey.com>. Thanks! Guenther (cherry picked from commit ab4b8c9c0438bc5afca17e3ebf05dde6f98bc0aa) commit d5c6ff96fd89b87c7331f264044e931b100b3a1a Author: Günther Deschner <g...@samba.org> Date: Thu Apr 30 23:36:24 2009 +0200 wkssvcs: add WKSSVC_JOIN_FLAGS_IGNORE_UNSUPPORTED_FLAGS join flag. Guenther (cherry picked from commit 26b9c9370ce047ecc732082b2b554ffc295ae406) commit 492b5cfea364c60376245962a8777e04e31e8392 Author: Günther Deschner <g...@samba.org> Date: Thu Apr 30 16:49:50 2009 +0200 s3-printing: rework move_driver_file_to_download_area() a bit for clarity. Guenther (cherry picked from commit baf78506895b8bd50433058ba0f18e1aaf8aeee5) commit c89fdbed5286806d9a9b0b4a5d35870f7989baf7 Author: Günther Deschner <g...@samba.org> Date: Thu Apr 30 12:30:10 2009 +0200 s3-lsa: use LSA_POLICY_MODE flags in _lsa_GetSystemAccessAccount(). Guenther (cherry picked from commit af5a71d5280984a7d707e39fb522ecc7e1b71436) ----------------------------------------------------------------------- Summary of changes: librpc/gen_ndr/ndr_wkssvc.c | 1 + librpc/gen_ndr/wkssvc.h | 1 + librpc/idl/wkssvc.idl | 1 + source3/include/privileges.h | 6 -- .../examples/netdomjoin-gui/netdomjoin-gui.c | 3 +- source3/printing/nt_printing.c | 72 +++++++++++--------- source3/rpc_server/srv_lsa_nt.c | 3 +- source3/utils/net_dom.c | 3 +- 8 files changed, 49 insertions(+), 41 deletions(-) Changeset truncated at 500 lines: diff --git a/librpc/gen_ndr/ndr_wkssvc.c b/librpc/gen_ndr/ndr_wkssvc.c index 050aced..760b4ee 100644 --- a/librpc/gen_ndr/ndr_wkssvc.c +++ b/librpc/gen_ndr/ndr_wkssvc.c @@ -5545,6 +5545,7 @@ _PUBLIC_ void ndr_print_wkssvc_joinflags(struct ndr_print *ndr, const char *name { ndr_print_uint32(ndr, name, r); ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_IGNORE_UNSUPPORTED_FLAGS", WKSSVC_JOIN_FLAGS_IGNORE_UNSUPPORTED_FLAGS, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_JOIN_WITH_NEW_NAME", WKSSVC_JOIN_FLAGS_JOIN_WITH_NEW_NAME, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_JOIN_DC_ACCOUNT", WKSSVC_JOIN_FLAGS_JOIN_DC_ACCOUNT, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_DEFER_SPN", WKSSVC_JOIN_FLAGS_DEFER_SPN, r); diff --git a/librpc/gen_ndr/wkssvc.h b/librpc/gen_ndr/wkssvc.h index 19aa126..42360a9 100644 --- a/librpc/gen_ndr/wkssvc.h +++ b/librpc/gen_ndr/wkssvc.h @@ -458,6 +458,7 @@ struct wkssvc_PasswordBuffer { }/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; /* bitmap wkssvc_joinflags */ +#define WKSSVC_JOIN_FLAGS_IGNORE_UNSUPPORTED_FLAGS ( 0x10000000 ) #define WKSSVC_JOIN_FLAGS_JOIN_WITH_NEW_NAME ( 0x00000400 ) #define WKSSVC_JOIN_FLAGS_JOIN_DC_ACCOUNT ( 0x00000200 ) #define WKSSVC_JOIN_FLAGS_DEFER_SPN ( 0x00000100 ) diff --git a/librpc/idl/wkssvc.idl b/librpc/idl/wkssvc.idl index 9340990..9e92ed7 100644 --- a/librpc/idl/wkssvc.idl +++ b/librpc/idl/wkssvc.idl @@ -659,6 +659,7 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_PasswordBuffer; typedef [bitmap32bit] bitmap { + WKSSVC_JOIN_FLAGS_IGNORE_UNSUPPORTED_FLAGS = 0x10000000, WKSSVC_JOIN_FLAGS_JOIN_WITH_NEW_NAME = 0x00000400, WKSSVC_JOIN_FLAGS_JOIN_DC_ACCOUNT = 0x00000200, /* TRUE: defer setting the SPN and dNSHostName until a rename operation */ diff --git a/source3/include/privileges.h b/source3/include/privileges.h index 9a5d928..57d3fc0 100644 --- a/source3/include/privileges.h +++ b/source3/include/privileges.h @@ -77,12 +77,6 @@ extern const SE_PRIV se_take_ownership; /* * These are used in Lsa replies (srv_lsa_nt.c) */ -#define PR_NONE 0x0000 -#define PR_LOG_ON_LOCALLY 0x0001 -#define PR_ACCESS_FROM_NETWORK 0x0002 -#define PR_LOG_ON_BATCH_JOB 0x0004 -#define PR_LOG_ON_SERVICE 0x0010 - typedef struct { uint32 high; diff --git a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c index 8164b74..629a447 100644 --- a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c +++ b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c @@ -655,7 +655,8 @@ static void callback_do_join(GtkWidget *widget, unjoin_creds_required = TRUE; join_creds_required = FALSE; unjoin_flags = NETSETUP_JOIN_DOMAIN | - NETSETUP_ACCT_DELETE; + NETSETUP_ACCT_DELETE | + NETSETUP_IGNORE_UNSUPPORTED_FLAGS; } if (try_unjoin) { diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index a7cca40..8953c7a 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -1806,8 +1806,8 @@ static char* ffmt(unsigned char *c){ static WERROR move_driver_file_to_download_area(TALLOC_CTX *mem_ctx, connection_struct *conn, const char *driver_file, - const char *architecture, - const char *new_dir, + const char *short_architecture, + uint32_t driver_version, uint32_t version) { char *old_name = NULL; @@ -1815,26 +1815,30 @@ static WERROR move_driver_file_to_download_area(TALLOC_CTX *mem_ctx, SMB_STRUCT_STAT st; NTSTATUS status; - new_name = talloc_asprintf(mem_ctx, "%s/%s", - architecture, driver_file); - W_ERROR_HAVE_NO_MEMORY(new_name); - old_name = talloc_asprintf(mem_ctx, "%s/%s", - new_dir, driver_file); + short_architecture, driver_file); W_ERROR_HAVE_NO_MEMORY(old_name); - if (version != -1 && (version = file_version_is_newer(conn, new_name, old_name)) > 0) { + new_name = talloc_asprintf(mem_ctx, "%s/%d/%s", + short_architecture, driver_version, driver_file); + W_ERROR_HAVE_NO_MEMORY(new_name); + + if (version != -1 && (version = file_version_is_newer(conn, old_name, new_name)) > 0) { - new_name = driver_unix_convert(conn, new_name, &st); - W_ERROR_HAVE_NO_MEMORY(new_name); + old_name = driver_unix_convert(conn, old_name, &st); + W_ERROR_HAVE_NO_MEMORY(old_name); - status = copy_file(mem_ctx, conn, new_name, old_name, + DEBUG(10,("move_driver_file_to_download_area: copying '%s' to '%s'\n", + old_name, new_name)); + + status = copy_file(mem_ctx, conn, old_name, new_name, OPENX_FILE_EXISTS_TRUNCATE | OPENX_FILE_CREATE_IF_NOT_EXIST, 0, false); + if (!NT_STATUS_IS_OK(status)) { - DEBUG(0,("move_driver_file_to_download_area: Unable to rename [%s] to [%s]\n", - new_name, old_name)); + DEBUG(0,("move_driver_file_to_download_area: Unable to rename [%s] to [%s]: %s\n", + old_name, new_name, nt_errstr(status))); return WERR_ACCESS_DENIED; } } @@ -1848,7 +1852,7 @@ WERROR move_driver_to_download_area(struct pipes_struct *p, { NT_PRINTER_DRIVER_INFO_LEVEL_3 *driver; NT_PRINTER_DRIVER_INFO_LEVEL_3 converted_driver; - const char *architecture; + const char *short_architecture; char *new_dir = NULL; connection_struct *conn = NULL; NTSTATUS nt_status; @@ -1862,18 +1866,21 @@ WERROR move_driver_to_download_area(struct pipes_struct *p, *perr = WERR_OK; - if (level==3) - driver=driver_abstract.info_3; - else if (level==6) { + switch (level) { + case 3: + driver = driver_abstract.info_3; + break; + case 6: convert_level_6_to_level3(&converted_driver, driver_abstract.info_6); driver = &converted_driver; - } else { + break; + default: DEBUG(0,("move_driver_to_download_area: Unknown info level (%u)\n", (unsigned int)level )); return WERR_UNKNOWN_LEVEL; } - architecture = get_short_archi(driver->environment); - if (!architecture) { + short_architecture = get_short_archi(driver->environment); + if (!short_architecture) { return WERR_UNKNOWN_PRINTER_DRIVER; } @@ -1895,10 +1902,9 @@ WERROR move_driver_to_download_area(struct pipes_struct *p, return *perr; } - DEBUG(5,("Creating first directory\n")); new_dir = talloc_asprintf(ctx, "%s/%d", - architecture, + short_architecture, driver->cversion); if (!new_dir) { *perr = WERR_NOMEM; @@ -1910,6 +1916,8 @@ WERROR move_driver_to_download_area(struct pipes_struct *p, goto err_exit; } + DEBUG(5,("Creating first directory: %s\n", new_dir)); + create_directory(conn, NULL, new_dir); /* For each driver file, archi\filexxx.yyy, if there is a duplicate file @@ -1936,8 +1944,8 @@ WERROR move_driver_to_download_area(struct pipes_struct *p, *perr = move_driver_file_to_download_area(ctx, conn, driver->driverpath, - architecture, - new_dir, + short_architecture, + driver->cversion, ver); if (!W_ERROR_IS_OK(*perr)) { if (W_ERROR_EQUAL(*perr, WERR_ACCESS_DENIED)) { @@ -1953,8 +1961,8 @@ WERROR move_driver_to_download_area(struct pipes_struct *p, *perr = move_driver_file_to_download_area(ctx, conn, driver->datafile, - architecture, - new_dir, + short_architecture, + driver->cversion, ver); if (!W_ERROR_IS_OK(*perr)) { if (W_ERROR_EQUAL(*perr, WERR_ACCESS_DENIED)) { @@ -1972,8 +1980,8 @@ WERROR move_driver_to_download_area(struct pipes_struct *p, *perr = move_driver_file_to_download_area(ctx, conn, driver->configfile, - architecture, - new_dir, + short_architecture, + driver->cversion, ver); if (!W_ERROR_IS_OK(*perr)) { if (W_ERROR_EQUAL(*perr, WERR_ACCESS_DENIED)) { @@ -1992,8 +2000,8 @@ WERROR move_driver_to_download_area(struct pipes_struct *p, *perr = move_driver_file_to_download_area(ctx, conn, driver->helpfile, - architecture, - new_dir, + short_architecture, + driver->cversion, ver); if (!W_ERROR_IS_OK(*perr)) { if (W_ERROR_EQUAL(*perr, WERR_ACCESS_DENIED)) { @@ -2020,8 +2028,8 @@ WERROR move_driver_to_download_area(struct pipes_struct *p, *perr = move_driver_file_to_download_area(ctx, conn, driver->dependentfiles[i], - architecture, - new_dir, + short_architecture, + driver->cversion, ver); if (!W_ERROR_IS_OK(*perr)) { if (W_ERROR_EQUAL(*perr, WERR_ACCESS_DENIED)) { diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index 9481c20..d9d74ed 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -1716,7 +1716,8 @@ NTSTATUS _lsa_GetSystemAccessAccount(pipes_struct *p, they can be ORed together */ - *r->out.access_mask = PR_LOG_ON_LOCALLY | PR_ACCESS_FROM_NETWORK; + *r->out.access_mask = LSA_POLICY_MODE_INTERACTIVE | + LSA_POLICY_MODE_NETWORK; return NT_STATUS_OK; } diff --git a/source3/utils/net_dom.c b/source3/utils/net_dom.c index 132630d..3bf6a27 100644 --- a/source3/utils/net_dom.c +++ b/source3/utils/net_dom.c @@ -38,7 +38,8 @@ static int net_dom_unjoin(struct net_context *c, int argc, const char **argv) const char *account = NULL; const char *password = NULL; uint32_t unjoin_flags = NETSETUP_ACCT_DELETE | - NETSETUP_JOIN_DOMAIN; + NETSETUP_JOIN_DOMAIN | + NETSETUP_IGNORE_UNSUPPORTED_FLAGS; struct cli_state *cli = NULL; bool do_reboot = false; NTSTATUS ntstatus; -- Samba Shared Repository