samba.git
14 years agos3-spoolss: Added EN ISO 216, A0 and A1 to builtin forms.
Andreas Schneider [Wed, 12 May 2010 16:36:30 +0000 (18:36 +0200)]
s3-spoolss: Added EN ISO 216, A0 and A1 to builtin forms.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
(cherry picked from commit 0953087f82ddbd580e9807e0e8d780e78686c03c)

Fix bug #7423 (Large Formats at printing not available).

14 years agoWHATSNEW: Prepare Samba 3.5.4 release notes.
Karolin Seeger [Wed, 19 May 2010 09:52:06 +0000 (11:52 +0200)]
WHATSNEW: Prepare Samba 3.5.4 release notes.

Karolin

14 years agoVERSION: Bump version number up to 3.5.4.
Karolin Seeger [Wed, 19 May 2010 09:49:08 +0000 (11:49 +0200)]
VERSION: Bump version number up to 3.5.4.

Karolin

14 years agoWHATSNEW: Add major enhancements in 3.5.3.
Karolin Seeger [Mon, 17 May 2010 11:49:42 +0000 (13:49 +0200)]
WHATSNEW: Add major enhancements in 3.5.3.

Karolin

14 years agoWHATSNEW: Update changes since 3.5.2.
Karolin Seeger [Mon, 17 May 2010 08:21:08 +0000 (10:21 +0200)]
WHATSNEW: Update changes since 3.5.2.

Karolin

14 years agomount.cifs: check for NULL addr pointer before handling scopeid
Jeff Layton [Wed, 12 May 2010 11:05:10 +0000 (07:05 -0400)]
mount.cifs: check for NULL addr pointer before handling scopeid

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Fix bug #7315 (mount.cifs segfaults after upgrade to 2.6.33).

14 years agos3-docs: Unify capitalization.
Karolin Seeger [Wed, 12 May 2010 14:21:56 +0000 (16:21 +0200)]
s3-docs: Unify capitalization.

Karolin
(cherry picked from commit da64913f55fa2c3d0b34cda3b8c4953894c4ed66)

14 years agos3-docs: Add documentation of the net g_lock subcommand.
Karolin Seeger [Wed, 12 May 2010 14:17:33 +0000 (16:17 +0200)]
s3-docs: Add documentation of the net g_lock subcommand.

Karolin
(cherry picked from commit ad6f63822915463011074c9e5f3ed938b48579f4)

14 years agos3-docs: Move -D option to the right paragraph in man winbindd.
Karolin Seeger [Wed, 12 May 2010 09:24:57 +0000 (11:24 +0200)]
s3-docs: Move -D option to the right paragraph in man winbindd.

Fix bug #7260 (Command line option documentation in wrong place in winbindd man
page.). Thanks to Ged Haywood <samba@jubileegroup.co.uk> for reporting!

Karolin
(cherry picked from commit da5c49d727150eea7d2a4b83da1a02ac1f26e77c)

14 years agowork around AIX6.1 name space pollution rename mod_name to module_name
Olaf Flebbe [Tue, 11 May 2010 09:30:04 +0000 (11:30 +0200)]
work around AIX6.1 name space pollution rename mod_name to module_name

Fix bug #7421 (samba 3.4.7 does not compile on AIX 6.1).

14 years agolib/replace: make sure IPV6_V6ONLY is available for IPv6 support
Stefan Metzmacher [Sat, 24 Apr 2010 11:07:50 +0000 (13:07 +0200)]
lib/replace: make sure IPV6_V6ONLY is available for IPv6 support

We rely on IPV6_V6ONLY being supported. See bug #7196.

metze
(cherry picked from commit 41cd6f992829c45c890f5daf78eb3019633f3620)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agolib/replace: add replacement for IPV6_V6ONLY on linux systems with broken headers
Stefan Metzmacher [Sat, 24 Apr 2010 17:02:22 +0000 (19:02 +0200)]
lib/replace: add replacement for IPV6_V6ONLY on linux systems with broken headers

This is needed on SLES8. See bug 7196.

metze
(cherry picked from commit e06cf3950252a46486aa046a4552ed6ebff175b3)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agotsocket_bsd: Always use a real length for the sa_socklen, and keep it around
Andrew Bartlett [Wed, 7 Apr 2010 00:42:37 +0000 (10:42 +1000)]
tsocket_bsd: Always use a real length for the sa_socklen, and keep it around

The previous code assumed the OS would happily accept sizeof(struct
sockaddr_storage).  It seems some versions of Solaris do not like
this.

Andrew Bartlett
(cherry picked from commit f1aa4c34bf0bd7d42627024af333963b741babea)

Fix for bug #7354.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agotsocket: only copy the specific part of sockaddr*
Stefan Metzmacher [Wed, 23 Dec 2009 18:34:32 +0000 (19:34 +0100)]
tsocket: only copy the specific part of sockaddr*

This makes sure we fill the unspefic bytes with 0
and have zero termination for sockaddr_un.

metze
(cherry picked from commit 17c804a67593cdb4d8646b5be6b50fddf56b3e27)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agotsocket: allow AF_UNIX sockaddrs smaller than sizeof(sockaddr_un)
Stefan Metzmacher [Wed, 23 Dec 2009 18:31:41 +0000 (19:31 +0100)]
tsocket: allow AF_UNIX sockaddrs smaller than sizeof(sockaddr_un)

This is needed as getpeername() truncates the length to 2 if the
peer socket has no name.

metze
(cherry picked from commit 4784c8c3bea98592486ca973d57c99671eb68cb2)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agos3:configure: use correct SONAMEFLAG on Solaris depending on which linker is being...
Björn Jacke [Fri, 7 May 2010 09:56:38 +0000 (11:56 +0200)]
s3:configure: use correct SONAMEFLAG on Solaris depending on which linker is being used
(cherry picked from commit 358a3855c20153d7fe742ca2e6b9bd8a9c92e525)

Fix bug #7385 (Can't compile. Undefined symbol 'main').

14 years agos3:configure: not simply check for "ld" but for the linker used by $CC
Björn Jacke [Wed, 5 May 2010 18:17:39 +0000 (20:17 +0200)]
s3:configure: not simply check for "ld" but for the linker used by $CC

this hopefully fixes Solaris' gcc build which uses the system ld by default.
All in all we should clean up most of the compiler and linker flags depending
on the actual compilers and linkers we use. Only some tweaks are OS-specific.
A cleanup in this area should be done along with the move to a new build
system (whensoever that will be ...).
(cherry picked from commit 1969b4acc3fd7c124e288d0495b9b4665d4b42db)

Fix bug #7385 (Can't compile. Undefined symbol 'main').

14 years agos3-net: Fix Bug #7417. 'net rpc user password' can set the wrong password.
Günther Deschner [Sat, 8 May 2010 00:16:37 +0000 (02:16 +0200)]
s3-net: Fix Bug #7417. 'net rpc user password' can set the wrong password.

Guenther
(cherry picked from commit 7887d99a60387e93ce5ce4a3bfe9117939d1e4c8)

14 years agos3-spoolss: Fix _spoolss_EnumPrinters servername handling.
Günther Deschner [Thu, 18 Feb 2010 11:40:00 +0000 (12:40 +0100)]
s3-spoolss: Fix _spoolss_EnumPrinters servername handling.

Guenther
(cherry picked from commit b3c2b2260a503079b9abf22f6b35b56c61c2b372)

The last two patches address bug #7418 ("net rpc printer list" command is
inoperative).

14 years agos3-spoolss: in spoolss_EnumPrinters r->in.server is a *unique* pointer!
Günther Deschner [Thu, 18 Feb 2010 01:03:53 +0000 (02:03 +0100)]
s3-spoolss: in spoolss_EnumPrinters r->in.server is a *unique* pointer!

Guenther
(cherry picked from commit 8ce66fba03f782c0b9948a9835bb488cfa74acf9)

14 years agoFix bug #7263 - Unable to print using Samba 3.5.1 and cups-1.1.23-40.46 on SLES10.
Luca Olivetti [Tue, 4 May 2010 22:07:57 +0000 (15:07 -0700)]
Fix bug #7263 - Unable to print using Samba 3.5.1 and cups-1.1.23-40.46 on SLES10.

Fix cups encryption setting

I had the same problem and it's due to the fact that samba doesn't respect the
"cups encryption" setting since lp_cups_encrypt changes the value: if you set
"cups encryption=no", the first call will change it to HTTP_ENCRYPT_NEVER,
since that is 1 (i.e. true), the next call will change it to
HTTP_ENCRYPT_ALWAYS and after that it'll remain set as HTTP_ENCRYPT_ALWAYS.
This patch fixes this problem.

Don't mix up the HTTP_ENCRYPT_XXX constants up with the
enumeration constants (True, False, Auto) used in the
loadparm code.
(cherry picked from commit a9e008ee36c8fd9ca79b3bdfdc78111939c3e539)

14 years agos3-rpcclient: Fix Bug #7277. rpcclient was sending invalid data, causing cupsaddsmb...
Günther Deschner [Mon, 3 May 2010 13:54:14 +0000 (15:54 +0200)]
s3-rpcclient: Fix Bug #7277. rpcclient was sending invalid data, causing cupsaddsmb to fail.

Guenther
(cherry picked from commit 9cc10e6a5742f09261f01a2c0b3a94b7b772e573)

14 years agotsocket: Improve the tsocket_address_bsd_sockaddr documentation.
Andreas Schneider [Thu, 25 Feb 2010 13:32:39 +0000 (14:32 +0100)]
tsocket: Improve the tsocket_address_bsd_sockaddr documentation.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agoSpelling fixes for tsocket API documentation.
Brad Hards [Sun, 21 Feb 2010 05:34:22 +0000 (16:34 +1100)]
Spelling fixes for tsocket API documentation.

Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
(cherry picked from commit 319d3bf9d93ddfc1afbfb0c759f6d91906f915c1)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agotsocket: Fix the description of tstream_writev_queue_send/recv (cherry picked from...
Kai Blin [Thu, 28 Jan 2010 10:16:24 +0000 (11:16 +0100)]
tsocket: Fix the description of tstream_writev_queue_send/recv (cherry picked from commit 88099bcc93fabebe3d4548f8a5aa26b585886a1c)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agotsocket: Fix description for tstream_readv_pdu_queue_send/recv (cherry picked from...
Kai Blin [Thu, 28 Jan 2010 10:11:33 +0000 (11:11 +0100)]
tsocket: Fix description for tstream_readv_pdu_queue_send/recv (cherry picked from commit 9184f524f0e5fe828b723200182969e0e3e8685d)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agotsocket: Added complete doxygen documentation.
Andreas Schneider [Wed, 16 Dec 2009 12:26:48 +0000 (13:26 +0100)]
tsocket: Added complete doxygen documentation.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agotsocket: Added doxygen config file.
Andreas Schneider [Mon, 21 Dec 2009 11:44:00 +0000 (12:44 +0100)]
tsocket: Added doxygen config file.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agos3: Fix bug 7398 -- rename problems with full_audit
Volker Lendecke [Thu, 29 Apr 2010 18:07:35 +0000 (20:07 +0200)]
s3: Fix bug 7398 -- rename problems with full_audit

14 years agos3/packaging: make rpm build work by overriding strict linker flags
Björn Jacke [Tue, 27 Apr 2010 15:06:55 +0000 (17:06 +0200)]
s3/packaging: make rpm build work by overriding strict linker flags
(cherry picked from commit 8f74d38c3a4a853f608fed0bed1b55915d01555a)

14 years agos3: Fix a winbind crash when scanning trusts
Volker Lendecke [Wed, 21 Apr 2010 15:04:49 +0000 (17:04 +0200)]
s3: Fix a winbind crash when scanning trusts

add_trusted_domain() for a new domain always needs to be followed by a
setup_domain_child(). This was not always done, in particular not when walking
to the forest root for additional trusts.

This is a minimal patch, we need to fix add_trusted_domain().

Fix bug #7389 (Fix a winbind crash when scanning trusted domains).

14 years agoFix bug #7384 - dptr_Close has a bitmap leak.
Ira Cooper [Fri, 23 Apr 2010 17:55:46 +0000 (10:55 -0700)]
Fix bug #7384 - dptr_Close has a bitmap leak.

s3: Fix to dptr_Close

This fixes a bitmap "leak" in dptr_Close by making it use the same internal
routines the rest of the code does.
(cherry picked from commit dd2025947136f28b22b70de59309e149a1f45f3d)

14 years agos3-net_conf: Display an error on net conf import failures.
Jim McDonough [Wed, 21 Apr 2010 18:51:54 +0000 (20:51 +0200)]
s3-net_conf: Display an error on net conf import failures.

When something goes wrong, such as a typo in a parameter
name, we'll now display the failure instead of just returning
with -1 and no message.

Fix bug #7378 ("net conf import" fails silently on parameter typo).

14 years agos3 torture: Prevent smbcli segfault when running smbtorture3 against an smbd with...
Tim Prouty [Mon, 4 Jan 2010 20:57:34 +0000 (12:57 -0800)]
s3 torture: Prevent smbcli segfault when running smbtorture3 against an smbd with security=share

Fix bug #7370 (3.5.2 smbclient segfaults when used against old samba
"security = share").

14 years agos3-docs: Improve "winbind nss info" section in man smb.conf.
Karolin Seeger [Fri, 16 Apr 2010 07:23:30 +0000 (09:23 +0200)]
s3-docs: Improve "winbind nss info" section in man smb.conf.

Karolin
(cherry picked from commit 20fc769179377bf037f4d5efe1afbaf77d4c9292)

14 years agoFix bug #7288 - SMB job IDs in CUPS job names wrong.
Jeremy Allison [Fri, 26 Mar 2010 01:22:16 +0000 (18:22 -0700)]
Fix bug #7288 - SMB job IDs in CUPS job names wrong.

Based on a patch from Michael Karcher <samba@mkarcher.dialup.fu-berlin.de>.

I think this is the correct fix. It causes cups_job_submit to use
print_parse_jobid(), which I've moved into printing/lpq_parse.c (to allow the
link to work).

It turns out the old print_parse_jobid() was *broken*, in that the pjob
filename was set as an absolute path - not relative to the sharename (due to it
not going through the VFS calls).

This meant that the original code doing a strncmp on the first part of the
filename would always fail - it starts with a "/", not the relative pathname of
PRINT_SPOOL_PREFIX ("smbprn.").

This fix could fix some other mysterious printing bugs - probably the ones
Guenther noticed where job control fails on non-cups backends.

Contains c79ca41baf15b4ef7eb287d343b17a53ba41e852 and
92332fb2368c641db1552d1f2a2f7b3deaa11519 from master.

Jeremy.

14 years agos3-libsmbclient: Fix incomplete description of function return values in libsmbclient.h.
Derrell Lipman [Tue, 13 Apr 2010 18:32:14 +0000 (20:32 +0200)]
s3-libsmbclient: Fix incomplete description of function return values in libsmbclient.h.

Fix bug #7345.

14 years agolibwbclient: Re-Fix a bug that was fixed with e5741e27c4c
Volker Lendecke [Tue, 13 Apr 2010 10:09:21 +0000 (12:09 +0200)]
libwbclient: Re-Fix a bug that was fixed with e5741e27c4c

> r21878: Fix a bug with smbd serving a windows terminal server: If winbind
> decides smbd to be idle it might happen that smbd needs to do a winbind
> operation (for example sid2name) as non-root. This then fails to get the
> privileged pipe. When later on on the same connection another authentication
> request comes in, we try to do the CRAP auth via the non-privileged pipe.
>
> This adds a winbindd_priv_request_response() request that kills the existing
> winbind pipe connection if it's not privileged.

The fix for this was lost during the conversion to libwbclient.

Thanks to Ira Cooper <samba@ira.wakeful.net> for pointing this out!

Volker

Fix bug #7357.

14 years agos3:winbindd: make "smbcontrol winbindd validate-cache" reliable again
Stefan Metzmacher [Thu, 8 Apr 2010 10:45:54 +0000 (12:45 +0200)]
s3:winbindd: make "smbcontrol winbindd validate-cache" reliable again

commit 73577205cf81644e7fe853eaf3e6459f7f443096
(s3:winbindd: fix problems with SIGCHLD handling (bug #7317))
broke this.

metze
(cherry picked from commit eb9b7d0363669574de8ec380089407890f15eac2)

14 years agos3:winbindd: remove unused variables
Stefan Metzmacher [Thu, 1 Apr 2010 16:10:47 +0000 (18:10 +0200)]
s3:winbindd: remove unused variables

metze
(cherry picked from commit e18ddb6036f5e0a2211e89a7c9b5514c30a653cf)

14 years agos3:winbindd: fix problems with SIGCHLD handling (bug #7317)
Stefan Metzmacher [Thu, 1 Apr 2010 14:23:06 +0000 (16:23 +0200)]
s3:winbindd: fix problems with SIGCHLD handling (bug #7317)

The main problem is that we call CatchChild() within the
parent winbindd, which overwrites the signal handler
that was registered by winbindd_setup_sig_chld_handler().

That means winbindd_sig_chld_handler() and winbind_child_died()
are never triggered when a winbindd domain child dies.
As a result will get "broken pipe" for all requests to that domain.

To reduce the risk of similar bugs in future we call
CatchChild() in winbindd_reinit_after_fork() now.

We also use a full winbindd_reinit_after_fork() in the
cache validation child now instead instead of just resetting
the SIGCHLD handler by hand. This will also fix possible
tdb problems on systems without pread/pwrite and disabled mmap
as we now correctly reopen the tdb handle for the child.

metze
(cherry picked from commit 73577205cf81644e7fe853eaf3e6459f7f443096)

14 years agos3-docs: Fix typo in man idmap_ad.
Karolin Seeger [Tue, 13 Apr 2010 18:06:14 +0000 (20:06 +0200)]
s3-docs: Fix typo in man idmap_ad.

Karolin
(cherry picked from commit 6389fac6db2f54d148222009b5e209cef5c6bdd7)

14 years agos3:lib/time: remove TIME_T_MIN/MAX defines
Björn Jacke [Wed, 6 Jan 2010 23:41:50 +0000 (00:41 +0100)]
s3:lib/time: remove TIME_T_MIN/MAX defines

we already get them from lib/util/time.h
(cherry picked from commit f5729dbb6e720cb6076ea053f1ad0680259e6b39)

The last two patches address bug #7352 (TIME_T_MAX defines inconsistent).

14 years agolib/util: move TIME_T_MIN/MAX defines into header file (cherry picked from commit...
Björn Jacke [Wed, 6 Jan 2010 23:40:09 +0000 (00:40 +0100)]
lib/util: move TIME_T_MIN/MAX defines into header file (cherry picked from commit 571ee54b791b93ad46e09ed563ef4a5582dcf0c8)

14 years agoFix bug #7339 - MSDFS is non-functional in 3.5.x
Jeremy Allison [Fri, 9 Apr 2010 03:32:36 +0000 (20:32 -0700)]
Fix bug #7339 - MSDFS is non-functional in 3.5.x

In the refactoring around filename_convert, the split between the functions
resolve_dfspath() and resolve_dfspath_wcard() was lost, leaving us only with
resolve_dfspath_wcard().

Internally resolve_dfspath_wcard() calls dfs_redirect() only with a
"allow_wcards" flag of true, wheras the old resolve_dfspath() would call with a
value of false. The loss of this case causes dfs_redirect to always masquerade
DFS links as directories, even when they are being queried directly by a trans2
QPATHINFO call. We should only masquerade DFS links as directories when called
from a SMBsearch or trans2 findfirst/findnext - which was the intent of the
"allow_wcards" flag.

This patch adds back an allow_wcards bool parameter to
resolve_dfspath_wcard(). This bool is set from the state of the ucf_flags when
filename_convert() is called.

I will follow this up with a new smbclient-based torture test that will prevent
us from ever regressing our DFS support again.

Jeremy.
(cherry picked from commit 358781559526f962c96c1af88cd104946c507d05)

14 years agoWHATSNEW: Start release notes for Samba 3.5.3.
Karolin Seeger [Wed, 7 Apr 2010 08:41:07 +0000 (10:41 +0200)]
WHATSNEW: Start release notes for Samba 3.5.3.

Karolin

14 years agoVERSION: Raise version number up to 3.5.3.
Karolin Seeger [Wed, 7 Apr 2010 08:39:08 +0000 (10:39 +0200)]
VERSION: Raise version number up to 3.5.3.

Karolin

14 years agoWHATSNEW: Update changes since 3.5.1.
Karolin Seeger [Thu, 1 Apr 2010 13:25:13 +0000 (15:25 +0200)]
WHATSNEW: Update changes since 3.5.1.

Karolin

14 years agos3:winbindd: make sure we don't try rpc requests against unaccessable domains
Stefan Metzmacher [Thu, 1 Apr 2010 07:29:38 +0000 (09:29 +0200)]
s3:winbindd: make sure we don't try rpc requests against unaccessable domains

This makes sure we don't crash while trying to dereference domain->conn.cli->foo
while trying to establish a rpc connection to the server.

This fixes bug #7316.

metze
(cherry picked from commit d930904b997d310aeff781bde1e7e3ce47dde8a1)

14 years agoWHATSNEW: Update changes since 3.5.1.
Karolin Seeger [Thu, 1 Apr 2010 09:32:46 +0000 (11:32 +0200)]
WHATSNEW: Update changes since 3.5.1.

Karolin

14 years agoWHATSNEW: Prepare release notes for Samba 3.5.2.
Karolin Seeger [Thu, 1 Apr 2010 09:22:59 +0000 (11:22 +0200)]
WHATSNEW: Prepare release notes for Samba 3.5.2.

Karolin

14 years agos3: signals are processed twice in child.
Bo Yang [Tue, 9 Feb 2010 09:02:20 +0000 (17:02 +0800)]
s3: signals are processed twice in child.

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

Fix bug #7206 (duplicate signal handler, signals are processed twice in child
process).

14 years agoFix bug 7310 - DOS attribute inconsistency with MS Office
Jeremy Allison [Wed, 31 Mar 2010 05:16:37 +0000 (22:16 -0700)]
Fix bug 7310 - DOS attribute inconsistency with MS Office

On rename we need to set the archive bit on the renamed file.

Jeremy

14 years agos3:registry: eliminate race condition in creating/scanning sorted subkeys
Michael Adam [Mon, 8 Feb 2010 10:01:47 +0000 (11:01 +0100)]
s3:registry: eliminate race condition in creating/scanning sorted subkeys

Called, from key_exists, scan_sorted_subkeys re-creates the sorted
subkeys record of the given key and then searches through it.
The race is that between creation and parsing of the sorted subkey
record, another process that stores some other subkey of the same
parent key will delete the sorted subkey record, resulting in an
WERR_BADFILE of an operation that should actually succeed.

This patch fixes the issue by wrapping the creation and parsing
into a transaction.

Michael
(cherry picked from commit a752bbd10d661ebc93b8d51bd583eb62eb00ad18)

Fix bug #7314 (registry: creation of sorted subkey record is racy (not atomic)).

14 years agos3:make "net conf addshare" atomic by wrapping all writes in one transaction
Michael Adam [Fri, 29 Jan 2010 14:04:25 +0000 (15:04 +0100)]
s3:make "net conf addshare" atomic by wrapping all writes in one transaction

Michael
(cherry picked from commit 09f3ed102472304d6b4446a6fab9cf6f05c9176a)

Fix bug #7313 (Net conf addshare is not atomic).

14 years agos3: Remove the unused parameter "persistent" from fetch_locked_internal (cherry picke...
Volker Lendecke [Fri, 5 Mar 2010 14:30:22 +0000 (15:30 +0100)]
s3: Remove the unused parameter "persistent" from fetch_locked_internal (cherry picked from commit a5db27936e9c6aad99300ea46808481803f57e08)

The last 32 patches address bug #7232 (CTDB persistent transactions are racy).

14 years agos3: db->persistent==true was handled earlier, make this more obvious (cherry picked...
Volker Lendecke [Fri, 5 Mar 2010 14:28:39 +0000 (15:28 +0100)]
s3: db->persistent==true was handled earlier, make this more obvious (cherry picked from commit c7835a4845bbc7e4d340a75229866b2d4946f6eb)

14 years agos3: Add "g_lock_do" as a convenience wrapper function (cherry picked from commit...
Volker Lendecke [Fri, 12 Mar 2010 13:22:54 +0000 (14:22 +0100)]
s3: Add "g_lock_do" as a convenience wrapper function (cherry picked from commit 79100c242153ea174a4405afd45cbf635da313aa)

14 years agos3: Fix timeout calculation if g_lock_lock is given a timeout < 60s
Volker Lendecke [Tue, 16 Feb 2010 14:21:25 +0000 (15:21 +0100)]
s3: Fix timeout calculation if g_lock_lock is given a timeout < 60s

Detected while showing this code to obnox :-)
(cherry picked from commit f8b246e44c819b909b23b4b98ef0999c84d2f4ff)

14 years agos3: Slightly increase parallelism in g_lock
Volker Lendecke [Tue, 16 Feb 2010 11:31:58 +0000 (12:31 +0100)]
s3: Slightly increase parallelism in g_lock

There's no need to still hold the g_lock tdb-level lock while telling the
waiters to retry
(cherry picked from commit 83542d973ca771353109c7da4b0391d6ba910f53)

14 years agos3: Avoid starving locks when many processes die at the same time
Volker Lendecke [Tue, 16 Feb 2010 11:28:53 +0000 (12:28 +0100)]
s3: Avoid starving locks when many processes die at the same time

In g_lock_unlock we have a little race between the process_exists and
messaging_send call: We only send to 5 waiters now, they all might have died
between us checking their existence and sending the message. This change makes
g_lock_lock retry at least once every minute.
(cherry picked from commit be919d6faed198cdc29322a4d9491946c0b044b3)

14 years agos3: Avoid a thundering herd in g_lock_unlock
Volker Lendecke [Tue, 16 Feb 2010 11:22:08 +0000 (12:22 +0100)]
s3: Avoid a thundering herd in g_lock_unlock

Only notify the first 5 pending lock waiters. This avoids a thundering herd
problem that is really nasty in a cluster. It also makes acquiring a lock a bit
more FIFO, lock waiters are added to the end of the array.
(cherry picked from commit 725b3654f831fbe0388cc09f46269903c9eef1d7)

14 years agos3: Optimize g_lock_lock for a heavily contended case
Volker Lendecke [Mon, 15 Feb 2010 15:57:16 +0000 (16:57 +0100)]
s3: Optimize g_lock_lock for a heavily contended case

Only check the existence of the lock owner in g_lock_parse, check the rest of
the records only when we got the lock successfully. This reduces the load on
process_exists which can involve a network roundtrip in the clustered case.
(cherry picked from commit 07978bd175395e0dc770f68fff5b8bd8b0fdeb51)

14 years agos3: Fix handling of processes that died in g_lock
Volker Lendecke [Mon, 15 Feb 2010 15:49:46 +0000 (16:49 +0100)]
s3: Fix handling of processes that died in g_lock

g_lock_parse might have thrown away entries from the locks array because the
processes were not around anymore. Don't store the orphaned entries.
(cherry picked from commit f3bdb163f461175c50b4930fa3464beaee30f4a8)

14 years agos3: Fix a typo (cherry picked from commit bac235dd302570850bb25194ff4bd39b6d653f0d)
Volker Lendecke [Mon, 15 Feb 2010 15:35:06 +0000 (16:35 +0100)]
s3: Fix a typo (cherry picked from commit bac235dd302570850bb25194ff4bd39b6d653f0d)

14 years agoFix warning messages on compile in g_lock.c Volker & Michael please check.
Jeremy Allison [Sat, 13 Feb 2010 06:21:19 +0000 (22:21 -0800)]
Fix warning messages on compile in g_lock.c Volker & Michael please check.

Jeremy.
(cherry picked from commit 10e54fb422d9f1ae6d33e5fabbf8c651b0e57a8c)

14 years agos3:g_lock: remove a nested event loop, replacing the inner loop by select
Michael Adam [Sat, 23 Jan 2010 00:17:06 +0000 (01:17 +0100)]
s3:g_lock: remove a nested event loop, replacing the inner loop by select

This made smbd crash in g_lock_lock() when trying to start a
transaction on a db with an already started transaction,
e.g. in a tcon_and_X where the share_info.tdb was not yet
initialized but share_info.tdb was already locked by another
process or writing acces to the winreg rpc pipe where the
registry tdb was already locked by another process.

What we really _want_ to do here by design is to react to
MSG_DBWRAP_G_LOCK_RETRY messages that are either sent
by a client doing g_lock_unlock or by ourselves when
we receive a CTDB_SRVID_SAMBA_NOTIFY or
CTDB_SRVID_RECONFIGURE message from ctdbd, i.e. when
either a client holding a lock or a complete node
has died.

Doing this properly involves calling tevent_loop_once(),
but doing this here with the main ctdbd messaging context
creates a nested event loop when g_lock_lock() is called
from the main event loop.

So as a quick fix, we act a little corasely here: we do
a select on the ctdb connection fd and when it is readable
or we get EINTR, then we retry without actually parsing
any ctdb packages or dispatching messages. This means that
we retry more often than necessary and intended by design,
but this does not harm and it is unobtrusive. When we have
finished, the main loop will pick up all the messages and
ctdb packets. The only extra twist is that we cannot use
timed events here but have to handcode a timeout for select.

Michael
(cherry picked from commit 83fffbeb44441a87569e543054af21d975eb20ae)

14 years agos3:ctdb_conn: add ctdbd_conn_get_fd() to get the fd out of the ctdb connection
Michael Adam [Fri, 22 Jan 2010 23:05:15 +0000 (00:05 +0100)]
s3:ctdb_conn: add ctdbd_conn_get_fd() to get the fd out of the ctdb connection

Michael
(cherry picked from commit e4af0bc5af2c3ee025ca7fac251c3672ba2c8dd5)

14 years agos3:g_lock: remove an unreached code path.
Michael Adam [Fri, 22 Jan 2010 14:56:28 +0000 (15:56 +0100)]
s3:g_lock: remove an unreached code path.

Michael
(cherry picked from commit 8e306b51b79d3dacd68be9f13aa8455e2eb4c03f)

14 years agos3:dbwrap_ctdb: fix reading/storing of special key __db_sequence_number__
Michael Adam [Mon, 18 Jan 2010 16:26:04 +0000 (17:26 +0100)]
s3:dbwrap_ctdb: fix reading/storing of special key __db_sequence_number__

The key for reading and writing was inconsistent due to a
off by one data length.

Michael
(cherry picked from commit 1933214108d1a71bc6473a696ce35020a427d8f4)

14 years agos3:dbwrap_ctdb: exit early when nothing has been written in transaction_commit.
Michael Adam [Wed, 13 Jan 2010 22:53:54 +0000 (23:53 +0100)]
s3:dbwrap_ctdb: exit early when nothing has been written in transaction_commit.

This skips update of the __db_sequence_number__ record when nothing else has
been written. There are transactions that are just openend and then nothing
is written until transaction_commit is called. This is for instance the case
with registry initialization routines: They start a transaction and only
write somthing when the registry has not been initialized yet.
So this change will skip many db_seqnum bumps and TRANS3_COMMIT roundtrips.

Michael
(cherry picked from commit c311697aded87ce624d40cbf14e05d6e6377c257)

14 years agos3:dbwrap_ctdb: fix brown paperbag bug in ctdb_transaction_commit.
Michael Adam [Wed, 13 Jan 2010 22:51:34 +0000 (23:51 +0100)]
s3:dbwrap_ctdb: fix brown paperbag bug in ctdb_transaction_commit.

I carefully prepared the return value only to "return 0;" at the bottom. :-(
This may well have hit us for instance in the nested cancel case
and produced random errors.

Michael
(cherry picked from commit 1d594bd734a2f7146ed52872456a16c5e41816f1)

14 years agos3:dbwrap_ctdb: fix logic error in pull_newest_from_marshall_buffer().
Michael Adam [Tue, 5 Jan 2010 23:37:21 +0000 (00:37 +0100)]
s3:dbwrap_ctdb: fix logic error in pull_newest_from_marshall_buffer().

The logic bug was that if a record was found in the marshall buffer,
then always the ctdb header of tha last record in the marshall buffer
was returned, and not the ctdb header of the last occurrence of the
requested record.

This is fixed by introducing an additional temporary variable.

Michael
(cherry picked from commit 524072b56bf659002410a817749bf86fe6f51e83)

14 years agos3:dbwrap_ctdb: fix an uninitialized variable.
Michael Adam [Tue, 5 Jan 2010 15:17:27 +0000 (16:17 +0100)]
s3:dbwrap_ctdb: fix an uninitialized variable.

Michael
(cherry picked from commit 1505b69dea6044a13a59f672e22f5833256cb981)

14 years agos3:dbwrap_ctdb: fix two "may be used uninitialized" warnings
Michael Adam [Fri, 11 Dec 2009 23:38:14 +0000 (00:38 +0100)]
s3:dbwrap_ctdb: fix two "may be used uninitialized" warnings

Michael
(cherry picked from commit fb981cdb8282d3b9b46d9ca515a5685add232a72)

14 years agos3:dbwrap_ctdb: fix db_ctdb_fetch_db_seqnum_from_db() when NT_STATUS_NOT_FOUND.
Michael Adam [Fri, 11 Dec 2009 23:30:37 +0000 (00:30 +0100)]
s3:dbwrap_ctdb: fix db_ctdb_fetch_db_seqnum_from_db() when NT_STATUS_NOT_FOUND.

Don't treat this as an error but return seqnum 0 instead.

Michael
(cherry picked from commit 10a44ee6930bb51b4b20ce42f35bc455ac1b7293)

14 years agos3:build: remove checks for deprecated ctdb controls.
Michael Adam [Fri, 11 Dec 2009 15:45:38 +0000 (16:45 +0100)]
s3:build: remove checks for deprecated ctdb controls.

Michael
(cherry picked from commit 9113ce82b59c718ac709eb01b125e9e6746a96b7)

14 years agos3:dbwrap_ctdb: maintain a database sequence number that bumps in transactions
Michael Adam [Fri, 11 Dec 2009 13:07:28 +0000 (14:07 +0100)]
s3:dbwrap_ctdb: maintain a database sequence number that bumps in transactions

For persistent databases, 64bit integer is kept in a special record
__db_sequence_number__. This record is incremented with each completed
transaction.

The retry mechanism for failing TRANS3_COMMIT controls inside the
db_ctdb_transaction_commit() function now relies one a modified
behaviour of ctdbd's treatment of persistent databases in recoveries.
Recently, a special treatment for persistent databases had been
introduced in ctdb (1.0.108) to work around the problems with the
orinal design of persistent transactions.
Now with the rewrite we need to revert to the old behaviour that
ctdb always takes the newest copies of all records.

This change also paves the way for a next step, which will make
recovery use the db seqnum to tell which node has the newest copy
of a persistent db and use that node's copy. This will greatly
reduce the amount of data transferred with each recovery.

Michael
(cherry picked from commit 3fe7ce141d6afe3825b06c5feb90558911e4df1e)

14 years agos3:dbwrap_ctdb: change db_ctdb_transaction_store() to return NTSTATUS.
Michael Adam [Fri, 11 Dec 2009 11:30:57 +0000 (12:30 +0100)]
s3:dbwrap_ctdb: change db_ctdb_transaction_store() to return NTSTATUS.

The return values calculated by the callers were wrong anyways since
the new marshalling code does not set the local tdbs tdb error code.

Michael
(cherry picked from commit 26225d3e798892b39b3c238b0bee465bffac6550)

14 years agos3:dbwrap_ctdb: update (C)
Michael Adam [Fri, 11 Dec 2009 09:35:50 +0000 (10:35 +0100)]
s3:dbwrap_ctdb: update (C)

Michael
(cherry picked from commit 5a0c42770b349877928a2b3fd8316903dd62e5b7)

14 years agobuild: Add a configure check for CTDB_CONTROL_TRANS3_COMMIT.
Michael Adam [Fri, 4 Dec 2009 10:49:21 +0000 (11:49 +0100)]
build: Add a configure check for CTDB_CONTROL_TRANS3_COMMIT.

This is the new implementation of ctdb transactions using the
global lock feature. It is needed by the current dbwrap_ctdb code.

Michael
(cherry picked from commit d4c0afa841ecdae1cab955cc73360deae23f5873)

14 years agos3:dbwrap_ctdb: start rewrite of transactions using the global lock (g_lock)
Michael Adam [Thu, 3 Dec 2009 16:29:54 +0000 (17:29 +0100)]
s3:dbwrap_ctdb: start rewrite of transactions using the global lock (g_lock)

This simplifies the transaction code a lot:

* transaction_start essentially consists of acquiring a global lock.

* No write operations at all are performed on the local database
  until the transaction is committed: Every store operation is just
  going into the marshall buffer.

* The commit operation calls a new simplified TRANS3_COMMIT control
  in ctdb which rolls out thae changes to all nodes including the
  node that is performing the transaction.

Michael
(cherry picked from commit 16bc6ba2268e3660d026076264de8666356e00bf)

14 years agos3: Add tdb_data_equal (cherry picked from commit ebc08b9938a4d266be16ca7e06d27813952...
Volker Lendecke [Thu, 3 Dec 2009 17:43:49 +0000 (18:43 +0100)]
s3: Add tdb_data_equal (cherry picked from commit ebc08b9938a4d266be16ca7e06d27813952cd00f)

14 years agos3:torture: add a test LOCAL-DBTRANS to torture dbwrap with transactions.
Volker Lendecke [Fri, 11 Dec 2009 14:37:52 +0000 (15:37 +0100)]
s3:torture: add a test LOCAL-DBTRANS to torture dbwrap with transactions.

14 years agos3: setup debug for smbtorture (cherry picked from commit b13dd17840a598ae3441e48b130...
Volker Lendecke [Sun, 6 Dec 2009 23:36:51 +0000 (00:36 +0100)]
s3: setup debug for smbtorture (cherry picked from commit b13dd17840a598ae3441e48b130a2b2a2b940572)

14 years agos3: Add ctdb_conn_msg_ctx() (cherry picked from commit 12abab711b58237ddccfa1d9bb526f...
Volker Lendecke [Fri, 4 Dec 2009 12:22:30 +0000 (13:22 +0100)]
s3: Add ctdb_conn_msg_ctx() (cherry picked from commit 12abab711b58237ddccfa1d9bb526f8c7dbb6e9f)

14 years agos3: Implement global locks in a g_lock tdb
Volker Lendecke [Sun, 25 Oct 2009 15:12:12 +0000 (16:12 +0100)]
s3: Implement global locks in a g_lock tdb

This is the basis to implement global locks in ctdb without depending on a
shared file system. The initial goal is to make ctdb persistent transactions
deterministic without too many timeouts.
(cherry picked from commit 4c1c3f2549f32fd069e0e7bf3aec299213f1e85b)

14 years agos3-smbd: add a rate limited cleanup of brl, connections and locking db
Andrew Tridgell [Sat, 6 Feb 2010 05:08:56 +0000 (21:08 -0800)]
s3-smbd: add a rate limited cleanup of brl, connections and locking db

On unclean shutdown we can end up with stale entries in the brlock,
connections and locking db. Previously we would do the cleanup on
every unclean exit, but that can cause smbd to be completely
unavailable for several minutes when a large number of child smbd
processes exit.

This adds a rate limited cleanup of the databases, with the default
that cleanup happens at most every 20s
(cherry picked from commit dd498d2eecf124a03b6117ddab892a1112f9e9db)

The last 4 patches address bug #7312 (Many disconnecting clients renders
clustered samba unusuable for some time).

14 years agos3-brlock: we don't need these MSG_SMB_UNLOCK calls now
Andrew Tridgell [Sat, 6 Feb 2010 05:02:24 +0000 (21:02 -0800)]
s3-brlock: we don't need these MSG_SMB_UNLOCK calls now

These have been replaced with the min timeout in blocking.c
(cherry picked from commit 74267d652485cdcb711f734f0d80da0fb1495867)

14 years agos3-brlock: add a minimim retry time for pending blocking locks
Andrew Tridgell [Sat, 6 Feb 2010 04:59:43 +0000 (20:59 -0800)]
s3-brlock: add a minimim retry time for pending blocking locks

When we are waiting on a pending byte range lock, another smbd might
exit uncleanly, and therefore not notify us of the removal of the
lock, and thus not trigger the lock to be retried.

We coped with this up to now by adding a message_send_all() in the
SIGCHLD and cluster reconfigure handlers to send a MSG_SMB_UNLOCK to
all smbd processes. That would generate O(N^2) work when a large
number of clients disconnected at once (such as on a network outage),
which could leave the whole system unusable for a very long time (many
minutes, or even longer).

By adding a minimum re-check time for pending byte range locks we
avoid this problem by ensuring that pending locks are retried at a
more regular interval.
(cherry picked from commit 5b398edbee672392f2cea260ab17445ecca927d7)

14 years agos3-events: make the old timed events compatible with tevent
Andrew Tridgell [Sat, 6 Feb 2010 03:14:45 +0000 (19:14 -0800)]
s3-events: make the old timed events compatible with tevent

tevent ensures that a timed event is only called once. The old events
code relied on the called handler removing the event itself. If the
handler removed the event after calling a function which invoked the
event loop then the timed event could loop forever.

This change makes the two timed event systems more compatible, by
allowing the handler to free the te if it wants to, but ensuring it is
off the linked list of events before the handler is called, and
ensuring it is freed even if the handler doesn't free it.
(cherry picked from commit 5dbf175c75bd6139f3238f36665000641f7f7f79)

14 years agoFix bug 7307 - man net usershare mistake
Jeremy Allison [Mon, 29 Mar 2010 21:24:18 +0000 (14:24 -0700)]
Fix bug 7307 - man net usershare mistake

Fix bad usage message, reported by headset001@yahoo.com.

Jeremy.
(cherry picked from commit e14a6fbf8c9e4d16b2727e48c708ceccfd157e59)

14 years agoFix bug #7283 - vfs_acl_tdb does not work as expected.
Jeremy Allison [Wed, 24 Mar 2010 17:02:18 +0000 (10:02 -0700)]
Fix bug #7283 - vfs_acl_tdb does not work as expected.

both vfs_acl_common.c and vfs_acl_tdb.c were using the connection
handle, thus conflicted. Fix this.

Jeremy.

14 years agos3:winbindd: correctly retry if the netlogon pipe gets disconnected during a logon...
Stefan Metzmacher [Mon, 29 Mar 2010 20:03:55 +0000 (22:03 +0200)]
s3:winbindd: correctly retry if the netlogon pipe gets disconnected during a logon call

This fixes hopefully the last part of bug #7295.

metze
(cherry picked from commit 4c6cde99c0751a073120d8bc36d40922d8027344)

14 years agos3:rpc_client: remove more unused code
Stefan Metzmacher [Thu, 25 Mar 2010 14:54:29 +0000 (15:54 +0100)]
s3:rpc_client: remove more unused code

metze
(cherry picked from commit cac9981b1a88a37c703a76a951b0691fa4ba7b4b)

14 years agos3:rpc_client: remove unused code, we handle transport failures in the transport...
Stefan Metzmacher [Thu, 25 Mar 2010 14:29:05 +0000 (15:29 +0100)]
s3:rpc_client: remove unused code, we handle transport failures in the transport layer now

metze
(cherry picked from commit 13cf592bb8478453dccd4d78bdb4dabec7aeddc2)

14 years agos3:winbindd_reconnect: don't only reconnect on NT_STATUS_UNSUCCESSFUL
Stefan Metzmacher [Mon, 29 Mar 2010 14:31:13 +0000 (16:31 +0200)]
s3:winbindd_reconnect: don't only reconnect on NT_STATUS_UNSUCCESSFUL

metze
(cherry picked from commit 6bd5a2a3739938f95fce23ab2da652c9b5a48111)

14 years agos3:winbindd_cm: invalidate connection if cm_connect_netlogon() fails
Stefan Metzmacher [Thu, 25 Mar 2010 14:25:47 +0000 (15:25 +0100)]
s3:winbindd_cm: invalidate connection if cm_connect_netlogon() fails

metze
(cherry picked from commit 94a4bcd2f0c0464e192556679c6636639cb307ea)

14 years agos3:winbindd: consistently use TALLOC_FREE(conn->foo_pipe) is we create a new connection
Stefan Metzmacher [Thu, 25 Mar 2010 14:17:07 +0000 (15:17 +0100)]
s3:winbindd: consistently use TALLOC_FREE(conn->foo_pipe) is we create a new connection

metze
(cherry picked from commit 4f391fedac7111683d13f2d79fee7c0dbc27f86e)

14 years agos3:winbindd_cm: use rpccli_is_connected() helper function
Stefan Metzmacher [Thu, 25 Mar 2010 14:15:57 +0000 (15:15 +0100)]
s3:winbindd_cm: use rpccli_is_connected() helper function

metze
(cherry picked from commit d980c06a994d032a833adc8d56d2f2c037f8fdaf)