obnox/samba-ctdb.git
14 years agos3: Don't fail authentication when one or some group of require-membership-of is...
Bo Yang [Wed, 14 Oct 2009 22:23:48 +0000 (06:23 +0800)]
s3: Don't fail authentication when one or some group of require-membership-of is invalid.

Signed-off-by: Bo Yang <boyang@samba.org>
(cherry picked from commit 31f1a36901b5b8959dc51401c09c114829b50392)

Fix bug #6826.

14 years agoWHATSNEW: Update changes since 3.4.2.
Karolin Seeger [Thu, 22 Oct 2009 14:22:10 +0000 (16:22 +0200)]
WHATSNEW: Update changes since 3.4.2.

Karolin

14 years agos3-spnego: Fix Bug #6815. Windows 2008 R2 SPNEGO negTokenTarg parsing failure.
Günther Deschner [Thu, 15 Oct 2009 14:01:36 +0000 (16:01 +0200)]
s3-spnego: Fix Bug #6815. Windows 2008 R2 SPNEGO negTokenTarg parsing failure.

When parsing a SPNEGO session setup retry (falling back from KRB5 to NTLMSSP),
we failed to parse the ASN1_ENUMERATED negResult in the negTokenTarg, thus
failing spnego_parse_auth() completely.

Guenther

14 years agos3-spnego: avoid NULL talloc context in read_spnego_data().
Günther Deschner [Thu, 15 Oct 2009 14:00:57 +0000 (16:00 +0200)]
s3-spnego: avoid NULL talloc context in read_spnego_data().

Guenther

14 years agoWHATSNEW: Start release notes for Samba 3.4.3.
Karolin Seeger [Mon, 19 Oct 2009 12:56:44 +0000 (14:56 +0200)]
WHATSNEW: Start release notes for Samba 3.4.3.

Karolin

14 years agoVERSION: Raise version number up to 3.4.3.
Karolin Seeger [Mon, 19 Oct 2009 12:54:37 +0000 (14:54 +0200)]
VERSION: Raise version number up to 3.4.3.

Karolin

14 years agos3:configure: fix avahi activation
Björn Jacke [Sun, 18 Oct 2009 15:01:57 +0000 (17:01 +0200)]
s3:configure: fix avahi activation

Avahi was correctly found but not activated since e4a26c942.
(cherry picked from commit 718d2801d6bafedfe91d7b475294d69e2d6a77a4)

Fix bug #6824.

14 years agoFix symlink calls in all vfs modules.
Jeremy Allison [Mon, 19 Oct 2009 06:39:23 +0000 (08:39 +0200)]
Fix symlink calls in all vfs modules.

Additional patch to fix bug #6769.

14 years agos3:packaging: Fix building RHEL packages.
Karolin Seeger [Fri, 16 Oct 2009 14:00:26 +0000 (16:00 +0200)]
s3:packaging: Fix building RHEL packages.

Fix bug #6721.
Thanks to Eero Volotinen <eero.volotinen@medicel.com> for providing the patch!

Karolin
(cherry picked from commit 79c2c61b99eb7c47c8bfbbb479d9d2197d1ad1fb)
(cherry picked from commit 11a6d88ea387fa50690880561f0ffffefbeb8956)

14 years agocifs.upcall: do a brute-force search for KRB5 credcache
Jeff Layton [Wed, 14 Oct 2009 14:59:00 +0000 (10:59 -0400)]
cifs.upcall: do a brute-force search for KRB5 credcache

A few weeks ago, I added some code to cifs.upcall to take the pid sent
by the kernel and use that to get the value of the $KRB5CCNAME
environment var for the process. That works fine on the initial mount,
but could be problematic on reconnect.

There's no guarantee on a reconnect that the process that initiates the
upcall will have $KRB5CCNAME pointed at the correct credcache. Because
of this, the current scheme isn't going to be reliable enough and we
need to use something different.

This patch replaces that scheme with one very similar to the one used by
rpc.gssd in nfs-utils. It searches the credcache dir (currently
hardcoded to /tmp) for a valid credcache for the given uid. If it finds
one then it uses that as the credentials cache. If it finds more than
one, it uses the one with the latest TGT expiration.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Addresses bug #6810.

14 years agocifs.upcall: make using ip address conditional on new option
Jeff Layton [Wed, 14 Oct 2009 14:58:56 +0000 (10:58 -0400)]
cifs.upcall: make using ip address conditional on new option

Igor Mammedov pointed out that reverse resolving an IP address to get
the hostname portion of a principal could open a possible attack
vector. If an attacker were to gain control of DNS, then he could
redirect the mount to a server of his choosing, and fix the reverse
resolution to point to a hostname of his choosing (one where he has
the key for the corresponding cifs/ or host/ principal).

That said, we often trust DNS for other reasons and it can be useful
to do so. Make the code that allows trusting DNS to be enabled by
adding --trust-dns to the cifs.upcall invocation.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: switch to getopt_long
Jeff Layton [Wed, 14 Oct 2009 14:58:48 +0000 (10:58 -0400)]
cifs.upcall: switch to getopt_long

...to allow long option names.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: fix IPv6 addrs sent to upcall to have colon delimiters
Jeff Layton [Wed, 14 Oct 2009 14:58:48 +0000 (10:58 -0400)]
cifs.upcall: fix IPv6 addrs sent to upcall to have colon delimiters

Current kernels don't send IPv6 addresses with the colon delimiters, add
a routine to add them when they're not present.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: use ip address passed by kernel to get server's hostname
Jeff Layton [Wed, 14 Oct 2009 14:58:48 +0000 (10:58 -0400)]
cifs.upcall: use ip address passed by kernel to get server's hostname

Instead of using the hostname given by the upcall to get the server's
principal, take the IP address given in the upcall and reverse resolve
it to a hostname.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: clean up flag handling
Jeff Layton [Wed, 14 Oct 2009 14:58:47 +0000 (10:58 -0400)]
cifs.upcall: clean up flag handling

Add a new stack var to hold the flags returned by the decoder routine
so that we don't need to worry so much about preserving "rc".

With this, we can drop privs before trying to find the location of
the credcache.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: try getting a "cifs/" principal and fall back to "host/"
Jeff Layton [Wed, 14 Oct 2009 14:58:20 +0000 (10:58 -0400)]
cifs.upcall: try getting a "cifs/" principal and fall back to "host/"

cifs.upcall takes a "-c" flag that tells the upcall to get a principal
in the form of "cifs/hostname.example.com@REALM" instead of
"host/hostname.example.com@REALM". This has turned out to be a source of
great confusion for users.

Instead of requiring this flag, have the upcall try to get a "cifs/"
principal first. If that fails, fall back to getting a "host/"
principal.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: declare a structure for holding decoded args
Jeff Layton [Wed, 14 Oct 2009 14:44:40 +0000 (10:44 -0400)]
cifs.upcall: declare a structure for holding decoded args

The argument list for the decoder is becoming rather long. Declare an
args structure and use that for holding the args. This also simplifies
pointer handling a bit.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: formatting cleanup
Jeff Layton [Wed, 14 Oct 2009 14:44:22 +0000 (10:44 -0400)]
cifs.upcall: formatting cleanup

Clean up some unneeded curly braces, and fix some indentation.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agocifs.upcall: clean up logging and add debug messages
Jeff Layton [Wed, 14 Oct 2009 14:43:18 +0000 (10:43 -0400)]
cifs.upcall: clean up logging and add debug messages

Change the log levels to be more appropriate to the messages being
logged. Error messages should be LOG_ERR and not LOG_WARNING, for
instance.

Add some LOG_DEBUG messages that we can use to diagnose problems with
krb5 upcalls. With these, someone can set up syslog to log daemon.debug
and should be able to get more info when things aren't working.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoAttempt to fix the build -- jlayton, please check!
Volker Lendecke [Wed, 14 Oct 2009 14:42:46 +0000 (10:42 -0400)]
Attempt to fix the build -- jlayton, please check!

14 years agocifs.upcall: use pid value from kernel to determine KRB5CCNAME to use
Jeff Layton [Wed, 14 Oct 2009 14:42:28 +0000 (10:42 -0400)]
cifs.upcall: use pid value from kernel to determine KRB5CCNAME to use

If the kernel sends the upcall a pid of the requesting process, we can
open that process' /proc/<pid>/environ file and scrape the KRB5CCNAME
value out of it.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
14 years agoFinal part of fix for bug 6793 - winbindd crash with "INTERNAL ERROR: Signal 6" Don...
Jeremy Allison [Wed, 14 Oct 2009 18:11:26 +0000 (11:11 -0700)]
Final part of fix for bug 6793 - winbindd crash with "INTERNAL ERROR: Signal 6" Don't use mapped_user uninitialized. Jeremy.

14 years agos3/aio: Correctly handle aio_error() and errno.
Olaf Flebbe [Tue, 6 Oct 2009 09:09:28 +0000 (11:09 +0200)]
s3/aio: Correctly handle aio_error() and errno.

Fix bug #6805.

14 years agoFix bug 6811 - pam_winbind references freed memory. s3: Fix reference to freed memory...
Bo Yang [Wed, 14 Oct 2009 19:45:16 +0000 (12:45 -0700)]
Fix bug 6811 - pam_winbind references freed memory. s3: Fix reference to freed memory in pam_winbind.

14 years agos3: Fix bug 6606
Volker Lendecke [Sat, 10 Oct 2009 09:15:42 +0000 (11:15 +0200)]
s3: Fix bug 6606

This is a port of 1f34ffa0caae5 and 24309bdb2efc to 3.4.

Fix file corruption using smbclient with NT4 server.

14 years agos3:winbind: Fix a double-free
Volker Lendecke [Tue, 13 Oct 2009 18:56:28 +0000 (20:56 +0200)]
s3:winbind: Fix a double-free

Part of a fix for bug #6793.

14 years agos3:winbind: Fix bug 6793 -- segfault in winbindd_pam_auth
Volker Lendecke [Fri, 9 Oct 2009 20:05:37 +0000 (22:05 +0200)]
s3:winbind: Fix bug 6793 -- segfault in winbindd_pam_auth

14 years agos3:net: Fix a segfault in "net rpc trustdom list" for overlong domain names
Volker Lendecke [Tue, 13 Oct 2009 13:56:00 +0000 (15:56 +0200)]
s3:net: Fix a segfault in "net rpc trustdom list" for overlong domain names

That was a complicated way to say "%-20.s"... But that code was from 2002 ...
(cherry picked from commit 8a27fdea89bc54aa35e363a376836662103c7cb7)

Fix Bug #6807.

14 years agos3/loadparm: Fix hpux compiler issue.
Olaf Flebbe [Tue, 13 Oct 2009 09:39:49 +0000 (11:39 +0200)]
s3/loadparm: Fix hpux compiler issue.

Fixes bug #6804.

14 years agos3: Fix a memleak reported by dmarkey
Volker Lendecke [Fri, 9 Oct 2009 20:58:14 +0000 (22:58 +0200)]
s3: Fix a memleak reported by dmarkey
(cherry picked from commit 5aeb954ba9382e1975c64ac96f1e377ed6af3ae0)

Fix bug #6797.

14 years agoFix bug 6796 - Deleting an event context on shutdown can cause smbd to crash.
Jeremy Allison [Fri, 9 Oct 2009 19:50:26 +0000 (12:50 -0700)]
Fix bug 6796 - Deleting an event context on shutdown can cause smbd to crash.

Sync's tevent signal code with 3.5.x tree.
Protects against ev pointer being NULL.

Jeremy

14 years agoFix bug 6774 - smbd crashes if "aio write behind" is set.
Jeremy Allison [Fri, 9 Oct 2009 17:01:29 +0000 (10:01 -0700)]
Fix bug 6774 - smbd crashes if "aio write behind" is set.

Don't dereference a talloc_move'd pointer.

Jeremy.

14 years agos3/aio: allow for outstanding_aio_calls to be decremented.
Olaf Flebbe [Wed, 30 Sep 2009 12:55:58 +0000 (14:55 +0200)]
s3/aio: allow for outstanding_aio_calls to be decremented.

Fixes bug #6772.

14 years agos3/Makefile: BUG 6791: Fix link order for libwbclient.
Karolin Seeger [Fri, 9 Oct 2009 06:58:55 +0000 (08:58 +0200)]
s3/Makefile: BUG 6791: Fix link order for libwbclient.

Patch was provided by Buchan Milne <bgmilne@mandriva.org>.

Signed-off-by: Björn Jacke <bj@sernet.de>
14 years agos3/Makefile: BUG 6791: Fix linking order in cifs.upcall.
Karolin Seeger [Fri, 9 Oct 2009 06:55:53 +0000 (08:55 +0200)]
s3/Makefile: BUG 6791: Fix linking order in cifs.upcall.

Patch was originally provided by Buchan Milne <bgmilne@mandriva.org>.

Signed-off-by: Björn Jacke <bj@sernet.de>
14 years agoCorrect fix for bug 6781 - Cannot rename subfolders in Explorer view with recent...
Jeremy Allison [Wed, 7 Oct 2009 22:46:57 +0000 (15:46 -0700)]
Correct fix for bug 6781 - Cannot rename subfolders in Explorer view with recent versions of Samba. Without this fix, renaming a directory ./a to ./b, whilst a directory ./aa was already open would fail. Simplifies logic of earlier code. Jeremy.

14 years agoFix bug 6769 - symlink unlink does nothing. Jeremy.
Jeremy Allison [Thu, 8 Oct 2009 23:40:26 +0000 (16:40 -0700)]
Fix bug 6769 - symlink unlink does nothing. Jeremy.

14 years agos3:winbind: Only ever handle one event after a select call
Volker Lendecke [Wed, 7 Oct 2009 12:06:53 +0000 (14:06 +0200)]
s3:winbind: Only ever handle one event after a select call

While handling an fd event, the situation with other fds can change. I've just
seen a winbind stuck in the accept() call on the privileged pipe. I can only
imagine this happen because under high load we first handled other requests and
meanwhile the client on the privileged pipe went away.

14 years agoFix bug 6776 - Running overlapping Byte Lock test will core dump Samba daemon. Re...
Jeremy Allison [Mon, 5 Oct 2009 21:22:05 +0000 (14:22 -0700)]
Fix bug 6776 - Running overlapping Byte Lock test will core dump Samba daemon. Re-write core of POSIX locking logic. Jeremy.

14 years agos3:smbd: Fix bug 6690, wrong error check
Andrew Klosterman [Tue, 8 Sep 2009 15:38:37 +0000 (17:38 +0200)]
s3:smbd: Fix bug 6690, wrong error check

14 years agos3:winbindd: only notify the client when we exist, if the connection isn't dead already
Stefan Metzmacher [Fri, 25 Sep 2009 04:20:33 +0000 (06:20 +0200)]
s3:winbindd: only notify the client when we exist, if the connection isn't dead already

This is similar to commit 83edf3e43e86781872a07d8eb53084f59ad7384c.

metze

14 years agos3:winbindd_cm: don't invalidate the whole connection when just samr gave ACCCESS_DENIED
Stefan Metzmacher [Thu, 24 Sep 2009 19:35:38 +0000 (21:35 +0200)]
s3:winbindd_cm: don't invalidate the whole connection when just samr gave ACCCESS_DENIED

metze
(cherry picked from commit bfd3a6f13aa935950142a24bf331feb98f987bde)

14 years agos3:rpc_client: don't randomly fragment rpc pdu's in developer mode
Stefan Metzmacher [Sun, 20 Sep 2009 21:29:11 +0000 (23:29 +0200)]
s3:rpc_client: don't randomly fragment rpc pdu's in developer mode

This is really confusing and also breaks against windows,
as it doesn't accept fragmented bind requests.

metze
(cherry picked from commit 68b8149d1fb26b2fe1138c99d971754b0a30378b)

14 years agos3:lib/select: don't overwrite errno in the signal handler
Stefan Metzmacher [Sun, 20 Sep 2009 21:29:34 +0000 (23:29 +0200)]
s3:lib/select: don't overwrite errno in the signal handler

metze
(cherry picked from commit 00e378f17c39c52689601bc622b9cd78a0cdce12)

14 years agotevent: make sure we don't set errno within the signal handler function.
Stefan Metzmacher [Mon, 21 Sep 2009 01:16:18 +0000 (03:16 +0200)]
tevent: make sure we don't set errno within the signal handler function.

metze
(cherry picked from commit d13dfbeb6c6ab5b20277439da5b95f1a7f2850eb)

14 years agos3:rpc_server: we need to make a copy of my_name in serverinfo_to_SamInfo_base()
Stefan Metzmacher [Thu, 24 Sep 2009 04:38:08 +0000 (06:38 +0200)]
s3:rpc_server: we need to make a copy of my_name in serverinfo_to_SamInfo_base()

This is important for the case the server_info already contains a logon_server.

metze
(This is similar to commit 9ef39406d8072a1a102813fb4448af76e9020fcd)

14 years agos3:winbind: Fix an uninitialized variable (cherry picked from commit 0724649a8a7c04d0...
Volker Lendecke [Wed, 23 Sep 2009 04:23:50 +0000 (06:23 +0200)]
s3:winbind: Fix an uninitialized variable (cherry picked from commit 0724649a8a7c04d015317d9dc2ae43ee87c1bd25)

14 years agos3-winbindd: Fix Bug #6711: trusts to windows 2008 (2008 r2) not working.
Günther Deschner [Thu, 17 Sep 2009 07:43:36 +0000 (09:43 +0200)]
s3-winbindd: Fix Bug #6711: trusts to windows 2008 (2008 r2) not working.

Winbindd should always try to use LSA via an schannel authenticated ncacn_ip_tcp
connection when talking to AD for LSA lookup calls.

In Samba <-> W2k8 interdomain trust scenarios, LookupSids3 and LookupNames4 via an
schannel ncacn_ip_tcp LSA connection are the *only* options to successfully resolve
sids and names.

Guenther
(cherry picked from commit 6a8ef6c424c52be861ed2a9806f917a64ec892a6)

14 years agos3-winbindd: add cm_connect_lsa_tcp().
Günther Deschner [Sat, 12 Sep 2009 21:30:39 +0000 (23:30 +0200)]
s3-winbindd: add cm_connect_lsa_tcp().

Guenther
(cherry picked from commit 58f2deb94024f002e3c3df47f45454edc97f47e1)

14 years agos3-rpc_client: fix non initialized structure in rpccli_lsa_lookup_sids_noalloc.
Günther Deschner [Thu, 17 Sep 2009 07:42:49 +0000 (09:42 +0200)]
s3-rpc_client: fix non initialized structure in rpccli_lsa_lookup_sids_noalloc.

Guenther
(cherry picked from commit a4b5c792c55ef90648a528d279beec32f86a9b22)

14 years agos3-rpc_client: add rpccli_lsa_lookup_sids3 wrapper.
Günther Deschner [Sat, 12 Sep 2009 22:28:49 +0000 (00:28 +0200)]
s3-rpc_client: add rpccli_lsa_lookup_sids3 wrapper.

Guenther
(cherry picked from commit 2f9adf04e4b3e16c046cb371a428a8a70d5de041)

14 years agos3-rpc_client: add rpccli_lsa_lookup_names4 wrapper.
Günther Deschner [Fri, 11 Sep 2009 17:35:14 +0000 (19:35 +0200)]
s3-rpc_client: add rpccli_lsa_lookup_names4 wrapper.

Guenther
(cherry picked from commit ff968712bab6c2635ef74723c6f52b0fdac4b424)

14 years agos3-winbindd: add and use winbindd_lookup_names().
Günther Deschner [Thu, 17 Sep 2009 06:06:34 +0000 (08:06 +0200)]
s3-winbindd: add and use winbindd_lookup_names().

Guenther
(cherry picked from commit 99c3fc19587431efda1ae6161453d84673b32071)

14 years agos3-winbindd: add and use winbindd_lookup_sids().
Günther Deschner [Thu, 17 Sep 2009 05:59:25 +0000 (07:59 +0200)]
s3-winbindd: add and use winbindd_lookup_sids().

Guenther
(cherry picked from commit f0b52b8c3133e3696db361d9d0e7d1fff0fab991)

14 years agos3-rpc_client: add dcerpc_transport_t to cli_rpc_pipe_open_schannel().
Günther Deschner [Thu, 10 Sep 2009 20:23:21 +0000 (22:23 +0200)]
s3-rpc_client: add dcerpc_transport_t to cli_rpc_pipe_open_schannel().

Guenther
(cherry picked from commit bea8e5fa6038d5abd2ec1e12f9005c4a04abb79f)

14 years agos3-rpc_client: add dcerpc_transport_t to cli_rpc_pipe_open_spnego_ntlmssp and cli_rpc...
Günther Deschner [Thu, 10 Sep 2009 20:23:21 +0000 (22:23 +0200)]
s3-rpc_client: add dcerpc_transport_t to cli_rpc_pipe_open_spnego_ntlmssp and cli_rpc_pipe_open_ntlmssp.

Guenther
(cherry picked from commit 032e01e7c13724d057b5744d7d79613449c2f24f)

14 years agos3-rpc_client: add cli_rpc_pipe_open_noauth_transport.
Günther Deschner [Tue, 4 Nov 2008 17:40:24 +0000 (18:40 +0100)]
s3-rpc_client: add cli_rpc_pipe_open_noauth_transport.

Guenther
(cherry picked from commit 87f61a144b8d25c90b847940ca03ced1f77b036c)

14 years agos3-rpc_client: add enum dcerpc_transport_t to rpc_cli_transport struct.
Günther Deschner [Thu, 10 Sep 2009 17:59:37 +0000 (19:59 +0200)]
s3-rpc_client: add enum dcerpc_transport_t to rpc_cli_transport struct.

Guenther
(cherry picked from commit 393a1f594d5f03a51448cdc465f92c599a93904c)

14 years agoSecond part of a fix for bug #6235.
Jeremy Allison [Fri, 2 Oct 2009 10:23:32 +0000 (12:23 +0200)]
Second part of a fix for bug #6235.

Domain enumeration breaks if master browser has space in name.

14 years agoFix bug #6532.
Derrell Lipman [Fri, 2 Oct 2009 10:22:25 +0000 (12:22 +0200)]
Fix bug #6532.

Domain enumeration breaks if master browser has space in name.

14 years agoFixing timeval calculation
Simo Sorce [Fri, 25 Sep 2009 14:59:04 +0000 (10:59 -0400)]
Fixing timeval calculation

The code was always doubling microseconds when attempting to round up.

Fix bug #6764.

14 years agos3: Document the "share:fake_fscaps" parameter, fix bug 6765
Volker Lendecke [Tue, 29 Sep 2009 12:34:16 +0000 (14:34 +0200)]
s3: Document the "share:fake_fscaps" parameter, fix bug 6765
(cherry picked from commit 21794b0dd28a80b149342b3218d7ebb4c8791e09)

14 years agos3:smbd: Add a "hidden" parameter "share:fake_fscaps"
Volker Lendecke [Wed, 9 Sep 2009 19:58:47 +0000 (21:58 +0200)]
s3:smbd: Add a "hidden" parameter "share:fake_fscaps"

This is needed to support some special app I've just come across where I had to
set the SPARSE_FILES bit (0x40) to make it work against Samba at all. There
might be others to fake. This is definitely a "Don't touch if you don't know
what you're doing" thing, so I decided to make this an undocumented parametric
parameter.

I know this sucks, so feel free to beat me up on this. But I don't think it
will hurt.
(cherry picked from commit a5cace128d1dcabd6cc90dda71a09dfa8ee8c6f6)

Fix bug #6765.

14 years agoFix for CVE-2009-2906.
Jeremy Allison [Wed, 30 Sep 2009 12:17:40 +0000 (14:17 +0200)]
Fix for CVE-2009-2906.

Summary:
Specially crafted SMB requests on
authenticated SMB connections can send smbd
into a 100% CPU loop, causing a DoS on the
Samba server.
(cherry picked from commit 7439cd5efa50058741c57857109690e4a104f9f0)

14 years agoWHATSNEW: Update release notes.
Karolin Seeger [Wed, 30 Sep 2009 11:54:22 +0000 (13:54 +0200)]
WHATSNEW: Update release notes.

Karolin
(cherry picked from commit 9851a27b2f73e16c730983f60f7d580de897da95)

14 years agoWHATSNEW: Update release date.
Karolin Seeger [Mon, 28 Sep 2009 11:38:32 +0000 (13:38 +0200)]
WHATSNEW: Update release date.

Karolin
(cherry picked from commit cc0829c00d527ba0e707efe0f57d637a38b03dee)

14 years agoFix for CVE-2009-2813.
Jeremy Allison [Mon, 28 Sep 2009 11:26:37 +0000 (13:26 +0200)]
Fix for CVE-2009-2813.

===========================================================
== Subject:     Misconfigured /etc/passwd file may share folders unexpectedly
==
== CVE ID#:     CVE-2009-2813
==
== Versions:    All versions of Samba later than 3.0.11
==
== Summary:     If a user in /etc/passwd is misconfigured to have
==              an empty home directory then connecting to the home
==              share of this user will use the root of the filesystem
==              as the home directory.
===========================================================
(cherry picked from commit ac075bd679fd59e93ea13780f6651a431002edd0)

14 years agomount.cifs: don't leak passwords with verbose option
Jeff Layton [Fri, 25 Sep 2009 11:03:07 +0000 (07:03 -0400)]
mount.cifs: don't leak passwords with verbose option

When running mount.cifs with the --verbose option, it'll print out the
option string that it passes to the kernel...including the mount
password if there is one. Print a placeholder string instead to help
ensure that this info can't be used for nefarious purposes.

Also, the --verbose option printed the option string before it was
completely assembled anyway. This patch should also make sure that
the complete option string is printed out.

Finally, strndup passwords passed in on the command line to ensure that
they aren't shown by --verbose as well. Passwords used this way can
never be truly kept private from other users on the machine of course,
but it's simple enough to do it this way for completeness sake.

Reported-by: Ronald Volgers <r.c.volgers@student.utwente.nl>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Steve French <sfrench@us.ibm.com>
Part 2/2 of a fix for CVE-2009-2948.
(cherry picked from commit 2a422f453dd3ad9978e6ec0ac40c122163c028ed)

14 years agomount.cifs: check access of credential files before opening
Jeff Layton [Fri, 25 Sep 2009 10:51:01 +0000 (06:51 -0400)]
mount.cifs: check access of credential files before opening

It's possible for an unprivileged user to pass a setuid mount.cifs a
credential or password file to which he does not have access. This can cause
mount.cifs to open the file on his behalf and possibly leak the info in the
first few lines of the file.

Check the access permissions of the file before opening it.

Reported-by: Ronald Volgers <r.c.volgers@student.utwente.nl>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Steve French <sfrench@us.ibm.com>
Part 1/2 of a fix for CVE-2009-2948.
(cherry picked from commit 42351937b00f6aa013d16c2a4dbd0b37e7e9ed11)

14 years agoWHATSNEW: Prepare release notes for 3.4.2.
Karolin Seeger [Mon, 28 Sep 2009 11:21:07 +0000 (13:21 +0200)]
WHATSNEW: Prepare release notes for 3.4.2.

Karolin
(cherry picked from commit 53ba0b36d0d3bb2fb4b2fc5335920487060ed284)

14 years agoRaise version number up to 3.4.2.
Karolin Seeger [Thu, 24 Sep 2009 12:29:43 +0000 (14:29 +0200)]
Raise version number up to 3.4.2.

Karolin
(cherry picked from commit d805592d6fb1fa841a74c547945226a916494a2d)

14 years agoAdjust regex to match variable names including underscores
Lars Müller [Mon, 2 Feb 2009 20:38:38 +0000 (21:38 +0100)]
Adjust regex to match variable names including underscores

This is required to get the CIFSUPCALL_PROGS setting extracted from
config.log.
(cherry picked from commit 5148eefe1ea6e215dcbf4ffaa642860bd8dab45f)

Fix for bug #6710.

14 years agos3: Don't overwrite password in pam_winbind, subsequent pam modules might use the...
Bo Yang [Wed, 16 Sep 2009 15:57:01 +0000 (23:57 +0800)]
s3: Don't overwrite password in pam_winbind, subsequent pam modules might use the old password and new password.

Signed-off-by: Bo Yang <boyang@samba.org>
Fix bug #6735.

14 years agos3: Fix reading beyond the end of a named stream in xattr_streams
Volker Lendecke [Wed, 16 Sep 2009 01:20:49 +0000 (03:20 +0200)]
s3: Fix reading beyond the end of a named stream in xattr_streams

This was found thanks to a test by Sivani from Microsoft against Samba at the
SDC plugfest
(cherry picked from commit 444a05c28df693a745809fef73ae583a78be7c8f)

Fix bug #6731.

14 years agos3: BSD needs sys/sysctl.h included to build properly
Björn Jacke [Tue, 15 Sep 2009 04:48:49 +0000 (06:48 +0200)]
s3: BSD needs sys/sysctl.h included to build properly

FreeBSD (and other BSDs, too) need sys/sysctl.h inclueded to use sysctlbyname().

Thanks to Timur Bakeyev for that.

Fix bug #6728.

14 years agos3:smbstatus: Fix bug 6703, allow smbstatus as non-root
Volker Lendecke [Fri, 18 Sep 2009 16:27:16 +0000 (18:27 +0200)]
s3:smbstatus: Fix bug 6703, allow smbstatus as non-root

We only require a ctdb connection when clustering is enabled. This limits the
restriction for only-root smbstatus to the clustering case.

14 years agos3: QNX doesn't know uint - replace with uint_t
Björn Jacke [Tue, 7 Jul 2009 20:11:50 +0000 (22:11 +0200)]
s3: QNX doesn't know uint - replace with uint_t
(cherry picked from commit a28596964b44f20d794999541d38fe4bae64b56b)

14 years agos3/libsmb: SIVAL should have been an SVAL.
Jeremy Allison [Tue, 15 Sep 2009 07:40:48 +0000 (09:40 +0200)]
s3/libsmb: SIVAL should have been an SVAL.

Fix bug #6726.

14 years agoFix bug 6707 - 3.4.1 segfault in parsing configs.
Marc Aurele La France [Thu, 10 Sep 2009 16:52:11 +0000 (09:52 -0700)]
Fix bug 6707 - 3.4.1 segfault in parsing configs.
Fixes an occasional segfault caused by an out-of-bounds reference in config file parsing.
(cherry picked from commit 7c00227f00a83345035c4c0a6716b46864f2da8d)

14 years agoFix bug 6529 - Offline files conflict with Vista and Office 2003. Jeremy.
Jeremy Allison [Wed, 9 Sep 2009 21:39:17 +0000 (14:39 -0700)]
Fix bug 6529 - Offline files conflict with Vista and Office 2003. Jeremy.

14 years agoConditional install of the cifs.upcall man page
Lars Müller [Mon, 2 Feb 2009 20:12:52 +0000 (21:12 +0100)]
Conditional install of the cifs.upcall man page

Only install the cifs.upcall man page if CIFSUPCALL_PROGS was set while
configure.
(cherry picked from commit e9e2414e798a2eb447de45803e61cc0a49752f11)

14 years agos3:configure: fix syntax error in avahi configure test
Björn Jacke [Fri, 3 Jul 2009 12:25:06 +0000 (14:25 +0200)]
s3:configure: fix syntax error in avahi configure test
(cherry picked from commit b54e48b830dbc3d66f9de5d2711a57a1630809e2)

Should fix bug #6704.

14 years agoumount.cifs: do not attempt to update /etc/mtab if it is symbolic link
Shirish Pargaonkar [Mon, 27 Jul 2009 16:02:35 +0000 (12:02 -0400)]
umount.cifs: do not attempt to update /etc/mtab if it is symbolic link

If /etc/mtab is a symbolic link to e.g. /proc/mounts, do not update it.

This is a fix for a bug reported in 4675 on samba bugzilla

Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
(cherry picked from commit a869e4253a87f9a5e13dbe87b2799f8683d238d7)

Fixes bug #4675.

14 years agos3:docs: Add info about how to obtain cifs module in cifs mount helper manpage
Volker Lendecke [Wed, 9 Sep 2009 21:08:28 +0000 (23:08 +0200)]
s3:docs: Add info about how to obtain cifs module in cifs mount helper manpage
(cherry picked from commit a224392649ffb81dc1d67f41a01dd983b76d513b)

Fixes bug #5129.

14 years agoWHATSNEW: Update changes.
Karolin Seeger [Wed, 9 Sep 2009 12:24:08 +0000 (14:24 +0200)]
WHATSNEW: Update changes.

Karolin

14 years agos3:libsmb: Correctly chew keepalive packets
Volker Lendecke [Wed, 9 Sep 2009 10:24:08 +0000 (12:24 +0200)]
s3:libsmb: Correctly chew keepalive packets

Thanks a *lot* to Günther to send me the relevant traces!

Volker

Signed-off-by: Günther Deschner <gd@samba.org>
Fixes bug #6646 (Winbind authentication issue on 3.2.13/14 and 3.4.0 (was:
[Samba] Crazied NTLM_AUTH on samba 3.4.0)).

14 years agoWHATSNEW: Update changes since 3.4.0.
Karolin Seeger [Wed, 9 Sep 2009 10:53:36 +0000 (12:53 +0200)]
WHATSNEW: Update changes since 3.4.0.

Karolin

14 years agoFix bug 6496 - libsmbclient: MS-DFS: cannot follow multibyte char link name. A server...
SATOH Fumiyasu [Tue, 8 Sep 2009 23:07:17 +0000 (16:07 -0700)]
Fix bug 6496 - libsmbclient: MS-DFS: cannot follow multibyte char link name. A server returns a byte of consumed path in UCS2, not UNIX charset.

14 years agoFix bug 6673 - smbpasswd does not work with "unix password sync = yes". Revert change...
Jeremy Allison [Tue, 8 Sep 2009 23:22:46 +0000 (16:22 -0700)]
Fix bug 6673 - smbpasswd does not work with "unix password sync = yes". Revert change from 3.3 -> 3.4 with read_socket_with_timeout changed from sys_read() to sys_recv(). read_socket_with_timeout() is called with non-fd's (with a pty in chgpasswd.c and with a disk file in lib/dbwrap_file.c via read_data()). recv works for the disk file, but not the pty. Change the name of read_socket_with_timeout() to read_fd_with_timeout() to make this clear (and add comments). Jeremy.

14 years agoHopefully last part of the fix for bug 6651 - smbd SIGSEGV when breaking oplocks...
Jeremy Allison [Thu, 3 Sep 2009 14:40:48 +0000 (07:40 -0700)]
Hopefully last part of the fix for bug 6651 - smbd SIGSEGV when breaking oplocks. This one is subtle. There is a race condition where a signal can be queued for oplock break, and then the file can be closed by the client before the signal can be processed. Currently if this occurs we panic (we can't match an incoming signal fd with a fsp pointer). Simply log the error (at debug level 10 right now, might be too much) and then return without processing the break request. It looks like there is another race condition with this fix, but here's why it won't happen. If the signal was pending (caused by a kernel oplock break from a local file open), and the client closed the file and then re-opened another file which happened to use the same file descriptor as the file just closed, then theoretically the oplock break requests could be processed on the wrong fd. Here's why this should be very rare.. Processing a pending signal always take precedence over an incoming network request, so as long as the client close request is non-chained then the break signal should always be harmlessly processed *before* the open can be called. If the open is chained onto the close, and the fd on the new open is the same as the old closed fd, then it's possible this race will occur. However, all that will happen is that we'll lose the oplock on this file. A shame, but not a fatal event. Jeremy. (cherry picked from commit bdc7bdb0d3e02d04477906dbda8995bc5789ce22)

14 years agoHelp debug for bug 6651 - smbd SIGSEGV when breaking oplocks. Should help track if...
Jeremy Allison [Tue, 25 Aug 2009 04:14:52 +0000 (21:14 -0700)]
Help debug for bug 6651 - smbd SIGSEGV when breaking oplocks. Should help track if we get invoked with an invalid fd from the signal handler. Jeremy. (cherry picked from commit 213546103749c30dbb3ad8472872b9a8fad34205)

14 years agotevent: change version to 0.9.8 after some critical bugs have been fixed
Stefan Metzmacher [Fri, 4 Sep 2009 10:56:39 +0000 (12:56 +0200)]
tevent: change version to 0.9.8 after some critical bugs have been fixed

metze
(cherry picked from commit 1bb68402a2e37f39118eaaaa039ac69e03ba66f2)

14 years agoAnother part of the fix for bug 6651 - smbd SIGSEGV when breaking oplocks. SA_INFO_QU...
Jeremy Allison [Thu, 3 Sep 2009 14:38:21 +0000 (07:38 -0700)]
Another part of the fix for bug 6651 - smbd SIGSEGV when breaking oplocks. SA_INFO_QUEUE_COUNT *MUST* be a power of 2, in order for the ring buffer wrap to work correctly at the 32 bit boundary. Thanks to Petr Vandrovec <petr@vandrovec.name> for this. (cherry picked from commit c97698e762b1ea8d7133f04ae822225676a6f135)

14 years agotevent: Fix a segfault upon the first signal
Volker Lendecke [Sat, 29 Aug 2009 07:41:32 +0000 (09:41 +0200)]
tevent: Fix a segfault upon the first signal

When the first signal arrives, tevent_common_signal_handler() crashed: "ev" is
initialized to NULL, so the first "write(ev->pipe_fds[1], &c, 1);" dereferences
NULL.

Rusty, Tridge, please check. Also, can you tell me a bit more about the
environment you tested this in? I'd be curious to see where this survived.

Thanks,

Volker
(cherry picked from commit 23abcd2318c69753aa2a144e1dc0f9cf9efdb705)

14 years agolib/tevent: close pipe_fds on event_context destruction
Rusty Russell [Fri, 28 Aug 2009 02:41:23 +0000 (12:11 +0930)]
lib/tevent: close pipe_fds on event_context destruction

The "hack_fds" were never closed before; now they're inside event_context
they should be closed when that is destroyed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(cherry picked from commit 76d91156c82e20bbd68c752376cb814d71759033)

14 years agolib/tevent: handle tevent_common_add_signal on different event contexts.
Rusty Russell [Fri, 28 Aug 2009 02:38:47 +0000 (12:08 +0930)]
lib/tevent: handle tevent_common_add_signal on different event contexts.

I don't know if this is a problem in real life.

The code assumes there's only one tevent_context; all signals will notify
the first event context.  That's counter-intuitive if you ever use more
than one, and there's nothing else in this code which prevents it AFAICT.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(cherry picked from commit be4ac227842530d484659f2db683453366326d8b)

14 years agolib/tevent: fix race with signals and tevent_common_add_signal
Rusty Russell [Fri, 28 Aug 2009 02:34:22 +0000 (12:04 +0930)]
lib/tevent: fix race with signals and tevent_common_add_signal

We carefully preserve the old signal handler, but we replace it before
we've set up everything; in particular, if we fail setting up the
pipe_hack we could write a NUL char to stdout (fd 0), instead of
calling the old signal handler.

Replace the signal handler as the very last thing we do.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(cherry picked from commit 6abb637e3e0d23635fdbbb91c163731b325d696d)

14 years agolib/tevent: remove spectacularly complicated manual subtraction
Rusty Russell [Wed, 26 Aug 2009 08:00:32 +0000 (17:30 +0930)]
lib/tevent: remove spectacularly complicated manual subtraction

To be completely honest, I don't quite know whether to laugh or cry at
this one:

1 + (0xFFFFFFFF & ~(s.seen - s.count))
== 1 + (~(s.seen - s.count)) # s.seen, s.count are uint32_t
== s.count - s.seen # -A == ~A + 1

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(cherry picked from commit 4279879c9847ca069527e11ca934b8906009cad8)

14 years agotevent: avoid using reserved c++ word.
Günther Deschner [Mon, 24 Aug 2009 12:27:13 +0000 (14:27 +0200)]
tevent: avoid using reserved c++ word.

Guenther
(cherry picked from commit 965a079535bd11a7870d45991a0d0628d6579b3b)

14 years agoFix for bug 6651 - smbd SIGSEGV when breaking oplocks. Based on a patch submitted...
Jeremy Allison [Fri, 21 Aug 2009 22:07:25 +0000 (15:07 -0700)]
Fix for bug 6651 - smbd SIGSEGV when breaking oplocks. Based on a patch submitted by Petr Vandrovec <petr@vandrovec.name>. Multiple pending signals with siginfo_t's weren't being handled correctly leading to smbd abort with kernel oplock signals. Jeremy (cherry picked from commit ba52f18bfecfd7b0ba22c4ad9e9b5bfd18f34c93)