1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
Commit Graph

84872 Commits

Author SHA1 Message Date
Rusty Russell
00c9e83d92 libcli/auth: convert to dbwrap.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-12 14:59:31 -07:00
Rusty Russell
b45e3f557a secrets: use lpcfg_private_db_path() convenience helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-12 14:59:27 -07:00
Rusty Russell
ccfd929d96 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>
2013-04-12 14:59:23 -07:00
Rusty Russell
1cf46d2e35 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>
2013-04-12 14:59:16 -07:00
Rusty Russell
5b15d10795 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>
2013-04-12 14:59:00 -07:00
Jeremy Allison
7a4dd84595 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
2013-04-12 16:21:09 +02:00
Jeremy Allison
0fe894fb89 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>
2013-04-12 14:33:40 +02:00
Jeremy Allison
ea14c94431 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>
2013-04-12 14:33:11 +02:00
Jeremy Allison
e89ec641fc 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>
2013-04-12 14:29:51 +02:00
Volker Lendecke
237ec2fbac 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
2013-04-12 03:07:10 +02:00
Volker Lendecke
cd2cc97df2 libsmbclient: Make cli_full_connection async
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:52:56 -07:00
Volker Lendecke
5daf6476fa libsmbclient: Make cli_tree_connect async
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:46:36 -07:00
Volker Lendecke
6d1dc76952 libsmbclient: Make cli_raw_tcon async
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:45:50 -07:00
Volker Lendecke
c38dfebe5f libsmbclient: Streamline cli_openx a bit
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:45:38 -07:00
Volker Lendecke
906d173ca4 libsmbclient: Use tevent_req_poll_ntstatus in cli_openx
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:45:10 -07:00
Volker Lendecke
6bed164c15 libsmbclient: Streamline cli_tcon_andx a bit
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:44:43 -07:00
Volker Lendecke
80097ac122 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>
2013-04-11 14:44:22 -07:00
Volker Lendecke
47a1de356e libsmbclient: Make cli_start_connection async
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:43:31 -07:00
Volker Lendecke
82b3069c30 libsmbclient: Remove unused cli_connect_sock
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:43:06 -07:00
Volker Lendecke
48053b77f9 libsmbclient: Add async cli_connect_nb
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:42:02 -07:00
Volker Lendecke
a7c02f9a6e libsmbclient: Avoid a talloc_strdup in cli_connect_nb
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:41:25 -07:00
Volker Lendecke
3b3dacf20d libsmbclient: Make cli_connect_sock async
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:38:44 -07:00
Volker Lendecke
9879c88e91 libsmbclient: Remove unused sync wrappers
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:38:06 -07:00
Volker Lendecke
0e1e0a6e41 libsmbclient: Add async cli_session_setup
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:35:44 -07:00
Volker Lendecke
dc796331ca libsmbclient: Remove unused cli_session_setup_ntlmssp()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:35:14 -07:00
Volker Lendecke
26359c25ef libsmbclient: Add async cli_session_setup_ntlmssp
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:26:38 -07:00
Volker Lendecke
e2e0449a58 libsmbclient: Factor out cli_session_setup_get_account
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:25:49 -07:00
Volker Lendecke
0008d9e1c5 libsmbclient: Slightly simplify cli_session_setup_spnego
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:24:20 -07:00
Volker Lendecke
4627699e4f libsmbclient: Factor out cli_session_setup_get_principal
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 13:59:08 -07:00
Volker Lendecke
54316ea339 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>
2013-04-11 13:57:58 -07:00
Volker Lendecke
fbda7826b8 libsmbclient: Fix a leak on talloc_tos()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 13:57:44 -07:00
Jeremy Allison
8956c0d53b 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
2013-04-11 21:17:21 +02:00
Jeremy Allison
33478058c7 Remove unneeded initializations (we already talloc_zero).
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:42 -07:00
Jeremy Allison
353718c3f9 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>
2013-04-11 09:49:41 -07:00
Jeremy Allison
6ae58dd153 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>
2013-04-11 09:49:41 -07:00
Jeremy Allison
770512e3bd Check SMB_VFS_NEXT_OPENDIR return in dirsort_opendir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:41 -07:00
Jeremy Allison
7e437a39ab 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>
2013-04-11 09:49:41 -07:00
Jeremy Allison
cdcb631912 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>
2013-04-11 09:49:41 -07:00
Jeremy Allison
53d980bb0e 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>
2013-04-11 09:49:41 -07:00
Jeremy Allison
b30697f638 Protect against early error in SMB_VFS_NEXT_READDIR.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:41 -07:00
Jeremy Allison
c55eb37114 Change source3/modules/vfs_dirsort.c from MALLOC -> TALLOC.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:41 -07:00
Andrew Bartlett
f7756137e8 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
2013-04-11 10:41:02 +02:00
Andrew Bartlett
7955bf473f 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>
2013-04-11 16:44:46 +10:00
Jean Raby
afd291b1de 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
2013-04-11 06:06:03 +02:00
Ralph Wuerthner
8aae8b5bad 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
2013-04-10 02:03:12 +02:00
Ralph Wuerthner
a70e9db0f3 s3:smbd: convert srvstr_pull_req_talloc() into a function
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-10 00:13:45 +02:00
Ralph Wuerthner
98f9e5edd3 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>
2013-04-10 00:13:45 +02:00
Andrew Bartlett
e7e37b3b90 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>
2013-04-10 00:13:45 +02:00
Andrew Bartlett
45a596fbe9 build: Remove extra space in shebang
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-10 00:13:45 +02:00
Andrew Bartlett
58e3c5323e 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>
2013-04-10 00:13:45 +02:00