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

6282 Commits

Author SHA1 Message Date
Stefan Metzmacher
6457fb5c39 s3:lib: implement interpret_pid() as wrapper of server_id_from_string()
metze
2012-08-17 20:07:07 +02:00
Stefan Metzmacher
6a58c5fc64 s3:lib: implement serverid_equal() as macro of server_id_equal()
metze
2012-08-17 20:07:07 +02:00
Volker Lendecke
cbe25105c7 s3-g_lock: Make g_lock_lock more robust
If for some reason the cleanup of dbwrap_watch_send does not work
properly, we might starve indefinitely. Make the lock routine more
robust by retrying every 5-10 seconds. g_lock_trylock will clean up
orphaned entries.

Signed-off-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Thu Aug 16 19:44:00 CEST 2012 on sn-devel-104
2012-08-16 19:44:00 +02:00
Volker Lendecke
b83cd05ce1 s3-msg: For msg_channel, correct the talloc hierarchy
talloc_free() of a channel must free all immediate requests that have
piled up

Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-16 18:05:34 +02:00
Volker Lendecke
8e50ff02f1 s3-msg: Rename msg_channel_init_destructor
Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-16 18:05:34 +02:00
Volker Lendecke
494003fb67 s3-g_lock: Properly free "rec" on retry to avoid deadlock
Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-16 18:05:34 +02:00
Andrew Bartlett
24b1143068 s3-sysacls: Remove sys_acl_free_qualifier() as it is a no-op
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Aug 15 05:23:18 CEST 2012 on sn-devel-104
2012-08-15 05:23:18 +02:00
Andrew Bartlett
6ccfd05e72 s3-sysacls: Remove sys_acl_free_acl() and replace with TALLOC_FREE() 2012-08-15 11:44:50 +10:00
Andrew Bartlett
dcfb6aad16 s3-smbd: Change allocation of smb_acl_t to talloc()
The acl element is changed to be a talloc child, and is no longer one element
longer than requested by virtue of the acl[1] base pointer.

This also avoids one of the few remaining cases of over-allocation of a structure.

Andrew Bartlett
2012-08-15 11:44:43 +10:00
Jeremy Allison
a5495bc6b0 Remove smb_panic() from unix_strlower(). Just rely on error code return.
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Aug  9 23:52:53 CEST 2012 on sn-devel-104
2012-08-09 23:52:53 +02:00
Jeremy Allison
b70f23c2b5 Correctly check for errors in strlower_m() returns. 2012-08-09 12:08:18 -07:00
Jeremy Allison
ce21d08040 Fix strlower_m() to return an error indication. 2012-08-09 12:07:41 -07:00
Jeremy Allison
c13887defc Check error returns on strnorm(). 2012-08-09 12:07:32 -07:00
Jeremy Allison
526e875cec Check error returns from strupper_m() (in all reasonable places). 2012-08-09 12:06:54 -07:00
Jeremy Allison
9fcc6f27fb Change strupper_m() to return a value. 2012-08-09 09:47:35 -07:00
Jeremy Allison
af3e529c18 Fix bad return in unix_strupper. 2012-08-09 09:47:35 -07:00
Jeremy Allison
b6eb3a6808 Prepare to remove smb_panic() from unix_strlower(). 2012-08-09 09:47:35 -07:00
Jeremy Allison
8605b35e88 Fix bad return values in unix_strlower/unix_strupper. 2012-08-09 09:47:35 -07:00
Andrew Bartlett
434bed75c4 s3-events: Do not vasprintf() the tevent debug messages that will not be shown
This malloc() and free() actually shows up quite high on a call profile of
provision of the AD DC (and this is the matching patch for source3).

Andrew Bartlett
2012-08-09 20:14:22 +10:00
Rusty Russell
d65bded0c2 source3/loadparm.c: Move string_set/string_free inside.
The only user, so make them static inside loadparm.c

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-07 23:20:05 +10:00
Christian Ambach
764f2f99e0 s3-ctdb: return proper exit code
do not loose the result from ctdbd_messaging_send_blob()

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Fri Aug  3 14:49:01 CEST 2012 on sn-devel-104
2012-08-03 14:49:01 +02:00
Christian Ambach
0a45e9c4d2 s3-ctdb: adjust a loglevel 2012-08-03 12:53:49 +02:00
Volker Lendecke
6cfe6e92a1 s3-ctdb: Fix ctdb_serverids_exist for target nodes that died
Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-03 12:53:49 +02:00
Volker Lendecke
6d83e35410 s3-ctdb: Add debugs to ctdb_serverids_exist
Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-03 12:53:49 +02:00
Michael Adam
9b9ef92701 s3:ctdbd_conn: use unitX_t types consistently throughout the module
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-01 12:30:26 +02:00
Stefan Metzmacher
ec69eb41bf s3:dbwrap_ctdb: initialize db_record->db
metze
2012-07-31 09:34:20 +02:00
Björn Jacke
96340e60b7 s3: add Darwin sendfile support and merge with the FreeBSD code
This is based on the adpotion of the FreeBSD sendfile code that was done by
James Peach for Darwin.

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Jul 26 17:19:09 CEST 2012 on sn-devel-104
2012-07-26 17:19:09 +02:00
Andrew Bartlett
f3562424b6 lib/param: Move all enum declarations to lib/param
This is in preperation for the parameter table being made common.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2012-07-24 11:01:17 +02:00
Andreas Schneider
a256d61c50 s3-winbind: Fix bug #9052 resolving our own "Domain Local" groups.
We don't resolve our own "Domain Local" groups since bug #7843 has been
fixed. So we need to add the add resource groups to the sid list too.

Before bug #7843 the "Domain Local" groups were added with a
lookupuseraliases call, but this isn't done anymore for our domain
so we need to resolve resource groups here.

When to use Resource Groups:
http://technet.microsoft.com/en-us/library/cc753670%28v=WS.10%29.aspx

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jul 23 22:12:30 CEST 2012 on sn-devel-104
2012-07-23 22:12:29 +02:00
Jeremy Allison
b336b8ed58 Remove source3/lib/pidfile.c
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 20 03:57:20 CEST 2012 on sn-devel-104
2012-07-20 03:57:20 +02:00
Jeremy Allison
0d24370c76 Make the s3 pidfile use the common code inside lib/util/pidfile.c 2012-07-19 16:08:49 -07:00
Jeremy Allison
2922fdaaf0 Move source4/smbd/pidfile into lib/util in preparation for making it in common. 2012-07-19 15:41:52 -07:00
Volker Lendecke
3da86cc23f s3: Add tevent_wait_send/recv
To me it seems that we might have this functionality already somewere... I
just can't find it. Metze, do you have an idea?

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:54:20 -07:00
Volker Lendecke
dc5e3fba48 s3-libasys: Add asys_fsync() implementation
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:47:13 -07:00
Volker Lendecke
9dc78c90f3 s3-aio: Remove unused VFS functions and more
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:45:58 -07:00
Volker Lendecke
f9df073a31 s3: Make smbd/aio.c not depend on aio.h anymore
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:40:35 -07:00
Volker Lendecke
d44ccdd437 libasys
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 13:47:48 -07:00
Rusty Russell
06731bc28f source3/netapi: fix only caller which doesn't set up a talloc_stackframe()
libnetapi_free() needs a stackframe too; looked like Andrew and Günther
missed this in a37de9a959.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:28 +09:30
Rusty Russell
fe72740e82 loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some
of whom don't want to us talloc_tos().

A simple patch, but hits a lot of files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:23 +09:30
Rusty Russell
f3001e808c source3/lib/smbconf/testsuite.c: fix stackframe leak
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 05:07:31 +09:30
Jeremy Allison
d81e20653b Move set_thread_credentials_permanently() to set_thread_credentials()
as we need to keep the saved set uid/gid otherwise there is an
interaction with open[at]() and NO_ATIME returning EPERM. As this
is meant for threaded code inside the process we don't need
to do an irreverisble change anyway.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul 11 03:54:00 CEST 2012 on sn-devel-104
2012-07-11 03:54:00 +02:00
Jeremy Allison
b25619175f Fix typo we've had for a long time in set_re_uid() in the USE_SETRESUID case.
We only set the real euid, not the effective one. This is not
a security issue as this is *only* used in the quota code, and
only between code that brackets it with save_re_uid()/restore_re_uid(),
Also this is not used on most platforms (we use USE_SETREUID by
preference) but it's better to have this right. Bug to follow to get this
fixed in 3.6.next and 3.5.next.
2012-07-10 16:50:51 -07:00
Jeremy Allison
9d5e026bde Make check_same_stat() and check_same_dev_ino() common functions. 2012-07-09 12:26:56 -07:00
Volker Lendecke
d27a9c4e43 s3: Fix Coverity ID 709470 Uninitialized scalar variable
Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jul  6 18:46:06 CEST 2012 on sn-devel-104
2012-07-06 18:46:06 +02:00
Jeremy Allison
90881da685 Move copy_unix_token() from locking/locking.c to lib/util.c.
Make public.
2012-07-03 15:34:22 -07:00
Jeremy Allison
a559fcf156 Add function set_thread_credentials_permanently(). Panic if fail.
Not yet used.
2012-07-03 15:34:22 -07:00
Andreas Schneider
02c239c6d3 s3-passdb: Remove obsolte ldapsam_compat support. 2012-07-03 21:56:49 +02:00
Björn Baumbach
993e809b5a s3-libpidfile: fix check for running process.
Call pidfile_pid() with process name instead of pid file name.
pidfile_pid does create the pid file name by itself.

Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Jul  2 19:19:21 CEST 2012 on sn-devel-104
2012-07-02 19:19:21 +02:00
Björn Baumbach
a440df93a6 s3-libpidfile: some more debug output
Signed-off-by: Michael Adam <obnox@samba.org>
2012-07-02 17:27:31 +02:00
Jeremy Allison
f81fd1ccc3 Try and fix the autoconf build on Solaris/Nexenta/etc.
Their AC_TRY_RUN doesn't include any current CPPFLAGS. Make
the set[res]uid checks independent of this. Needs a small
change to the waf build in order to code with the change.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun 30 00:32:36 CEST 2012 on sn-devel-104
2012-06-30 00:32:36 +02:00
Michael Adam
01863df25d s3_dbrwap_ctdb: improve a comment in db_ctdb_can_use_local_record()
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29 15:21:21 +02:00
Michael Adam
b46977e4f6 s3:dbwrap_ctdb: fix a comment in db_ctdb_fetch()
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29 15:21:20 +02:00
Michael Adam
92808a6005 s3:dbwrap_ctdb: expand the comment for the db_ctdb_can_use_local_copy() function
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29 15:21:19 +02:00
Michael Adam
0a5f363333 s3:dbwrap_ctdb: rename db_ctdb_own_record() -> db_ctdb_can_use_local_copy()
This matches the function's intention much closer, since it
also tests whether we have a valid local read only copy.

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29 15:21:19 +02:00
Michael Adam
d6abf79247 s3:dbrwap_ctdb: remove commented out legacy code 2012-06-29 15:21:18 +02:00
Michael Adam
9d11277337 s3:dbwrap_ctdb: fix fetch/fetch_locked when samba is built against old ctdb
The introduction of read only copies has broken the algorithm for
deteting whether we can use the local record copy for fetch_locked
and fetch: For fetch locked the new code always uses the local copy
if there is one...

This patch re-establish the original algorithm for the build against
a ctdb without read only record copies.

Reported-by: Gregor Beck <gbeck@sernet.de>
2012-06-29 15:21:17 +02:00
Jeremy Allison
485787f0df Move back to using per-thread credentials on Linux. Fixes the glibc native AIO lost wakeup problem.
See this post:

https://lists.samba.org/archive/samba-technical/2012-June/085101.html

for details.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 29 03:57:45 CEST 2012 on sn-devel-104
2012-06-29 03:57:45 +02:00
Jeremy Allison
821bd95156 Replace all uses of setXX[ug]id() and setgroups with samba_setXX[ug]id() calls.
Will allow thread-specific credentials to be added by modifying
the central definitions. Deliberately left the setXX[ug]id()
call in popt as this is not used in Samba.
2012-06-28 17:15:16 -07:00
Volker Lendecke
572701f9c8 s3: Fix compilation of pthreadpool_sync.c on platforms without pthread.h
Signed-off-by: Bjoern Jacke <bj@sernet.de>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Jun 28 16:43:13 CEST 2012 on sn-devel-104
2012-06-28 16:43:13 +02:00
Andrew Bartlett
666dba3353 s3-param: Rename loadparm_s3_context -> loadparm_s3_helpers
This helps clarify the role of this structure and wrapper function.

The purpose here is to provide helper functions to the lib/param
loadparm_context that point back at the s3 lp_ functions.  This allows
a struct loadparm_context to be passed to any point in the code, and
always refer to the correct loadparm system.  If this has not been
set, the variables loaded in the lib/param code will be returned.

As requested by Michael Adam.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jun 27 17:11:16 CEST 2012 on sn-devel-104
2012-06-27 17:11:16 +02:00
Gregor Beck
088e505e84 s3:conn_tdb: add a function connections_fetch_entry_ext() that also takes the cnum
and have connections_fetch_entry() call connections_fetch_entry_ext().

Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-27 08:18:18 +02:00
Gregor Beck
c71062fcf4 s3:lib:dbwrap: fix return value of db_ctdb_traverse[_read] for non-persistent dbs
to return the number of traversed records upon successful traverse.

Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-27 08:18:17 +02:00
Stefan Metzmacher
ad82c52db0 s3:serverid: don't ignore the result of dbwrap_parse_record()
metze
2012-06-22 12:56:45 +02:00
Rusty Russell
9d97bf3f47 dbwrap: dbwrap_local_open()
This simply opens a tdb: it will eventually switch depending on the
extension.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
1acf548eb7 dbwrap: remove get_flags().
The flags returned were TDB-specific: this was only used for detecting
the endianness of obsolete databases (the conversion code was put in in
2003, with reference to Samba 2.3).

It's easier to remove it than to translate the NTDB flags to TDB flags,
and it's a really weird thing to ask for anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
fc9b298761 util_tdb: move timeout chainlock variants from source3/lib/util/util_tdb.c
We're about to use them for dbwrap.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Stefan Metzmacher
3c74117e2e s3:idmap_cache: also store negative entries for unknown sids
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jun 21 18:04:05 CEST 2012 on sn-devel-104
2012-06-21 18:04:05 +02:00
Volker Lendecke
7a2daf34f2 s3: Use string_term_tdb_data where appropriate
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-21 14:08:38 +02:00
Volker Lendecke
c6aa36c6c4 s3: Fix const warnings
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-21 14:08:38 +02:00
Michael Adam
b240406651 s3:move serverid_equal() to serverid.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:32 +02:00
Michael Adam
73b200064f s3:util: rename procid_equal() to serverid_equal()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:32 +02:00
Michael Adam
0159344d4c s3:util: remove (now) unused cluster_id_equal()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:31 +02:00
Michael Adam
6289fcffd7 s3:util: reformat procid_equal() to adhere to coding guidelines
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:29 +02:00
Michael Adam
3bdad95e3b s3:util: also compare the unique_id in procid_equal().
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:29 +02:00
Volker Lendecke
acc9302931 s3: We can depend on pthreadpool now
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-06-19 10:27:24 -07:00
Volker Lendecke
8b35a4de38 s3: Add a dummy implementation for the pthreadpool API
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-06-19 10:27:24 -07:00
Stefan Metzmacher
e89150597a Revert "s3-lib Remove unused sys_fcntl_long()"
This reverts commit 846a697e20.

This is still used in source3/smbd/oplock_irix.c

metze
2012-06-19 17:04:29 +02:00
Rusty Russell
316e5e376c lib/tdb_wrap: use tdb directly, not tdb_compat.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:07 +02:00
Rusty Russell
6244f668a3 TDB2: make SAMBA use tdb1 again for the moment.
Otherwise the following surgery will break the SAMBA build and testsuite.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:05 +02:00
Andrew Bartlett
7a723c6b38 build: Remove support for non-64bit sendfile()
Some early Linux 2.6 platforms can not handle sendfile and _FILE_OFFSET_BITS == 64

This disables sendfile() on these platforms.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun 16 02:21:28 CEST 2012 on sn-devel-104
2012-06-16 02:21:27 +02:00
Andrew Bartlett
d7b0e9a42a s3-lib: Fix conversion of lib/events.c to modern tevent names
This corrects an error in 8e31d97c8b.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jun 15 16:25:20 CEST 2012 on sn-devel-104
2012-06-15 16:25:20 +02:00
Volker Lendecke
749314fcf9 dbwrap: dbwrap_store_int32->dbwrap_store_int32_bystring
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15 12:14:27 +02:00
Volker Lendecke
737c0a5473 dbwrap: dbwrap_fetch_int32->dbwrap_fetch_int32_bystring
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15 12:14:27 +02:00
Andrew Bartlett
8e31d97c8b s3-lib: Convert lib/events.c to modern tevent names 2012-06-15 09:18:33 +02:00
Michael Adam
b27f88898a s3:vfs: change files_struct.fnum from int to uint64_t
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 15 05:22:41 CEST 2012 on sn-devel-104
2012-06-15 05:22:41 +02:00
Michael Adam
3309a52988 s3:lib: add a utility function "fsp_fnum_dbg" for logging the fnum of an fsp
This is to unify logging of an files_struct.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15 03:28:14 +02:00
Michael Adam
0635af0a08 s3:lib: elaborate the comment for fsp_str_debug a bit.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15 03:28:14 +02:00
Michael Adam
bbf519de37 s3:lib: remove part of a comment for fsp_str_dbg that does not apply any more.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15 03:28:14 +02:00
Volker Lendecke
a40a566504 s3: Add --pw-nt-hash to popt_common_credentials
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-12 10:48:15 +02:00
Volker Lendecke
2be5ace544 s3: Add user_auth_info->use_pw_nt_hash
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-12 10:48:15 +02:00
Stefan Metzmacher
16be476d40 s3:lib: we don't need smbd/proto.h in smbd_shim.c
metze
2012-06-06 10:18:39 +02:00
Andrew Bartlett
d2f6d0ba1e build: Rationalise AIO support in configure, ensure on by default
With this change, the define to check for AIO is HAVE_AIO, consistant
with other subsystems.

It is now also on by default in the autoconf build, as it has been for waf.

Andrew Bartlett
2012-06-06 08:23:10 +02:00
Stefan Metzmacher
8693a4fff9 s3:lib: split things into a conn_tdb.h
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jun  5 19:28:35 CEST 2012 on sn-devel-104
2012-06-05 19:28:35 +02:00
Andrew Bartlett
6c4cdbe891 s3-libnetapi: Cope with popt versions without POPT_TABLEEND 2012-06-03 15:30:15 +10:00
Andrew Bartlett
c290cdb934 lib/replace: xattr wrappers in lib/replace rather than source3/lib/system.c
This also moves all the still-used configure tests etc.  The unused OSF API
is also removed at this time.

Andrew Bartlett
2012-06-02 02:13:49 +02:00
Luk Claes
4f6f4ea93c s3:libsmb: get rid of cli_state_remote_name
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:45 +02:00
Alexander Bokovoy
72029d5547 s3-smbldap: Add API for external callback to perform LDAP bind in smbldap
In order to support other bind methods, introduce a generic bind callback.
When smbldap_state.bind_callback is set, it means there is an alternative
way to perform LDAP bind to ldap_simple_bind_s() so call it instead.
The call is wrapped in become_root()/unbecome_root() to allow proper permissions
in smbd to access needed resources in the callback, for example, credential caches.
When run outside smbd, become_root()/unbecome_root() are no-op.

The API expectation is similar to ldap_simple_bind_s().

A caller of smbldap API can pass additional information to the callback by setting
smbldap_state.bind_callback_data pointer.

Both callback and the data pointer elements of smbldap_state structure get
cleaned up if someone sets proper credentials on smbldap_state with
smbldap_set_creds() so if you are interested in using smbldap_state.bind_dn
with the callback, make sure to set callback after credentials are set.
2012-05-24 16:21:26 +02:00
Michael Adam
7db637483b s3:idmap_cache: improve checks for format of value string in idmap_cache_find_sid2unixid()
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri May 18 16:34:27 CEST 2012 on sn-devel-104
2012-05-18 16:34:27 +02:00
Michael Adam
0c3137c2e1 s3:idmap_cache: add common exit point to idmap_cache_find_sid2unixid() 2012-05-18 14:44:15 +02:00
Michael Adam
ecb24fd459 s3:idmap_cache: improve debug messages in idmap_cache_find_sid2unixid() 2012-05-18 14:44:15 +02:00
Volker Lendecke
8ae354ed4e s3: Remove some unused code
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue May 15 18:24:10 CEST 2012 on sn-devel-104
2012-05-15 18:24:10 +02:00
Stefan Metzmacher
b2c9fe4ad1 lib/util: move tevent_req_poll_ntstatus() to tevent_ntstatus.c
metze
2012-05-14 15:12:34 +02:00
Stefan Metzmacher
05e4f24729 s3:lib/util: use map_nt_error_from_unix_common() in tevent_req_poll_ntstatus()
metze
2012-05-14 15:12:34 +02:00
Michael Adam
e945511aae move the dbwrap library to the top level
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon May 14 04:04:55 CEST 2012 on sn-devel-104
2012-05-14 04:04:55 +02:00
Michael Adam
e96a842527 s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_tdb.c 2012-05-13 22:41:49 +02:00
Michael Adam
db7a8bf43c s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_rbt.c 2012-05-13 22:41:49 +02:00
Michael Adam
746548401f s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_ctdb.c 2012-05-13 22:41:49 +02:00
Michael Adam
03183e3584 s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_file.c 2012-05-13 22:41:48 +02:00
Michael Adam
05afaa8361 s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_util.c 2012-05-13 22:41:48 +02:00
Michael Adam
508a33fc2a s3:dbwrap: move definition of dbwrap_lock_order to dbwrap.h
This is needed in all of the library, not only in the dbwrap_open part.
2012-05-13 22:41:48 +02:00
Andrew Bartlett
e09f05731d s3-lib/sysacls: Do not include an embedded \0 between ACL entries in sys_acl_to_text()
This makes it possible to print the entire string again.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed May  9 06:07:06 CEST 2012 on sn-devel-104
2012-05-09 06:07:06 +02:00
Andrew Bartlett
fc4c06f284 s3-lib: Add const to sys_acl_to_text 2012-05-09 04:21:05 +02:00
Andrew Bartlett
ad11b90eb6 s3-lib: Fix indentation in sys_acl_to_text() 2012-05-09 04:21:05 +02:00
Stefan Metzmacher
3e9b760406 s3:idmap_cache: change DEBUG message to level 10
metze
2012-05-06 14:50:38 +02:00
Andrew Bartlett
bb1d541da1 s3-idmap: remove (now) unused function idmap_cache_set_sid2both()
Signed-off-by: Michael Adam <obnox@samba.org>
2012-05-02 13:18:05 +02:00
Andrew Bartlett
583b104d4b s3-idmap: Rework idmap_cache to store ID_TYPE_BOTH values
This required that the lower level cache store a UID/GID and a type, and that
we operate on struct unixid rather than just uid/gid.

The ID_TYPE_BOTH is then handled as being a positive mapping for both
a UID and GID value.  Wrapper functions are provided so that callers are not
changed in this patch.

Andrew Bartlett

Signed-off-by: Michael Adam <obnox@samba.org>
2012-05-02 13:18:02 +02:00
Christian Ambach
7a07ce2680 s3:util add sid_check_is_wellknown_builtin() 2012-05-01 09:32:11 +02:00
Andrew Bartlett
442a81e7b2 s3-lib Add a way to allocate the task_id value in server_id
This safely allocates the task_id so that when we have multiple event
contexts, they can each have their own messaging context, particularly
for the imessaging subsystem under source4.

Andrew Bartlett
2012-04-30 17:55:12 +10:00
Volker Lendecke
374ca0bd26 s3: Fix Coverity ID 2751: REVERSE_INULL 2012-04-24 13:28:50 +02:00
Andrew Bartlett
3969cc28e8 s3-dbwrap: A void function can not return a value
Only non-gcc compilers seem to notice this as an error.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Apr 23 05:58:52 CEST 2012 on sn-devel-104
2012-04-23 05:58:52 +02:00
Volker Lendecke
13d667bbff s3: Implement db_id for dbwrap_cache
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Apr 21 13:46:00 CEST 2012 on sn-devel-104
2012-04-21 13:46:00 +02:00
Volker Lendecke
d26028316d s3: Initialize "stored_callback" in dbwrap_cache
This should fix one of the recent flaky tests
2012-04-21 12:10:49 +02:00
Michael Adam
499e7372be s3:id_cache: do not use the in-memory idmap cache (it is going to be removed)
This also removes the ID_CACHE_FLUSH message.
2012-04-20 23:17:36 +02:00
Stefan Metzmacher
3f00295f5e s3-dbwrap: dbwrap_watch_record_stored => NT_STATUS_NOT_FOUND is ok...
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Apr 20 17:05:52 CEST 2012 on sn-devel-104
2012-04-20 17:05:52 +02:00
Volker Lendecke
1be6d849ab s3-g_lock: Use dbwrap_record_watch_send/recv
This simplifies the g_lock implementation. The new implementation tries to
acquire a lock. If that fails due to a lock conflict, wait for the g_lock
record to change. Upon change, just try again. The old logic had to cope with
pending records and an ugly hack into ctdb itself. As a bonus, we now get a
really clean async g_lock_lock_send/recv that can asynchronously wait for a
global lock. This would have been almost impossible to do without the
dbwrap_record_watch infrastructure.
2012-04-19 22:24:19 +02:00
Volker Lendecke
99fa29ae09 s3-dbwrap: Add dbwrap_record_watch_send/recv
With this API you can asynchronously wait for a record to be modified
2012-04-19 22:24:18 +02:00
Volker Lendecke
61c97506e8 s3-dbwrap: Add dbwrap_set_stored_callback
This is a per-db function that is called whenever some record is modified
2012-04-20 13:42:40 +02:00
Volker Lendecke
8e5b11bc14 s3-dbwrap: Add "db_context" to "db_record" 2012-04-20 13:42:40 +02:00
Volker Lendecke
0f20ffbcbd s3-dbwrap: Add dbwrap_db_id
This returns a blob uniquely identifying the database
2012-04-20 13:42:40 +02:00
Volker Lendecke
e3de5e4fb6 s3: Fix msg_channel in the cluster case 2012-04-20 13:42:40 +02:00
Volker Lendecke
e58f03c91a s3: Fix the build on FreeBSD
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Apr 19 19:13:45 CEST 2012 on sn-devel-104
2012-04-19 19:13:45 +02:00
Volker Lendecke
7011d7ef18 s3: Fix Coverity ID 2743: CHECKED_RETURN 2012-04-19 17:37:38 +02:00
Volker Lendecke
f1c90e12f5 s3: Fix Coverity ID 2744: CHECKED_RETURN 2012-04-19 17:37:38 +02:00
Volker Lendecke
85c1e895a5 s3: Fix Coverity ID 2745 and 2746: FORWARD_NULL
We can assume that the rbt dbs are around
2012-04-19 17:37:37 +02:00
Volker Lendecke
dc3b796260 s3: Attempt to fix Coverity ID 2748: INTEGER_OVERFLOW
Not sure this will actually please Coverity, but it fixes a severe bug
2012-04-19 17:37:37 +02:00
Andrew Bartlett
84ad848c86 s3-xattr_tdb: Remove dead code: talloc_stackframe() cannot fail
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Apr 19 14:15:42 CEST 2012 on sn-devel-104
2012-04-19 14:15:41 +02:00
Andrew Bartlett
00d493b00c s3-dbwrap: Remove dead code: talloc_stackframe() cannot fail 2012-04-19 12:34:33 +02:00
Volker Lendecke
0021fc17e4 s3-dbwrap: Fix an unused var warning 2012-04-18 18:16:27 +02:00
Andrew Bartlett
44b6bf9130 s3-xattr_tdb: Use talloc_stackframe() more to allow calling from common code 2012-04-18 12:05:00 +10:00
Andrew Bartlett
492942a66a s3-xattr_tdb: Be nice to xattr_tdb_getxattr callers, return the full blob
In this case, the blob is already in memory, so it is easier to return the full
blob to the caller, and let the caller decide if some interface restriction
stops the full blob from being passed all the way up the stack.

This allows us to quickly write a python wrapper for this xattr storage
mechanism.

Andrew Bartlett
2012-04-18 12:05:00 +10:00
Andrew Bartlett
351c78fc67 s3-xattr_tdb: make xattr_tdb a private library, for use outside vfs_xattr_tdb 2012-04-18 12:05:00 +10:00
Andrew Bartlett
ce9676839b s3-lib: Add file_id_string() 2012-04-18 12:05:00 +10:00
Andrew Bartlett
ea5a9b21fb s3-build: move file_id.c into samba3-util and create a private header 2012-04-18 12:05:00 +10:00
Andrew Bartlett
cc86f8e985 lib/util: Move map_nt_error_from_tdb to the top level
This will help with making dbwrap available as a top level library.

Andrew Bartlett
2012-04-18 12:04:59 +10:00
Andrew Bartlett
338e5a1d35 s3-dbwrap: push lp_ctx up another layer in the stack
This will allow db_open_tdb() to be called from common code, which may
already have a loadparm context loaded.

It also slowly moves the lp_ctx up the stack, as required to remove
the library loop between smbconf and the registry.

Andrew Bartlett
2012-04-18 12:04:59 +10:00
Andrew Bartlett
235016bcf9 s3-dbwrap: Add talloc_stackframe() calls
This is in preperation for calling dbwrap from common code, where we may not
have a stackframe set up.

Andrew Bartlett
2012-04-18 12:04:59 +10:00
Volker Lendecke
0b501e823f s3: Make ctdbd_messaging_send_blob available in non-clustered mode
This will avoid the need for some #ifdefs
2012-04-17 10:21:02 +02:00
Volker Lendecke
a03a74c353 s3: Make messaging_ctdbd_connection available in non-clustered mode
This might make some #ifdef CLUSTER_SUPPORT unnecessary in the future
2012-04-17 10:21:02 +02:00
Volker Lendecke
b23b357557 s3: Implement tevent_barrier
This will help notify torture tests: A tevent barrier can be waited on with
tevent_barrier_wait_send/recv. The barrier is initialized with a number of
requests that it will accept waiting. When that number is reached, all those
requests will be released and their callback will be called. The barrier will
be free for re-use again.
2012-04-17 10:21:02 +02:00
Volker Lendecke
05ff425c17 s3: Introduce ctdb_messaging_send_blob
Send a raw blob without the messaging.idl wrap
2012-04-17 10:21:01 +02:00
Volker Lendecke
74baae782f s3: Add msg_channel
This is a tevent_based variant of messaging_register
2012-04-17 10:21:01 +02:00
Volker Lendecke
41712599e0 s3: Add messaging_tdb_event()
This is a void* that represents a signal handler attached to some
custom tevent_context. This is necessary to make the tdb based
messaging infrastructure trigger its business when we are sitting in
tevent_loop_once for an event context that is not the main one in the
messaging context.
2012-04-17 10:21:01 +02:00
Volker Lendecke
48a485b639 s3: Add a second ctdb connect library
The existing one is not async at all.
2012-04-17 10:21:01 +02:00
Volker Lendecke
94cf5cc284 s3: Add dbwrap_try_fetch_locked
This is designed to spread the load on individual ctdb records to allow upper
layers to do backoff mechanisms. In the ctdb case, do not get the record if a
local lock is already taken. If we are not dmaster, do at most one migrate
attempt.

For the tdb case, this is a nonblocking fetch_locked. If someone else has the
lock, give up.
2012-04-17 10:21:00 +02:00
Volker Lendecke
bd9178506e s3: Add dbwrap_cache
This is a caching layer for the notify database and potentially for the brlock
database. It caches the parse_record operation as long as the underlying seqnum
does not change.
2012-04-17 10:21:00 +02:00
Volker Lendecke
ba8f19c556 s3: Open up 3 levels of dbwrap_lock_order 2012-04-17 10:21:00 +02:00
Volker Lendecke
1e1b6f79b3 s3: Add infrastructure for background jobs 2012-04-17 10:21:00 +02:00
Volker Lendecke
a49ac23a10 s3: Return CTDB_PATH from lp_ctdbd_socket()
All callers had that fallback
2012-04-17 10:21:00 +02:00
Volker Lendecke
8a907c9c65 s3: Fix the pthreadpool build on OS/X
OS/X does not have clock_gettime, and without replace.h we do not
get the replacement macro
2012-04-09 18:05:02 +02:00
Volker Lendecke
5138b1f7fb s3: Compile fix for dbwrap_file.c
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Apr  7 14:10:35 CEST 2012 on sn-devel-104
2012-04-07 14:10:35 +02:00
Andrew Bartlett
6aa12fcb30 build: Remove SMB_OFF_T, replace with off_t
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Apr  6 01:47:43 CEST 2012 on sn-devel-104
2012-04-06 01:47:43 +02:00
Andrew Bartlett
19eee33d82 s3-vfs: Remove unused lremovexattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to removexattr.

Andrew Bartlett
2012-04-05 13:39:01 +10:00
Andrew Bartlett
c70ac29c54 s3-vfs: Remove unused lsetxattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to listxattr.

Andrew Bartlett
2012-04-05 13:39:00 +10:00
Andrew Bartlett
c5b17c5555 s3-vfs: Remove unused llistxattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to listxattr.

Andrew Bartlett
2012-04-05 13:39:00 +10:00
Andrew Bartlett
b2f7cfa848 s3-vfs: Remove unused lgetxattr call from VFS modules, system.c and configure 2012-04-05 13:39:00 +10:00
Andrew Bartlett
1ac7f071ce build: Remove SMB_F* locking defines 2012-04-05 02:39:09 +02:00
Andrew Bartlett
6098f8d80c build: Remove SMB_STRUCT_FLOCK define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
f6e0532024 build: Remove SMB_STRUCT_DIR define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
2320b2144f build: Remove SMB_STRUCT_DIRENT define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
6edd8e95f1 build: Remove sys_rewinddir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
3e8a6e5760 build: Remove sys_closedir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
ecc822faf8 build: Remove sys_telldir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
900473a45b build: Remove sys_seekdir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
afdb78075c build: Remove sys_readdir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
fe526bb32b build: Remove sys_opendir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
b74fe73a6f build: Remove sys_fopen wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
d166b79852 build: Remove sys_open wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
9cc056e567 build: Remove sys_creat wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
ced1f61ec1 build: Remove fallback call to sys_open as HAVE_CREAT is not actually checked for 2012-04-05 02:39:08 +02:00
Andrew Bartlett
7fa1b878c1 build: Remove sys_ftell wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
43e9be8894 build: Remove sys_lseek wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
5c89d12ca4 build: Remove sys_ftruncate wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
473b974a06 build: do not use HAVE_EXPLICIT_LARGEFILE_SUPPORT and *64() fucntions any more 2012-04-05 02:39:08 +02:00
Volker Lendecke
22a6497526 s3: Enhance the dbwrap needed x attempts msg
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Apr  3 15:17:11 CEST 2012 on sn-devel-104
2012-04-03 15:17:11 +02:00
Andrew Bartlett
c363815809 s3-smbd: Inline init_modules() into only caller 2012-04-03 14:25:12 +10:00
Volker Lendecke
1e24997e3e s3: Avoid a crash with debug level 10
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Mar 30 16:52:16 CEST 2012 on sn-devel-104
2012-03-30 16:52:16 +02:00
Volker Lendecke
ed43a5a94f s3: Fix a valgrind error
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Mar 29 15:50:13 CEST 2012 on sn-devel-104
2012-03-29 15:50:13 +02:00
Jelmer Vernooij
c9fb33697d use usleep rather than sys_usleep in various places, in anticipation of usleep moving to libreplace. 2012-03-24 22:41:05 +01:00
Jelmer Vernooij
c0288e0612 lib/util: Remove obsolete sys_getpid() and sys_fork().
The performance of these is minimal (these days) and they can return
invalid results when used as part of applications that do not use
sys_fork().

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
2012-03-24 21:55:40 +01:00
Jelmer Vernooij
85aa07761a adt_tree: Fix return types. 2012-03-24 17:11:11 +01:00
Jelmer Vernooij
6f1b735cc2 adt_tree: Avoid WERROR. 2012-03-24 16:41:35 +01:00
Jelmer Vernooij
76bb68fd2b util_malloc: Remove unused constant. 2012-03-24 15:44:33 +01:00
Jelmer Vernooij
2a82c45f02 lib/util: Remove dummy wrapper for getgrnam(). 2012-03-24 15:25:48 +01:00
Jelmer Vernooij
818e0722e1 lib/util: Remove dummy wrapper for getpwnam(). 2012-03-24 15:24:15 +01:00
Jelmer Vernooij
3be6258912 lib/util: Remove dummy wrappers for setpwent/getpwent/endpwent. 2012-03-24 15:23:02 +01:00
Jelmer Vernooij
14fdc1c5cd lib/util: Move calloc_array and memalign_array to top-level libutil. 2012-03-24 15:19:09 +01:00
Jelmer Vernooij
e7cd5291db sock_exec: Avoid sys_connect. 2012-03-24 14:57:33 +01:00
Jelmer Vernooij
a9c22de3f4 util_sock: Avoid sys_connect. 2012-03-24 14:51:23 +01:00
Jelmer Vernooij
eb3617c426 ctdb_conn: Avoid sys_connect. 2012-03-24 14:48:56 +01:00
Jelmer Vernooij
d4c4cb06c5 replace: Move memalign() from lib/util/system.c to libreplace. 2012-03-24 14:43:21 +01:00