metze/samba/wip.git
11 years agovfs: Convert afsacl_get_nt_acl to synthetic_smb_fname
Volker Lendecke [Fri, 12 Apr 2013 08:55:54 +0000 (10:55 +0200)]
vfs: Convert afsacl_get_nt_acl to synthetic_smb_fname

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolib: Add synthetic_smb_fname
Volker Lendecke [Thu, 11 Apr 2013 15:01:22 +0000 (17:01 +0200)]
lib: Add synthetic_smb_fname

The interface of create_synthetic_smb_fname is just silly

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosmbd: Make copy_smb_filename static
Volker Lendecke [Thu, 11 Apr 2013 14:46:37 +0000 (16:46 +0200)]
smbd: Make copy_smb_filename static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosmbd: Convert call_trans2setfilepathinfo to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:34:15 +0000 (16:34 +0200)]
smbd: Convert call_trans2setfilepathinfo to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosmbd: Convert smb_set_file_unix_basic to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:30:38 +0000 (16:30 +0200)]
smbd: Convert smb_set_file_unix_basic to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosmbd: Convert smb_set_file_size to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:28:53 +0000 (16:28 +0200)]
smbd: Convert smb_set_file_size to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosmbd: Convert call_trans2qfilepathinfo to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:27:48 +0000 (16:27 +0200)]
smbd: Convert call_trans2qfilepathinfo to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosmbd: Convert fsp_set_smb_fname to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:26:45 +0000 (16:26 +0200)]
smbd: Convert fsp_set_smb_fname to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosmbd: Convert copy_file to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:25:10 +0000 (16:25 +0200)]
smbd: Convert copy_file to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosmbd: Convert rename_internals_fsp to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:23:53 +0000 (16:23 +0200)]
smbd: Convert rename_internals_fsp to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosmbd: Convert smbd_dirptr_get_entry to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:22:38 +0000 (16:22 +0200)]
smbd: Convert smbd_dirptr_get_entry to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosmbd: Convert smbd_smb2_close to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:20:29 +0000 (16:20 +0200)]
smbd: Convert smbd_smb2_close to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert cap_ntimes to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:18:39 +0000 (16:18 +0200)]
vfs: Convert cap_ntimes to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert cap_unlink to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:17:42 +0000 (16:17 +0200)]
vfs: Convert cap_unlink to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert cap_rename to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:16:58 +0000 (16:16 +0200)]
vfs: Convert cap_rename to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert alloc_get_client_smb_fname to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:14:05 +0000 (16:14 +0200)]
vfs: Convert alloc_get_client_smb_fname to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert catia_ntimes to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:12:13 +0000 (16:12 +0200)]
vfs: Convert catia_ntimes to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert catia_unlink to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:11:26 +0000 (16:11 +0200)]
vfs: Convert catia_unlink to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert catia_rename to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 14:10:22 +0000 (16:10 +0200)]
vfs: Convert catia_rename to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert recycle_do_touch to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 13:40:10 +0000 (15:40 +0200)]
vfs: Convert recycle_do_touch to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert recycle_get_file_size to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 13:38:41 +0000 (15:38 +0200)]
vfs: Convert recycle_get_file_size to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert recycle_file_exists to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 13:37:38 +0000 (15:37 +0200)]
vfs: Convert recycle_file_exists to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert streams_xattr_unlink to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 13:36:18 +0000 (15:36 +0200)]
vfs: Convert streams_xattr_unlink to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert xattr_tdb_unlink to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 13:35:02 +0000 (15:35 +0200)]
vfs: Convert xattr_tdb_unlink to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert shadow_copy2_ntimes to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 13:33:44 +0000 (15:33 +0200)]
vfs: Convert shadow_copy2_ntimes to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert shadow_copy2_unlink to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 13:32:39 +0000 (15:32 +0200)]
vfs: Convert shadow_copy2_unlink to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert posix_eadb_unlink to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 13:31:27 +0000 (15:31 +0200)]
vfs: Convert posix_eadb_unlink to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs: Convert unlink_acl_tdb to cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 13:29:55 +0000 (15:29 +0200)]
vfs: Convert unlink_acl_tdb to cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolib: Convert copy_smb_filename to use cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 13:26:34 +0000 (15:26 +0200)]
lib: Convert copy_smb_filename to use cp_smb_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolib: Add cp_smb_filename
Volker Lendecke [Thu, 11 Apr 2013 13:24:55 +0000 (15:24 +0200)]
lib: Add cp_smb_filename

The interface of copy_smb_filename is just silly ;-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agoBug 9807 - wbinfo: fix segfault in wbinfo_pam_logon
David Disseldorp [Wed, 17 Apr 2013 17:39:12 +0000 (10:39 -0700)]
Bug 9807 - wbinfo: fix segfault in wbinfo_pam_logon

wbinfo_pam_logon() incorrectly assumes that wbcLogonUser() always
returns an allocated wbcAuthErrorInfo struct on failure.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 17 21:29:29 CEST 2013 on sn-devel-104

11 years agoCleanup. Remove unused function dptr_DirCacheAdd(). Make DirCacheAdd() static.
Jeremy Allison [Mon, 15 Apr 2013 23:54:20 +0000 (16:54 -0700)]
Cleanup. Remove unused function dptr_DirCacheAdd(). Make DirCacheAdd() static.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Apr 16 12:05:13 CEST 2013 on sn-devel-104

11 years agoAdd a test that shows the difference between Windows and Samba with respect to Delete...
Richard Sharpe [Fri, 5 Apr 2013 00:15:30 +0000 (17:15 -0700)]
Add a test that shows the difference between Windows and Samba with respect to DeleteOnClose.

Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr 16 00:46:54 CEST 2013 on sn-devel-104

11 years agosmbd: Fix an error return in change_dir_owner_to_parent
Volker Lendecke [Mon, 15 Apr 2013 09:15:23 +0000 (11:15 +0200)]
smbd: Fix an error return in change_dir_owner_to_parent

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Richard Sharpe <sharpe@samba.org>
Autobuild-Date(master): Mon Apr 15 18:05:06 CEST 2013 on sn-devel-104

11 years agosamba-tool - MX records cannot be deleted (part2)
Guenter Kukkukk [Sun, 14 Apr 2013 17:39:02 +0000 (19:39 +0200)]
samba-tool - MX records cannot be deleted (part2)

I missed this one, also a wrong compare of MX vs. SRV record

Signed-off-by: Guenter Kukkukk <kukks@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Apr 14 22:43:07 CEST 2013 on sn-devel-104

11 years agosamba-tool - MX records cannot be deleted (error in called C-program)
Guenter Kukkukk [Sun, 14 Apr 2013 04:17:28 +0000 (06:17 +0200)]
samba-tool - MX records cannot be deleted (error in called C-program)

Only matching UNION-members should be compared. MX vs. SRV record

Signed-off-by: Guenter Kukkukk <kukks@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Apr 14 08:46:07 CEST 2013 on sn-devel-104

11 years agontdb: remove --disable-ntdb.
Rusty Russell [Thu, 11 Apr 2013 07:42:16 +0000 (17:12 +0930)]
ntdb: remove --disable-ntdb.

Remove DISABLE_NTDB option, and --disable-ntdb from waf build.  This just
means that it will always get built: it isn't used by default yet.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Apr 13 02:01:02 CEST 2013 on sn-devel-104

11 years agosource4/cluster and source4/ntvfs: convert to dbwrap, add ntdb option.
Rusty Russell [Thu, 11 Apr 2013 07:42:15 +0000 (17:12 +0930)]
source4/cluster and source4/ntvfs: convert to dbwrap, add ntdb option.

This makes the code use dbwrap_local_open(), so it can handle
NTDB.

brlock.tdb, notify.tdb and openfiles.tdb can now be brlock.ntdb,
notify.ntdb and openfiles.ntdb, if 'use ntdb' is set.

Cc: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agoSamba3-HOWTO: mention NTDB.
Rusty Russell [Thu, 11 Apr 2013 07:42:14 +0000 (17:12 +0930)]
Samba3-HOWTO: mention NTDB.

Not sure if we're keeping this up-to-date, but try to document which
databases can be NTDB now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agoschannel_store.tdb: make it schannel_store.ntdb if 'use ntdb'.
Rusty Russell [Thu, 11 Apr 2013 07:42:13 +0000 (17:12 +0930)]
schannel_store.tdb: make it schannel_store.ntdb if 'use ntdb'.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibcli/auth: convert to dbwrap.
Rusty Russell [Thu, 11 Apr 2013 07:42:12 +0000 (17:12 +0930)]
libcli/auth: convert to dbwrap.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosecrets: use lpcfg_private_db_path() convenience helper.
Rusty Russell [Thu, 11 Apr 2013 07:42:11 +0000 (17:12 +0930)]
secrets: use lpcfg_private_db_path() convenience helper.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolib/param: lpcfg_private_db_path()
Rusty Russell [Thu, 11 Apr 2013 07:42:10 +0000 (17:12 +0930)]
lib/param: lpcfg_private_db_path()

This wrapper avoids testing lpcfg_use_ntdb() everywhere.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agosource4/scripting/python/samba/samba3: handle ntdb files.
Rusty Russell [Thu, 11 Apr 2013 07:42:09 +0000 (17:12 +0930)]
source4/scripting/python/samba/samba3: handle ntdb files.

Upgrading old Samba 3 instances seems like a place where we don't have
to read ntdb files, but Andrew Bartlett points out that you can run a
Samba 4.0 and even a 4.1 'classic' domain and desire to migrate that
to the AD DC.

So make this upgrade code generic: if it finds an ntdb file, read
that, otherwise read the tdb file.

Cc: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agoautoconf: build in NTDB.
Rusty Russell [Thu, 11 Apr 2013 07:42:08 +0000 (17:12 +0930)]
autoconf: build in NTDB.

I previously added -DDISABLE_NTDB to FLAGS, but lib/param/util.c
doesn't seem to be compiled with that flag, so it's really not a good
solution.

So instead, compile in ntdb for the autoconf build.  This means:

1) Add -DHAVE_CCAN to cflags.
2) Remove pyntdb from autoconf objects (which is what tdb does)
3) Remove -DDISABLE_NTDB
4) Add ntdb utility objects
5) Link in ntdb everywhere we link in tdb.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agoRemove dependency on detection of HAVE_DIRFD for use of fdopendir().
Jeremy Allison [Wed, 10 Apr 2013 23:30:10 +0000 (16:30 -0700)]
Remove dependency on detection of HAVE_DIRFD for use of fdopendir().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Apr 12 16:21:10 CEST 2013 on sn-devel-104

11 years agoRemove the "Ugly hack" that was the second use of dirfd().
Jeremy Allison [Wed, 10 Apr 2013 23:29:03 +0000 (16:29 -0700)]
Remove the "Ugly hack" that was the second use of dirfd().

The destructor does all the resource deallocation needed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoIn the struct smb_Dir destructor, use the fsp back pointer to release resources.
Jeremy Allison [Wed, 10 Apr 2013 23:24:15 +0000 (16:24 -0700)]
In the struct smb_Dir destructor, use the fsp back pointer to release resources.

Removes one use of dirfd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoMaintain a back-pointer to the fsp in struct smb_Dir when opening with FDOPENDIR.
Jeremy Allison [Wed, 10 Apr 2013 23:21:39 +0000 (16:21 -0700)]
Maintain a back-pointer to the fsp in struct smb_Dir when opening with FDOPENDIR.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agolibsmbclient: Use async cli_full_connection in python connection setup
Volker Lendecke [Tue, 9 Apr 2013 10:15:02 +0000 (12:15 +0200)]
libsmbclient: Use async cli_full_connection in python connection setup

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr 12 03:07:10 CEST 2013 on sn-devel-104

11 years agolibsmbclient: Make cli_full_connection async
Volker Lendecke [Fri, 5 Apr 2013 12:55:26 +0000 (14:55 +0200)]
libsmbclient: Make cli_full_connection async

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Make cli_tree_connect async
Volker Lendecke [Sat, 6 Apr 2013 08:57:41 +0000 (10:57 +0200)]
libsmbclient: Make cli_tree_connect async

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Make cli_raw_tcon async
Volker Lendecke [Fri, 5 Apr 2013 13:29:14 +0000 (15:29 +0200)]
libsmbclient: Make cli_raw_tcon async

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Streamline cli_openx a bit
Volker Lendecke [Fri, 5 Apr 2013 13:09:02 +0000 (15:09 +0200)]
libsmbclient: Streamline cli_openx a bit

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Use tevent_req_poll_ntstatus in cli_openx
Volker Lendecke [Fri, 5 Apr 2013 13:08:22 +0000 (15:08 +0200)]
libsmbclient: Use tevent_req_poll_ntstatus in cli_openx

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Streamline cli_tcon_andx a bit
Volker Lendecke [Fri, 5 Apr 2013 13:02:51 +0000 (15:02 +0200)]
libsmbclient: Streamline cli_tcon_andx a bit

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Use tevent_req_poll_ntstatus in cli_tcon_andx
Volker Lendecke [Fri, 5 Apr 2013 12:58:02 +0000 (14:58 +0200)]
libsmbclient: Use tevent_req_poll_ntstatus in cli_tcon_andx

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Make cli_start_connection async
Volker Lendecke [Fri, 5 Apr 2013 10:42:01 +0000 (12:42 +0200)]
libsmbclient: Make cli_start_connection async

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Remove unused cli_connect_sock
Volker Lendecke [Thu, 4 Apr 2013 14:56:43 +0000 (16:56 +0200)]
libsmbclient: Remove unused cli_connect_sock

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Add async cli_connect_nb
Volker Lendecke [Thu, 4 Apr 2013 14:55:48 +0000 (16:55 +0200)]
libsmbclient: Add async cli_connect_nb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Avoid a talloc_strdup in cli_connect_nb
Volker Lendecke [Thu, 4 Apr 2013 13:01:25 +0000 (15:01 +0200)]
libsmbclient: Avoid a talloc_strdup in cli_connect_nb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Make cli_connect_sock async
Volker Lendecke [Thu, 4 Apr 2013 12:36:51 +0000 (14:36 +0200)]
libsmbclient: Make cli_connect_sock async

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Remove unused sync wrappers
Volker Lendecke [Tue, 2 Apr 2013 11:39:05 +0000 (13:39 +0200)]
libsmbclient: Remove unused sync wrappers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Add async cli_session_setup
Volker Lendecke [Tue, 2 Apr 2013 11:37:30 +0000 (13:37 +0200)]
libsmbclient: Add async cli_session_setup

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Remove unused cli_session_setup_ntlmssp()
Volker Lendecke [Tue, 2 Apr 2013 10:50:43 +0000 (12:50 +0200)]
libsmbclient: Remove unused cli_session_setup_ntlmssp()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Add async cli_session_setup_ntlmssp
Volker Lendecke [Sat, 9 Mar 2013 12:07:57 +0000 (13:07 +0100)]
libsmbclient: Add async cli_session_setup_ntlmssp

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Factor out cli_session_setup_get_account
Volker Lendecke [Sat, 9 Mar 2013 08:53:42 +0000 (09:53 +0100)]
libsmbclient: Factor out cli_session_setup_get_account

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Slightly simplify cli_session_setup_spnego
Volker Lendecke [Fri, 8 Mar 2013 18:41:07 +0000 (19:41 +0100)]
libsmbclient: Slightly simplify cli_session_setup_spnego

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Factor out cli_session_setup_get_principal
Volker Lendecke [Fri, 8 Mar 2013 16:21:13 +0000 (17:21 +0100)]
libsmbclient: Factor out cli_session_setup_get_principal

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Avoid a data copy
Volker Lendecke [Fri, 8 Mar 2013 14:55:51 +0000 (15:55 +0100)]
libsmbclient: Avoid a data copy

spnego_parse_negTokenInit does a asn_load of that blob, which does a data copy
itself. So we don't have to had it a copy as well.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agolibsmbclient: Fix a leak on talloc_tos()
Volker Lendecke [Fri, 8 Mar 2013 16:40:54 +0000 (17:40 +0100)]
libsmbclient: Fix a leak on talloc_tos()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agoEnsure we test the dirsort module in make test.
Jeremy Allison [Tue, 9 Apr 2013 23:56:24 +0000 (16:56 -0700)]
Ensure we test the dirsort module in make test.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 11 21:17:21 CEST 2013 on sn-devel-104

11 years agoRemove unneeded initializations (we already talloc_zero).
Jeremy Allison [Tue, 9 Apr 2013 18:02:58 +0000 (11:02 -0700)]
Remove unneeded initializations (we already talloc_zero).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoRemove the use of dirfd inside the vfs_dirsort.c.
Jeremy Allison [Tue, 9 Apr 2013 17:50:55 +0000 (10:50 -0700)]
Remove the use of dirfd inside the vfs_dirsort.c.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoConvert mtime from a time_t to a struct timespec.
Jeremy Allison [Tue, 9 Apr 2013 17:43:53 +0000 (10:43 -0700)]
Convert mtime from a time_t to a struct timespec.

In preparation for removing the dirfd and using fsp_stat()
and VFS_STAT functions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoCheck SMB_VFS_NEXT_OPENDIR return in dirsort_opendir().
Jeremy Allison [Tue, 9 Apr 2013 17:38:24 +0000 (10:38 -0700)]
Check SMB_VFS_NEXT_OPENDIR return in dirsort_opendir().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoClean error paths in opendir and fd_opendir by only setting handle data on success.
Jeremy Allison [Tue, 9 Apr 2013 17:29:47 +0000 (10:29 -0700)]
Clean error paths in opendir and fd_opendir by only setting handle data on success.

Pass extra struct dirsort_privates * to open_and_sort_dir() function
to avoid it having to re-read the handle data.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoProtect open_and_sort_dir() from the directory changing size.
Jeremy Allison [Mon, 8 Apr 2013 23:40:35 +0000 (16:40 -0700)]
Protect open_and_sort_dir() from the directory changing size.

Otherwise there could be an error between initial count, allocation
and re-read.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoUse an index i rather than re-using a state variable.
Jeremy Allison [Mon, 8 Apr 2013 23:38:03 +0000 (16:38 -0700)]
Use an index i rather than re-using a state variable.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoProtect against early error in SMB_VFS_NEXT_READDIR.
Jeremy Allison [Mon, 8 Apr 2013 23:31:53 +0000 (16:31 -0700)]
Protect against early error in SMB_VFS_NEXT_READDIR.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoChange source3/modules/vfs_dirsort.c from MALLOC -> TALLOC.
Jeremy Allison [Mon, 8 Apr 2013 22:11:28 +0000 (15:11 -0700)]
Change source3/modules/vfs_dirsort.c from MALLOC -> TALLOC.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoscripting-provision: Do not enforce domain != realm if we are joining an existing...
Andrew Bartlett [Fri, 5 Apr 2013 01:01:17 +0000 (12:01 +1100)]
scripting-provision: Do not enforce domain != realm if we are joining an existing domain

This will allow us users to join existing oddly named domains without
objection from provision.

Andrew Bartlett

Reviewed-by: Matthieu Patou <mat@matws.net>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Apr 11 10:41:02 CEST 2013 on sn-devel-104

11 years agobuild: Raise minimum python version to 2.5.0 for samba build
Andrew Bartlett [Mon, 8 Apr 2013 07:25:27 +0000 (17:25 +1000)]
build: Raise minimum python version to 2.5.0 for samba build

RHEL5 has a python26 package for a modern python, and was the main reason we
kept python 2.5 support.

However, this support never actually worked for AD DC installations,
as samba-tool uses a feature only in 2.5 and above.  Very few folks
noticed and those were on RHEL5, and moving to 2.5 allows us to remove
some other workarounds.

Andrew Bartlett

Reviewed-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
11 years agoAvoid leaking temp file if an exception is raised
Jean Raby [Thu, 11 Apr 2013 01:33:34 +0000 (21:33 -0400)]
Avoid leaking temp file if an exception is raised

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Apr 11 06:06:03 CEST 2013 on sn-devel-104

11 years agos3:smbd: do not access data behind req->buf+req->buflen in srvstr_pull_req_talloc()
Ralph Wuerthner [Thu, 4 Apr 2013 11:29:01 +0000 (13:29 +0200)]
s3:smbd: do not access data behind req->buf+req->buflen in srvstr_pull_req_talloc()

Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Apr 10 02:03:13 CEST 2013 on sn-devel-104

11 years agos3:smbd: convert srvstr_pull_req_talloc() into a function
Ralph Wuerthner [Thu, 4 Apr 2013 11:24:36 +0000 (13:24 +0200)]
s3:smbd: convert srvstr_pull_req_talloc() into a function

Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:smbd: do not access data behind req->buf+req->buflen in srvstr_get_path_req_wcard()
Ralph Wuerthner [Thu, 4 Apr 2013 10:59:36 +0000 (12:59 +0200)]
s3:smbd: do not access data behind req->buf+req->buflen in srvstr_get_path_req_wcard()

Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agopython-samba-tool domain classicupgrade: Make failure to connect directly to the...
Andrew Bartlett [Fri, 5 Apr 2013 04:23:20 +0000 (15:23 +1100)]
python-samba-tool domain classicupgrade: Make failure to connect directly to the LDAP backend fatal

This is better than failing just a little further down the stack with a useless error
about use-before-set.

Andrew Bartlett

Reviewed-by: Michael Adam <obnox@samba.org>
11 years agobuild: Remove extra space in shebang
Andrew Bartlett [Sun, 7 Apr 2013 22:33:55 +0000 (08:33 +1000)]
build: Remove extra space in shebang

Reviewed-by: Michael Adam <obnox@samba.org>
11 years agobuild: Replace #!/usr/bin/env python with passed in PYTHON=
Andrew Bartlett [Mon, 8 Apr 2013 05:57:45 +0000 (15:57 +1000)]
build: Replace #!/usr/bin/env python with passed in PYTHON=

This means that if we were forced to use a specific python for the build, we
will put that binary into the top of samba-tool, so it continues to work
after the install.

Andrew Bartlett

Reviewed-by: Michael Adam <obnox@samba.org>
11 years agovfs_fake_perms: Fix bug 9775, segfault for "artificial" conn_structs
Volker Lendecke [Tue, 9 Apr 2013 19:18:34 +0000 (21:18 +0200)]
vfs_fake_perms: Fix bug 9775, segfault for "artificial" conn_structs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 10 00:12:06 CEST 2013 on sn-devel-104

11 years agovfs_fake_perms: Slightly streamline code
Volker Lendecke [Tue, 9 Apr 2013 19:07:23 +0000 (21:07 +0200)]
vfs_fake_perms: Slightly streamline code

Don't initialize a variable directly set

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agovfs_fake_perms: Slightly streamline code
Volker Lendecke [Tue, 9 Apr 2013 19:07:23 +0000 (21:07 +0200)]
vfs_fake_perms: Slightly streamline code

Do an early error return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agos3-netlogon: enumerate UPN suffixes from PASSDB when available
Alexander Bokovoy [Wed, 3 Apr 2013 13:52:45 +0000 (16:52 +0300)]
s3-netlogon: enumerate UPN suffixes from PASSDB when available

Optionally append list of UPN suffixes if PDB module returns non-empty one.

Refactor fill_forest_trust_array() in source3 to allow reuse of the code between
_netr_DsRGetForestTrustInformation() and _netr_GetForestTrustInformation()

Implement a special case of _netr_DsRGetForestTrustInformation in smbd
when trusted_domain_name is NULL (covered by test_DsrEnumerateDomainTrusts()
in rpc.netlogon torture tests, see comment in source4/torture/rpc/netlogon.c).

Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Apr  9 22:19:34 CEST 2013 on sn-devel-104

11 years agoPASSDB: add support to set and enumerate UPN suffixes associated with our forest
Alexander Bokovoy [Wed, 3 Apr 2013 13:37:00 +0000 (16:37 +0300)]
PASSDB: add support to set and enumerate UPN suffixes associated with our forest

Samba PDC may manage a forest containing DNS domains in addition to the primary one.
Information about them is advertised via netr_DsRGetForestTrustInformation when
trusted_domain_name is NULL, according to MS-NRPC and MS-LSAD, and
via netr_GetForestTrustInformation.

This changeset only expands PASSDB API; how suffixes are maintained is left
to specific PDB modules. Set function is added so that suffixes could be
managed through 'net' and other Samba utilities, if possible.

One possible implementation is available for ipasam module in FreeIPA:
http://git.fedorahosted.org/cgit/freeipa.git/commit/?id=cc56723151c9ebf58d891e85617319d861af14a4

Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agos3-waf: filter out ldapsam internal init functions
Alexander Bokovoy [Wed, 3 Apr 2013 13:01:34 +0000 (16:01 +0300)]
s3-waf: filter out ldapsam internal init functions

pdb_ldapsam_init* functions (init and init_common) are used in
pdb_ipa.c and pdb_nds.c which are always linked together with
pdb_ldap.c where pdb_ldapsam_init* functions reside.

Tested with both ldapsam integrated (into libpdb) and as
a separate module.

Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agowafsamba: fix samba_abi for default catch-all case
Alexander Bokovoy [Wed, 3 Apr 2013 12:52:06 +0000 (15:52 +0300)]
wafsamba: fix samba_abi for default catch-all case

Only filter out the symbol when positive match was not found and there is
negative match.

ABI signature file generator worked incorrectly for cases when mixture of
positive and negative matches were provided. This resulted in generating empty
signature file for libpdb since there was no catch-all positive match anymore.

Commit 9ba44cc610426fb558b49aa9680b5bdf55c29082 removed explicit '*' positive
match and corresponding vscript generator adds '*' by default if global match
list is empty, so this commit introduces feature parity into signature
generator.

Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agowinbindd: Avoid a fd leak when we can not fork
Volker Lendecke [Tue, 9 Apr 2013 14:37:29 +0000 (16:37 +0200)]
winbindd: Avoid a fd leak when we can not fork

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jim McDonough <jmcd@samba.org>
Autobuild-User(master): Jim McDonough <jmcd@samba.org>
Autobuild-Date(master): Tue Apr  9 20:27:27 CEST 2013 on sn-devel-104

11 years agopylibsmb: Avoid a segfault if no credentials are passed to libsmb.Conn()
Volker Lendecke [Tue, 9 Apr 2013 12:29:11 +0000 (14:29 +0200)]
pylibsmb: Avoid a segfault if no credentials are passed to libsmb.Conn()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Richard Sharpe <sharpe@samba.org>
Autobuild-Date(master): Tue Apr  9 18:30:06 CEST 2013 on sn-devel-104

11 years agoBUG 9766: Cache name_to_sid/sid_to_name correctly.
Andreas Schneider [Thu, 4 Apr 2013 10:18:25 +0000 (12:18 +0200)]
BUG 9766: Cache name_to_sid/sid_to_name correctly.

If there is no domain_name specified we still need to set to for
caching else we will not find the entry later if we lookup the entry
with the domain_name.

Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Apr  9 16:32:44 CEST 2013 on sn-devel-104