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

5686 Commits

Author SHA1 Message Date
Michael Adam
7eeb168523 s3:dbwrap_ctdb: improve transaction start/commit/cancel debugging
* also log nesting transaction start/commit/cancel
* unify transaction log messages slightly
2011-08-15 17:15:15 +02:00
Michael Adam
0aa85ec43a s3:lib: fix a comment in tdb_unpack() 2011-08-15 17:15:15 +02:00
Gregor Beck
8a36e72140 s3: avoid reading past the end of buffer in tdb_unpack 'f' if zero termination is missing
Signed-off-by: Michael Adam <obnox@samba.org>
2011-08-15 17:15:14 +02:00
Gregor Beck
39f9c854ae s3: avoid reading past the end of buffer in tdb_unpack 'P' if zero termination is missing
Signed-off-by: Michael Adam <obnox@samba.org>
2011-08-15 17:15:14 +02:00
Simo Sorce
2e5fc83350 s3-prefork: Do not use mmap/mremap/munmap directly
Use the wrappers in util.h as they deal with trying to do the best they can on
platfroms that do not support mmap extensions.

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Mon Aug 15 04:13:51 CEST 2011 on sn-devel-104
2011-08-15 04:13:50 +02:00
Simo Sorce
b706fd37f6 s3-messaging: Fix messaging classes.
This has been broken since ff0ac5b0 (May 2007).
Basically all messages were belonging to the General class except for CTDB
messages.
This fixed the message_send_all() function to correctly compute the class, and
fixes registrations to include all they need to cope with the fact not all
messages are of calss general (registrations rotted a bit because as long as
FLAG_MSG_GENERAL was defined the process woould receive all messages).

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-11 14:58:01 +02:00
Simo Sorce
cb1af61cb1 s3-messaging: Remove obsolete class.
The FLAG_MSG_PRINT_NOTIFY class is actually obsolete and never used, as the
only message belonging to it is not used either.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-11 14:57:55 +02:00
Volker Lendecke
63435f9ef2 s3: Fix some typos -- Simo, please check 2011-08-10 19:40:58 +02:00
Simo Sorce
7a07162558 s3-prefork: Fix use of child id.
Children Ids must start at 1 as 0 represent the father.
Also fix callbacks that restart logs to use a procedd global variable that
holds the Id so that they work correctly both fot the parent process and the
children.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:05 +02:00
Simo Sorce
fa893e815b s3-prefork: Pass the child a child_id
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:05 +02:00
Simo Sorce
227551a07b s3-prefork: Return tsocket_address for client and server
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:04 +02:00
Simo Sorce
2b33b438ba s3-prefork: Pass messaging context around too
Pair-Programmed-With: Andreas Schneider <asn@samba.org>

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:04 +02:00
Simo Sorce
1155280a48 s3-prefork: Set up a SIGCHLD handler by default
We need to properly handle preforked children so it is better to just do that
automatically.

If the parent needs/wants to intercept SIGCHLD events it can set a callback
that will be called by the prefork code once the internal cleanup function that
checks all prefork children has been executed.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:04 +02:00
Simo Sorce
0a910c9347 s3-prefork: Provide a cleanup function
This way the parent doesn't need to know how to handle dead children and
keeps all of that within the prefork abstraction.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:04 +02:00
Simo Sorce
e0aa6eec0b s3-prefork: Inline Doxygen Documentation
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:04 +02:00
Simo Sorce
b58d446c03 s3-prefork: better timing out semantics
If this child has no clients, let the lock functions block for 1 second,
and then immediately reschedule the operation. This means we catch the lock
as soon as possible on a free child.

If, instead, we are already serving a client, we want to be non blocking,
so we timeout immediately on getting the lock, and then we sleep a 1/10th of
a second.
This means that a busy child will be slightly slower on picking up the lock,
but we won't block the existing client from communicating with us as we
immediately react to activity on the already opened file handler.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:04 +02:00
Simo Sorce
f6ae58f242 s3-prefork: add support for multiple listning file descriptors
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:04 +02:00
Simo Sorce
3339c9b9b4 s3-prefork: provide way to send a signal to all children
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:04 +02:00
Simo Sorce
567ca03786 s3-prefork: provide means to expand the pool size
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:03 +02:00
Simo Sorce
2056d06cae s3-prefork: add way to manage number of clients per child
The allowed_clients var is a parent managed variable that tell children how
many clients they are allowed to handle at the same time. This way children
can overcommit but within parent controlled limits.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:03 +02:00
Simo Sorce
b9354f7229 s3-prefork: add asynchronous functions
To get a client connection it is now possible to use asynchronous functions.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:03 +02:00
Simo Sorce
4fef4fe498 s3-prefork: implement prefork framework
Primarily built for forked off rpc service daemons, but not tied to rpc
services and generic enough to be used elsewhere easily.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:03 +02:00
Volker Lendecke
e0dc3aa5b6 s3: Remove an unnecessary include
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Aug 10 18:10:39 CEST 2011 on sn-devel-104
2011-08-10 18:10:39 +02:00
Stefan Metzmacher
020032e114 s3:lib/events: Fix a bug in run_poll_events().
Ignore fd events without EVENT_FD_READ or EVENT_FD_WRITE also in
run_events_poll(). They are ignore when building the array
for the syscall in event_add_to_poll_args(), so we need to
ignore them run_events_poll() too.

metze

Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Aug  9 10:11:54 CEST 2011 on sn-devel-104
2011-08-09 10:11:54 +02:00
Gregor Beck
3db91e6599 s3:smbconf let drop leave the smbconf key in place to match a virgin registry.tdb
Signed-off-by: Michael Adam <obnox@samba.org>
2011-08-08 15:27:07 +02:00
Björn Jacke
fd06cf379d s3/ldap: delay the ldap search alarm termination a bit
do the alarm termination of the the ldap search a bit delayed so the LDAP
server has a chance to tell us that the time limit was reached and the
search was abandoned. If the search is terminated this way we also get
the correct LDAP return code in the logs. If alarm() stops the search the ldap
search routine will report that the LDAP server is down which would trigger us
to rebind to the server needlessly which we also want to avoid.
2011-08-05 11:32:09 +02:00
Andrew Bartlett
1aced1e989 s3-auth remove sanitized_username from auth_serversupplied_info
This structure element was only written to, not read.

It is filled into the companion structure, auth_session_info()
by create_local_token().

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:04 +10:00
Volker Lendecke
190b5432f0 s3: Make map_open_params_to_ntcreate() available in lib/ 2011-07-29 16:43:17 +02:00
Volker Lendecke
0102c6e2bc s3: Make is_executable() available in lib/ 2011-07-29 16:43:17 +02:00
Michael Adam
0b5c4a601a s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29 13:34:22 +02:00
Michael Adam
2414fc88d8 s3:dbwrap: move db_is_local() from dbwrap.c to dbwrap_open.c 2011-07-29 12:23:13 +02:00
Michael Adam
1abdd9b2bb s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.
Also start new folder lib/dbwrap/ where dbwrap_open.c is stored and
make the fallbacke implementation functoins non-static and create a
dbwrap_private.h header file that contains their prototypes.
2011-07-29 12:23:13 +02:00
Michael Adam
75c7320497 s3:g_lock: explicitly include dbwrap.h 2011-07-29 12:23:12 +02:00
Michael Adam
f72153ea83 s3:dbwrap: explicitly include dbwrap.h in dbwrap_ctdb.c
This used to come in via g_lock.h

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2011-07-29 12:23:12 +02:00
Michael Adam
88ee6973f0 s3:libsmbconf: use lp_load_global() in the testsuite 2011-07-28 11:17:30 +02:00
Michael Adam
2c3a1f44fa s3:libnetapi: use lp_load_global() 2011-07-28 11:17:30 +02:00
Christian Ambach
749868ede4 s3:lib change default share security access mask
when there is no share SD set, the default share SD that
is used e.g. for the output of sharesec -v defaults to a
value that is not equivalent to the desired FULL access.

This is a more or less a cosmetical follow-up for the patches
in Bug #8201 that makes them more consumeable by printing
FULL (that is what the user expects) instead of a bitmask
in hexadecimal form.

previous output:
REVISION:1
OWNER:(NULL SID)
GROUP:(NULL SID)
ACL:S-1-1-0:ALLOWED/0/0x101f01ff

with patch:
REVISION:1
OWNER:(NULL SID)
GROUP:(NULL SID)
ACL:S-1-1-0:ALLOWED/0/FULL

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Tue Jul 26 15:57:55 CEST 2011 on sn-devel-104
2011-07-26 15:57:55 +02:00
Stefan Metzmacher
bb0d063f01 s3:lib/netapi: make use of cli_state_remote_name()
metze
2011-07-22 17:06:09 +02:00
Christian Ambach
4370dc11bd s3:afs make path argument to afs_syscall const 2011-07-21 14:55:08 +02:00
Christian Ambach
ffef23d40f s3:lib/afs use stdbool types 2011-07-21 14:55:06 +02:00
Christian Ambach
ffbecc0cf6 s3:lib/afs_settoken fix some compiler warnings 2011-07-21 14:54:50 +02:00
Christian Ambach
a78407b9ca s3:lib/afs fix some compiler warnings 2011-07-21 14:54:46 +02:00
Christian Ambach
3b231e6a12 s3:lib/afs fix the build with --with-fake-kaserver
This fixes one piece of Bug #8263
2011-07-21 14:51:28 +02:00
Andrew Bartlett
9289537993 s3-auth Use struct auth_user_info_unix for unix_name and sanitized_username
This is closer to the layout of struct auth_session_info in auth.idl

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +10:00
Andrew Bartlett
6d741e918f s3-auth Use *unix_token rather than utok in struct auth3_session_info
This brings this structure one step closer to the struct auth_session_info.

A few SMB_ASSERT calls are added in some key places to ensure that
this pointer is initialised, to make tracing any bugs here easier in
future.

NOTE: Many of the users of this structure should be reviewed, as unix
and NT access checks are mixed in a way that should just be done using
the NT ACL.  This patch has not changed this behaviour however.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Jeremy Allison
93dcfdea38 Second part of fix for bug 8310 - toupper_ascii() is broken on big-endian systems.
Re-add:
	smb_ucs2_t toupper_w(smb_ucs2_t v);

and ensure it is called whenever we are operating on smb_ucs2_t
variables. I'd like to make the definition of smb_ucs2_t incompatible
with int and codepoint_t so they can't be mixed, but that's a patch
for another time.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Jul 19 23:48:05 CEST 2011 on sn-devel-104
2011-07-19 23:48:05 +02:00
Jeremy Allison
ee34c25c8a First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systems
Remove
int toupper_ascii(int c);
int tolower_ascii(int c);
int isupper_ascii(int c);
int islower_ascii(int c);

and replace with their _m equivalents, as they are identical.
2011-07-19 13:19:29 -07:00
Andrew Bartlett
6f4c093729 s3-lib Remove unused get_cmdline_auth_info_copy 2011-07-14 15:06:45 +10:00
Björn Baumbach
b807c58b65 s3: dbwrap_ctdb.c: fix #ifdef CTDB_CONTROL_SCHEDULE_FOR_DELETION issue (bug #8303)
Check for HAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL instead of
CTDB_CONTROL_SCHEDULE_FOR_DELETION, which is an enum member and not a
define.

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jul 12 18:56:30 CEST 2011 on sn-devel-104
2011-07-12 18:56:30 +02:00
Stefan Metzmacher
a2d4197590 s3:lib: s/SMBkeepalive/NBSSkeepalive
metze
2011-07-12 09:44:04 +02:00