samba.git
12 years agos3 swat: Allow getting the user's HTTP auth password
Kai Blin [Fri, 8 Jul 2011 10:56:21 +0000 (12:56 +0200)]
s3 swat: Allow getting the user's HTTP auth password

Signed-off-by: Kai Blin <kai@samba.org>
(cherry picked from commit dffaf0ed0bb7f38c23f15b0b128a5eb39a55a813)

12 years agos3 swat: Fix possible XSS attack (bug #8289)
Kai Blin [Thu, 7 Jul 2011 08:03:33 +0000 (10:03 +0200)]
s3 swat: Fix possible XSS attack (bug #8289)

Nobuhiro Tsuji of NTT DATA SECURITY CORPORATION reported a possible XSS attack
against SWAT, the Samba Web Administration Tool. The attack uses reflection to
insert arbitrary content into the "change password" page.

This patch fixes the reflection issue by not printing user-specified content on
the website anymore.

Signed-off-by: Kai Blin <kai@samba.org>
(cherry picked from commit 05fa09be5a801baa5d35014e2f54b46c1ff5466b)

12 years agos3:nmbd_packets: return the used number of sockets in create_listen_fdset() (bug...
Stefan Metzmacher [Thu, 30 Jun 2011 07:56:06 +0000 (09:56 +0200)]
s3:nmbd_packets: return the used number of sockets in create_listen_fdset() (bug #8276)

Fix bug #7949 (DoS in Winbind and smbd with many file descriptors open)
(commit feb3fcd0fa4bda0967b881315595d7702f4d1752) changed the bahavior,
so that we skipped some sockets.

This should work for v3-4-test.

metze

12 years agos3: increase the log level for missing PIDs on SIGCHLD
David Disseldorp [Wed, 16 Feb 2011 16:23:25 +0000 (17:23 +0100)]
s3: increase the log level for missing PIDs on SIGCHLD

Since the fix for bso#7836, the parent smbd is responsible for
maintaining an up-to-date printcap cache. It does this by forking a
child process to asynchronously fetch printcap data from CUPS.

When the child process exits after fetching all printcap data, the
parent smbd is sent SIGCHLD. This triggers smbd_sig_chld_handler() which
looks for the exited process PID on a "children" list.
Child smbd process PIDs are added to the "children" list to ensure
cleanup on unclean shutdown and log level change notification messages.

Printcap update process PIDs are not added to the list as they do not
maintain any state that requires cleanup, nor do they wait on tevent for
messages.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Feb 17 11:11:45 CET 2011 on sn-devel-104
(cherry picked from commit 9c12232f1ae36e00d04114ad73edd8ba3c2c6a5c)

Fix bug #8269 (smbd spams log with "Could not find child X -- ignoring"
messages).
(cherry picked from commit ba118ac287d49267dd2f346d4ddd2e590ebbe653)

12 years agos3-libnet: fix bug #6364: Pull realm from supplied username on libnet join
Jim McDonough [Thu, 26 May 2011 18:30:33 +0000 (20:30 +0200)]
s3-libnet: fix bug #6364: Pull realm from supplied username on libnet join

12 years agos3-printing: remove duplicate cups response processing code
David Disseldorp [Tue, 24 May 2011 09:50:12 +0000 (11:50 +0200)]
s3-printing: remove duplicate cups response processing code

There is currently a lot of duplicate code included for processing
responses to CUPS_GET_PRINTERS and CUPS_GET_CLASSES requests. This
change splits this code into a separate function.

Signed-off-by: Günther Deschner <gd@samba.org>
12 years agos3-printing: use printcap IDL for IPC
David Disseldorp [Tue, 24 May 2011 09:46:25 +0000 (11:46 +0200)]
s3-printing: use printcap IDL for IPC

Use printcap IDL for marshalling and unmarshalling messages between cups
child and parent smbd processes. This simplifies the IPC and ensures
the parent is notified of cups errors encountered by the child.

https://bugzilla.samba.org/show_bug.cgi?id=7994

Signed-off-by: Günther Deschner <gd@samba.org>
12 years agoidl: define printcap IPC message format
David Disseldorp [Tue, 24 May 2011 09:41:27 +0000 (11:41 +0200)]
idl: define printcap IPC message format

Signed-off-by: Günther Deschner <gd@samba.org>
12 years agos3-printing: an empty cups printer list is treated as an error
David Disseldorp [Tue, 24 May 2011 09:34:59 +0000 (11:34 +0200)]
s3-printing: an empty cups printer list is treated as an error

cups_async_callback() is called to receive new printcap data from a
child process which requests the information from cupsd.
Newly received printcap information is stored in a temporary printcap
cache (tmp_pcap_cache). Once the child process closes the printcap IPC
file descriptor, the system printcap cache is replaced with the newly
populated tmp_pcap_cache, however this only occurs if tmp_pcap_cache is
non null (has at least one printer).

If the printcap cache is empty, which is the case when cups is not
exporting any printers, the printcap cache is not replaced resulting in
stale data.

Signed-off-by: Günther Deschner <gd@samba.org>
12 years agos3-printing: remove pcap_cache_loaded asserts
David Disseldorp [Mon, 17 Jan 2011 15:09:32 +0000 (16:09 +0100)]
s3-printing: remove pcap_cache_loaded asserts

pcap_cache_loaded() assertions were added to the (re)load_printers()
functions, to ensure the caller had called pcap_cache_reload() prior to
reloading printer shares.

The problem is, pcap_cache_loaded() returns false if the the pcap_cache
contains no printer entries. i.e. pcap_cache_reload() has run but not
detected any printers.

Remove these assertions, correct call ordering is already enforced.

Signed-off-by: Günther Deschner <gd@samba.org>
The last 3 patches address bug #7836 (A newly added printer isn't visbile to
clients).

12 years agoRevert "Revert "s3-printing: update parent smbd pcap cache""
David Disseldorp [Thu, 19 May 2011 09:29:12 +0000 (11:29 +0200)]
Revert "Revert "s3-printing: update parent smbd pcap cache""

This reverts commit ad450870eacb114b3f15941a4478ba25701e035a.

Signed-off-by: Günther Deschner <gd@samba.org>
12 years agoRevert "Revert "s3-printing: reload shares after pcap cache fill""
David Disseldorp [Thu, 19 May 2011 09:26:18 +0000 (11:26 +0200)]
Revert "Revert "s3-printing: reload shares after pcap cache fill""

This reverts commit 36ea03bbe28122ce03de4969e254dd276cfe5a79.

Signed-off-by: Günther Deschner <gd@samba.org>
13 years agoWHATSNEW: Start release notes for Samba 3.4.14.
Karolin Seeger [Thu, 21 Apr 2011 08:08:19 +0000 (10:08 +0200)]
WHATSNEW: Start release notes for Samba 3.4.14.

Karolin

13 years agoVERSION: Bump version number up to 3.4.14.
Karolin Seeger [Thu, 21 Apr 2011 08:06:36 +0000 (10:06 +0200)]
VERSION: Bump version number up to 3.4.14.

Karolin

13 years agoWHATSNEW: Update changes since 3.4.12.
Karolin Seeger [Wed, 20 Apr 2011 18:51:26 +0000 (20:51 +0200)]
WHATSNEW: Update changes since 3.4.12.

Karolin

13 years agos3: Fix bug 8099 - setpwent() actually does endpwent() on FreeBSD
Sergey Korsak [Tue, 19 Apr 2011 16:51:32 +0000 (18:51 +0200)]
s3: Fix bug 8099 - setpwent() actually does endpwent() on FreeBSD
(cherry picked from commit 2167ac2cd42c9ed5aaae0086dbd27e29d1d77686)

13 years agoWHATSNEW: Prepare 3.4.13 release notes.
Karolin Seeger [Mon, 18 Apr 2011 13:00:14 +0000 (15:00 +0200)]
WHATSNEW: Prepare 3.4.13 release notes.

Karolin

13 years agos3-cli_pipe: fix timeout in rpc_pipe_open_tcp_port().
Günther Deschner [Wed, 13 Apr 2011 15:41:36 +0000 (17:41 +0200)]
s3-cli_pipe: fix timeout in rpc_pipe_open_tcp_port().

Make sure we use a timeout of 60 seconds, not 60 milliseconds...

This prevented us from successfully using the ncacn_ip_tcp client in a lot of
places, I guess.

Guenther

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Apr 13 18:59:19 CEST 2011 on sn-devel-104
(cherry picked from commit 4b3fe5247a6e16b1ad9f05269e9aa00e3120e36a)

Fix bug #8085 - incorrect timeout handling in ncacn_ip_tcp client code.
(cherry picked from commit d7d39c723e1855a3d18813e8a79fcca9770b0142)

13 years agoAllow NULL queue to writev_send
Volker Lendecke [Sun, 10 May 2009 08:49:18 +0000 (10:49 +0200)]
Allow NULL queue to writev_send

Fix bug #8086 - null pointer reference crashes winbind.

13 years agoWHATSNEW: Start 3.4.13 release notes.
Karolin Seeger [Mon, 28 Feb 2011 13:51:37 +0000 (14:51 +0100)]
WHATSNEW: Start 3.4.13 release notes.

Karolin
(cherry picked from commit c32b64f22e0ed14d686cb88554e618f2d63acebe)

13 years agoVERSION: Bump version number up to 3.4.13.
Karolin Seeger [Mon, 28 Feb 2011 13:49:44 +0000 (14:49 +0100)]
VERSION: Bump version number up to 3.4.13.

Karolin
(cherry picked from commit 7afb216d1d25c1269dcf63f845bebde9a989caa2)

13 years agoWHATSNEW: Fix typo.
Karolin Seeger [Sun, 27 Feb 2011 17:44:10 +0000 (18:44 +0100)]
WHATSNEW: Fix typo.

Karolin
(cherry picked from commit 2aa648e4e9c530a4c9e8d1389fa16e775ac91e54)

13 years agoVERSION: Bump version number up to 3.4.12.
Karolin Seeger [Sun, 27 Feb 2011 17:21:38 +0000 (18:21 +0100)]
VERSION: Bump version number up to 3.4.12.

Karolin
(cherry picked from commit 8da98df066bcfc8a47a83615788a55206075ad2b)

13 years agoWHATSNEW: Prepare 3.4.12 release notes.
Karolin Seeger [Sun, 27 Feb 2011 17:20:42 +0000 (18:20 +0100)]
WHATSNEW: Prepare 3.4.12 release notes.

Karolin
(cherry picked from commit da478595190a4a6634b6fc1654fcac58c73e66de)

13 years agoFix denial of service - memory corruption.
Jeremy Allison [Sun, 27 Feb 2011 17:16:20 +0000 (18:16 +0100)]
Fix denial of service - memory corruption.

CVE-2011-0719

Fix bug #7949 (DoS in Winbind and smbd with many file descriptors open).

All current released versions of Samba are vulnerable to
a denial of service caused by memory corruption. Range
checks on file descriptors being used in the FD_SET macro
were not present allowing stack corruption. This can cause
the Samba code to crash or to loop attempting to select
on a bad file descriptor set.

A connection to a file share, or a local account is needed
to exploit this problem, either authenticated or unauthenticated
(guest connection).

Currently we do not believe this flaw is exploitable
beyond a crash or causing the code to loop, but on the
advice of our security reviewers we are releasing fixes
in case an exploit is discovered at a later date.
(cherry picked from commit 43babef991feedbe2acb77d27254d302ab107fa8)

13 years agoWHATSNEW: Fix typo.
Karolin Seeger [Sun, 23 Jan 2011 19:14:52 +0000 (20:14 +0100)]
WHATSNEW: Fix typo.

Karolin

13 years agoWHATSNEW: Add changes since 3.4.10.
Karolin Seeger [Sun, 23 Jan 2011 18:54:47 +0000 (19:54 +0100)]
WHATSNEW: Add changes since 3.4.10.

Karolin

13 years agos3: Fix connecting to port-139 only servers
Volker Lendecke [Sat, 22 Jan 2011 15:22:42 +0000 (16:22 +0100)]
s3: Fix connecting to port-139 only servers

When the TCP RST came before the 5 msecs timeout kicked in, we
viewed this as final, as state->req_139 was not set yet.

Fix bug introduced by a fix for bug #7881 (winbind flaky against w2k8).
(cherry picked from commit f2a19b87725f9318e983dff6358a3eee721bff08)

13 years agoWHATSNEW: Start release notes for Samba 3.4.11.
Karolin Seeger [Sat, 22 Jan 2011 18:43:40 +0000 (19:43 +0100)]
WHATSNEW: Start release notes for Samba 3.4.11.

Karolin

13 years agoVERSION: Raise version number up to 3.4.11.
Karolin Seeger [Sat, 22 Jan 2011 18:41:28 +0000 (19:41 +0100)]
VERSION: Raise version number up to 3.4.11.

Karolin

13 years agoWHATSNEW: Add major enhancements.
Karolin Seeger [Wed, 19 Jan 2011 14:14:45 +0000 (15:14 +0100)]
WHATSNEW: Add major enhancements.

Karolin

13 years agoWHATSNEW: Update changes since 3.4.9.
Karolin Seeger [Mon, 17 Jan 2011 17:16:03 +0000 (18:16 +0100)]
WHATSNEW: Update changes since 3.4.9.

Karolin

13 years agoRevert "s3-printing: update parent smbd pcap cache"
Karolin Seeger [Sat, 15 Jan 2011 18:06:42 +0000 (19:06 +0100)]
Revert "s3-printing: update parent smbd pcap cache"

This reverts commit 2c2ce9caead5a13edb582313b7d36c7eb12a09fb.

13 years agoRevert "s3-printing: reload shares after pcap cache fill"
Karolin Seeger [Sat, 15 Jan 2011 18:06:16 +0000 (19:06 +0100)]
Revert "s3-printing: reload shares after pcap cache fill"

This reverts commit 9bc0cd243ac66126d42905dd8710d078094e0cd7.

This commit seems to break 'make test'.

13 years agos3-rpcclient: Fix bug #7880: cmd_spoolss_deletedriver() returned without checking...
Björn Baumbach [Wed, 22 Dec 2010 14:20:29 +0000 (15:20 +0100)]
s3-rpcclient: Fix bug #7880: cmd_spoolss_deletedriver() returned without checking all architectures.

Continues now with next architecture if no driver is available.

Because of the broken behavior of the rpccli_*() functions,
we need special error code handling.

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

13 years agos3-printing: update parent smbd pcap cache
David Disseldorp [Mon, 10 Jan 2011 13:08:07 +0000 (14:08 +0100)]
s3-printing: update parent smbd pcap cache

If a client connects to a samba share and while connected a printer is
added, the client will see the new printer share after a maximum of
'printcap cache time' seconds.

smbd's forked for new client connections inherit printcap information
from the parent (listener) smbd, which does not perform updates on
printcap cache time expiry. Therefore newly connected clients may
initially be presented with stale printer shares.

Add a housekeeping function to the parent smbd to ensure newly connected
clients see up to date printer shares.

The last 2 patches address bug #7836 (A newly added printer isn't visbile to
clients).

13 years agos3-printing: reload shares after pcap cache fill
David Disseldorp [Sun, 19 Dec 2010 18:52:08 +0000 (19:52 +0100)]
s3-printing: reload shares after pcap cache fill

Since commit eada8f8a, updates to the cups pcap cache are performed
asynchronously - cups_cache_reload() forks a child process to request
cups printer information and notify the parent smbd on completion.

Currently printer shares are reloaded immediately following the call to
cups_cache_reload(), this occurs prior to smbd receiving new cups pcap
information from the child process. Such behaviour can result in stale
print shares as outlined in bug 7836.

This fix ensures print shares are only reloaded after new pcap data has
been received.

Pair-Programmed-With: Lars Müller <lars@samba.org>

13 years agos3-dns Don't use DELEG_FLAG in DNS update, Windows 2008R2 does not like it (cherry...
Andrew Bartlett [Fri, 10 Dec 2010 04:32:08 +0000 (15:32 +1100)]
s3-dns Don't use DELEG_FLAG in DNS update, Windows 2008R2 does not like it (cherry picked from commit 280caa6b3bb1199939f9349ea5a436a491c81791)

The last 2 patches address bug #7356 (net ads dns register fails in 2008 R2
domain).
(cherry picked from commit 6857b749229cc72c604ab5646a4bae5f09b72e11)

13 years agos3-dns Don't use SEQUENCE_FLAG in DNS update, Windows 2008R2 does not like it
Andrew Bartlett [Fri, 10 Dec 2010 04:30:22 +0000 (15:30 +1100)]
s3-dns Don't use SEQUENCE_FLAG in DNS update, Windows 2008R2 does not like it

Andrew Bartlett
(cherry picked from commit 0f1cc889a26477e9a98629f120fe5890b2e106fa)
(cherry picked from commit 2b463484cc7bb80cdfb6727ab9e5a873faff5ec8)

13 years agoWHATSNEW: Start to add changes since 3.4.9.
Karolin Seeger [Thu, 13 Jan 2011 17:36:26 +0000 (18:36 +0100)]
WHATSNEW: Start to add changes since 3.4.9.

Karolin

13 years agoWHATSNEW: Start release notes for Samba 3.4.10.
Karolin Seeger [Tue, 11 Jan 2011 20:49:30 +0000 (21:49 +0100)]
WHATSNEW: Start release notes for Samba 3.4.10.

Karolin

13 years agoVERSION: Bump version number.
Karolin Seeger [Tue, 11 Jan 2011 20:44:50 +0000 (21:44 +0100)]
VERSION: Bump version number.

Karolin

13 years agos3-nmbd: Fix bug #7875
Björn Baumbach [Fri, 7 Jan 2011 14:53:13 +0000 (15:53 +0100)]
s3-nmbd: Fix bug #7875

nmbd --port didn't work
(cherry picked from commit 79280c99f67c3a3bfb1873b373ec181fa402f18c)

13 years agos3:lib/netapi: don't set SAMR_FIELD_FULL_NAME if we just want to set the account...
Stefan Metzmacher [Wed, 29 Dec 2010 11:08:19 +0000 (12:08 +0100)]
s3:lib/netapi: don't set SAMR_FIELD_FULL_NAME if we just want to set the account name (bug #7896)

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Dec 30 18:09:13 CET 2010 on sn-devel-104
(cherry picked from commit f1d15ea54c313e71fc032b2ed191bdecad868858)
(cherry picked from commit c6a0971b3790253a906b370562237479d273bb94)

13 years agos3: Fix bug 7066 -- wbcAuthenticateEx gives unix times
Volker Lendecke [Sat, 18 Dec 2010 15:02:09 +0000 (16:02 +0100)]
s3: Fix bug 7066 -- wbcAuthenticateEx gives unix times

We might eventually want to change this, but right now we get unix times
out of the winbind pipe struct
(cherry picked from commit 993923880e213136de89b5b8d59f6f32a51b94b7)

13 years agoѕ3/configue: set Tru64 cc's PIC switch right (none)
Björn Jacke [Fri, 26 Nov 2010 00:32:53 +0000 (01:32 +0100)]
ѕ3/configue: set Tru64 cc's PIC switch right (none)

-fPIC made shared library builds fail there

Fixes #7821

(cherry picked from commit dbcf73c45782c310cb7ff1f2177d410399e2f06d)
(cherry picked from commit 83eb2e9aef40e5e838d2654298e281ad3ec98af3)

13 years agoFix bug #7892 - open_file_fchmod() leaves a stale lock.
Jeremy Allison [Wed, 29 Dec 2010 02:11:33 +0000 (18:11 -0800)]
Fix bug #7892 - open_file_fchmod() leaves a stale lock.

13 years agos3: Use smbsock_any_connect in winbind
Volker Lendecke [Tue, 21 Dec 2010 20:55:01 +0000 (21:55 +0100)]
s3: Use smbsock_any_connect in winbind

The last 8 patches address bug #7881 (winbind flaky against w2k8).

13 years agos3: Retry *SMBSERVER in nb_connect
Volker Lendecke [Tue, 21 Dec 2010 17:52:53 +0000 (18:52 +0100)]
s3: Retry *SMBSERVER in nb_connect

13 years agos3: Add smbsock_any_connect
Volker Lendecke [Mon, 13 Dec 2010 16:17:51 +0000 (17:17 +0100)]
s3: Add smbsock_any_connect

13 years agos3: Add an async smbsock_connect
Volker Lendecke [Sun, 12 Dec 2010 17:55:06 +0000 (18:55 +0100)]
s3: Add an async smbsock_connect

This connects to 445 and after 5 milliseconds also to 139. It treats a netbios
session setup failure as equivalent as a TCP connect failure. So if 139 is
faster but fails the nb session setup, the 445 still has the chance to succeed.

13 years agov3-4-test: Pull in tevent_req_poll_ntstatus from master
Volker Lendecke [Wed, 22 Dec 2010 14:21:27 +0000 (15:21 +0100)]
v3-4-test: Pull in tevent_req_poll_ntstatus from master

13 years agos3: Add async cli_session_request
Volker Lendecke [Sun, 12 Dec 2010 17:54:31 +0000 (18:54 +0100)]
s3: Add async cli_session_request

This does not do the redirects, but I think that might be obsolete anyway

13 years agov3-4-test: Pull in read_smb_send from master
Volker Lendecke [Wed, 22 Dec 2010 14:15:47 +0000 (15:15 +0100)]
v3-4-test: Pull in read_smb_send from master

13 years agos3: Add some const to name_mangle()
Volker Lendecke [Sun, 12 Dec 2010 17:53:49 +0000 (18:53 +0100)]
s3: Add some const to name_mangle()

13 years agos3: Make winbind recover from a signing error
Volker Lendecke [Wed, 17 Nov 2010 15:56:28 +0000 (08:56 -0700)]
s3: Make winbind recover from a signing error

When winbind sees a signing error on the smb connection to a DC (for whatever
reason, our bug, network glitch, etc) it should recover properly. The "old"
code in clientgen.c just closed the socket in this case. This is the right
thing to do, this connection is spoiled anyway. The new, async code did not do
this so far, which led to the code in winbindd_cm.c not detect that we need to
reconnect.

Fix bug #7800 (winbind does not recover from smb signing errors).

13 years agos3: Stop using the write cache after an oplock break
Volker Lendecke [Sat, 2 Oct 2010 15:07:00 +0000 (17:07 +0200)]
s3: Stop using the write cache after an oplock break

Fix bug #7715 (Setting Samba Write Cache Size Can Cause File Corruption).
(cherry picked from commit 9f8292e5f765dff586bfbb261b54da4d4b27a837)

13 years agoWHATSNEW: Prepare 3.4.9 release notes.
Karolin Seeger [Wed, 15 Sep 2010 18:55:30 +0000 (20:55 +0200)]
WHATSNEW: Prepare 3.4.9 release notes.

Karolin

13 years agoFix bug #7669.
Jeremy Allison [Thu, 9 Sep 2010 13:48:23 +0000 (15:48 +0200)]
Fix bug #7669.

Fix bug #7669 (buffer overflow in sid_parse() in Samba3 and dom_sid_parse in
Samba4).

CVE-2010-3069:

===========
Description
===========

All current released versions of Samba are vulnerable to
a buffer overrun vulnerability. The sid_parse() function
(and related dom_sid_parse() function in the source4 code)
do not correctly check their input lengths when reading a
binary representation of a Windows SID (Security ID). This
allows a malicious client to send a sid that can overflow
the stack variable that is being used to store the SID in the
Samba smbd server.

A connection to a file share is needed to exploit this
vulnerability, either authenticated or unauthenticated
(guest connection).
(cherry picked from commit df20a300758bc12286820e31fcf573bdfc2147bc)

13 years agoFix bug 7636 - winbind internal error, backtrace.
Jeremy Allison [Mon, 23 Aug 2010 23:30:53 +0000 (16:30 -0700)]
Fix bug 7636 - winbind internal error, backtrace.

Jeremy.

13 years agos3-printing: fix BUG 7280 - auto printers not loading with registry config
Jim McDonough [Mon, 23 Aug 2010 09:14:47 +0000 (11:14 +0200)]
s3-printing: fix BUG 7280 - auto printers not loading with registry config

13 years agoFix bug 7590 - offline login fails because winbind deletes cache on every startup.
Jeremy Allison [Tue, 27 Jul 2010 08:54:01 +0000 (01:54 -0700)]
Fix bug 7590 - offline login fails because winbind deletes cache on every startup.

Sync lib/tdb_validate.c with the change in current master.
Change tdb_validate_open() to always use O_RDWR instead of O_RDONLY,
as (from the bug report): "db_check() will always return failure for a read-only database.
Silently, without any log output, when _tdb_lockall() fails."

Jeremy.
(cherry picked from commit 39cb903463d8a3fcabd9e148112bf5cf81744130)

13 years agorerun: make samba3-idl
Stefan Metzmacher [Mon, 9 Aug 2010 09:26:03 +0000 (11:26 +0200)]
rerun: make samba3-idl

metze

13 years agopidl: Samba3/ClientNDR - Correctly copy arrays, if r.out.size < r.in.size.
Stefan Metzmacher [Mon, 9 Aug 2010 09:14:52 +0000 (11:14 +0200)]
pidl: Samba3/ClientNDR - Correctly copy arrays, if r.out.size < r.in.size.

metze

Signed-off-by: Andreas Schneider <asn@samba.org>
(similar to commit 33d1879d5b50e2d98c1bb13b835e7cfb178e3336)
(similar to commit d1e92cd2944983ecabd0511ff7c8221c1033a3a8)
Fixes bug #7607.

13 years agoFix bug #7617 - smbd coredump due to uninitialized variables in the performance count...
Jeremy Allison [Thu, 12 Aug 2010 21:24:01 +0000 (14:24 -0700)]
Fix bug #7617 - smbd coredump due to uninitialized variables in the performance counter code.

In the file rpc_server.c, function _winreg_QueryValue()

uint8_t *outbuf

Should be :

uint8_t *outbuf = NULL;

As it is later freed by

      if (free_buf) SAFE_FREE(outbuf);

in some cases, this frees the unintialized outbuf, which causes a coredump.
(cherry picked from commit 84fd910c347ddfad6f01edbe7f6e25546c8382ee)
(cherry picked from commit 80e65236158d6f1690bf9f153c0eb12d81d56b8a)

13 years agos3-winbind: Fix Bug #7568: Make sure cm_connect_lsa_tcp does not reset the secure...
Günther Deschner [Mon, 9 Aug 2010 12:31:24 +0000 (14:31 +0200)]
s3-winbind: Fix Bug #7568: Make sure cm_connect_lsa_tcp does not reset the secure channel.

This is an important fix as the following could and is happening:

* winbind authenticates a user via schannel secured netlogon samlogonex call,
current secure channel cred state is stored in winbind state, winbind
sucessfully decrypts session key from the info3

* winbind sets up a new schannel ncacn_ip_tcp lsa pipe (and thereby resets the
secure channel on the dc)

* subsequent samlogonex calls use the new secure channel creds on the dc to
encrypt info3 session key, while winbind tries to use old schannel creds for
decryption

Guenther
(cherry picked from commit be396411a4e1f3a174f8a44b6c062d834135e70a)

13 years agos3-libsmb: Fix bug #7577.
Jeremy Allison [Tue, 27 Jul 2010 06:47:14 +0000 (08:47 +0200)]
s3-libsmb: Fix bug #7577.

SPNEGO auth fails when contacting Win7 system using Microsoft Live Sign-in
Assistant.

13 years agolibrpc: split out a separate GUID_from_ndr_blob() function
Andrew Tridgell [Thu, 10 Dec 2009 00:22:20 +0000 (11:22 +1100)]
librpc: split out a separate GUID_from_ndr_blob() function

This will simplify many of the places that deal with NDR formatted
GUIDs
(cherry picked from commit effff544265c63c95cf630d426b630bfe4d25aec)

This patch is part of a fix for bug #7538 (Backport fixes for
GUID_from_data_blob).
(cherry picked from commit e8ed2b596627e8704e3384d5997020059b47144a)

13 years agos3: Fix bug 7336: Enable idmap_passdb module build as shared
Volker Lendecke [Sun, 4 Jul 2010 08:01:42 +0000 (10:01 +0200)]
s3: Fix bug 7336: Enable idmap_passdb module build as shared
(cherry picked from commit 8c0fbc410798512b7a4b7db73bcb24cde6fa7849)
(cherry picked from commit b4803af11525823ea508d0ca4e58402d55901194)

13 years agos3-librpc: Fixed GUID_from_data_blob() with length of 32.
Andreas Schneider [Mon, 28 Jun 2010 19:00:30 +0000 (21:00 +0200)]
s3-librpc: Fixed GUID_from_data_blob() with length of 32.

If we hit the case that the blob length is 32. The code goes to the end
of the function and generates a GUID with garbage.
So try to convert the blob to the GUID and return.

Fix bug #7538 (Backport fixes for GUID_from_data_blob).
(cherry picked from commit 3c4353d2aa15db278bb87c949cce2deb3a5072ca)

13 years agos3-printing: Fix Bug #7541, %D in "printer admin" causing smbd crash.
Günther Deschner [Thu, 1 Jul 2010 11:58:56 +0000 (13:58 +0200)]
s3-printing: Fix Bug #7541, %D in "printer admin" causing smbd crash.

Guenther

13 years agos3-docs: Add missing whitespace.
Karolin Seeger [Mon, 21 Jun 2010 08:30:25 +0000 (10:30 +0200)]
s3-docs: Add missing whitespace.

Karolin
(cherry picked from commit 2352538362977e456e8d05783f2732ff650cea41)
(cherry picked from commit 9d9a9a0f79ad6fa894f72a4678f59fb40c9fce94)
(cherry picked from commit fb5b75d26b882c48ac073b6425dfce15873c243e)

13 years agos3-docs: Fix some of ntlm_auth ntlm-server-1 protocol documentation.
Günther Deschner [Wed, 16 Jun 2010 15:08:36 +0000 (17:08 +0200)]
s3-docs: Fix some of ntlm_auth ntlm-server-1 protocol documentation.

Guenther
(cherry picked from commit cfb67b1a169350a8316532eb5d53de4a3f2bacb3)
(cherry picked from commit b3ccbcb83650cea627ad97e920d3f73659ffa6a0)

13 years agos3: Fix EnumDomainAliases when no aliases are in LDAP
Volker Lendecke [Thu, 10 Jun 2010 13:40:14 +0000 (15:40 +0200)]
s3: Fix EnumDomainAliases when no aliases are in LDAP

We used to return NT_STATUS_ACCESS_DENIED, now we just return 0 entries, just
like W2k8 does.

usrmgr.exe was pretty unhappy with the NT_STATUS_ACCESS_DENIED
(cherry picked from commit f66cc827096c53d4d16b8c850c83a3b5664e9725)

Fix bug #7262 (Unable to maintain users' groups via UsrMgr).
(cherry picked from commit 1439a1d7ff406dd5dce885100349751151c14bf6)

13 years agos3:pdb_ldap: fix bug 7507 - init_sam_from_ldap stores group in sid2uid cache
Michael Adam [Thu, 10 Jun 2010 09:56:15 +0000 (11:56 +0200)]
s3:pdb_ldap: fix bug 7507 - init_sam_from_ldap stores group in sid2uid cache
(cherry picked from commit ba809ecb8ab217e4376bf75d2300e146b62b88eb)
(cherry picked from commit cc740fb5eb56a0875703753d4a116d2fe33ec186)

13 years agos3-netdomjoin-gui: Fix Bug #7500. Fix 'not a string literal' warning in netdomjoin...
Günther Deschner [Tue, 8 Jun 2010 09:25:00 +0000 (11:25 +0200)]
s3-netdomjoin-gui: Fix Bug #7500. Fix 'not a string literal' warning in netdomjoin-gui.

Patch from Buchan Milne <bgmilne@mandriva.org>.

Thanks!

Guenther
(cherry picked from commit 575b1018c65312e9eab562cf4851524cf2f8f24a)
(cherry picked from commit 1419c154d67b8ffaf0d6e2e3ba103121ab3736f5)

14 years agos3-kerberos: temporary fix for ipv6 in print_kdc_line().
Günther Deschner [Fri, 14 May 2010 22:34:35 +0000 (00:34 +0200)]
s3-kerberos: temporary fix for ipv6 in print_kdc_line().

Currently no krb5 lib supports "kdc = ipv6 address" at all, so for now just fill
in just the kdc_name if we have it and let the krb5 lib figure out the
appropriate ipv6 address

ipv6 gurus, please check.

Guenther
(cherry picked from commit dd5a4e23f8c24564d3fd21bb8d01172321087362)

The last 3 patches fix bug #7341 (winbind not working over IPv6).

14 years agos3-kerberos: pass down kdc_name to create_local_private_krb5_conf_for_domain().
Günther Deschner [Fri, 14 May 2010 21:23:34 +0000 (23:23 +0200)]
s3-kerberos: pass down kdc_name to create_local_private_krb5_conf_for_domain().

Guenther
(cherry picked from commit e3bdff3d67b46277ee59685218bd90f3788b487d)

14 years agos3-winbind: make the getpeername() checks in cm_prepare_connection IPv6 aware.
Günther Deschner [Fri, 14 May 2010 21:21:47 +0000 (23:21 +0200)]
s3-winbind: make the getpeername() checks in cm_prepare_connection IPv6 aware.

Note that this failure was hard to track, as winbind did only log a super helpful
"cm_prepare_connection: Success" debug message.

IPv6 gurus, please check

Successfully tested in two independent IPv6 networks now.

Guenther
(cherry picked from commit 14ac2bb36ee22be6133ca1d069dc5de6c1891f47)

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

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 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 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 agoWHATSNEW: Start release notes for Samba 3.4.9.
Karolin Seeger [Tue, 11 May 2010 12:40:39 +0000 (14:40 +0200)]
WHATSNEW: Start release notes for Samba 3.4.9.

Karolin

14 years agoVERSION: Bump version up to 3.4.9.
Karolin Seeger [Tue, 11 May 2010 12:38:38 +0000 (14:38 +0200)]
VERSION: Bump version up to 3.4.9.

Karolin

14 years agoWHATSNEW: Update changes since 3.4.7.
Karolin Seeger [Mon, 10 May 2010 12:55:44 +0000 (14:55 +0200)]
WHATSNEW: Update changes since 3.4.7.

Karolin

14 years agos3-spoolss: fix rpcclient after setprinter IDL fixes.
Günther Deschner [Wed, 16 Dec 2009 09:33:13 +0000 (10:33 +0100)]
s3-spoolss: fix rpcclient after setprinter IDL fixes.

Guenther
(cherry picked from commit 31cf2b086a9275955b0480b4b9035dc12671761d)

14 years agospoolss: more mork on SetPrinterInfo() levels.
Günther Deschner [Wed, 16 Dec 2009 09:32:35 +0000 (10:32 +0100)]
spoolss: more mork on SetPrinterInfo() levels.

Guenther
(cherry picked from commit be95cb6f8357334af08d1502910a429328b85bc5)

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 agos3-net_conf: Display an error on net conf import failures.
Jim McDonough [Wed, 21 Apr 2010 18:53:51 +0000 (20:53 +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-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 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 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 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

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

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 e0ece652956292cc67383535a0fa174b5015d91e)