samba.git
15 years agoMerge branch 'v3-3-test' of ssh://jra@git.samba.org/data/git/samba into v3-3-test
Jeremy Allison [Fri, 16 Jan 2009 20:25:54 +0000 (12:25 -0800)]
Merge branch 'v3-3-test' of ssh://jra@git.samba.org/data/git/samba into v3-3-test

15 years agoFix a segfault if ? is there but the options are NULL. This is the case if SMBC_parse...
Andreas Schneider [Fri, 16 Jan 2009 20:24:58 +0000 (12:24 -0800)]
Fix a segfault if ? is there but the options are NULL. This is the case if SMBC_parse_path is called by SMBC_stat_ctx.

15 years ago"First thing, kill all the language lawyers" :-). Ensure possible insane compilers
Jeremy Allison [Fri, 16 Jan 2009 19:55:57 +0000 (11:55 -0800)]
"First thing, kill all the language lawyers" :-). Ensure possible insane compilers
can't kill us later.
Jeremy.

15 years agoads_connect: Return immediately on a failed GC connection.
Gerald (Jerry) Carter [Fri, 16 Jan 2009 18:06:49 +0000 (12:06 -0600)]
ads_connect: Return immediately on a failed GC connection.

ads_connect_gc() feeds an explicit server to ads_connect().  However, if the
resulting connection fails, the latter function was attempting to find a DC
on its own and continuing the connection.  This resulting in GC searches being
sent over a connection using port 389 which would fail when using the base
search suffix outside of the domain naming context.

The fix is to fail immediately in ads_connect() since the GC lookup ordering
is handled already in ads_connect_gc().

(was commit 073e9f42f0c5f5de5d736ec7843d80a274c891ce in master)

15 years agoFix bug #6040 - Missing <th> header in Status page.
Jeremy Allison [Thu, 15 Jan 2009 23:55:29 +0000 (15:55 -0800)]
Fix bug #6040 -  Missing <th> header in Status page.
Based on a patch from pkg-samba-maint@lists.alioth.debian.org.
Jeremy.

15 years agoMerge branch 'v3-3-test' of ssh://jra@git.samba.org/data/git/samba into v3-3-test
Jeremy Allison [Thu, 15 Jan 2009 23:53:23 +0000 (15:53 -0800)]
Merge branch 'v3-3-test' of ssh://jra@git.samba.org/data/git/samba into v3-3-test

15 years agoAllow reinit_after_fork to be called safely from within swat and other binaries that...
Jeremy Allison [Thu, 15 Jan 2009 23:50:50 +0000 (15:50 -0800)]
Allow reinit_after_fork to be called safely from within swat and other binaries that don't have
an event context or a msg context. Fixes crash bug in swat.
Jeremy.

15 years agopackaging(RHEL-CTDB): export CC - really use ccache...
Stefan Metzmacher [Thu, 15 Jan 2009 12:46:38 +0000 (13:46 +0100)]
packaging(RHEL-CTDB): export CC - really use ccache...

metze

Signed-off-by: Michael Adam <obnox@samba.org>
15 years agoFix bug #6040 - Calling Samba print server with an aliased DNS-name fails.
Jeremy Allison [Thu, 15 Jan 2009 18:41:01 +0000 (10:41 -0800)]
Fix bug #6040 - Calling Samba print server with an aliased DNS-name fails.
Jeremy.

15 years agoFix bug #6035 - Possible race between fcntl F_SETLKW and alarm delivery.
Jeremy Allison [Wed, 14 Jan 2009 21:15:59 +0000 (13:15 -0800)]
Fix bug #6035 - Possible race between fcntl F_SETLKW and alarm delivery.
Jeremy.

15 years agoFix bug in get_dc_name_via_netlogon(), null pointer refrence.
Bo Yang [Wed, 14 Jan 2009 19:48:16 +0000 (11:48 -0800)]
Fix bug in get_dc_name_via_netlogon(), null pointer refrence.

15 years agoDon't send message to any other child in child process.
Bo Yang [Wed, 14 Jan 2009 19:16:00 +0000 (11:16 -0800)]
Don't send message to any other child in child process.

15 years agoFrom boyang - ensure we never "return" from a forked child, always _exit().
Jeremy Allison [Tue, 13 Jan 2009 23:42:29 +0000 (15:42 -0800)]
From boyang - ensure we never "return" from a forked child, always _exit().
Jeremy.

15 years agoFix bug #6019 File corruption in Clustered SMB/NFS environment managed via CTDB
Jeremy Allison [Tue, 13 Jan 2009 19:15:00 +0000 (11:15 -0800)]
Fix bug #6019 File corruption in Clustered SMB/NFS environment managed via CTDB
Jeremy.

15 years agoDeprecate the "share modes" parameter to address bug #6024, swat disagrees with smbst...
Jeremy Allison [Tue, 13 Jan 2009 00:27:31 +0000 (16:27 -0800)]
Deprecate the "share modes" parameter to address bug #6024, swat disagrees with smbstatus as to share mode with share modes = No set in samba.
Jeremy.

15 years agos3:libsmb: handle the smb signing states the same in the krb5 and ntlmssp cases
Stefan Metzmacher [Mon, 12 Jan 2009 11:32:46 +0000 (12:32 +0100)]
s3:libsmb: handle the smb signing states the same in the krb5 and ntlmssp cases

SMB signing works the same regardless of the used auth mech.

We need to start with the temp signing ("BSRSPYL ")
and the session setup response with NT_STATUS_OK
is the first signed packet.

Now we set the krb5 session key if we got the NT_STATUS_OK
from the server and then recheck the packet.

All this is needed to make the fallback from krb5 to
ntlmssp possible. This commit also resets the cli->vuid
value to 0, if the krb5 auth didn't succeed. Otherwise
the server handles NTLMSSP packets as krb5 packets.

The restructuring of the SMB signing code is needed to
make sure the krb5 code only starts the signing engine
on success. Otherwise the NTLMSSP fallback could not initialize
the signing engine (again).

metze
(cherry picked from commit 7d9fd64f38aa5821b38c1223cf87979fc87bfb71)

15 years agoEven for srclen == 0 we have to return something
Volker Lendecke [Sat, 10 Jan 2009 16:59:43 +0000 (17:59 +0100)]
Even for srclen == 0 we have to return something

This fixes a regression reported by Corinna Vinschen <corinna@vinschen.de>

Thanks,

Volker

15 years agoDon't set child->requests to NULL in parent after fork
Bo Yang [Sat, 10 Jan 2009 22:09:48 +0000 (14:09 -0800)]
Don't set child->requests to NULL in parent after fork

15 years agos3/smbpasswd: Check if Unix account exists before asking for the password.
Karolin Seeger [Sat, 10 Jan 2009 03:39:46 +0000 (19:39 -0800)]
s3/smbpasswd: Check if Unix account exists before asking for the password.

Admins shouldn't have to type in the password twice when the passdb account
cannot be created because the Unix account is missing.

Karolin

15 years agodocs: Improve man mount.cifs.
Karolin Seeger [Fri, 9 Jan 2009 10:22:00 +0000 (11:22 +0100)]
docs: Improve man mount.cifs.

Add hint about specifying the workgroup in the credentials file.
Whitespace cleanup.

This fixes bug #4541.
Patch based on proposed patch from Christian Perrier <bubulle@debian.org>.
Thanks for reporting and providing a patch!

Karolin
(cherry picked from commit 1f7e09ea542df3a2f5f553c0cb11a39c74712950)

15 years agos3: Remove a few unnecessary checks from the streams depot module and fix to work...
Tim Prouty [Fri, 9 Jan 2009 01:21:08 +0000 (17:21 -0800)]
s3: Remove a few unnecessary checks from the streams depot module and fix to work with NTRENAME

Handling of error codes when renaming a file to a stream and a stream
to a file is now done in rename_internals_fsp.

The NTRENAME stream path only passes in the stream name, so the new
base can now be different from the old base.

15 years agos3: Remove a few unnecessary checks from the streams xattr module
Tim Prouty [Fri, 9 Jan 2009 01:20:14 +0000 (17:20 -0800)]
s3: Remove a few unnecessary checks from the streams xattr module

Handling of error codes when renaming a file to a stream and a stream
to a file is now done in rename_internals_fsp.

The NTRENAME stream path only passes in the stream name, so the new
base can now be different from the old base.

15 years agos3: Allow renames of streams via NTRENAME and fix stream error codes on rename
Tim Prouty [Fri, 9 Jan 2009 01:19:24 +0000 (17:19 -0800)]
s3: Allow renames of streams via NTRENAME and fix stream error codes on rename

The test_streams_rename2 test in RAW-STREAMS verifies these changes

15 years agoFix bug #6021 - smbclient du command does not recuse properly
Jeremy Allison [Thu, 8 Jan 2009 23:42:38 +0000 (15:42 -0800)]
Fix bug #6021 - smbclient du command does not recuse properly
Jeremy.

15 years agoFix race condition in alarm lock processing noticed by Richard Sharpe <realrichardsha...
Jeremy Allison [Thu, 8 Jan 2009 18:34:23 +0000 (10:34 -0800)]
Fix race condition in alarm lock processing noticed by Richard Sharpe <realrichardsharpe@gmail.com>.
"It seems to me that if the lock is already held by another process when we
enter this code, there is a race between the timeout and the granting. If
the lock is subsequently granted, the process releasing the lock will signal
the wait variable (or whatever) and our process will be scheduled. However,
if the timeout occurs before we are scheduled, the timeout will be delivered
first.

We will have the lock but will forget we have the lock, and never release
it."
Jeremy.

15 years agoFix bug #6016 - Alternate Data Streams / Extended Attributes seem to conflict.
Jeremy Allison [Wed, 7 Jan 2009 22:55:13 +0000 (14:55 -0800)]
Fix bug #6016 - Alternate Data Streams / Extended Attributes seem to conflict.
Jeremy.

15 years agorefresh sequence number as soon as possible when domain->sequence_number == -1 or...
boyang [Wed, 7 Jan 2009 19:01:48 +0000 (11:01 -0800)]
refresh sequence number as soon as possible when domain->sequence_number == -1 or domain->last_status is not ok.

15 years agoMake winbindd_cm.c use winbindd_reinit_after_fork().
Jeremy Allison [Wed, 7 Jan 2009 01:35:34 +0000 (17:35 -0800)]
Make winbindd_cm.c use winbindd_reinit_after_fork().
Jeremy.

15 years agoFix bug #6017, - magic script does not work. based on a patch from monyo@samba.gr.jp.
Jeremy Allison [Wed, 7 Jan 2009 00:06:22 +0000 (16:06 -0800)]
Fix bug #6017, - magic script does not work. based on a patch from monyo@samba.gr.jp.
Jeremy.

15 years agoAdd winbindd_reinit_after_fork(), cleaning out all possible events
Jeremy Allison [Tue, 6 Jan 2009 23:15:30 +0000 (15:15 -0800)]
Add winbindd_reinit_after_fork(), cleaning out all possible events
in a forked child.
Jeremy.

15 years agoFactor out lots of common code into a function.
Jeremy Allison [Tue, 6 Jan 2009 21:16:25 +0000 (13:16 -0800)]
Factor out lots of common code into a function.
Jeremy.

15 years agos3:events: change event_add_timed() prototype to match samba4
Stefan Metzmacher [Tue, 6 Jan 2009 19:22:08 +0000 (11:22 -0800)]
s3:events: change event_add_timed() prototype to match samba4

metze

15 years agos3/swat: Fix creation of the first share using SWAT.
Volker Lendecke [Tue, 6 Jan 2009 14:13:43 +0000 (15:13 +0100)]
s3/swat: Fix creation of the first share using SWAT.

This fixes bug #5965.

15 years agodocs: Improve description of the share commands in man smb.conf.
Karolin Seeger [Tue, 6 Jan 2009 11:26:23 +0000 (12:26 +0100)]
docs: Improve description of the share commands in man smb.conf.

-Correct the parameter names.
-Fix typos.
-Fix related parameters.

This fixes bug #6008.
Thanks to TAKAHASHI Motonobu <monyo@samba.gr.jp> for reporting!

Karolin
(cherry picked from commit 8b7f66c548ed170d2dab0c91ccff4aca00f4b52d)

15 years agodocs: Fix example in man vfs_recycle.
Karolin Seeger [Tue, 6 Jan 2009 09:26:37 +0000 (10:26 +0100)]
docs: Fix example in man vfs_recycle.

This fixes bug #6001.
Thanks to TAKAHASHI Motonobu <monyo@samba.gr.jp> for reporting!

Karolin
(cherry picked from commit 9f44a17c3bf36067d04cec036c3e529798932cd7)

15 years agoset entry->refresh_time to make ccache_regain_all_now() work correctly.
Bo Yang [Tue, 6 Jan 2009 05:12:03 +0000 (21:12 -0800)]
set entry->refresh_time to make ccache_regain_all_now() work correctly.

15 years agos3:events: get rid of the stupid set_event_dispatch_time() function
Stefan Metzmacher [Tue, 6 Jan 2009 05:06:25 +0000 (21:06 -0800)]
s3:events: get rid of the stupid set_event_dispatch_time() function

metze

15 years agos3:events: get rid of the stupid cancel_named_event() function
Stefan Metzmacher [Tue, 6 Jan 2009 05:05:48 +0000 (21:05 -0800)]
s3:events: get rid of the stupid cancel_named_event() function

metze

15 years agos3:events: move prototypes to event.h
Stefan Metzmacher [Tue, 6 Jan 2009 05:05:20 +0000 (21:05 -0800)]
s3:events: move prototypes to event.h

metze

15 years agos3:events: remove unused stuff
Stefan Metzmacher [Tue, 6 Jan 2009 04:55:24 +0000 (20:55 -0800)]
s3:events: remove unused stuff

metze

15 years agos3:winbindd: regain tickets for all ccache entries, when we go online
Stefan Metzmacher [Tue, 6 Jan 2009 04:54:03 +0000 (20:54 -0800)]
s3:winbindd: regain tickets for all ccache entries, when we go online

set_event_dispatch_time() is stupid by design and only handles
the first event with a given name.

metze

15 years agos3:winbindd: cancel all ccache entry events and not just one
Stefan Metzmacher [Tue, 6 Jan 2009 04:40:19 +0000 (20:40 -0800)]
s3:winbindd: cancel all ccache entry events and not just one

cancel_named_event() is stupid by design and also only cancels
one single event.

metze

15 years agos3:winbindd: recreate the per domain check_online_event without relying on global...
Stefan Metzmacher [Tue, 6 Jan 2009 04:35:03 +0000 (20:35 -0800)]
s3:winbindd: recreate the per domain check_online_event without relying on global state

set_event_dispatch_time() is stupid by design and just picks the first
event with the given name.

metze

15 years agos3:winbindd: rename fd_event => winbindd_fd_event
Stefan Metzmacher [Tue, 6 Jan 2009 04:20:31 +0000 (20:20 -0800)]
s3:winbindd: rename fd_event => winbindd_fd_event

It's really confusing to have two versions of 'fd_event'

metze

15 years agos3:winbindd: move WINBINDD_CCACHE_ENTRY and WINBINDD_MEMORY_CREDS to winbindd.h
Stefan Metzmacher [Tue, 6 Jan 2009 04:12:30 +0000 (20:12 -0800)]
s3:winbindd: move WINBINDD_CCACHE_ENTRY and WINBINDD_MEMORY_CREDS to winbindd.h

metze

15 years agoFix broken krb5 refresh chain
Bo Yang [Tue, 6 Jan 2009 04:05:53 +0000 (20:05 -0800)]
Fix broken krb5 refresh chain

Signed-off-by: Stefan Metzmacher <metze@samba.org>
15 years agoclean event context after child is forked.
Bo Yang [Tue, 6 Jan 2009 00:19:48 +0000 (16:19 -0800)]
clean event context after child is forked.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
15 years agoAttempt to fix crash seen with new CUPS async printcap loading code.
Jeremy Allison [Mon, 5 Jan 2009 19:42:52 +0000 (11:42 -0800)]
Attempt to fix crash seen with new CUPS async printcap loading code.
Karolin please pull for 3.3.0.
Jeremy.

15 years agoexamples: Avoid bashism in perfcount.init.
Karolin Seeger [Mon, 5 Jan 2009 15:33:00 +0000 (16:33 +0100)]
examples: Avoid bashism in perfcount.init.

This fixes bug #6000.
Thanks to the Debian Samba package maintainers for providing the patch!
Remove trailing whitespaces.

Karolin
(cherry picked from commit 2e09746a4db4186c9d648370b9004971bc18e5c9)

15 years agoRevert "examples: Avoid bashism in perfcount.init."
Karolin Seeger [Mon, 5 Jan 2009 15:35:11 +0000 (16:35 +0100)]
Revert "examples: Avoid bashism in perfcount.init."

This reverts commit e273c07e94ee607bbf05b6fa66cf3cea13fe4502.

15 years agoWHATSNEW: Update changes since 3.3.0rc2.
Karolin Seeger [Mon, 5 Jan 2009 15:16:18 +0000 (16:16 +0100)]
WHATSNEW: Update changes since 3.3.0rc2.

Karolin

15 years agoFix bug 6014 -- mget shouldn't segfault without arguments
Volker Lendecke [Mon, 5 Jan 2009 14:47:19 +0000 (15:47 +0100)]
Fix bug 6014 -- mget shouldn't segfault without arguments

Thanks to kevin.paulus@mtm.kuleuven.be for the bug report

Volker

15 years agoexamples: Avoid bashism in perfcount.init.
Karolin Seeger [Mon, 5 Jan 2009 13:54:28 +0000 (14:54 +0100)]
examples: Avoid bashism in perfcount.init.

This fixes bug #6000.
Thanks to the Debian Samba package maintainers for providing the patch!
Remove trailing whitespaces.

Karolin
(cherry picked from commit 73875cd344608b591fa884ab99b5f3a10550c149)

15 years agodocs: Document the -g option of smbclient.
Karolin Seeger [Mon, 5 Jan 2009 13:39:59 +0000 (14:39 +0100)]
docs: Document the -g option of smbclient.

This fixes bug #6013.
Thanks to the Debian Samba packages maintainers for reporting!

Karolin
(cherry picked from commit 6752d78e946b2c4278e2deba325c76fb7ffbc06a)

15 years agoFix a bad memleak in vfs_full_audit
Volker Lendecke [Mon, 5 Jan 2009 12:41:39 +0000 (13:41 +0100)]
Fix a bad memleak in vfs_full_audit

15 years agoFix bug 6012: Add "get_real_filename" to full_audit
Volker Lendecke [Mon, 5 Jan 2009 11:58:23 +0000 (12:58 +0100)]
Fix bug 6012: Add "get_real_filename" to full_audit

Thanks to Hodur <coil93@gmail.com> for testing!

Volker

15 years agosmbd: prevent access to root filesystem when connecting with empty service name
Michael Adam [Thu, 18 Dec 2008 17:01:55 +0000 (18:01 +0100)]
smbd: prevent access to root filesystem when connecting with empty service name

This only applies to a setup with "registry shares = yes"

Michael
(cherry picked from commit 288fa94ac7cfdf7457b5098c33fc840bed3d5410)
(cherry picked from commit e85526b184e66f86b7faa9d0a37288a09c12c19e)

15 years agoFix bug #6009 - Setting "min receivefile size = 1" breaks writes.
Jeremy Allison [Sun, 4 Jan 2009 19:46:28 +0000 (11:46 -0800)]
Fix bug #6009 - Setting "min receivefile size = 1" breaks writes.
Karolin please pull for 3.3.0. Thanks !
Jeremy.

15 years agoAlternative fix for 45db33e73 and 0d443ae7931
Volker Lendecke [Fri, 2 Jan 2009 13:53:26 +0000 (14:53 +0100)]
Alternative fix for 45db33e73 and 0d443ae7931

Simo is right, we need to ask passdb first. At least this fixes a nasty to find
NT_STATUS_ACCESS_DENIED problem in the build farm for the test run I just did
on host "opi".

Michael, can you re-check if this also fixes the error you found, leading to
the two fixes?

Thanks,

Volker

15 years agoRevert "Fix uid_to_sid mapping when the idmap cache is empty."
Volker Lendecke [Fri, 2 Jan 2009 14:02:03 +0000 (15:02 +0100)]
Revert "Fix uid_to_sid mapping when the idmap cache is empty."

This reverts commit d4bc1f8d79929dc1a1d06e92eaf85923a1848e6f.

15 years agoRevert "idmap: Remove passd check from idmap_backends_unixid_to_sid()."
Volker Lendecke [Fri, 2 Jan 2009 14:01:47 +0000 (15:01 +0100)]
Revert "idmap: Remove passd check from idmap_backends_unixid_to_sid()."

This reverts commit 3d22b77f1ac5e8f83d1063d87c68e60655a3ed6b.

15 years agopackaging(RHEL): fix typo in [u]mount.cifs installation
Michael Adam [Wed, 17 Dec 2008 21:27:39 +0000 (22:27 +0100)]
packaging(RHEL): fix typo in [u]mount.cifs installation

Michael
(cherry picked from commit 835108bcf84a5f47f46d237c7a93c572348125a1)

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 71c74725bce403e36e4dc38287802c95b8d4de66)

15 years agopackaging(RHEL): fix build of [u]mount.cifs
Michael Adam [Wed, 17 Dec 2008 17:56:34 +0000 (18:56 +0100)]
packaging(RHEL): fix build of [u]mount.cifs

mount.cifs is now built by make everything.
And it needs extra objects anyways (mtab.o),
which is why the build of mount.cifs failed.

Michael
(cherry picked from commit 96c811cf222be5463a6705feae73d6215685c5f1)

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 308dbca653ce1d689b75f9b781237c67df4233a8)

15 years agoWHATSNEW: Update changes since 3.3.0rc2.
Karolin Seeger [Fri, 2 Jan 2009 12:48:48 +0000 (13:48 +0100)]
WHATSNEW: Update changes since 3.3.0rc2.

Karolin

15 years agoHappy New Year!
Stefan Metzmacher [Fri, 2 Jan 2009 08:46:17 +0000 (09:46 +0100)]
Happy New Year!

metze

15 years agoFix bug 5913.
Volker Lendecke [Thu, 1 Jan 2009 21:05:03 +0000 (22:05 +0100)]
Fix bug 5913.

Never seen this to be a problem, but it doesn't hurt either :-)

15 years agoFix warnings in make test code.
Jeremy Allison [Thu, 1 Jan 2009 03:06:00 +0000 (19:06 -0800)]
Fix warnings in make test code.
Jeremy.

15 years agoFix all warnings with gcc4.3.
Jeremy Allison [Thu, 1 Jan 2009 01:27:52 +0000 (17:27 -0800)]
Fix all warnings with gcc4.3.
Jeremy.

15 years agoFix more asprintf and "ignoring return code" warnings from gcc 4.3.
Jeremy Allison [Thu, 1 Jan 2009 00:16:52 +0000 (16:16 -0800)]
Fix more asprintf and "ignoring return code" warnings from gcc 4.3.
Jeremy.

15 years agorecvfile can't be used for printing so far
Volker Lendecke [Wed, 31 Dec 2008 17:37:39 +0000 (18:37 +0100)]
recvfile can't be used for printing so far

15 years agos3:winbindd: we don't need to call messaging_reinit() twice
Stefan Metzmacher [Mon, 29 Dec 2008 15:31:57 +0000 (16:31 +0100)]
s3:winbindd: we don't need to call messaging_reinit() twice

reinit_after_fork() already calls messaging_reinit()

metze
(cherry picked from commit 429276556a4930fa1bc782904447120950073190)

15 years agoFix an ancient uninitialized variable read
Volker Lendecke [Tue, 30 Dec 2008 21:24:04 +0000 (22:24 +0100)]
Fix an ancient uninitialized variable read

The callers of open_file_ntcreate expect *psbuf to be filled correctly

15 years agoFix more "ignore return value" warnings from gcc 4.3.
Jeremy Allison [Wed, 31 Dec 2008 01:52:08 +0000 (17:52 -0800)]
Fix more "ignore return value" warnings from gcc 4.3.
Jeremy

15 years agos3:cluster: register the client connection via CTDB_CONTROL_TCP_ADD
Stefan Metzmacher [Thu, 18 Dec 2008 14:02:42 +0000 (15:02 +0100)]
s3:cluster: register the client connection via CTDB_CONTROL_TCP_ADD

This means we correctly pass IPv6 addresses too.
(CTDB_CONTROL_TCP_CLIENT was IPv4 only)

metze
(cherry picked from commit 465176b7e2fc1370dded850a80a8fe8519e79db8)

15 years agos3:pdb_tdb: store the next rid counter in passdb.tdb instead of winbind_idmap.tdb
Stefan Metzmacher [Mon, 15 Dec 2008 18:28:27 +0000 (19:28 +0100)]
s3:pdb_tdb: store the next rid counter in passdb.tdb instead of winbind_idmap.tdb

This upgrades the TDBSAM_VERSION to 4 and SAMU_BUFFER_V4.

metze
(cherry picked from commit 7516ba860c160e8b971b6f5bc1036370169e6e8a)

15 years agos3:passdb: add SAMU_BUFFER_V4 with no changes
Stefan Metzmacher [Tue, 16 Dec 2008 10:51:14 +0000 (11:51 +0100)]
s3:passdb: add SAMU_BUFFER_V4 with no changes

The upgrade is required because of the followin TDBSAM_VERSION
upgrade.

metze
(cherry picked from commit 671469ae7e3013809fe3995ec8f33dda9adda2ed)

15 years agos3:passdb: make marshalling struct samu from and to a buffer more generic
Stefan Metzmacher [Mon, 15 Dec 2008 17:46:37 +0000 (18:46 +0100)]
s3:passdb: make marshalling struct samu from and to a buffer more generic

This marshalling isn't specific to tdbsam and it's
ugly to have the related functions in two different files.

metze
(cherry picked from commit 0544734309feea44e8d449737a9934231f63693d)

15 years agoFix a memory leak in cups_pull_comment_location
Volker Lendecke [Tue, 30 Dec 2008 14:47:06 +0000 (15:47 +0100)]
Fix a memory leak in cups_pull_comment_location

We allocated "request" with ippNew, so we also should ippDelete it.

15 years agoFix a spinning smbd when printing
Volker Lendecke [Tue, 30 Dec 2008 13:05:26 +0000 (14:05 +0100)]
Fix a spinning smbd when printing

Without this, we end up adding more than one timed event. In the event handler
print_notify_event_send_messages() only one event will be deleted, all others
will fire indefinitely.

15 years agoDon't increment twice
Volker Lendecke [Mon, 29 Dec 2008 22:24:43 +0000 (23:24 +0100)]
Don't increment twice

Thanks metze :-)

15 years agoSecond part of the bugfix for #5933
Volker Lendecke [Mon, 29 Dec 2008 21:06:08 +0000 (22:06 +0100)]
Second part of the bugfix for #5933

Incrementing the next vuid did not correctly overflow

Now we survive BENCH-SESSSETUP with -o 100000. Takes a while though :-)

Thanks a lot to Ofer Tal <otsmb@shmoop.org> for reporting #5933

15 years agoFirst part of bugfix for #5933
Volker Lendecke [Mon, 29 Dec 2008 21:01:57 +0000 (22:01 +0100)]
First part of bugfix for #5933

Ofer Tal <otsmb@shmoop.org> fully correctly noted that we're incrementing
num_validated_vuids twice per session setup, but decrement it only once.
Looking at sesssetup.c we always call register_initial_vuid() before
register_existing_vuid(), so there's no point in incrementing it in
register_existing_vuid().

Jeremy, please check!

15 years agos3:dbwrap: fix dbwrap_store_uint32() to match dbwrap_store_int32()
Stefan Metzmacher [Wed, 17 Dec 2008 16:16:50 +0000 (17:16 +0100)]
s3:dbwrap: fix dbwrap_store_uint32() to match dbwrap_store_int32()

All callers expect 0 an success and -1 on error.

metze
(cherry picked from commit a255f9ce713b29552722ec73e4038226959e1c8e)

15 years agoAdd code to test write_data_iov a bit
Volker Lendecke [Mon, 22 Dec 2008 21:42:44 +0000 (22:42 +0100)]
Add code to test write_data_iov a bit

15 years agoAttempt to fix bug 5953: Make cli_send_smb_direct_writeX use writev
Volker Lendecke [Mon, 22 Dec 2008 21:32:12 +0000 (22:32 +0100)]
Attempt to fix bug 5953: Make cli_send_smb_direct_writeX use writev

It seems there are SMB servers around which can't cope with the write header
being sent in a packet of its own. With writev we keep the advantage of direct
writes, giving the kernel the chance to coalesce the write calls.

15 years agoMake write_data use write_data_iov
Volker Lendecke [Mon, 22 Dec 2008 21:17:59 +0000 (22:17 +0100)]
Make write_data use write_data_iov

15 years agoAdd write_data_iov
Volker Lendecke [Mon, 22 Dec 2008 21:17:28 +0000 (22:17 +0100)]
Add write_data_iov

15 years agoAdd sys_writev
Volker Lendecke [Sun, 21 Dec 2008 22:22:30 +0000 (23:22 +0100)]
Add sys_writev

15 years agoFix some nonempty blank lines
Volker Lendecke [Sun, 24 Aug 2008 10:46:26 +0000 (12:46 +0200)]
Fix some nonempty blank lines
(cherry picked from commit 010c7101e59477f0d5f3bf11c17f474ec6f79cc1)

Signed-off-by: Michael Adam <obnox@samba.org>
15 years agoFix some C++ warnings
Volker Lendecke [Sun, 24 Aug 2008 10:43:36 +0000 (12:43 +0200)]
Fix some C++ warnings
(cherry picked from commit dd9e4e6db04acf20f6ef7705955358c7ca442bbd)

Signed-off-by: Michael Adam <obnox@samba.org>
15 years agoFix bug #5990 - strict allocate should be checked before ftruncate
Jeremy Allison [Thu, 25 Dec 2008 20:12:22 +0000 (12:12 -0800)]
Fix bug #5990 - strict allocate should be checked before ftruncate
reported by and based on a patch by Yasuma Takeda <yasuma@osstech.co.jp>.
Jeremy.

15 years agoidmap: Remove passd check from idmap_backends_unixid_to_sid().
Michael Adam [Wed, 1 Oct 2008 06:53:15 +0000 (08:53 +0200)]
idmap: Remove passd check from idmap_backends_unixid_to_sid().

As noted by Metzy, it makes no sense here to check id->sid.
What is worse, this might even be passed in uninitialized.

This still fixes the bug for me (of course), but we might need
to check, if another special handling of passdb is needed
(possibly changing from constant return code NT_STATUS_OK...)

Michael
(cherry picked from commit 651b5d6deaab4fb3cb726fafd98171c79777631c)

Signed-off-by: Michael Adam <obnox@samba.org>
15 years agoFix uid_to_sid mapping when the idmap cache is empty.
Michael Adam [Wed, 1 Oct 2008 06:30:15 +0000 (08:30 +0200)]
Fix uid_to_sid mapping when the idmap cache is empty.

This failed for backends other than passed, since
idmap_backends_unixid_to_sid() always asked passdb first,
which returned Success no matter whether a mapping was
found or not.

One effect wast that getpwuid failed after "net cache flush".
Only after filling the cache with a getpwnam call it succeeded.

This fix makes the behaviour of idmap_backends_unixid_to_sid()
exactly the same as that of idmap_backends_sid_to_unixid()

Michael
(cherry picked from commit da7eb5e22e56ea718e393375085cf66a90afafc8)

Signed-off-by: Michael Adam <obnox@samba.org>
15 years agoFix more asprintf warnings and some error path errors.
Jeremy Allison [Tue, 23 Dec 2008 20:10:47 +0000 (12:10 -0800)]
Fix more asprintf warnings and some error path errors.
Jeremy.

15 years agoMore asprintf warning fixes.
Jeremy Allison [Tue, 23 Dec 2008 19:57:03 +0000 (11:57 -0800)]
More asprintf warning fixes.
Jeremy.

15 years agoMore asprintf warning fixes.
Jeremy Allison [Tue, 23 Dec 2008 19:45:40 +0000 (11:45 -0800)]
More asprintf warning fixes.
Jeremy.

15 years agoFix more asprintf errors and error code paths.
Jeremy Allison [Tue, 23 Dec 2008 19:29:02 +0000 (11:29 -0800)]
Fix more asprintf errors and error code paths.
Jeremy.

15 years agoFix more ‘asprintf’, declared with attribute warn_unused_result.
Jeremy Allison [Tue, 23 Dec 2008 18:42:38 +0000 (10:42 -0800)]
Fix more ‘asprintf’, declared with attribute warn_unused_result.
Jeremy.

15 years agoFix more "warning: ignoring return value of ‘asprintf’, declared with
Jeremy Allison [Tue, 23 Dec 2008 18:27:37 +0000 (10:27 -0800)]
Fix more "warning: ignoring return value of ‘asprintf’, declared with
attribute warn_unused_result"
Jeremy.

15 years agoFix another "format not a string literal and no format arguments" warning.
Jeremy Allison [Tue, 23 Dec 2008 17:49:47 +0000 (09:49 -0800)]
Fix another "format not a string literal and no format arguments" warning.
Jeremy