1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

80499 Commits

Author SHA1 Message Date
Andrew Bartlett
ca2b6259b7 s4-selftest: Demonstrate the correct behaviour between specified usernames and kerberos ccache
This shows that a username/password on the command line must always
override any credentials cache in the environment.

Andrew Bartlett
2012-05-24 16:21:26 +02:00
Alexander Bokovoy
dc3f74a953 auth/credentials: 'workgroup' set via command line will not drop existing ccache
The root cause for existing ccache being invalidated was use of global loadparm with
'workgroup' value set as if from command line. However, we don't really need to take
'workgroup' parameter value's nature into account when invalidating existing ccache.
When -U is used on the command line, one can specify a password to force ccache
invalidation.

The commit also reverts previous fix now that root cause is clear.
2012-05-24 16:21:26 +02:00
Stefan Metzmacher
a95b2ba043 s3:smbd/msdfs: pass allow_broken_path to resolve_dfspath_wcard()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu May 24 16:14:01 CEST 2012 on sn-devel-104
2012-05-24 16:14:01 +02:00
Stefan Metzmacher
758d61201f s3:smbd/msdfs: pass 'allow_broken_path' to get_referred_path()
Note the DCERPC code should not be smb2 specific!

I wonder why this is at all smb2 specific...

metze
2012-05-24 14:12:32 +02:00
Stefan Metzmacher
a92f7176bd s3:smbd/msdfs: let create_conn_struct() also fake the 'smbd_server_connection'
metze
2012-05-24 14:12:32 +02:00
Stefan Metzmacher
0733183594 s3:smbd/files: work without sconn->file_bmap and assign fsp->fnum = -1
For faked connection_structs we do not need valid fnum values,
e.g. in the dfs and printing code.

metze
2012-05-24 14:12:32 +02:00
Stefan Metzmacher
768004b11d s3:smbd/files: fix error path and correctly cleanup
metze
2012-05-24 14:12:32 +02:00
Andrew Bartlett
e33bf32ba3 selftest: Run only the samba3 tests on builds without the AD DC
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu May 24 11:51:40 CEST 2012 on sn-devel-104
2012-05-24 11:51:40 +02:00
Andrew Bartlett
9633ec0c86 WHATSNEW: Move to document changes for beta1
This is not the beta1 release, but this is the preperation for such a release.

Andrew Bartlett
2012-05-24 09:59:04 +02:00
Andrew Bartlett
abb2c7fef4 s4-provision: Make s3fs the default way to install a new Samba4 DC
With s3fs now well settled into master, we now throw the swtich and make
it the default.

There is still much to do, but we need to be using s3fs by default to
find out exactly what that is.

Andrew Bartlett
2012-05-24 09:59:04 +02:00
Andrew Bartlett
22cd4bcc9e s4-selftest: Always delete the user at the end of test_passwords.sh
If this test is run in the "dc" environment (rather than "dc:local") is would not delete the
test user.

Andrew Bartlett
2012-05-24 09:59:04 +02:00
Amitay Isaacs
f52afa955e dlz_bind9: Make the talloc destructor static and return 0.
Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Thu May 24 03:32:50 CEST 2012 on sn-devel-104
2012-05-24 03:32:47 +02:00
Amitay Isaacs
34eab45cba dlz_bind9: Fix the named crash on reloading named
When reloading zones, named first creates new zone instance and then shuts down
the old instance. Since ldb layer, keeps the same LDB open, talloc_free() on samdb
handle, causes talloc "access after use" error.

This patch keeps only single context (dlz_bind9_data) and uses reference counting
to decide when to actually free the context. Since samdb handle is reused, use
talloc_unlink() instead of talloc_free() on samdb handle.
2012-05-24 09:42:24 +10:00
Ira Cooper
e8601c02ba s3-configure: Fix configure version information.
version.h moved from include -> include/autoconf.

Autobuild-User: Ira Cooper <ira@samba.org>
Autobuild-Date: Thu May 24 01:34:24 CEST 2012 on sn-devel-104
2012-05-24 01:34:24 +02:00
Stefan Metzmacher
b21176875a s3:rpc_server/dfs: pass allow_broken_path=true to create_junction()
DCERPC code can't be smb2 specific!

I'm not sure if 'true' is the correct value here, but at least
it matches the old behavior and the tcp and smb1 cases.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed May 23 21:56:05 CEST 2012 on sn-devel-104
2012-05-23 21:56:05 +02:00
Stefan Metzmacher
aa7b1e21a8 s3:smbd/proto.h: remove unused resolve_dfspath() prototype
metze
2012-05-23 20:03:10 +02:00
Stefan Metzmacher
97f0a3675f s3:smbd/files: remove unused VALID_FNUM()
metze
2012-05-23 20:03:09 +02:00
Stefan Metzmacher
a0c9a291e7 s3:smb2_server: make use of nt_status_np_pipe()
metze
2012-05-23 20:03:09 +02:00
Stefan Metzmacher
d595d2e5af s3:smbd: use nt_status_np_pipe for smb1
metze
2012-05-23 20:03:08 +02:00
Stefan Metzmacher
d869f0260c s3:smbd: add nt_status_np_pipe()
This mapps between NT_STATUS_CONNECTION_* to NT_STATUS_PIPE_*

metze
2012-05-23 20:03:08 +02:00
Alexander Bokovoy
dcfb34fbb4 blackbox: fix samba4.blackbox.kinit test
This deserves some explanation.

With commit 518232d457 samba4.blackbox.kinit test set
was wrapped with password settings reset before and after the tests with an idea to
maintain reliable state for the tests. As result, the resetting of the password
settings was done after the test that tried to use smbclient with a Kerberos ticket
obtained with machine account credentials.

However, the code in credentials_krb5.c, function cli_credentials_get_client_gss_creds(),
never worked correctly when credentials were already in ccache. Instead, gensec_gssapi module
always re-kinited even if existing credentials were available in the ccache. This had an effect
on 'samba4.blackbox.kinit(dc:local).reset password policies(dc:local)' test equal to
never having initialized ccache at all, as if 'rm -f $KRB5CCNAME' was run before the test.

When the issue of not using already initialized credentials from ccache was fixed with
d0aae88f1290e6a7a6d4bfc24aa62795e4892a31 'auth-credentials: Support using pre-fetched ccache
when obtaining kerberos credentials' commit, Samba 4 credentials library started to correctly
re-used already obtained credentials from ccaches. This caused failure of the test
'samba4.blackbox.kinit(dc:local).reset password policies(dc:local)' because machine account
has no permissions to modify password settings.

Thus, the correct fix is to reset ccache state before performing the test.

Autobuild-User: Alexander Bokovoy <ab@samba.org>
Autobuild-Date: Wed May 23 18:46:12 CEST 2012 on sn-devel-104
2012-05-23 18:46:12 +02:00
Andreas Schneider
2b144531f1 gse: Use the smb_gss_oid_equal wrapper.
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-05-23 17:51:51 +03:00
Andreas Schneider
0a6e568344 krb5samba: Add smb_gss_oid_equal wrapper.
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-05-23 17:51:51 +03:00
Alexander Bokovoy
c1444c3839 s3-autoconf: fix typo after migrating DNS resolver code to lib/addns 2012-05-23 17:51:51 +03:00
Alexander Bokovoy
77a6c81347 wafsamba: ensure TO_LIST does not fail with empty string 2012-05-23 17:51:50 +03:00
Alexander Bokovoy
744f9910c8 libcli/dns: make 'clidns' private library out of DNS code in WAF build
After consolidating DNS resolver code to lib/addns, there is one piece
that still needs to be moved into a common DNS resolver library: DNS_HOSTS_FILE
subsystem. Unfortunately, direct move would require lib/addns to depend on
libcli/util/{ntstatus.h,werror.h} (provided by errors subsystem).

In addition, moving libcli/dns/* code to lib/addns/ would make conflicting
the dns_tkey_record struct. The conflict comes from source4/dns_server/ and is due
to use of IDL to define the struct. lib/addns/ library also provides its own definition
so we either need to keep them in sync (rewrite code in lib/addns/ a bit) or
depend on generated IDL headers.

Thus, making a private library and subsystem clidns is an intermediate step
that allows to buy some time fore refactoring.
2012-05-23 17:51:50 +03:00
Alexander Bokovoy
2ddf89a2bc Introduce system MIT krb5 build with --with-system-mitkrb5 option.
System MIT krb5 build also enabled by specifying --without-ad-dc

When --with-system-mitkrb5 (or --withou-ad-dc) option is passed to top level
configure in WAF build we are trying to detect and use system-wide MIT krb5
libraries. As result, Samba 4 DC functionality will be disabled due to the fact
that it is currently impossible to implement embedded KDC server with MIT krb5.

Thus, --with-system-mitkrb5/--without-ad-dc build will only produce
  * Samba 4 client libraries and their Python bindings
  * Samba 3 server (smbd, nmbd, winbindd from source3/)
  * Samba 3 client libraries

In addition, Samba 4 DC server-specific tests will not be compiled into smbtorture.
This in particular affects spoolss_win, spoolss_notify, and remote_pac rpc tests.
2012-05-23 17:51:50 +03:00
Alexander Bokovoy
2fc96e6955 s4: samba-tool is usable without export-keytab command, make sure it does not break
When export_keytab is not compiled in (pure client-side Samba 4 build as with
system MIT krb5), export-keytab command of samba-tool will not be available.
Make sure it is not provided but its absence does not break the Python tool.
2012-05-23 17:51:50 +03:00
Alexander Bokovoy
ec989e7c40 auth-credentials: Support using pre-fetched ccache when obtaining kerberos credentials
When credentials API is used by a client-side program that already as fetched required
tickets into a ccache, we need to skip re-initializing ccache. This is used in FreeIPA
when Samba 4 Python bindings are run after mod_auth_kerb has obtained user tickets
already.
2012-05-23 17:51:50 +03:00
Alexander Bokovoy
2d9a0d8d0c s3-passdb: add unixid_from_uid/unixid_from_gid/unixid_from_both API
struct unixid is defined in idmap.idl and therefore to use it one
would need generated headers from librpc/gen_ndr. Not all of these
files are installed and available as public headers. Also, they
pull in some support headers which requires them to be available
via specific locations like <librpc/gen_ndr/*> or <libcli/util>.

Instead of pulling the headers to get structure and enum definitions,
introduce three simple helpers to fill in 'struct unixid' based on
the type of id. This is sufficient for PASSDB users and does not
require exposing generated headers or code.
2012-05-23 17:51:50 +03:00
Alexander Bokovoy
f32d43763d dns: fix comments and make s4/libcli/resolve dns resolver working
After migrating to use libaddns, reply_to_addrs() needed to change the
way answers are iterated through. Originally libroken implementation
gave all answers as separate records with last one being explicitly NULL.
libaddns unmarshalling code gives all non-NULL answers and should be
iterated with explicit reply->num_answers in use.
2012-05-23 17:51:49 +03:00
Alexander Bokovoy
1feb31246d lib/krb5_wrap: implement krb5_cc_get_lifetime for MIT Kerberos
In case krb5_cc_get_lifetime is not available, iterate over
existing tickets in the keytab, find the one marked as TKT_FLAG_INITIAL,
and use its lifetime. This is how it is implemented in Heimdal and
how it was suggested to be done by MIT Kerberos developers.
2012-05-23 17:51:49 +03:00
Simo Sorce
ad945bc68f gensec_gssapi: Make it possible to build with MIT krb5
We need to ifdef out some minor things here because there is no available API
to set these options in MIT.
The realm and canonicalize options should be not interesting in the client
case. Same for the send_to_kdc hacks.
Also the OLD DES3 enctype is not at all interesting. I am not aware that
Windows will ever use DES3 and no modern implementation relies on that enctype
anymore as it has been fully deprecated long ago, so we can simply ignore it.
2012-05-23 17:51:49 +03:00
Simo Sorce
302abe6190 auth and s4-rpc_server: Do not use features we currently can't implement with MIT Kerbros build 2012-05-23 17:51:49 +03:00
Simo Sorce
c54fe86a63 s4-resolve: Remove dependency on libroken
Use available native samba resolver functions
2012-05-23 17:51:49 +03:00
Simo Sorce
a8ee6f2ca5 addns: Make ads_dns_lookup_srv pulic 2012-05-23 17:51:49 +03:00
Simo Sorce
34a65739d3 Move source3/libads/dns.c to lib/addns 2012-05-23 17:51:48 +03:00
Simo Sorce
cc3321c9ff s3-ads-dns: Avoid unnecessary dependencies 2012-05-23 17:51:48 +03:00
Simo Sorce
a7e94fce3f s3-ads-dns: Break dependency on lp_parm
In preparation of making this code common to s3 and s4
2012-05-23 17:51:48 +03:00
Simo Sorce
4a335e9632 s3-ad-dns: Use more standard uint and booleans defs
In preparation of making this code common to s3 and s4
2012-05-23 17:51:48 +03:00
Simo Sorce
9c5aa0bef4 addns: Fix talloc hiereachy
Attach request to local memory context not to potentially long lived connection
2012-05-23 17:51:48 +03:00
Stefan Metzmacher
37866df4ee s3:smbd: use reply_force_doserror(req, ERRSRV, ERRbaduid) on SMBulogoff
We don't support security = share anymore, so we should always have
a valid session.

Found by the raw.context test.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed May 23 12:47:37 CEST 2012 on sn-devel-104
2012-05-23 12:47:37 +02:00
Herb Lewis
42b2026a83 Second part of fix for bug 8953 - winbind can hang as nbt_getdc() has no timeout.
If we're running with SEC_ADS and we don't get a cldap response from
the server when querying its name, don't fall back to NetBIOS requests
as they're unlikely to succeed.

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed May 23 03:49:36 CEST 2012 on sn-devel-104
2012-05-23 03:49:35 +02:00
Jeremy Allison
d673402992 Fix bug #8953 - winbind can hang as nbt_getdc() has no timeout.
Add a timeout_in_seconds parameter to nbt_getdc() to make it fail
after that time with NT_STATUS_IO_TIMEOUT.
2012-05-22 16:25:14 -07:00
Michael Adam
f9e4105f41 s3:smbd: remove unused 'connection_struct->used'
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue May 22 16:42:22 CEST 2012 on sn-devel-104
2012-05-22 16:42:22 +02:00
Jeremy Allison
c531aac27c Added torture test for bug #8910. Test remove_duplicate_addrs2().
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue May 22 01:31:17 CEST 2012 on sn-devel-104
2012-05-22 01:31:17 +02:00
Volker Lendecke
8576256738 s3: Fix vfs_xattr_tdb.c
"size" is the maximum buffer, only copy what we actually got. For me, this
fixes valgrind errors in the DIR1 test that might potentially make DIR1
non-flaky again.

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon May 21 22:10:15 CEST 2012 on sn-devel-104
2012-05-21 22:10:15 +02:00
Stefan Metzmacher
ce11eb5b94 s3:smb2_ioctl: Fix Coverity ID 701771 Uninitialized scalar variable
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon May 21 19:27:44 CEST 2012 on sn-devel-104
2012-05-21 19:27:43 +02:00
Matthieu Patou
1d53e57bbf s4-dsdb: allow modification of some deleted object if the show-deleted control is presented
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Sat May 19 20:28:01 CEST 2012 on sn-devel-104
2012-05-19 20:28:00 +02:00
Matthieu Patou
db866864f7 s4-dsdb: naming context needs to have the extended-dn syntax too 2012-05-19 09:35:29 -07:00