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

306 Commits

Author SHA1 Message Date
Volker Lendecke
9e7c6f12fd w3:winbind: Convert WINBINDD_ALLOCATE_UID to the new API 2009-08-30 09:48:28 +02:00
Volker Lendecke
2774a02f64 s3:winbind: Convert WINBINDD_LIST_GROUPS to the new API 2009-08-29 19:53:46 +02:00
Volker Lendecke
6b474c56a5 s3:winbind: Convert WINBINDD_LIST_USERS to the new API 2009-08-29 19:53:29 +02:00
Volker Lendecke
e47491e83c s3:winbind: Convert the getgrent functions to the new API 2009-08-29 19:42:27 +02:00
Volker Lendecke
50d9fb42fc w3:winbind: Convert WINBINDD_LOOKUPRIDS to the new API 2009-08-29 19:42:26 +02:00
Volker Lendecke
425239caee s3:winbind: Convert the GETDCNAME routines to the new API 2009-08-29 19:42:26 +02:00
Volker Lendecke
244bb7f163 s3:winbind: Convert winbindd_dsgetdcname to the new API 2009-08-29 19:42:26 +02:00
Volker Lendecke
9c30a8dc6f s3:winbind: Convert the GETPWENT routines to the new API 2009-08-29 19:42:26 +02:00
Volker Lendecke
1d8d3fd7c3 s3:winbind: Convert WINBINDD_GETUSERSIDS to the new API 2009-08-27 15:04:09 +02:00
Volker Lendecke
2c23e7dc5a s3:winbind: The get[gr|pw]end functions need access to the client state 2009-08-16 13:28:14 +02:00
Volker Lendecke
459233e630 s3:winbind: Convert WINBINDD_GETGRNAM to the new API 2009-08-16 12:39:08 +02:00
Volker Lendecke
a511a87519 s3:winbind: Convert WINBINDD_GETGRGID to the new API 2009-08-16 12:39:07 +02:00
Volker Lendecke
0f64bb5b7e s3:winbind: Convert winbindd_show_sequence to the new API 2009-08-16 10:38:24 +02:00
Volker Lendecke
0a16265bc2 s3:winbind: Convert WINBINDD_GETGROUPS to the new API 2009-08-05 03:21:25 -04:00
Volker Lendecke
fec380818f s3:winbind: Convert WINBINDD_GETUSERDOMGROUPS to the new API 2009-08-05 03:21:25 -04:00
Volker Lendecke
592822786d s3:winbind: Convert WINBINDD_GETSIDALIASES to the new API 2009-08-05 03:21:24 -04:00
Volker Lendecke
bd9d7f75e3 s3:winbind: Convert WINBINDD_GETPWUID to the new API 2009-08-05 03:21:23 -04:00
Volker Lendecke
5bbb7a0d14 s3:winbind: Convert WINBINDD_GETPWNAM to the new API 2009-08-05 03:21:23 -04:00
Volker Lendecke
9dc401a20e s3:winbind: Convert WINBINDD_GETPWSID to the new API 2009-08-05 03:21:23 -04:00
Volker Lendecke
10685b37d4 s3:winbind: Convert WINBINDD_GID_TO_SID the new API 2009-08-05 03:21:22 -04:00
Volker Lendecke
9b369ffcf0 s3:winbind: Convert WINBINDD_UID_TO_SID the new API 2009-08-05 03:21:22 -04:00
Volker Lendecke
5db561a608 s3:winbind: Convert WINBINDD_SID_TO_GID the new API 2009-08-05 03:21:21 -04:00
Volker Lendecke
fb7150f23b s3:winbind: Convert WINBINDD_SID_TO_UID to the new API 2009-08-05 03:21:21 -04:00
Volker Lendecke
9c6f4cd12a s3:winbind: Convert WINBINDD_LOOKUPNAME to the new API 2009-08-05 03:21:21 -04:00
Volker Lendecke
74b45ba46c s3:winbind: Remove old version of WINBINDD_PING 2009-08-05 03:21:20 -04:00
Volker Lendecke
fa59f9720d s3:winbind: Convert WINBINDD_LOOKUPSID to the new API 2009-08-05 03:21:20 -04:00
Volker Lendecke
f511ccbc42 Slightly restructure the async winbind request calling convention
The main loop now allocates the response, this has to be done everywhere
2009-07-31 17:28:53 +02:00
Volker Lendecke
e30509f037 Fix a valgrind error in winbind
When looking for idle clients, we dereferenced state->response. As this is
dynamically allocated now, the proper test is whether state->response exists at
all. This is the case when an async operation is in process at that moment.
2009-07-27 16:15:54 +02:00
Volker Lendecke
8cba97a164 Fix a winbind memleak 2009-07-25 12:59:20 -04:00
Volker Lendecke
8a17cd810f Make gencache more stable
This provides a compromise between stability and performance: gencache is a
persistent database these days that for performance reasons can not use tdb
transactions for all writes. This patch splits up gencache into gencache.tdb
and gencache_notrans.tdb. gencache_notrans is used with CLEAR_IF_FIRST, writes
to it don't use transactions. By default every 5 minutes and when a program
exits, all entries from _notrans.tdb are transferred to gencache.tdb in one
transaction.
2009-07-15 10:55:20 +02:00
Volker Lendecke
5a9ca3db03 Fix bug 4699: Remove pidfile on clean shutdown 2009-06-18 16:17:57 -07:00
Volker Lendecke
49eccee209 Remove "winbindd_request" and "winbindd_response" from winbindd_cli_state
This shrinks the memory footprint of an idle client by 5592 bytes to 60 bytes
on my 32-bit box.
2009-06-14 22:22:10 +02:00
Volker Lendecke
97ba4f6efd Make winbindd_cli_state->response a pointer instead of a struct member
Same comment as in baa6084378: This is just a preparatory checkin.

Volker
2009-06-14 22:22:10 +02:00
Volker Lendecke
f1dd6cd64d winbind: replace process_loop() by tevent_loop_once() 2009-06-14 11:25:48 +02:00
Volker Lendecke
07fac35b3b Make rescan_trusted_domains a timed event 2009-06-14 11:25:48 +02:00
Volker Lendecke
c4a97b2b41 Do not store the listening fde 2009-06-14 11:25:48 +02:00
Volker Lendecke
eaaaea01e0 Avoid scanning the client list when a client exits 2009-06-14 11:25:48 +02:00
Volker Lendecke
340b55a842 Add async wb_ping 2009-06-14 11:25:47 +02:00
Volker Lendecke
e3bed4848f Add an async wb request loop 2009-06-14 11:25:47 +02:00
Volker Lendecke
0834574fdd Remove some unused code 2009-06-14 11:25:47 +02:00
Volker Lendecke
c049d098d1 Convert the main winbind client communication to wb_reqtrans.c 2009-06-14 11:25:46 +02:00
Volker Lendecke
baa6084378 Make winbindd_cli_state->request a pointer instead of a struct member
In itself, this is pretty pointless. But in the next steps I'll convert the
winbind internal communication to wb_reqtrans which allocates the request
properly. This minimizes the later diff.

Volker
2009-06-14 11:25:44 +02:00
Marc VanHeyningen
a4887e250b s3: Allow child processes to exit gracefully if we are out of fds
When we run out of file descriptors for some reason, every new
connection forks a child that immediately panics causing smbd to
coredump.  This seems unnecessarily harsh; with this code change we
now catch that error and merely log a message about it and exit
without the core dump.

Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-05-27 13:16:17 -07:00
Volker Lendecke
68c5c6df0e Fix a race condition in winbind leading to a panic
In winbind, we do multiple events in one select round. This needs fixing, but
as long as we're still using it, for efficiency reasons we need to do that.

What can happen is the following: We have outgoing data pending for a client,
thus

	state->fd_event.flags == EVENT_FD_WRITE

Now a new client comes in, we go through the list of clients to find an idle
one. The detection for idle clients in remove_idle_client does not take the
pending data into account. We close the socket that has pending outgoing data,
the accept(2) one syscall later gives us the same socket.

In new_connection(), we do a setup_async_read, setting up a read fde. The
select from before however had found the socket (that we had already closed!!)
to be writable. In rw_callback we only want to see a readable flag, and we
panic in the SMB_ASSERT(flags == EVENT_FD_READ).

Found using

bin/smbtorture //127.0.0.1/tmp -U% -N 500 -o 2 local-wbclient

Volker
2009-05-24 18:57:13 +02:00
Bo Yang
d7480a91b4 s3: ignore EPIPE error when winbind finally writes to wb client because client might have already closed the socket
Signed-off-by: Bo Yang <boyang@samba.org>
2009-05-22 03:22:52 +08:00
Volker Lendecke
3fa69438b9 Convert response.extra_data.data from malloc to talloc 2009-05-12 18:02:00 +02:00
Volker Lendecke
646668bc51 Fix some type-punned warnings 2009-05-07 23:38:48 +02:00
Volker Lendecke
26a9643e45 Remove a misleading comment 2009-05-07 23:38:48 +02:00
Stefan Metzmacher
93c2057c8b s3:winbindd: accept new connections via fd events
metze
2009-03-18 07:00:42 +01:00
Stefan Metzmacher
3b8dd79f2b s3:winbindd: move non event related code out of process_loop() in the the caller
metze
2009-03-18 07:00:42 +01:00
Volker Lendecke
b17f9e15ef Make opt_nocache static to winbindd.c 2009-03-12 10:20:08 +01:00
Bo Yang
d526d340d8 Fix careless mistake in winbindd_setup_sig_usr2_handler 2009-03-04 17:26:57 -08:00
Jeremy Allison
faa1100d22 More warning fixes for Solaris.
Jeremy.
2009-02-23 16:22:43 -08:00
Dan Sledz
3b8a57e064 s3: Implement wbcGetSidAliases
* Adds wbcGetSidAliases that calls the lookup_useraliases function.
* Updates wbinfo and winbind_util.c to call the new function.
* Also added winbind_get_groups helper function.
2009-02-11 19:39:18 -08:00
Dan Sledz
aed8e9aa0a s3: Implement wbcGetpwsid
* Adds the plumbing required to lookup users by sid into winbind, wbinfo
  and smbd helper lib (winbind_util.c).
* Removes some double declarations of winbind_util.c functions.
* Bumps the winbind protocol version to 21 and the minor version of
  wbclient to 3.
2009-02-11 19:39:15 -08:00
Stefan Metzmacher
e6612c99fe s3:winbindd: handle SIG_TERM, SIGHUP, SIGCHLD and SIGUSR2 via tevent
metze
2009-01-27 15:28:08 +01:00
Stefan Metzmacher
cf53e48fec s3:winbindd: we don't need to call message_dispatch() anymore it's event triggered now
metze
2009-01-22 12:37:32 +01:00
Stefan Metzmacher
048f8dba14 s3: always call run_events() before and after sys_select()
And always setup the fd events.

metze
2009-01-22 12:37:29 +01:00
Michael Adam
39ec8791f8 s3: make better use of ccache by not including version.h in every C-file.
version.h changes rather frequently. Since it is included via includes.h,
this means each C file will be a cache miss. This applies to the following
situations:

* When building a new package with a new Samba version

* building in a git branch after calling mkversion.sh
  after a new commit (i.e. virtually always)

This patch improves the situation in the following way:

* remove inlude "version.h" from includes.h

* Use samba_version_string() instead of SAMBA_VERSION_STRING
  in files that use no other macro from version.h instead of
  SAMBA_VERSION_STRING.

* explicitly include "version.h" in those files that use more
  macros from "version.h" than just SAMBA_VERSION_STRING.

Michael
2009-01-15 22:56:01 +01:00
Jeremy Allison
d1f7a37174 Make winbindd_cm.c use winbindd_reinit_after_fork().
Jeremy.
2009-01-06 17:34:06 -08:00
Stefan Metzmacher
59612beea6 s3:winbindd: also handle fd events from the winbind_event_context()
metze
2009-01-05 15:07:36 +01:00
Stefan Metzmacher
a1c9e61643 s3:winbindd: rename fd_event => winbindd_fd_event
It's really confusing to have two versions of 'fd_event'

metze
2009-01-05 15:07:32 +01:00
Bo Yang
022e2f8199 clean event context after child is forked.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-01-05 15:07:31 +01:00
Volker Lendecke
2504d78c82 Fix a "ignoring function call result" warning 2008-12-19 13:57:32 +01:00
SATOH Fumiyasu
d46c1907fc winbindd: vars for signals must be volatile sig_atomic_t 2008-12-12 18:04:03 +01:00
Volker Lendecke
1db7076b8e Fix nonempty blank lines 2008-12-07 21:30:35 +01:00
Steven Danneman
ce44a20323 Clean-up various trailing space and >80 column lines. 2008-11-18 17:06:22 -08:00
Steven Danneman
00c6271d5c Added ability to remove id mappings in wbinfo and libwbclient.
The idmap_tdb backend already provides an interface to remove existing id
mappings.  This commit plumbs that ability up through, winbindd, libwbclient,
and wbinfo.

Added new winbindd command:
        WINBINDD_REMOVE_MAPPING
Added new libwbclient interfaces:
        wbcRemoveUidMapping() and wbcRemoveGidMapping()
Added new wbinfo options:
        --remove-uid-mapping
        --remove-gid-mapping

Increased libwbclient version to 0.2
Increased winbind interface version to 20
2008-11-18 16:04:04 -08:00
Tim Prouty
2efacde8c4 s3: fix a few "shadows a global declaration" warnings 2008-11-03 14:44:38 -08:00
Michael Adam
b881d2ee78 [s3]winbind: fix smbd hanging on Solaris when winbindd closes socket.
On some versions of Solaris, we observed a strange effect of close(2)
on a socket: After the server (here winbindd) called close, the client fd
was not marked as readable for select. And a write call to the fd did
not produce an error EPIPE but just returned as if successful.

So while winbindd had called remove_client(), the corresponding smbd
still thought that it was connected, but failed to retrieve answers
for its queries.

This patch works around the problem by forcing the client fd to
the readable state: Just write one byte into the socket before
closing.

Michael
2008-10-27 14:59:33 +01:00
Jelmer Vernooij
2d89b52be8 Use separate make variables for libutil and libcrypto. 2008-10-18 14:28:40 +02:00
Qiao Yang
38c287740f Fix a memleak
request.extra_data is not freed if there is no extra_data in response or
when there is some error happens in processing. This patch will free the
buffer right after processing a request before sending back a response.
(This used to be commit be6f12273f)
2008-09-05 14:13:39 +02:00
Andrew Tridgell
0f41961e4f first cut at adding full transactions for ctdb to samba3
(This used to be commit f91a3e0f7b)
2008-08-13 11:54:08 +02:00
Volker Lendecke
340ab6a256 idmap rewrite
(This used to be commit 30a180f2fc)
2008-08-12 11:28:29 +02:00
Volker Lendecke
8d4bd2d960 Remove the multi-ID lookup code and the 3.2.0 version of idmap_cache
(This used to be commit 1bd98521dc)
2008-08-12 11:28:29 +02:00
Volker Lendecke
8ea3ce5342 Remove unused request_finished_cont()
(This used to be commit 865ea6fcbc)
2008-07-24 15:01:04 +02:00
Volker Lendecke
d7b87cdce2 Make use of TALLOC_FREE when freeing the per-winbindrequest memory context
(This used to be commit 9e49d390f7)
2008-07-24 14:50:22 +02:00
Jeremy Allison
1484b7f3b5 From Jim McDonough
In reloading the smb.conf, if a "log file" is specified in smb.conf,
winbind children will overwrite the logfile name to be the same as the
parent.

Jeremy.
(This used to be commit 62d319cc1a)
2008-07-17 20:10:18 -07:00
Darshan Purandare
065760ede0 MSG_DEBUG now forwarded to all the winbindd children by parent.
smbcontrol winbindd debug level would only set the debug level of the
parent winbindd process and not the child processes. This patch adds
the functionality of broadcasting the debug message to all winbindd
children. Now the debug level message is propagated to all the winbindd
processes that includes parent and children.
(This used to be commit cfbcfc3ffe)
2008-07-01 17:52:24 -07:00
Michael Adam
89ce05bb14 winbind: remove duplicate debug message for failing messaging_init().
Leave the message inside winbind_messaging_context() for now.
There might be callers, where this debug message could prove useful...

Michael
(This used to be commit e9177ec56a)
2008-06-26 12:31:10 +02:00
Michael Adam
b33d226a61 winbind: untangle logic in winbind_messaging_context() slightly.
Michael
(This used to be commit e710a9b73e)
2008-06-26 12:31:10 +02:00
Michael Adam
7f8df9c217 winbindd: don't panic if messaging_init() fails - return NULL instead.
Leave appropriate handling to the callers.

Michael
(This used to be commit 3e0c24323a)
2008-06-26 12:31:10 +02:00
Jeremy Allison
908812e98d Fix bug #5504. winbindd children and parent were handing SIGTERM in the same way - deleting the socket!
Jeremy.
(This used to be commit 3ab5a3883e)
2008-05-30 17:52:54 -07:00
Jim McDonough
a6b0ea8ee3 Enable winbind child processes to do something with signals,
in particular closing and reopening logs on SIGHUP.

Conflicts:

	source/winbindd/winbindd.c
(This used to be commit 0f7b11acce)
2008-05-13 16:57:01 -04:00
Volker Lendecke
0c4093a234 Fix CLEAR_IF_FIRST handling of messages.tdb
We now open messages.tdb even before we do the become_daemon. become_daemon()
involves a fork and an immediate exit of the parent, thus the
parent_is_longlived argument must be set to false in this case. The parent is
not really long lived :-)
(This used to be commit 4f4781c6d1)
2008-04-23 22:18:26 +02:00
Stefan Metzmacher
913cd26b2b winbindd: create the messaging conntext earlier
metze
(This used to be commit 2e1b913063)
2008-04-18 15:00:20 +02:00
Stefan Metzmacher
e21b283d67 dbwrap: wait for tdb2 change notifies in smbd, nmbd and winbindd
metze
(This used to be commit 64450cc1e4)
2008-04-12 09:14:10 +02:00
Michael Adam
b884db5c47 winbindd: only call winbindd_validate_cache when not in offline logon mode.
originally, the cache was cleared before calling validate, but
this way, we skipt the validation of the database when not in
offline logon mode.

This is put into a new wrapper function winbindd_cache_validate_and_initialize()
which is now called in winbindd.c instead calling validate and
initialize functions separately.

Michael
(This used to be commit 641b5e3fec)
2008-04-10 13:23:30 +02:00
Volker Lendecke
04cd5c6bd8 Fix typo
(This used to be commit 38683a7301)
2008-03-25 21:35:41 +01:00
Günther Deschner
fcf42bb19c Add winbind_msg_dump_domain_list to winbindd.
Guenther
(This used to be commit 54ad97bd83)
2008-01-24 16:22:04 +01:00
Michael Adam
0818d41697 Fix a comment.
Michael
(This used to be commit 62d6d4fff2)
2008-01-07 11:19:27 +01:00
Michael Adam
696cf4d3c0 Make wcache_invalidate_cache() return bool, not int.
Michael
(This used to be commit dba24ceae7)
2008-01-07 10:59:14 +01:00
Andreas Schneider
18699d003b Prevent winbindd from segfaulting due to corrupted cache tdb.
If we try to flush the caches and due to a corrupted tdb we and have no tdb
context close the tdb and validate it. Initialize the cache afterwards again.
(This used to be commit d0c0f91fb9)
2008-01-07 10:24:34 +01:00
Andreas Schneider
d818a93d07 Don't restart winbind if a corrupted tdb is found during initialization.
The tdb is validated before it gets initialized. Since then sighandlers changed
a restart isn't needed anymore.
(This used to be commit aabe9b33fc)
2007-12-12 13:51:13 +01:00
Stefan Metzmacher
38f8d32d10 winbindd: remove unused WINBINDD_DUMP_MAPS support
Also the design of this function was really bad,
instead do the dump into a file, the client should get
back the list of mappings.

metze
(This used to be commit ce7fe8acf4)
2007-12-12 10:07:05 +01:00
Jeremy Allison
7faee02d0d Remove the char[1024] strings from dynconfig. Replace
them with malloc'ing accessor functions. Should save a
lot of static space :-).
Jeremy.
(This used to be commit 52dc5eaef2)
2007-12-10 11:30:37 -08:00
Jeremy Allison
acf15ae730 Don't build rpctorture anymore - not maintained. Just remove.
Remove all vestiges of pstring (except for smbctool as noted
in previous commit).
Jeremy
(This used to be commit 4c32a22ac5)
2007-12-07 12:26:32 -08:00
Jeremy Allison
66298d8080 More pstring elimination.
Jeremy.
(This used to be commit 15074de938)
2007-11-20 17:18:16 -08:00
Jeremy Allison
68be9a8200 More pstring removal. This one was tricky. I had to add
one horror (pstring_clean_name()) which will have to
remain until I've removed all pstrings from the client code.
Jeremy.
(This used to be commit 1ea3ac8014)
2007-11-15 14:19:52 -08:00
Stefan Metzmacher
851ef9e22f start smbd, nmbd and winbindd with the same startup message
at debug level 0.

metze
(This used to be commit 95f76ae7a5)
2007-10-30 15:44:27 +01:00
Jeremy Allison
9a85533914 Fix the popt / bool issues. Some places we used BOOL
where we meant int. Fix this. Thanks to metze for
pointing this out.
Jeremy.
(This used to be commit 793a9d24a1)
2007-10-19 11:38:36 -07:00
Günther Deschner
61e482cfdf Merge Tridge's fix for the winbind 32/64bit padding.
Guenther
(This used to be commit 36578b22f1)
2007-10-19 13:03:49 +02:00
Stefan Metzmacher
7f82fbad50 fix startup of smbd, nmbd, winbindd
jra: POPT_ARG_VAL arguments need int values.
     I assume there're more places like this
     in the cmdline tools.

     Please fix this properly, as my commit is just
     a hack to get make test working again.

in samba4 we have a workaround for this see
smbd/server.c

metze
(This used to be commit 9cb1937fe8)
2007-10-19 10:34:06 +02:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Stefan Metzmacher
28aa4bff8d r25154: move winbindd code into winbindd/
metze
(This used to be commit 3ac7566ae1)
2007-10-10 12:30:46 -05:00