kai/samba.git
12 years agos3:smbclient: use lp_load_client()
Michael Adam [Fri, 22 Jul 2011 15:17:46 +0000 (17:17 +0200)]
s3:smbclient: use lp_load_client()

12 years agos3:loadparm: make lp_is_in_client() static - only used inside loadparm
Michael Adam [Fri, 22 Jul 2011 15:24:38 +0000 (17:24 +0200)]
s3:loadparm: make lp_is_in_client() static - only used inside loadparm

12 years agos3:loadparm: add lp_load_client() that also sets the client state internally
Michael Adam [Fri, 22 Jul 2011 15:23:31 +0000 (17:23 +0200)]
s3:loadparm: add lp_load_client() that also sets the client state internally

12 years agos3:loadparm: add a convenience wrapper lp_load_global()
Michael Adam [Fri, 22 Jul 2011 15:16:02 +0000 (17:16 +0200)]
s3:loadparm: add a convenience wrapper lp_load_global()

This is the use case for most callers, especially the client tools.

12 years agos3:loadparm: rename parameter "allow_registry_shares" to "load_all_shares"
Michael Adam [Thu, 21 Jul 2011 12:05:24 +0000 (14:05 +0200)]
s3:loadparm: rename parameter "allow_registry_shares" to "load_all_shares"

12 years agosamba-tool: ensure prompting of passwords is in the right order
Andrew Tridgell [Thu, 28 Jul 2011 05:14:03 +0000 (15:14 +1000)]
samba-tool: ensure prompting of passwords is in the right order

ask the creds object for the password before prompting for the new
password in the user password change code, to ensure the user is asked
for the old password first

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Jul 28 08:35:45 CEST 2011 on sn-devel-104

12 years agosamba-tool: Added gpo fetch command implementation using python smb module.
Amitay Isaacs [Thu, 28 Jul 2011 04:17:19 +0000 (14:17 +1000)]
samba-tool: Added gpo fetch command implementation using python smb module.

To copy the GPO files, use libcli python interface list() to get directory
listing and loadfile() to read the contents of the file.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Change samba-tool gpo semantics (use gpo name instead of dn)
Amitay Isaacs [Thu, 28 Jul 2011 04:07:44 +0000 (14:07 +1000)]
samba-tool: Change samba-tool gpo semantics (use gpo name instead of dn)

Instead of using gpo dn as the key to refer to a gpo, use the gpo name
as the key.

If no URL is specified (-H option), find a writable DC and use that.

Extract a commonly used method as get_gpo_info() to find details of a GPO.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos4-libcli: Initialize stack structure variables to zero.
Amitay Isaacs [Thu, 28 Jul 2011 03:22:01 +0000 (13:22 +1000)]
s4-libcli: Initialize stack structure variables to zero.

Update do_smb_connect function to return NTSTATUS rather than raise
python exception on error. Error checking done in py_smb_new().

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agotests-blackbox: Revert the test to use user-level change password command
Amitay Isaacs [Wed, 27 Jul 2011 23:23:03 +0000 (09:23 +1000)]
tests-blackbox: Revert the test to use user-level change password command

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agotest-blackbox: use python version of change password command
Amitay Isaacs [Wed, 27 Jul 2011 08:56:35 +0000 (18:56 +1000)]
test-blackbox: use python version of change password command

Replace the "samba-tool user setpassword" command with user level
"samba-tool user password" command.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agotest-blackbox: Rearrange arguments for samba-tool user setpassword command
Amitay Isaacs [Wed, 27 Jul 2011 08:54:17 +0000 (18:54 +1000)]
test-blackbox: Rearrange arguments for samba-tool user setpassword command

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agotest-blackbox: Remove 'domain\' from username for samba-tool user setpassword
Amitay Isaacs [Wed, 27 Jul 2011 08:52:05 +0000 (18:52 +1000)]
test-blackbox: Remove 'domain\' from username for samba-tool user setpassword

Python version of samba-tool does not require 'domain\' prefix for username.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agotest-blackbox: Rearrange the arguments in required order for samba-tool time
Amitay Isaacs [Wed, 27 Jul 2011 08:49:35 +0000 (18:49 +1000)]
test-blackbox: Rearrange the arguments in required order for samba-tool time

Python version of samba-tool requires the command and the subcommand to
be specified before the options.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Add user password command to change user's own password
Amitay Isaacs [Wed, 27 Jul 2011 08:41:56 +0000 (18:41 +1000)]
samba-tool: Add user password command to change user's own password

This command is a user-level command and differs from setpassword
command which is administrator command.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos4-libnet: py_net Add change_password() python command
Amitay Isaacs [Wed, 27 Jul 2011 08:38:29 +0000 (18:38 +1000)]
s4-libnet: py_net Add change_password() python command

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos4-libnet: py_net - Remove parsing for credentials argument
Amitay Isaacs [Wed, 27 Jul 2011 08:37:14 +0000 (18:37 +1000)]
s4-libnet: py_net - Remove parsing for credentials argument

py_creds are not used anywhere in the function.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Python routine to find writable/ldap-capable DC
Amitay Isaacs [Tue, 26 Jul 2011 03:46:17 +0000 (13:46 +1000)]
samba-tool: Python routine to find writable/ldap-capable DC

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos4-libcli: Added python interface for file I/O using SMB
Amitay Isaacs [Tue, 26 Jul 2011 03:32:03 +0000 (13:32 +1000)]
s4-libcli: Added python interface for file I/O using SMB

This module will support file system access using SMB.

based on smb_composite - loadfile(), savefile()
based on raw -  getacl(), setacl()

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: For samba-tool-c, help lists commands implemented only in C
Amitay Isaacs [Tue, 26 Jul 2011 03:19:29 +0000 (13:19 +1000)]
samba-tool: For samba-tool-c, help lists commands implemented only in C

The rest of the commands are available in python version of samba-tool.
C version of samba-tool is for testing only and will be phased out once
all the commands are ported to python.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos4-param: Fix object names for python objects PyLoadparm and PyLoadparmContext
Amitay Isaacs [Mon, 25 Jul 2011 01:45:14 +0000 (11:45 +1000)]
s4-param: Fix object names for python objects PyLoadparm and PyLoadparmContext

Use the object names <modulename>.<objectname> to correctly generate
the object hierarchy in pydoc.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Catch exceptions at top-level and exit with correct return value
Amitay Isaacs [Thu, 21 Jul 2011 02:32:53 +0000 (12:32 +1000)]
samba-tool: Catch exceptions at top-level and exit with correct return value

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Display usage for main commands and list them alphabetically
Amitay Isaacs [Thu, 21 Jul 2011 02:30:38 +0000 (12:30 +1000)]
samba-tool: Display usage for main commands and list them alphabetically

This makes the MainCommand class similar to SuperCommand class in netcmd.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Raise exception on errors and report using base class
Amitay Isaacs [Thu, 21 Jul 2011 02:21:17 +0000 (12:21 +1000)]
samba-tool: Raise exception on errors and report using base class

Exceptions are captured at top-level samba-tool and reported using
the base class (Command) method show_command_error().

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Display Usage line and list commands alphabetically
Amitay Isaacs [Thu, 21 Jul 2011 02:15:33 +0000 (12:15 +1000)]
samba-tool: Display Usage line and list commands alphabetically

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Replace C version of samba-tool with python version
Amitay Isaacs [Wed, 20 Jul 2011 23:48:30 +0000 (09:48 +1000)]
samba-tool: Replace C version of samba-tool with python version

C version of samba-tool is now called samba-tool-c, which will be
removed as soon as all the samba-tool commands are ported to python.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Added python version of samba-tool
Amitay Isaacs [Wed, 20 Jul 2011 07:07:35 +0000 (17:07 +1000)]
samba-tool: Added python version of samba-tool

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos4auth: Fix the object name for Py_Security
Amitay Isaacs [Wed, 20 Jul 2011 04:50:05 +0000 (14:50 +1000)]
s4auth: Fix the object name for Py_Security

Use the object names as <modulename>.<objectname> to correctly generate the
object hierarchy in pydoc.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos4auth: Fix the object names for PyCredentials and PyCredentialCacheContainer
Amitay Isaacs [Wed, 20 Jul 2011 04:48:34 +0000 (14:48 +1000)]
s4auth: Fix the object names for PyCredentials and PyCredentialCacheContainer

Use the object names as <modulename>.<objectname> to correctly generate the
object hierarchy in pydoc.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos4auth: Remove duplicate assignment of structure variable
Amitay Isaacs [Wed, 20 Jul 2011 04:44:19 +0000 (14:44 +1000)]
s4auth: Remove duplicate assignment of structure variable

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agoldb-samba: Allow --show-binary flag on defaultSecurityDescriptor
Amitay Isaacs [Fri, 15 Jul 2011 01:25:36 +0000 (11:25 +1000)]
ldb-samba: Allow --show-binary flag on defaultSecurityDescriptor

This allows users to display defaultSecurityDescriptor in fully expanded form.

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agoldb: Expose ldb_handler_fold() funcion
Amitay Isaacs [Fri, 15 Jul 2011 01:23:03 +0000 (11:23 +1000)]
ldb: Expose ldb_handler_fold() funcion

This allows creation of derived syntax handlers from the base directory string.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Reimplement GPO functions in python
Amitay Isaacs [Wed, 13 Jul 2011 22:21:19 +0000 (08:21 +1000)]
samba-tool: Reimplement GPO functions in python

Implementation of subcommands - show, getlink, setlink, dellink,
getinheritance, setinheritance

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Removed newuser
Giampaolo Lauria [Wed, 27 Jul 2011 19:52:25 +0000 (15:52 -0400)]
samba-tool: Removed newuser

Removed newuser as its functionality has been moved to "user add"

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: updated test suite to account for newuser change
Giampaolo Lauria [Wed, 27 Jul 2011 19:44:34 +0000 (15:44 -0400)]
samba-tool: updated test suite to account for newuser change

Updated test suite invocations of newuser to "user add" as
the newuser functionality is now being moved to "user add"

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Changed "user add" implementation
Giampaolo Lauria [Tue, 26 Jul 2011 17:25:58 +0000 (13:25 -0400)]
samba-tool: Changed "user add" implementation

Changed "user add" to use SamDB instead of Net
Also, added the set of Options available in newuser

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: add -H or --URL where necessary
Giampaolo Lauria [Mon, 25 Jul 2011 15:56:10 +0000 (11:56 -0400)]
samba-tool: add -H or --URL where necessary

To improve consistency, I've made sure all the commands take either a -H
or --URL when specifying a URL

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: update test suite to reflect the move from password to "user setpassword"
Giampaolo Lauria [Tue, 5 Jul 2011 17:38:30 +0000 (13:38 -0400)]
samba-tool: update test suite to reflect the move from password to "user setpassword"

This is part of the work to reflect the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agosamba-tool: Remove password as it has been moved to "user setpassword"
Giampaolo Lauria [Tue, 5 Jul 2011 13:34:19 +0000 (09:34 -0400)]
samba-tool: Remove password as it has been moved to "user setpassword"

The password functionality has been moved to "user setpassword" to fit the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-waf: the passdb subsystem needs to be called pdb
Andrew Tridgell [Thu, 28 Jul 2011 04:41:56 +0000 (14:41 +1000)]
s3-waf: the passdb subsystem needs to be called pdb

the 'pdb' name is builtin to the passdb module loading code as a fixed
string. We need to call the subsystem pdb so that external passdb
modules end up in bin/modules/pdb/ where they can be found by the
Samba3 module loader

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

12 years agoUse existing ISDOT and ISDOTDOT macros.
Jeremy Allison [Mon, 25 Jul 2011 23:12:45 +0000 (16:12 -0700)]
Use existing ISDOT and ISDOTDOT macros.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Jul 28 02:09:20 CEST 2011 on sn-devel-104

12 years agonbt: fix WinXP S3 domain join: alignment of nbt_netlogon_response_from_pdc
Andrew Bartlett [Wed, 27 Jul 2011 02:04:26 +0000 (12:04 +1000)]
nbt: fix WinXP S3 domain join: alignment of nbt_netlogon_response_from_pdc

This fixes WinXP joining a Samba3 domain, which was broken on hosts
with an even number of characters in the host name.  The alignment
requested in the structure was ignored because of the overall
NDR_NOALIGN set on the packet.

Andrew Bartlett

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Jul 28 00:30:26 CEST 2011 on sn-devel-104

12 years agos3: Avoid calls to cli_dos/nt_error in torture
Volker Lendecke [Wed, 27 Jul 2011 19:51:45 +0000 (21:51 +0200)]
s3: Avoid calls to cli_dos/nt_error in torture

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Jul 27 23:07:51 CEST 2011 on sn-devel-104

12 years agos3: Fix formatting in check_error()
Volker Lendecke [Wed, 27 Jul 2011 19:51:13 +0000 (21:51 +0200)]
s3: Fix formatting in check_error()

12 years agos3:test_async_echo: unsure the desired smb message sequence
Stefan Metzmacher [Wed, 27 Jul 2011 16:35:00 +0000 (18:35 +0200)]
s3:test_async_echo: unsure the desired smb message sequence

We want to start sending echo requests once the rpc related
smb operation arrived the smb layer.

metze

12 years agos3:modules fix Bug 8330 NFSv4 ACL merging logic is broken
Christian Ambach [Wed, 27 Jul 2011 12:46:00 +0000 (14:46 +0200)]
s3:modules fix Bug 8330 NFSv4 ACL merging logic is broken

we should not merge ACEs with different flags (e.g. CI/OI/I/)
Otherwise ACLs get wrong entries and thus wrong semantics

Example:
ACL:BUILTIN\Users:ALLOWED/0x0/FULL
ACL:BUILTIN\Users:ALLOWED/I/READ
got merged to
ACL:BUILTIN\Users:ALLOWED/I/FULL

This is not the same and also leads to wrong displays
in the Windows ACL dialog

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Wed Jul 27 16:03:51 CEST 2011 on sn-devel-104

12 years agos3-spoolss: Use get_session_info_system().
Andreas Schneider [Tue, 26 Jul 2011 08:40:40 +0000 (10:40 +0200)]
s3-spoolss: Use get_session_info_system().

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Wed Jul 27 10:38:34 CEST 2011 on sn-devel-104

12 years agos3-spoolss: Free the info2 structure in _spoolss_GetPrinter.
Andreas Schneider [Mon, 25 Jul 2011 19:52:29 +0000 (21:52 +0200)]
s3-spoolss: Free the info2 structure in _spoolss_GetPrinter.

12 years agos3-spoolss: Use tmp_ctx everywhere in _spoolss_DeletePrinterDriverEx.
Andreas Schneider [Mon, 25 Jul 2011 19:48:40 +0000 (21:48 +0200)]
s3-spoolss: Use tmp_ctx everywhere in _spoolss_DeletePrinterDriverEx.

12 years agos3-spoolss: Use tmp_ctx in winreg_enum_printer_key_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:41:14 +0000 (21:41 +0200)]
s3-spoolss: Use tmp_ctx in winreg_enum_printer_key_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_printer_deleteform1_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:40:12 +0000 (21:40 +0200)]
s3-spoolss: Use tmp_ctx in winreg_printer_deleteform1_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_printer_setform1_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:39:01 +0000 (21:39 +0200)]
s3-spoolss: Use tmp_ctx in winreg_printer_setform1_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_printer_addform1_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:38:12 +0000 (21:38 +0200)]
s3-spoolss: Use tmp_ctx in winreg_printer_addform1_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_printer_getform1_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:37:25 +0000 (21:37 +0200)]
s3-spoolss: Use tmp_ctx in winreg_printer_getform1_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_printer_enumforms1_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:36:34 +0000 (21:36 +0200)]
s3-spoolss: Use tmp_ctx in winreg_printer_enumforms1_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_set_printer_secdesc_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:35:24 +0000 (21:35 +0200)]
s3-spoolss: Use tmp_ctx in winreg_set_printer_secdesc_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_get_printer_secdesc_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:33:22 +0000 (21:33 +0200)]
s3-spoolss: Use tmp_ctx in winreg_get_printer_secdesc_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_add_driver_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:32:22 +0000 (21:32 +0200)]
s3-spoolss: Use tmp_ctx in winreg_add_driver_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_del_driver_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:31:32 +0000 (21:31 +0200)]
s3-spoolss: Use tmp_ctx in winreg_del_driver_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_get_driver_list_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:15:36 +0000 (21:15 +0200)]
s3-spoolss: Use tmp_ctx in winreg_get_driver_list_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_get_driver_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:14:45 +0000 (21:14 +0200)]
s3-spoolss: Use tmp_ctx in winreg_get_driver_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_delete_printer_dataex_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:13:46 +0000 (21:13 +0200)]
s3-spoolss: Use tmp_ctx in winreg_delete_printer_dataex_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_get_printer_dataex_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:12:43 +0000 (21:12 +0200)]
s3-spoolss: Use tmp_ctx in winreg_get_printer_dataex_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_enum_printer_dataex_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:11:50 +0000 (21:11 +0200)]
s3-spoolss: Use tmp_ctx in winreg_enum_printer_dataex_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_set_printer_dataex_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:10:25 +0000 (21:10 +0200)]
s3-spoolss: Use tmp_ctx in winreg_set_printer_dataex_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_update_printer_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:09:17 +0000 (21:09 +0200)]
s3-spoolss: Use tmp_ctx in winreg_update_printer_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_create_printer_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:08:10 +0000 (21:08 +0200)]
s3-spoolss: Use tmp_ctx in winreg_create_printer_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_get_printer_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:07:21 +0000 (21:07 +0200)]
s3-spoolss: Use tmp_ctx in winreg_get_printer_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_printer_get_changeid_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:07:00 +0000 (21:07 +0200)]
s3-spoolss: Use tmp_ctx in winreg_printer_get_changeid_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_printer_update_changeid_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:06:34 +0000 (21:06 +0200)]
s3-spoolss: Use tmp_ctx in winreg_printer_update_changeid_internal.

12 years agos3-spoolss: Use tmp_ctx in winreg_delete_printer_key_internal.
Andreas Schneider [Mon, 25 Jul 2011 19:06:02 +0000 (21:06 +0200)]
s3-spoolss: Use tmp_ctx in winreg_delete_printer_key_internal.

12 years agos3-spoolss: Free local in winreg_printer_binding_handle.
Andreas Schneider [Tue, 26 Jul 2011 09:02:05 +0000 (11:02 +0200)]
s3-spoolss: Free local in winreg_printer_binding_handle.

12 years agos3-spoolss: Improve memory efficiency.
Simo Sorce [Fri, 22 Jul 2011 15:59:41 +0000 (11:59 -0400)]
s3-spoolss: Improve memory efficiency.

p->mem_ctx is a relatively long lived context as it will not be freed until
a full request is served. In spoolss we do a lot of operations including
opening new pipes to connect to winreg.
Use more shortlived temporary contexts to avoid leaking a lot of memory on
p->mem_ctx and carrying it around untill all the operations in the current call
are done.

Signed-off-by: Andreas Schneider <asn@samba.org>
12 years agos3-rpc_client: Fix memory context in winreg_enum_printer_dataex().
Andreas Schneider [Mon, 25 Jul 2011 17:41:31 +0000 (19:41 +0200)]
s3-rpc_client: Fix memory context in winreg_enum_printer_dataex().

12 years agos3-rpc_client: Close policy handles before creating defaults.
Andreas Schneider [Mon, 25 Jul 2011 20:16:20 +0000 (22:16 +0200)]
s3-rpc_client: Close policy handles before creating defaults.

We reopen the hive and key so close them before reopen.

12 years agos3-rpc_client: Close the hive handle before we open it again.
Andreas Schneider [Mon, 25 Jul 2011 15:48:08 +0000 (17:48 +0200)]
s3-rpc_client: Close the hive handle before we open it again.

12 years agos3-rpc_client: Close hive if opening of the key fails.
Andreas Schneider [Mon, 25 Jul 2011 20:31:08 +0000 (22:31 +0200)]
s3-rpc_client: Close hive if opening of the key fails.

12 years agos3-rpc_server: Copy correct local tsocket address.
Andreas Schneider [Tue, 26 Jul 2011 09:04:48 +0000 (11:04 +0200)]
s3-rpc_server: Copy correct local tsocket address.

12 years agos3:idmap_tdb2: remove the undocumented option of the silly name "tdb:idmap2.tdb"
Michael Adam [Fri, 24 Jun 2011 08:15:02 +0000 (10:15 +0200)]
s3:idmap_tdb2: remove the undocumented option of the silly name "tdb:idmap2.tdb"

In ancient times, when ctdb had not support for persistent databases and
tdb2 was introduced as a two-layer solution and it was more important than
today to be able to change the location of the permanent database file
because it had to reside on shared storage.

But these were times when idmap_tdb2 was not even officially released.
Nowadays, with ctdb handling the persistent idmap2.tdb database, the path
is stripped anyways, so this undocumented option has become unnecessary
and is hence removed.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Jul 27 05:37:57 CEST 2011 on sn-devel-104

12 years agos3:idmap_tdb2: remove a legacy comment
Michael Adam [Thu, 9 Jun 2011 11:36:54 +0000 (13:36 +0200)]
s3:idmap_tdb2: remove a legacy comment

12 years agos3:idmap_tdb2: remove legacy comment
Michael Adam [Thu, 9 Jun 2011 11:35:21 +0000 (13:35 +0200)]
s3:idmap_tdb2: remove legacy comment

12 years agos3:idmap_tdb2: remove superfluous initialization with bogus comment
Michael Adam [Thu, 9 Jun 2011 11:34:04 +0000 (13:34 +0200)]
s3:idmap_tdb2: remove superfluous initialization with bogus comment

12 years agos3:idmap_tdb2: fix a legacy comment that does not apply any more
Michael Adam [Thu, 9 Jun 2011 11:07:54 +0000 (13:07 +0200)]
s3:idmap_tdb2: fix a legacy comment that does not apply any more

12 years agos3:doc: add an example with idmap script to the idmap_tdb2 manpage
Michael Adam [Fri, 24 Jun 2011 09:38:05 +0000 (11:38 +0200)]
s3:doc: add an example with idmap script to the idmap_tdb2 manpage

12 years agos3:docs: remove legacy text from the example in the idmap_tdb2 manpage
Michael Adam [Fri, 24 Jun 2011 09:36:33 +0000 (11:36 +0200)]
s3:docs: remove legacy text from the example in the idmap_tdb2 manpage

12 years agos3:doc: clarify the idmap script section in the idmap_tdb2 manpage
Michael Adam [Fri, 24 Jun 2011 09:35:51 +0000 (11:35 +0200)]
s3:doc: clarify the idmap script section in the idmap_tdb2 manpage

12 years agos3:docs:idmap_tdb2: update the documentation of idmap script
Michael Adam [Fri, 24 Jun 2011 08:59:04 +0000 (10:59 +0200)]
s3:docs:idmap_tdb2: update the documentation of idmap script

to reflect the new variant "idmap config * : script" of configuring the idmap script

12 years agos3:idmap_tdb2: deprecate the idmap:script parameter and use "idmap config * : script...
Michael Adam [Tue, 7 Jun 2011 16:00:36 +0000 (18:00 +0200)]
s3:idmap_tdb2: deprecate the idmap:script parameter and use "idmap config * : script" instead

With this patch, "idmap config * : script" will override "idmap : script".
If "idmap : script" is present, a deprecation warning will be printed in any
case. If "idmap config * : script" is not set, then the value of "idmap :script"
will be used for backwards compatibility.

12 years agowaf: update to latest waf 1.5 version
Andrew Tridgell [Wed, 27 Jul 2011 00:07:50 +0000 (10:07 +1000)]
waf: update to latest waf 1.5 version

this includes an on_results fix from thomas that fixes a dependency
problem with our autoproto code

Note that this changes task signatures, so it will trigger a complete
rebuild

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Jul 27 04:27:32 CEST 2011 on sn-devel-104

12 years agoFix bug #8324 - smbclient cannot list directories from a big-endian machine.
Jeremy Allison [Tue, 26 Jul 2011 22:15:26 +0000 (15:15 -0700)]
Fix bug #8324 - smbclient cannot list directories from a big-endian machine.

Two uses of the setup array are not being correctly byte-swapped to little
endian.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jul 27 03:14:48 CEST 2011 on sn-devel-104

12 years agos3: cli_close_done->write_andx_done in test_async_echo
Volker Lendecke [Tue, 26 Jul 2011 19:07:08 +0000 (21:07 +0200)]
s3: cli_close_done->write_andx_done in test_async_echo

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Jul 27 02:03:49 CEST 2011 on sn-devel-104

12 years agos3: Fix a debug message
Volker Lendecke [Tue, 26 Jul 2011 19:06:41 +0000 (21:06 +0200)]
s3: Fix a debug message

12 years agos3: Fix formatting
Volker Lendecke [Tue, 26 Jul 2011 18:49:32 +0000 (20:49 +0200)]
s3: Fix formatting

12 years agos3: Fix an error message
Volker Lendecke [Tue, 26 Jul 2011 18:48:59 +0000 (20:48 +0200)]
s3: Fix an error message

12 years agos3: Fix async smb handling
Volker Lendecke [Tue, 26 Jul 2011 17:44:51 +0000 (19:44 +0200)]
s3: Fix async smb handling

In cli_echo with more than one response we ended up with more than one read_smb
request. One from the call to cli_smb_req_set_pending called from
cli_smb_received. The other one from cli_smb_received itself. I don't really
see another way to deal with this than to hold the read_smb request in the
cli_state.

Metze, please check!

Volker

12 years agos4-dcerpc: Do not return linked attribute on deleted objects it makes W2k8R2 loops...
Matthieu Patou [Mon, 18 Jul 2011 20:59:20 +0000 (00:59 +0400)]
s4-dcerpc: Do not return linked attribute on deleted objects it makes W2k8R2 loops when joining s4 domains

Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Wed Jul 27 00:46:56 CEST 2011 on sn-devel-104

12 years agos4-dsdb: Improve the calculation of system flags according to 3.1.1.5.2.4
Matthieu Patou [Mon, 25 Jul 2011 13:31:03 +0000 (17:31 +0400)]
s4-dsdb: Improve the calculation of system flags according to 3.1.1.5.2.4

12 years agos4-upgradeprovision: Detect recent provision in a more reliable way
Matthieu Patou [Wed, 20 Jul 2011 20:50:38 +0000 (00:50 +0400)]
s4-upgradeprovision: Detect recent provision in a more reliable way

12 years agos3 swat: Create random nonce in CGI mode
Kai Blin [Tue, 12 Jul 2011 06:08:24 +0000 (08:08 +0200)]
s3 swat: Create random nonce in CGI mode

In CGI mode, we don't get access to the user's password, which would
reduce the hash used so far to parameters an attacker can easily guess.
To work around this, read the nonce from secrets.tdb or generate one if
it's not there.
Also populate the C_user field so we can use that for token creation.

Signed-off-by: Kai Blin <kai@samba.org>
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Jul 26 23:33:24 CEST 2011 on sn-devel-104

12 years agos3 swat: Add time component to XSRF token
Kai Blin [Sat, 9 Jul 2011 07:52:07 +0000 (09:52 +0200)]
s3 swat: Add time component to XSRF token

Signed-off-by: Kai Blin <kai@samba.org>