1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

37073 Commits

Author SHA1 Message Date
Rusty Russell
5a7874e119 tdb_traverse/tdb_traverse_read: check returns for negative, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for < 0 instead of == -1.

Also, there's no tdb_traverse_read in TDB2: we don't try to make
traverse reliable any more, so there are no write locks anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
9850f25633 tdb_chainunlock: ignore return value.
TDB2 returns void here.  tdb_chainunlock will *always* return with the
chain unlocked, but it will complain via the log function if it wasn't
locked.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
868d77bc5b tdb_chainlock: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
d6251996fa tdb_transaction_cancel: ignore return value.
TDB2 returns void here.  tdb_transaction_cancel will *always* return
with the transaction cancelled, but it will complain via the log
function if a transaction wasn't in progress.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
2b1452b2fc tdb_transaction_commit: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
6bc59d77b6 tdb_store: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
1078eb21c4 tdb_delete: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
058c4f8492 tdb_fetch_compat: use instead of tdb_fetch.
This is a noop for tdb1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
0e4c358e27 tdb_compat.h: divert every tdb build and includes to tdb_compat
We change all the headers and wscript files to use tdb_compat; this
means we have one place to decide whether to use TDB1 or TDB2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:34 +02:00
Rusty Russell
eb8cb4f548 source3/smdb/files.c: file_name_hash to use Jenkins hash from CCAN.
Rather than tdb's internal one.
2011-06-20 11:18:34 +02:00
Rusty Russell
f72dd0cf0f source3/lib/util.c: str_checksum to use Jenkins hash from CCAN.
Rather than tdb's internal one.
2011-06-20 11:18:34 +02:00
Rusty Russell
20687dcd7b smb_share_modes: don't use tdb_jenkins_hash.
It's a nice hash, but this usage has nothing to do with TDB.  So use the
Jenkins hash directly from CCAN instead (it's the same one).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:34 +02:00
Rusty Russell
754c677b0b lib: import ccan modules for tdb2
Imported from git://git.ozlabs.org/~ccan/ccan init-1161-g661d41f

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:34 +02:00
Volker Lendecke
a8c3d38bc8 s3: Replace shadow_copy2 with a new implementation
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Jun 20 11:17:47 CEST 2011 on sn-devel-104
2011-06-20 11:17:47 +02:00
Andrew Bartlett
a1f04e8abc libcli/util Rename common map_nt_error_from_unix to avoid duplicate symbol
The two error tables need to be combined, but for now seperate the names.

(As the common parts of the tree now use the _common function,
errmap_unix.c must be included in the s3 autoconf build).

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Jun 20 08:12:03 CEST 2011 on sn-devel-104
2011-06-20 08:12:03 +02:00
Andrew Bartlett
018f4a5889 libcli/util Bring samba4 unix -> nt_status code in common.
Due to library link orders, this is already the function that is being
used.  However we still need to sort out the duplicate symbol issues,
probably by renaming things.

Andrew Bartlett
2011-06-20 14:36:06 +10:00
Andrew Bartlett
ee90e01030 s3-winbind Move winbind privileged socket dir into state_path()
On default installs, this will be the same as the old lock_path(), but
lock_path() is now a directory that can safely be mapped to /var/locks
and removed by the OS on reboot.  It is important that the directory
permissions of this directory be preserved, as they may be customised.

Andrew Bartlett
2011-06-20 14:05:32 +10:00
Volker Lendecke
5290faca7a s3: Fix Coverity ID 2582: FORWARD_NULL
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jun 19 20:46:43 CEST 2011 on sn-devel-104
2011-06-19 20:46:43 +02:00
Volker Lendecke
9cc68e49ee s3: Fix Coverity ID 2583: RESOURCE_LEAK 2011-06-19 19:36:27 +02:00
Volker Lendecke
59887edd1d s3: Remove unused name_queries
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jun 19 15:14:38 CEST 2011 on sn-devel-104
2011-06-19 15:14:38 +02:00
Volker Lendecke
809e5ea5ba s3: Fix some type-punned warnings 2011-06-19 14:03:52 +02:00
Volker Lendecke
f811e894c4 s3: Add name_resolve_bcast_send/recv 2011-06-19 14:03:51 +02:00
Volker Lendecke
bc3261f0c5 s3: Fix a memleak in name_resolve_bcast
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jun 19 12:40:55 CEST 2011 on sn-devel-104
2011-06-19 12:40:55 +02:00
Volker Lendecke
763941f245 s3: Test nttrans_create
This is a test for the share security descriptor exception for nttrans_create
2011-06-19 11:30:02 +02:00
Volker Lendecke
8e02b70767 s3: Add incomplete cli_nttrans_create
secdesc only at this moment
2011-06-19 11:08:12 +02:00
Volker Lendecke
ef816f1c4e s3: Correctly align even 2011-06-19 11:08:12 +02:00
Christian Ambach
bb66504dad s3:modules fix Bug 8244 - Cannot copy files larger than 2 GB to Samba share
the time_audit module uses int instead of uint64 as return value
in get_alloc_size so that sizes of files larger than 2 GB are
cut of leading to wrong replies to NtCreateAndX and Windows
clients giving up

While checking the types of all functions, I found two more wrong
return value types that needed correction

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Fri Jun 17 23:11:10 CEST 2011 on sn-devel-104
2011-06-17 23:11:10 +02:00
Andrew Bartlett
4162c7b74a errors: reorder error codes for easier s3/s4 comparison 2011-06-17 17:09:00 +10:00
Andrew Tridgell
264409750a s3-util: remove the s3 nterr.c
this is now in common code

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-06-17 17:09:00 +10:00
Andrew Bartlett
1233ba7bf3 libclu/util: Move get_friendly_nt_error_msg() in common.
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-17 17:08:59 +10:00
Stefan Metzmacher
5961852d9c s3:wb_lookupsids: add some paranoia checks to wb_lookupsids_recv()
This hopefully catches future bugs.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jun 16 19:50:16 CEST 2011 on sn-devel-104
2011-06-16 19:50:16 +02:00
Stefan Metzmacher
85809ccbe3 s3:wb_lookupsids: don't ignore 'result' and check if we got useable values
The wrong fix for bug #8215 discovered this bug, as it caused
sam_rids_to_names() to always return NT_STATUS_NONE_MAPPED.

metze
2011-06-16 18:41:01 +02:00
Stefan Metzmacher
283f8a7fb5 Revert "s3-winbind: Fix paranoia checks in winbindd_samr.c."
This reverts commit 207a84d725.

This is the wrong fix for the problem, see bug #8215.

metze
2011-06-16 18:41:01 +02:00
Stefan Metzmacher
67512152c0 s3:rpc_server/svcctl: fix valgrind bug in _svcctl_QueryServiceObjectSecurity()
r->out.buffer needs to stay in its size, as it will be marshalled completely.
As it's preallocated and initialized with zeros, we just need to copy
the payload into it, even if it's smaller than the offered buffer size.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jun 16 14:15:47 CEST 2011 on sn-devel-104
2011-06-16 14:15:47 +02:00
Stefan Metzmacher
11683ccf3e s3:rpc_server/svcctl: fix valgrind bugs in _svcctl_QueryServiceConfig2W()
r->out.buffer needs to stay in its size, as it will be marshalled completely.
As it's preallocated and initialized with zeros, we just need to copy
the payload into it.

If we always marshall the return buffer, we already have the needed
buffer size and don't need to call ndr_size_* functions.

metze
2011-06-16 12:40:14 +02:00
Stefan Metzmacher
48de3e51ea s3:rpc_server/svcctl: don't allocate return values on a temporary stackframe
And always initialize the whole return structure.

This caused samba3.posix_s3.rpc.svcctl to be flakey.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jun 16 11:34:34 CEST 2011 on sn-devel-104
2011-06-16 11:34:34 +02:00
Volker Lendecke
68a8c58d12 s3: Add debug level 0 warnings to make_new_server_info_guest
I've got a backtrace where this must have failed, but it is not clear why. If
this fails, we should really complain because we can't start up.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Jun 15 15:20:49 CEST 2011 on sn-devel-104
2011-06-15 15:20:49 +02:00
Volker Lendecke
51567de6d7 s3: Fix the return of make_new_server_info_guest 2011-06-15 14:11:05 +02:00
Andreas Schneider
207a84d725 s3-winbind: Fix paranoia checks in winbindd_samr.c.
This fixes looking up the correct unix user instead of allocation a new
uid and creating it.

Fix bug #8215 (winbind unix username lookup doesn't work correctly).
(cherry picked from commit 531edfdd19)

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Wed Jun 15 09:56:01 CEST 2011 on sn-devel-104
2011-06-15 09:56:01 +02:00
Stefan Metzmacher
5d736d8777 s3:utils/net_*registry: use c99 initializers which are supported by old gcc 2.95 compilers (bug #8226)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Jun 15 03:48:41 CEST 2011 on sn-devel-104
2011-06-15 03:48:41 +02:00
Volker Lendecke
df6b877cc2 s3: Fix connecting to ctdb as non-root
This is at least one instance which I could identify

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Jun 14 19:06:39 CEST 2011 on sn-devel-104
2011-06-14 19:06:39 +02:00
Volker Lendecke
2817eed741 s3: Fix count_current_connections
"False" is not really a valid return value for "int"..
2011-06-14 17:55:30 +02:00
Christian Ambach
7639684f27 s3-utils: fix crash in net cache get
free the blob correctly

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Tue Jun 14 12:01:59 CEST 2011 on sn-devel-104
2011-06-14 12:01:59 +02:00
Stefan Metzmacher
8096b1a9a4 s3:smbd/quotas: add #include "system/filesys.h" (bug #8224)
This should fix the build on FreeBSD

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jun 14 09:38:49 CEST 2011 on sn-devel-104
2011-06-14 09:38:49 +02:00
Michael Adam
9923a8cf43 s3:proto.h: remove prototypes of error functions moved to common code.
ntstatus_to_dos, werror_to_ntstatus, ntstatus_to_werror

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon Jun 13 03:31:58 CEST 2011 on sn-devel-104
2011-06-13 03:31:57 +02:00
Volker Lendecke
c118bcf755 s3: Use resolve_wins_send/recv in resolve_wins
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jun 12 18:19:41 CEST 2011 on sn-devel-104
2011-06-12 18:19:41 +02:00
Volker Lendecke
0dfcf3ef78 s3: Add resolve_wins_send/recv 2011-06-12 17:07:48 +02:00
Volker Lendecke
396b646123 s3: Add wins_server_tag_ips()
For a given tag, return the list of all wins servers
2011-06-12 17:07:48 +02:00
Volker Lendecke
12c3c35596 s3: Add query_wins_list_send/recv 2011-06-12 17:07:48 +02:00
Volker Lendecke
f0994c7495 s3: Fix IO_TIMEOUT handling for wins queries 2011-06-12 17:07:47 +02:00