samba.git
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>
(cherry picked from commit 15b509b4b03a2c19caf4abfe475666f0720b4441)

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>
(cherry picked from commit 109e407554c55a602b0c184eb7eec2ed1833b68b)

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>
(cherry picked from commit e96605da78f1a0afbaf3b0aedaf7a4730d64d3a5)

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>
(cherry picked from commit e9f7d271e2a96d5dbce63bc454c68930cbc52d62)

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').
(cherry picked from commit 47e2bd2e29dca9cb5b503ae07f8935e70c687c71)

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').
(cherry picked from commit eff42fa66e561069959c401492c3b82a09b4742b)

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)
(cherry picked from commit b4b36e1a486296d049c96ea66e201d9c01e7165d)

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).
(cherry picked from commit df5f448fe371a1227a507cedc2642fa1a4b77e65)

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)
(cherry picked from commit cb6fcb9b16b36fcdc68bef382dbd7ecf89521d4e)

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)
(cherry picked from commit 7f57b627800baba4bc030d9c3748ead9ac53397d)

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)
(cherry picked from commit 0fc2424ee2f5082a74dad45a03226b457b6b00a8)

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>
(cherry picked from commit 672b1c8f9d090b294f89bc322320d65375670660)

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>
(cherry picked from commit 3ebaa433c1d223147b649ac50540fda733c5380e)

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>
(cherry picked from commit 5f8cb2a49e94f29da85dd62237a5f8967c44d826)

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>
(cherry picked from commit 89abb42c9b1697a5b3727cfeed8e32da44732980)

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>
(cherry picked from commit 75ed29b8b72113302dafaf2ecb149a8b52b2206d)

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>
(cherry picked from commit 8810302313831195645fc83145cf930b4f5bd983)

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
(cherry picked from commit a9be37010b465346d5008edc5f8311180ff9e4f4)

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)
(cherry picked from commit 1c39ce13c551b0fb5ca1569d7be82a34284f7f06)

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).
(cherry picked from commit a356b04933e65aed9a6c38611bcbfce3b297d092)

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)
(cherry picked from commit 3e6f961a7a6b4d0e41d0cf2c47ca2aebeea8f6af)

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).
(cherry picked from commit c1ae6d36d09569732408fdd6c079a1db7a5a65a5)

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").
(cherry picked from commit db511272f3393a35a1e596740b88487333ebeb24)

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)
(cherry picked from commit fb1b0901ec93afe998145bb7a7549bbdb13c712c)

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.
(cherry picked from commit 12936bfeb36ae867b52fe48d0f6d3d17d5c8b110)

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.
(cherry picked from commit ce565b0498608714e2c4f7c9f9373dddcbfba568)

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.
(cherry picked from commit 5c5e646ab3546aae4660b6598a6c89c66c3b4687)

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)
(cherry picked from commit bc30dc6983835ee376125861a5450975cc5af2ff)

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)
(cherry picked from commit 284f94b01d70db2e55dd8c1f3f8a353c1b4c1b8e)

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)
(cherry picked from commit e7b9c148d6fe155bd8afb8ff9b148eaf4092ff4e)

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)
(cherry picked from commit 39dbf73a6fb4ad45eac259124b70042994d4f215)

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).
(cherry picked from commit 3668914ce12d0dc5a2f84159a8bd3e82a2ca32a1)

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)
(cherry picked from commit 42d89dbd9407fcdef989387208dd8cae8472a6e8)

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)
(cherry picked from commit d614655f918fdbafe4520e9cc4d5de82e15b7d7d)

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
(cherry picked from commit 827084bc317c76335f76d76970a51e67222b1fc9)

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
(cherry picked from commit 21c25005c79fa957ac95514373c7aa8828f3fee1)

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

Karolin
(cherry picked from commit 05bc07ccd7b7e6aa1a69c0142160fc99990fb0c1)

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)
(cherry picked from commit 01b60b113869f526dcf3bb478d70df21dbb207c8)

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
(cherry picked from commit 5567d48e1cca30b244cdc0e6302c4f941aeb1bf5)

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
(cherry picked from commit c5b5cf35361fe4ea811a6f48a80ec63d5d4389ed)

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).
(cherry picked from commit 3d10185c518608c332d41e2814e49cfce47d02e6)

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
(cherry picked from commit 779c2052b3b13c8f1a793e59e6152c3704eb75c6)

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)).
(cherry picked from commit 06d1aeb7b686b8b929cf9bff48aedc9dbb88b7c3)

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).
(cherry picked from commit 3ab90b2897cd4e05b21ce46e91e93609e596c80e)

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).
(cherry picked from commit f3ade095089d242484afd0f7fdbcc7826c311368)

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)
(cherry picked from commit a3b71fc3b903d23e0866d7c7779a96dc81450dca)

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)
(cherry picked from commit 5423a2cc8138db852fefa133a7da53dc5abf1961)

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)
(cherry picked from commit f73b306797f354d0a24ff8af40b05d6151e52a06)

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)
(cherry picked from commit eb15655fe1fb71fb7145ce9f479cc112a459f72e)

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)
(cherry picked from commit c5babceaa95fd163f785e1dfe5521b93402e06a3)

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)
(cherry picked from commit 7e787c513e47875e7dbfc195d8bd1cecec3f08ce)

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)
(cherry picked from commit 9673c93933624ae6e02e83dae3c19351edfd301a)

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)
(cherry picked from commit b2677d82dc5c6bc76b0343d90ec75972b5b2a8bf)

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)
(cherry picked from commit 8d4a14f3aa04812cd81aa4d56b878169dc41899c)

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)
(cherry picked from commit d0ce7072bd89d11bb63b1fa976305d7087dcb9af)

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)
(cherry picked from commit 0a030b0de66e84f35637699377e44a083c445fa2)

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)
(cherry picked from commit 84505cb3157d23b6df170bf694cd6adecc1fe9f5)

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)
(cherry picked from commit 77e4a72902856cd6c1f635dc3a952f846522b7d0)

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)
(cherry picked from commit c17daced42b3ea78fa8e6f6afc8c2550cac53ca0)

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)
(cherry picked from commit 6f325fb6b092da554180218d1cbb42181f90bbfa)

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)
(cherry picked from commit 7fc2b612b8f77751effadcd53800c96e83e76418)

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)
(cherry picked from commit e5cc0e718863d6cfaa59fbb4cac7d9b70fba0381)

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)
(cherry picked from commit 89cb10de5ec46384c5ae8d558ac29e4f9e00e8a1)

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)
(cherry picked from commit dfbc45f6d6ef2fb99652992e291b1bf5276dec28)

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)
(cherry picked from commit 8926082d096b2a6e8688b1668bd7293632ebb508)

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)
(cherry picked from commit ffaa072801d94ffcac837e77ff9e6538ba335150)

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)
(cherry picked from commit cfdf2d76878ee1ba32b2cb89f9ed740386990530)

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)
(cherry picked from commit 06943fe1e6982c9df4886ee0a17572e502726897)

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)
(cherry picked from commit 60aabc946ed981efe7e37bb2b39307e82dd20fcc)

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)
(cherry picked from commit ea3c4c96e0fd1f2165282589becb12bfb40700d3)

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)
(cherry picked from commit c2354aa193617ffc3e4036fe0b9034c2664901fd)

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)
(cherry picked from commit 3f64cba12aea87ad57bd52547f7dc312cd9e8636)

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.
(cherry picked from commit dcfbe61ab0381491e19827806cb06e0822fa69e7)

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)
(cherry picked from commit 139a9fdcd6c33ef10af83fd9c640ed0191670c5b)

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)
(cherry picked from commit 803cf6da0bb93760902e6118952d73967d6fcdff)

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)
(cherry picked from commit 98873e0d6a38abdcaed48af6504a9a39a23ae027)

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).
(cherry picked from commit 675c4b5522394e4431a88d9ab7647ca24765feb6)

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)
(cherry picked from commit 6a78929fd0543e027912346c30e6208b4a1f4362)

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)
(cherry picked from commit aa9ab3ea57808b8e227c960b442911219405f1bf)

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)
(cherry picked from commit 380e86e0f9c9314f4f69528227668dbbb222b144)

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)
(cherry picked from commit 9620f5fbe64910d86cae51345156a1a4dd71e231)

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.
(cherry picked from commit 12a5c447dbdbcfb74438270e5fc9189388e5d18a)

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)
(cherry picked from commit 482518fcafb18bda1f084ebf1906a2ad02436b80)

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)
(cherry picked from commit 877c6d0cf99dfe642f2c8dc733e075768aab2d95)

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)
(cherry picked from commit 86cbe6f85a732601b18f97b143976cbf92f56467)

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)
(cherry picked from commit 169628fcb656ba5987a99bd50c7f588b731eae51)

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)
(cherry picked from commit c046ae8428fb62ff2749689e7c738f1a2e8f8251)

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)
(cherry picked from commit c462e54142c00fdd81c2847d16a75119b1cc89fc)

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)
(cherry picked from commit aa7d54ed04585a183a88363406ed7f3244b24d85)

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

metze
(cherry picked from commit 408a3eb35a0e61b5d66a3b48ebbd1a6796672d0f)
(cherry picked from commit 00a93190d2cae31cd2213b810ea348c055670399)

14 years agos3:rpc_client: return at least 10 sec as old timeout in rpccli_set_timeout() instead...
Stefan Metzmacher [Sun, 28 Mar 2010 17:34:34 +0000 (19:34 +0200)]
s3:rpc_client: return at least 10 sec as old timeout in rpccli_set_timeout() instead of 0

metze
(cherry picked from commit 3e70da3f470eeb122f95477fb48d89939f501b3e)
(cherry picked from commit 60861fba533027b6c9a0ff704b95dcf631ea3ca3)

14 years agos3:rpc_client: add set_timeout hook to rpc_cli_transport
Stefan Metzmacher [Thu, 25 Mar 2010 14:51:51 +0000 (15:51 +0100)]
s3:rpc_client: add set_timeout hook to rpc_cli_transport

metze
(cherry picked from commit 99664ad15460530b6fb44957b6c57823f09884bf)
(cherry picked from commit 89164eb8363ffc0b951256578be48d37ddba46b1)

14 years agos3:rpc_client: add rpccli_is_connected()
Stefan Metzmacher [Thu, 25 Mar 2010 14:00:38 +0000 (15:00 +0100)]
s3:rpc_client: add rpccli_is_connected()

metze
(cherry picked from commit 4f41b53487ac9bc96c7960e8edab464558656373)
(cherry picked from commit 958b49323968740e2cbf69dc2a0a5dd57d5bcf87)

14 years agos3:rpc_client: don't mix layers and keep a reference to cli_state in the caller
Stefan Metzmacher [Mon, 29 Mar 2010 12:58:19 +0000 (14:58 +0200)]
s3:rpc_client: don't mix layers and keep a reference to cli_state in the caller

We should not rely on the backend to have a reference to the cli_state.
This will make it possible for the backend to set its cli_state reference
to NULL, when the transport is dead.

metze
(cherry picked from commit dc09b12681ea0e6d4c2b0f1c99dfeb1f23019c65)
(cherry picked from commit 1e2e47da82aeb249dce431541738a62cb139aebb)

14 years agos3:rpc_transport_np: add comment about bad usage in a destructor
Stefan Metzmacher [Thu, 25 Mar 2010 13:10:25 +0000 (14:10 +0100)]
s3:rpc_transport_np: add comment about bad usage in a destructor

metze
(cherry picked from commit 5f8fc63515a02aaf55719cb8d3be8ce695178fe9)
(cherry picked from commit 8d576661d15f1c032a4fe17ed03bfeb376039bdb)

14 years agos3:rpc_transport_np: use cli_state_is_connected() helper
Stefan Metzmacher [Thu, 25 Mar 2010 13:08:42 +0000 (14:08 +0100)]
s3:rpc_transport_np: use cli_state_is_connected() helper

metze
(cherry picked from commit b862351da8624df893ec77e020a456c1d23c58ed)
(cherry picked from commit 8c2f4426ce178ac33748cfba01532ec2fd205710)

14 years agos3:libsmb: add cli_state_is_connected() function
Stefan Metzmacher [Thu, 25 Mar 2010 12:20:56 +0000 (13:20 +0100)]
s3:libsmb: add cli_state_is_connected() function

metze
(cherry picked from commit d7bf30ef92031ffddcde3680b38e602510bcae24)
(cherry picked from commit 956514c98975d152c6ab50e0ee2d88971aa06f55)

14 years agos3:libsmb: don't let cli_shutdown() segfault with a NULL cli_state
Stefan Metzmacher [Mon, 29 Mar 2010 16:23:40 +0000 (18:23 +0200)]
s3:libsmb: don't let cli_shutdown() segfault with a NULL cli_state

metze
(similar to commit 47e10ab9a85960c78af807b66b99bcd139713644)
(cherry picked from commit 85aae5e96363d0b5b03d31fb36465121d3381cb2)

14 years agos3:rpc_transport_np: handle trans rdata like the output of a normal read
Stefan Metzmacher [Sat, 20 Feb 2010 08:08:16 +0000 (09:08 +0100)]
s3:rpc_transport_np: handle trans rdata like the output of a normal read

Inspired by bug #7159.

metze
(cherry picked from commit 911287285cc4c8485b75edfad3c1ece901a69b0b)
(cherry picked from commit e2739a2bf37e654c37cbea6e510f63a7ce4adfea)

14 years agos3: Fix bug 7212, "getent group does not return group members"
Volker Lendecke [Mon, 29 Mar 2010 14:59:48 +0000 (16:59 +0200)]
s3: Fix bug 7212, "getent group does not return group members"
(cherry picked from commit f4201fb61e575d38dc102befc1efceaf809fc68b)