nivanova/samba-autobuild/.git
6 years agoTests: avoid adding python options that are functions in the env
Matthieu Patou [Thu, 3 Jan 2013 22:34:13 +0000 (14:34 -0800)]
Tests: avoid adding python options that are functions in the env

This fix errors when running test --testenv --screen

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoTests: rewrite ldap_schema to specify attributes
Matthieu Patou [Tue, 1 Jan 2013 21:40:44 +0000 (13:40 -0800)]
Tests: rewrite ldap_schema to specify attributes

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoFix warnings with mismatched sizes in arguments to DEBUG statements.
Jeremy Allison [Fri, 18 Jan 2013 21:57:16 +0000 (13:57 -0800)]
Fix warnings with mismatched sizes in arguments to DEBUG statements.

This can cause compile errors on 32-bit systems.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Jan 19 12:14:13 CET 2013 on sn-devel-104

6 years agoRemove some unused variables.
Jeremy Allison [Thu, 17 Jan 2013 00:12:29 +0000 (16:12 -0800)]
Remove some unused variables.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agoheimdal_build: Try again to sort out the strerror_r mess
Andrew Bartlett [Mon, 19 Nov 2012 12:25:45 +0000 (23:25 +1100)]
heimdal_build: Try again to sort out the strerror_r mess

Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agoprinting: Free talloc_stackframe() on all exit paths
Andrew Bartlett [Fri, 18 Jan 2013 02:39:13 +0000 (13:39 +1100)]
printing: Free talloc_stackframe() on all exit paths

Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agonsswitch: Fix two bitfield constants being the same.
Ira Cooper [Wed, 16 Jan 2013 19:33:31 +0000 (11:33 -0800)]
nsswitch: Fix two bitfield constants being the same.

WBFLAG_PAM_AUTH_PAC and WBFLAG_BIG_NTLMV2_BLOB
are the same causing errors in NTLMv2 authentication.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 18 22:13:09 CET 2013 on sn-devel-104

6 years agoSort winbind request flags. Ira saw we have a duplicate.
Jeremy Allison [Wed, 16 Jan 2013 19:31:32 +0000 (11:31 -0800)]
Sort winbind request flags. Ira saw we have a duplicate.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed by: Ira Cooper <ira@wakeful.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosmbtorture: Satisfy a linker dependency
Volker Lendecke [Thu, 17 Jan 2013 14:22:32 +0000 (15:22 +0100)]
smbtorture: Satisfy a linker dependency

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agowinbind: Handle child requests in a tevent_fd
Volker Lendecke [Thu, 17 Jan 2013 13:34:35 +0000 (14:34 +0100)]
winbind: Handle child requests in a tevent_fd

This enables the use of standard tevent_loop_once in the child, which
now also uses epoll where available.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agowinbind: Introduce "struct child_handler_state"
Volker Lendecke [Thu, 17 Jan 2013 12:49:08 +0000 (13:49 +0100)]
winbind: Introduce "struct child_handler_state"

This will make the next patch simpler. child_handler_state contains the
information that the handler for the parent fde needs to pass to
process_child_request

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agowinbind: Use standard tevent_context_init
Volker Lendecke [Wed, 16 Jan 2013 11:00:00 +0000 (12:00 +0100)]
winbind: Use standard tevent_context_init

This makes winbind use epoll instead of poll

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agoBUG 9378: Add extra attributes for AD printer publishing.
David Disseldorp [Thu, 17 Jan 2013 12:21:25 +0000 (13:21 +0100)]
BUG 9378: Add extra attributes for AD printer publishing.

Currently attempting to publish a printer in AD fails with "Object class
violation", due to a number of missing attributes in the LDAP request.

Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jan 18 17:27:35 CET 2013 on sn-devel-104

6 years agoprinting: Remove invalid free from error path.
David Disseldorp [Fri, 18 Jan 2013 10:48:20 +0000 (11:48 +0100)]
printing: Remove invalid free from error path.

Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoRemove locking across the lifetime of the copychunk call.
Jeremy Allison [Thu, 17 Jan 2013 00:30:04 +0000 (16:30 -0800)]
Remove locking across the lifetime of the copychunk call.

Previous commit handles this around each read/write call.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Jan 18 01:47:01 CET 2013 on sn-devel-104

6 years agoMove copychunk locking to be local to the read/write calls.
Jeremy Allison [Thu, 17 Jan 2013 00:29:11 +0000 (16:29 -0800)]
Move copychunk locking to be local to the read/write calls.

Eliminates the need to hold locks across the
entire lifetime of the call.

Next commit will remove these.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agoAdd additional copychunk checks.
Jeremy Allison [Wed, 16 Jan 2013 20:58:17 +0000 (12:58 -0800)]
Add additional copychunk checks.

For printer, ipc$ connections, and directory handles.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agoMove handle checking code to copychunk_check_handles().
Jeremy Allison [Wed, 16 Jan 2013 20:51:32 +0000 (12:51 -0800)]
Move handle checking code to copychunk_check_handles().

Planning to add extra checks to ensure we don't attempt
copychunk on printer or IPC$ handles.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agotevent: Fix a comment
Volker Lendecke [Thu, 17 Jan 2013 21:14:33 +0000 (22:14 +0100)]
tevent: Fix a comment

liboop.org is now in a language I don't understand. But it does definitely not
contain a library.

Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 18 00:05:37 CET 2013 on sn-devel-104

6 years agoprinting: Create default architecture directories on init.
Andreas Schneider [Thu, 17 Jan 2013 16:18:04 +0000 (17:18 +0100)]
printing: Create default architecture directories on init.

Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jan 17 20:36:17 CET 2013 on sn-devel-104

6 years agos3-spoolss: use configurable spoolss architecture in compose_spoolss_server_path().
Günther Deschner [Thu, 17 Jan 2013 15:09:15 +0000 (16:09 +0100)]
s3-spoolss: use configurable spoolss architecture in compose_spoolss_server_path().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Jan 17 18:53:47 CET 2013 on sn-devel-104

6 years agospoolss: make spoolss deal with ndr64 SetForm by using proper container object.
Günther Deschner [Wed, 16 Jan 2013 12:41:28 +0000 (13:41 +0100)]
spoolss: make spoolss deal with ndr64 SetForm by using proper container object.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agospoolss: make spoolss deal with ndr64 AddForm by using proper container object.
Günther Deschner [Wed, 16 Jan 2013 00:15:49 +0000 (01:15 +0100)]
spoolss: make spoolss deal with ndr64 AddForm by using proper container object.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agos4-torture: add ndr64 spoolss_SetPrinter ndr test.
Günther Deschner [Tue, 15 Jan 2013 23:06:03 +0000 (00:06 +0100)]
s4-torture: add ndr64 spoolss_SetPrinter ndr test.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agospoolss: make spoolss deal with ndr64 ULONG_PTR of devmode_ptr and secdesc_ptr.
Günther Deschner [Tue, 15 Jan 2013 23:04:41 +0000 (00:04 +0100)]
spoolss: make spoolss deal with ndr64 ULONG_PTR of devmode_ptr and secdesc_ptr.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agodsdb-operational: Avoid doing the ldb_attr_cmp if bypass flag is not set
Matthieu Patou [Thu, 27 Dec 2012 08:01:49 +0000 (00:01 -0800)]
dsdb-operational: Avoid doing the ldb_attr_cmp if bypass flag is not set

Most of the time this flag is not set and so we can avoid the strcasecmp
in ldb_attr_cmp()

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 17 17:10:32 CET 2013 on sn-devel-104

6 years agotorture: Fix fsmo test to use correct -H samba-tool syntax
Andrew Bartlett [Sat, 17 Nov 2012 02:49:00 +0000 (13:49 +1100)]
torture: Fix fsmo test to use correct -H samba-tool syntax

However, the test still does not pass.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agodsdb: Do not hold the transaction over the IRPC call to perform a role transfer
Andrew Bartlett [Mon, 14 Jan 2013 22:56:46 +0000 (09:56 +1100)]
dsdb: Do not hold the transaction over the IRPC call to perform a role transfer

This avoids one samba process locking out another from the DB.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agoselftest: also skip raw.search as it also spins
Andrew Bartlett [Sun, 13 Jan 2013 02:03:13 +0000 (13:03 +1100)]
selftest: also skip raw.search as it also spins

Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agodrs-fsmo: Improve handling of FSMO role takeover.
Andrew Bartlett [Tue, 20 Nov 2012 03:59:17 +0000 (14:59 +1100)]
drs-fsmo: Improve handling of FSMO role takeover.

This needs to be more async, and give less scary errors.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agodsdb-acl: calculate sDRightsEffective based on "nTSecurityDescriptor"
Stefan Metzmacher [Tue, 8 Jan 2013 14:55:36 +0000 (15:55 +0100)]
dsdb-acl: calculate sDRightsEffective based on "nTSecurityDescriptor"

acl_check_access_on_attribute should never be called with attr=NULL
because we don't check access on an attribute in that case

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>
Autobuild-User(master): Matthieu Patou <mat@samba.org>
Autobuild-Date(master): Thu Jan 17 11:21:10 CET 2013 on sn-devel-104

6 years agodsdb-acl: add helper variable 'ldb' in acl_sDRightsEffective
Stefan Metzmacher [Tue, 8 Jan 2013 14:54:47 +0000 (15:54 +0100)]
dsdb-acl: add helper variable 'ldb' in acl_sDRightsEffective

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>
6 years agolibcli/security: don't look at the inherited type in get_ace_object_type()
Stefan Metzmacher [Fri, 4 Jan 2013 15:03:42 +0000 (16:03 +0100)]
libcli/security: don't look at the inherited type in get_ace_object_type()

The inherited_type is only used to decide if aces should be inherited
effectively or not (INHERIT_ONLY) for the specified object.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>
6 years agodsdb-acl: fix the order of special and system checks
Stefan Metzmacher [Thu, 17 Jan 2013 07:51:23 +0000 (08:51 +0100)]
dsdb-acl: fix the order of special and system checks

First we check for a special dn, then for system access.
All allocations happen after this checks in order to avoid
allocations we won't use.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>
6 years agodsdb-acl: Do not apply ACL on special DNs to hide attributes that the user shouldn...
Matthieu Patou [Sun, 30 Dec 2012 10:27:25 +0000 (02:27 -0800)]
dsdb-acl: Do not apply ACL on special DNs to hide attributes that the user shouldn't see

This fix frequent reindexing when using python script with a
user that is not system.
The reindexing is caused by ACL module hidding (removing) attributes in
the search request for all attributes in dn=@ATTRIBUTES and because
dsdb_schema_set_indices_and_attributes checks that the list of
attributes that it just calculated from the schema is the same as the
list written in @ATTRIBUTES, if not the list is replaced and a
reindexing is triggered.

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agodsdb-acl: talloc_free the private context when we pass to the next module
Stefan Metzmacher [Thu, 17 Jan 2013 07:37:58 +0000 (08:37 +0100)]
dsdb-acl: talloc_free the private context when we pass to the next module

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>
6 years agodsdb-acl: don't call dsdb_user_password_support() if we don't use the result
Stefan Metzmacher [Thu, 17 Jan 2013 07:37:12 +0000 (08:37 +0100)]
dsdb-acl: don't call dsdb_user_password_support() if we don't use the result

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>
6 years agosmb2_ioctl: copychunk request max output validation
David Disseldorp [Tue, 15 Jan 2013 16:23:12 +0000 (17:23 +0100)]
smb2_ioctl: copychunk request max output validation

Check that the copychunk ioctl request maximum output specified by the
client is large enough to hold copychunk response data.

Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 17 00:59:44 CET 2013 on sn-devel-104

6 years agosmb2_ioctl: track copychunk response output state
David Disseldorp [Tue, 15 Jan 2013 16:23:11 +0000 (17:23 +0100)]
smb2_ioctl: track copychunk response output state

Treat the response data independent to the status.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosmb2_ioctl: copychunk CHECK_READ and CHECK_WRITE
David Disseldorp [Tue, 15 Jan 2013 16:23:10 +0000 (17:23 +0100)]
smb2_ioctl: copychunk CHECK_READ and CHECK_WRITE

[MS-SMB2] 3.3.5.15.6 Handling a Server-Side Data Copy Request, specifies
that the copychunk destination file handle be granted FILE_WRITE_DATA
and FILE_READ_DATA access.

FILE_READ_DATA access must also be granted on the copychunk source file,
which may be done implicitly with execute permission.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agotorture: copychunk test suite improvements
David Disseldorp [Tue, 15 Jan 2013 16:23:09 +0000 (17:23 +0100)]
torture: copychunk test suite improvements

Allow for large files in test_setup_copy_chunk():
  Write test data in 1M IOs, rather than attempting to do the whole
  thing in one go.

Add copychunk bad resume key test:
  Send a copy chunk request with an intentionally bogus resume key
  (source key handle).

Add copychunk src=dest test:
  Test copychunk requests where the source and destination handles refer
  to the same file.

Add copychunk src=dest overlap test.

Add desired access args to test_setup_copy_chunk().

Add copychunk_bad_access test:
  Open the copychunk source and destination files with differing
  desired_access values. Confirm copychunk response matches 2k8 and 2k12
  behaviour.

Add copy_chunk_src_exceed test:
  Attempts to copy more data than is present in the copychunk source
  file.

Add copy_chunk_src_exceed_multi test:
  Test whether the first chunk in a multi-chunk copychunk request is
  written to disk, where the second chunk is invalid due to src file
  overrun.

Add copy_chunk_sparse_dest test:
  Issue a request where the target offset exceeds the file size, resulting
  in a sparse region.

Add copy_chunk_max_output_sz test.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosmb2_ioctl: only pass through to VFS on a valid fsp
David Disseldorp [Tue, 15 Jan 2013 16:23:08 +0000 (17:23 +0100)]
smb2_ioctl: only pass through to VFS on a valid fsp

A null fsp is dereferenced on VFS call.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agotorture: replace ioctl failure returns with helper calls
David Disseldorp [Tue, 15 Jan 2013 16:23:07 +0000 (17:23 +0100)]
torture: replace ioctl failure returns with helper calls

Also change test_ioctl_get_shadow_copy() to use torture_skip(), and
clean up test output.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agotorture: add locking tests for copychunk
David Disseldorp [Tue, 15 Jan 2013 16:23:06 +0000 (17:23 +0100)]
torture: add locking tests for copychunk

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosmb2_ioctl: perform locking around copychunk requests
David Disseldorp [Tue, 15 Jan 2013 16:23:05 +0000 (17:23 +0100)]
smb2_ioctl: perform locking around copychunk requests

For each chunk in a copychunk request, take a read and write lock on
the source and destination files respectively.

Also change the resume key format to use a combination of the persistent
and volatile handles. Thanks to Metze for his help on this.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosmbd: split out file_fsp_get from file_fsp_smb2
David Disseldorp [Tue, 15 Jan 2013 16:23:04 +0000 (17:23 +0100)]
smbd: split out file_fsp_get from file_fsp_smb2

Obtain the files_struct from smb2req, persistent_id and
volatile_id.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agotorture: skip FSCTL_SRV_ENUM_SNAPS test when not supported
David Disseldorp [Tue, 15 Jan 2013 16:23:03 +0000 (17:23 +0100)]
torture: skip FSCTL_SRV_ENUM_SNAPS test when not supported

If FSCTL_SRV_ENUM_SNAPS fails with NT_STATUS_NOT_SUPPORTED then skip the
test, this means we can run the full ioctl test suite as part of
autobuild.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agoselftest: enable samba3.smb2.ioctl tests against s3fs
David Disseldorp [Tue, 15 Jan 2013 16:23:02 +0000 (17:23 +0100)]
selftest: enable samba3.smb2.ioctl tests against s3fs

These tests are now expected to pass with copy-chunk support now
implemented.

This effectively reverts 632b1042aed94a71d810613fcdbbfecf615a25fa.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosmb2_ioctl: remove ioctl error response assumptions
David Disseldorp [Tue, 15 Jan 2013 16:23:01 +0000 (17:23 +0100)]
smb2_ioctl: remove ioctl error response assumptions

MS-SMB2 3.3.4.4 documents cases where a ntstatus indicating an error
should not be considered a failure. In such a case the output data
buffer should be sent to the client rather than an error response
packet.

Add a new fsctl copy_chunk test to confirm field limits are sent back
in response to an oversize chunk request.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosmb2_ioctl: add support for FSCTL_SRV_COPYCHUNK
David Disseldorp [Tue, 15 Jan 2013 16:23:00 +0000 (17:23 +0100)]
smb2_ioctl: add support for FSCTL_SRV_COPYCHUNK

SMB2 clients can issue FSCTL_SRV_COPYCHUNK requests in order to copy
data between files on the server side only, rather than reading data
then writing back from the client. FSCTL_SRV_COPYCHUNK is used by
default for Explorer SMB2 file copies on Windows Server 2012.

2.2.32.1 SRV_COPYCHUNK_RESPONSE in [MS-SMB2] describes the requirement
for the server to provide maximum copychunk request size limits in ioctl
responses carrying STATUS_INVALID_PARAMETER.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agos3-vfs: add copy_chunk vfs hooks
David Disseldorp [Tue, 15 Jan 2013 16:22:59 +0000 (17:22 +0100)]
s3-vfs: add copy_chunk vfs hooks

copy_chunk copies n bytes from a source file at a specific offset to a
destination file at a given offset. This interface will be used in
handling smb2 FSCTL_SRV_COPYCHUNK ioctl requests.

Use a pread/pwrite loop in vfs_default, so that requests referring to
the same src and dest file are possible.

Provide send and receive hooks for copy chunk VFS interface, allowing
asynchronous behaviour.

Check whether the request source offset + length exceeds the current
size. Return STATUS_INVALID_VIEW_SIZE under such a condition, matching
Windows server behaviour.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosmb2_ioctl: add FSCTL_SRV_REQUEST_RESUME_KEY support
David Disseldorp [Tue, 15 Jan 2013 16:22:58 +0000 (17:22 +0100)]
smb2_ioctl: add FSCTL_SRV_REQUEST_RESUME_KEY support

Use existing ioctl IDL infrastructure for marshalling. Support for this
ioctl is a prerequisite for FSCTL_SRV_COPYCHUNK handling.
The client-opaque resume key is constructed using the server side
dev/inode file identifier.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosmb2_ioctl: split ioctl handler code on device type
David Disseldorp [Tue, 15 Jan 2013 16:22:57 +0000 (17:22 +0100)]
smb2_ioctl: split ioctl handler code on device type

Add per device type ioctl handler source files for FSCTL_DFS,
FSCTL_FILESYSTEM, FSCTL_NAMED_PIPE and FSCTL_NETWORK_FILESYSTEM.

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosmb2_ioctl: split ioctl handlers into separate funtions
David Disseldorp [Tue, 15 Jan 2013 16:22:56 +0000 (17:22 +0100)]
smb2_ioctl: split ioctl handlers into separate funtions

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agobuild(waf): fix the abi_match for the pdb library
Michael Adam [Tue, 15 Jan 2013 14:35:09 +0000 (15:35 +0100)]
build(waf): fix the abi_match for the pdb library

The global wildcard match is automatically added by the parsing code
if the global match list is empty. Specifying an explicit '*' as the only
global match lets the parsing code add a second '*' to the local list,
which is an error tolerated on my linux by ld (the GNU linker), but
not by the stricter GNU ELF linker "gold".

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Wed Jan 16 21:31:00 CET 2013 on sn-devel-104

6 years agos4-torture: add ndr64 spoolss openprinterex to ndr test.
Günther Deschner [Tue, 15 Jan 2013 16:05:10 +0000 (17:05 +0100)]
s4-torture: add ndr64 spoolss openprinterex to ndr test.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jan 16 13:26:53 CET 2013 on sn-devel-104

6 years agos4-torture: allow to do ndr tests with flags, not only ndr_flags.
Günther Deschner [Tue, 15 Jan 2013 16:04:08 +0000 (17:04 +0100)]
s4-torture: allow to do ndr tests with flags, not only ndr_flags.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agospoolss: Make OpenPrinterEx work with NDR64 by using UserInfo Container.
Günther Deschner [Mon, 14 Jan 2013 16:26:31 +0000 (17:26 +0100)]
spoolss: Make OpenPrinterEx work with NDR64 by using UserInfo Container.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agotest: dbwrap_tool requires --persistent for the registry now
Volker Lendecke [Tue, 15 Jan 2013 10:22:49 +0000 (11:22 +0100)]
test: dbwrap_tool requires --persistent for the registry now

Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jan 15 16:31:35 CET 2013 on sn-devel-104

6 years agodocs: document the "--persistent" option in dbwrap_tool(1)
Michael Adam [Mon, 14 Jan 2013 16:22:05 +0000 (17:22 +0100)]
docs: document the "--persistent" option in dbwrap_tool(1)

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agos3:dbwrap_tool: add --persistent switch and mode for non-persistent DBs
Michael Adam [Wed, 2 Jan 2013 00:12:58 +0000 (01:12 +0100)]
s3:dbwrap_tool: add --persistent switch and mode for non-persistent DBs

This changes the default for dbwrap_tool to open a DB as non-persistent.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agodbwrap: add dbwrap_is_persistent()
Michael Adam [Wed, 2 Jan 2013 00:02:56 +0000 (01:02 +0100)]
dbwrap: add dbwrap_is_persistent()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agodocs: document the command line options in dbwrap_tool(1)
Michael Adam [Mon, 14 Jan 2013 16:15:08 +0000 (17:15 +0100)]
docs: document the command line options in dbwrap_tool(1)

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agodocs: use the popt.common.samba.client entity in samba-tool(8)
Michael Adam [Mon, 14 Jan 2013 16:55:51 +0000 (17:55 +0100)]
docs: use the popt.common.samba.client entity in samba-tool(8)

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agodocs: use the entities popt.common.samba.server and stdarg.help in samba(8)
Michael Adam [Mon, 14 Jan 2013 16:23:37 +0000 (17:23 +0100)]
docs: use the entities popt.common.samba.server and stdarg.help in samba(8)

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agodocs: add popt.common.samba.server and popt.common.samba.client entities
Michael Adam [Mon, 14 Jan 2013 16:08:30 +0000 (17:08 +0100)]
docs: add popt.common.samba.server and popt.common.samba.client entities

These are comprised by the popt.common.samba entity and the stdarg.server.debug
or the stdarg.client.debut entity, respectively.
The difference is only in the default value of the debug level setting.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agodocs: fix the stdarg.configfile entity to print a "=" sign after the long option
Michael Adam [Mon, 14 Jan 2013 16:12:51 +0000 (17:12 +0100)]
docs: fix the stdarg.configfile entity to print a "=" sign after the long option

This makes the appearance equal to the other options like --debuglevel or
--log-basename.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agodocs: use the stdarg.option entity in the popt.common.samba entity
Michael Adam [Mon, 14 Jan 2013 16:06:03 +0000 (17:06 +0100)]
docs: use the stdarg.option entity in the popt.common.samba entity

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agodocs: add an entity stdarg.option for the "--option" command line parameter
Michael Adam [Mon, 14 Jan 2013 16:05:05 +0000 (17:05 +0100)]
docs: add an entity stdarg.option for the "--option" command line parameter

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agowafsamba: use additional xml catalog file (bug #9512)
Björn Baumbach [Thu, 20 Dec 2012 09:01:43 +0000 (10:01 +0100)]
wafsamba: use additional xml catalog file (bug #9512)

Add additional "/usr/local/share/xml/catalog" catalog file
platforms (used by freebsd).
Fix manual page build on freebsd.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agosmb.conf(5): client min protocol: add hint at list of available protocols
Björn Baumbach [Tue, 16 Oct 2012 08:14:55 +0000 (10:14 +0200)]
smb.conf(5): client min protocol: add hint at list of available protocols

And fix the format.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agosmb.conf(5): server min protocol: add hint at list of available protocols
Björn Baumbach [Tue, 11 Dec 2012 12:46:38 +0000 (13:46 +0100)]
smb.conf(5): server min protocol: add hint at list of available protocols

And fix the format.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agobuild(waf)-libreplace: remove redundant check for flistea function
Björn Baumbach [Mon, 10 Dec 2012 10:52:08 +0000 (11:52 +0100)]
build(waf)-libreplace: remove redundant check for flistea function

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agontlm_auth(1): fix many format issues and and make examples visible
Björn Baumbach [Tue, 4 Dec 2012 09:54:05 +0000 (10:54 +0100)]
ntlm_auth(1): fix many format issues and and make examples visible

"<example>" is no child of "<para>". So these examples were not visible.
Using a varlist instead may be not the best way but it does look nice.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agobuild(waf): docs-xml: build new dbwrap_tool.8 manual page
Björn Baumbach [Mon, 15 Oct 2012 15:20:07 +0000 (17:20 +0200)]
build(waf): docs-xml: build new dbwrap_tool.8 manual page

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agodocs-xml: add dbwrap_tool.1 manual page
Björn Baumbach [Mon, 15 Oct 2012 15:17:29 +0000 (17:17 +0200)]
docs-xml: add dbwrap_tool.1 manual page

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agodsdb: Add test for modification of two attributes, one permitted, one denied (bug...
Andrew Bartlett [Wed, 9 Jan 2013 22:30:38 +0000 (09:30 +1100)]
dsdb: Add test for modification of two attributes, one permitted, one denied (bug #9554 - CVE-2013-0172)

Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 8bafe0871526cd5d5e7fdbe123ab661379f64cb1)

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 15 14:03:47 CET 2013 on sn-devel-104

6 years agodsdb-acl: Run sec_access_check_ds on each attribute proposed to modify (bug #9554...
Andrew Bartlett [Wed, 9 Jan 2013 05:59:18 +0000 (16:59 +1100)]
dsdb-acl: Run sec_access_check_ds on each attribute proposed to modify (bug #9554 - CVE-2013-0172)

This seems inefficient, but is needed for correctness.  The
alternative might be to have the sec_access_check_ds code confirm that
*all* of the nodes in the object tree have been cleared to
node->remaining_bits == 0.

Otherwise, I fear that write access to one attribute will become write
access to all attributes.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit d776fd807e0c9a62f428ce666ff812655f98bc47)

6 years agolibcli/security: Ensure to fill in remaining_access for the initial case (bug #9554...
Andrew Bartlett [Thu, 3 Jan 2013 09:39:23 +0000 (20:39 +1100)]
libcli/security: Ensure to fill in remaining_access for the initial case (bug #9554 - CVE-2013-0172)

It is critically important that we initialise this element as otherwise
all access is permitted.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit a75805490d96a85786287f5d0522dd7671d6816e)

6 years agotevent: Fix bug 9550 - sigprocmask does not work on FreeBSD to stop further signals...
Jeremy Allison [Mon, 14 Jan 2013 23:22:11 +0000 (15:22 -0800)]
tevent: Fix bug 9550 - sigprocmask does not work on FreeBSD to stop further signals in a signal handler

Mask off signals the correct way from the signal handler.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 15 12:13:43 CET 2013 on sn-devel-104

6 years agolib/replace: Include sys/ucontext.h if available.
Jeremy Allison [Mon, 14 Jan 2013 23:21:52 +0000 (15:21 -0800)]
lib/replace: Include sys/ucontext.h if available.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agolib/replace: Add ucontext configure autoconf checks.
Jeremy Allison [Mon, 14 Jan 2013 23:21:35 +0000 (15:21 -0800)]
lib/replace: Add ucontext configure autoconf checks.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agolib/replace: Add ucontext configure waf checks.
Jeremy Allison [Mon, 14 Jan 2013 23:21:12 +0000 (15:21 -0800)]
lib/replace: Add ucontext configure waf checks.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agolib/replace: Add missing check for sys/wait.h
Jeremy Allison [Mon, 14 Jan 2013 23:06:12 +0000 (15:06 -0800)]
lib/replace: Add missing check for sys/wait.h

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agosmbd: Fix bug 9544, part 2
Volker Lendecke [Mon, 14 Jan 2013 20:37:52 +0000 (21:37 +0100)]
smbd: Fix bug 9544, part 2

Plug in async pwrite

Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan 15 00:55:51 CET 2013 on sn-devel-104

6 years agosmbd: Fix bug 9544, part 1
Volker Lendecke [Mon, 14 Jan 2013 20:36:51 +0000 (21:36 +0100)]
smbd: Fix bug 9544, part 1

Adapt the sync function names

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosmbd: Always compile vfs_commit
Volker Lendecke [Mon, 14 Jan 2013 20:14:20 +0000 (21:14 +0100)]
smbd: Always compile vfs_commit

There's no reason not to

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agoconfigure: Fix bug 9546, aio_suspend detection on FreeBSD
Volker Lendecke [Mon, 7 Jan 2013 20:53:27 +0000 (12:53 -0800)]
configure: Fix bug 9546, aio_suspend detection on FreeBSD

NULL is not defined without some includes

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agoFix bug 9548: Correctly detect O_DIRECT
Volker Lendecke [Sat, 12 Jan 2013 15:08:07 +0000 (16:08 +0100)]
Fix bug 9548: Correctly detect O_DIRECT

Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jan 14 21:16:23 CET 2013 on sn-devel-104

6 years agosamr: Make use of posix_openpt
Volker Lendecke [Fri, 11 Jan 2013 09:36:04 +0000 (10:36 +0100)]
samr: Make use of posix_openpt

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosamr: Split up an assignment from an if condition
Volker Lendecke [Fri, 11 Jan 2013 09:31:42 +0000 (10:31 +0100)]
samr: Split up an assignment from an if condition

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agoldb: Move doxygen comments for ldb_connect to the right place
Stephen Gallagher [Wed, 2 Jan 2013 16:22:16 +0000 (11:22 -0500)]
ldb: Move doxygen comments for ldb_connect to the right place

Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan 14 16:21:02 CET 2013 on sn-devel-104

6 years agodsdb: Make linked_attributes module GUID based for renames
Andrew Bartlett [Fri, 11 Jan 2013 05:42:41 +0000 (16:42 +1100)]
dsdb: Make linked_attributes module GUID based for renames

This ensures that when we have the backlink out of sync with the forward link (perhaps due
to another operation that has put the backlink handling in an end-of-transaction
TODO list in repl_meta_data) that we do not error out, we just cope as well as we can.

The GUID is the unique identifier, not the DN.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Jan 12 12:52:28 CET 2013 on sn-devel-104

6 years agoselftest: skip base.dir2 tests as they just spin on modern ext4
Andrew Bartlett [Thu, 10 Jan 2013 21:26:07 +0000 (08:26 +1100)]
selftest: skip base.dir2 tests as they just spin on modern ext4

Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agos4-resolve: Fix parsing of IPv6/AAAA in dns_lookup (bug #9555)
Arvid Requate [Fri, 11 Jan 2013 13:17:06 +0000 (14:17 +0100)]
s4-resolve: Fix parsing of IPv6/AAAA in dns_lookup (bug #9555)

Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agowinbind: Fix some missing NULL checks
Volker Lendecke [Fri, 11 Jan 2013 13:51:42 +0000 (14:51 +0100)]
winbind: Fix some missing NULL checks

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jan 11 18:55:41 CET 2013 on sn-devel-104

6 years agowinbind: Fix error check in unpack_tdc_domains
Volker Lendecke [Fri, 11 Jan 2013 13:02:52 +0000 (14:02 +0100)]
winbind: Fix error check in unpack_tdc_domains

Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agodbwrap: Use INCOMPATIBLE_HASH for dbwrap_watchers.tdb
Volker Lendecke [Fri, 11 Jan 2013 16:04:39 +0000 (17:04 +0100)]
dbwrap: Use INCOMPATIBLE_HASH for dbwrap_watchers.tdb

Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agoscripting/samba_upgradedns: Only look for IPv4/IPv6 addresses if we actually them
Andrew Bartlett [Thu, 27 Dec 2012 23:05:40 +0000 (10:05 +1100)]
scripting/samba_upgradedns: Only look for IPv4/IPv6 addresses if we actually them

This allows the script to be used to create/remove the samba-specific dns-SERVER account
when we do not need to create the in-directory partition.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 10 20:56:50 CET 2013 on sn-devel-104

6 years agosamba-tool classicupgrade: Do not print the admin password during upgrade
Andrew Bartlett [Fri, 21 Dec 2012 22:28:05 +0000 (09:28 +1100)]
samba-tool classicupgrade: Do not print the admin password during upgrade

This changes the code to only set and show a new password if no admin
user is found during the upgrade.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 10 16:55:23 CET 2013 on sn-devel-104