1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

4721 Commits

Author SHA1 Message Date
Günther Deschner
f2243e8197 s3-netapi: Fix Coverity #775 (REVERSE_INULL).
Guenther
2009-03-20 11:19:59 +01:00
Günther Deschner
d2e348b191 s3-netapi: Fix Coverity #776 (REVERSE_INULL).
Guenther
2009-03-20 11:17:50 +01:00
Michael Adam
3a4638db03 add a versiontest program to print samba_version_string().
This is to allow for testing samba_version_string() without
the need to compile any of the larger binaries like smbd or net...

Michael
2009-03-19 23:57:35 +01:00
Dan Sledz
f603903cb0 s3: Fix a free of an uninitialized variable in winbind_get_sid_aliases 2009-03-19 14:59:23 -07:00
Stefan Metzmacher
0dfdb7b911 s3:lib/util_sock: use sys_recv() instead of sys_read() on sockets
This ways the pcap support in socket wrapper sees the received data.

metze
2009-03-19 13:54:17 +01:00
Günther Deschner
531af136f9 s3: remove POLICY_HND.
Guenther
2009-03-18 23:22:29 +01:00
Günther Deschner
7a85a87edf s3-rpc_parse: remove unused BUFFER5 and UNISTR3.
Guenther
2009-03-18 20:17:01 +01:00
Jeremy Allison
8dd1faaa29 Remove the global "struct cm_cred_struct" and associated calls, make
callers pass in a struct user_auth_info * instead. This commit causes
smbc_set_credentials() to print out a message telling callers to use
smbc_set_credentials_with_fallback() instead, as smbc_set_credentials()
has a broken API (no SMBCCTX * pointer). No more global variables used
in the connection manager API for client dfs calls.
Jeremy.
2009-03-17 14:53:06 -07:00
Stefan Metzmacher
6c290586e4 s3:events: add support for immediate events
metze
2009-03-17 19:59:07 +01:00
Stefan Metzmacher
d27be1d5fa s3:events: make use of tevent_common_loop_wait()
metze
2009-03-17 19:58:58 +01:00
Jeremy Allison
382d8069ad Add some appropriate const.
Jeremy.
2009-03-16 16:38:15 -07:00
Volker Lendecke
8a2b7b3e56 Remove unused async_req references from wb_reqtrans.c 2009-03-16 21:05:02 +01:00
Volker Lendecke
05b49fd4c8 Convert wb_trans to tevent_req 2009-03-16 20:45:55 +01:00
Volker Lendecke
1624b58beb Remove an unnecessary variable 2009-03-16 20:45:55 +01:00
Volker Lendecke
a58eccfee7 Make struct wb_context private to wbclient.c 2009-03-16 20:45:55 +01:00
Volker Lendecke
5c848e47cc Use tevent_wakeup_send in wb_trans 2009-03-16 20:45:55 +01:00
Volker Lendecke
20cee26a3d Convert open_socket_out_defer to tevent_req 2009-03-16 19:32:01 +01:00
Volker Lendecke
cb9effdc63 Use tevent_wakeup_send in open_socket_out_defer 2009-03-16 18:49:54 +01:00
Jelmer Vernooij
e548ec9c24 display_sec: Remove use of samba3-specific data types. 2009-03-15 17:14:25 +01:00
Volker Lendecke
5fa4cf283f Add queue argument to wb_resp_write 2009-03-15 11:26:22 +01:00
Jeremy Allison
e5136e9849 Remove the static "struct client_connection" mess which is part of
the problem that stops libsmbclient being thread safe. Subsidiary
DFS connections are now hung off a list inside the cli_state struct.
Much more to do in order to get libsmbclient to thread safety, but
this is a good start.
Jeremy.
2009-03-12 17:59:24 -07:00
Stefan Metzmacher
bd0f14c1d7 s3:events: pass __location__ to event_loop_*()
metze
2009-03-12 12:12:40 +01:00
Andrew Tridgell
6f1f9f6d8d fixed a bug in message handling for code the change notify code
The change notify code registered a separate message handler for each
tree connect. This registration uses the global messaging context.

The messaging code would consider a 2nd registration for the same
messaging type as being an 'update' of the handler, rather than a new
handler. It also would only call the first handler in the linked list
for a given message type when dispatching messages.

This patch changes the messaging code to allow for multiple
registrations of the same message type, and allow for multiple calls
to different messaging handler for one incoming message.

This fixes the problem with the test_notify_tcon() test that I
recently committed to the S4 smbtorture
2009-03-10 16:45:45 +11:00
Jelmer Vernooij
3b181564c5 Merge branch 'master' of ssh://git.samba.org/data/git/samba 2009-03-09 21:42:13 +01:00
Stefan Metzmacher
1410490fe7 s3:lib: interfaces.c isn't used in the configure tests anymore
libreplace always provides the getifaddr() function.

This fixes the build on sles8.

metze
2009-03-09 12:49:13 +01:00
Björn Jacke
c3691b839c fix "dubious escape" warning of Studio compiler 2009-03-09 10:47:30 +01:00
Volker Lendecke
dea9621680 Don't copy the winbindd_request in wb_trans 2009-03-08 12:52:58 +01:00
Volker Lendecke
e503148225 Convert wb_open_pipe to tevent_req 2009-03-08 12:52:58 +01:00
Volker Lendecke
33db1e07a7 Convert wb_connect to tevent_req 2009-03-08 12:52:58 +01:00
Volker Lendecke
549c30e9fe Convert wb_int_trans to tevent_req 2009-03-08 12:52:58 +01:00
Volker Lendecke
eb177592b5 Add parameter "queue" to wb_int_trans_send 2009-03-08 12:52:58 +01:00
Volker Lendecke
c7df046339 Move "struct req_read_state" where it belongs 2009-03-08 11:21:00 +01:00
Volker Lendecke
1611e63ae5 Convert wb_resp_write to tevent_req 2009-03-08 11:21:00 +01:00
Volker Lendecke
80fcd76421 Convert wb_resp_read to tevent_req 2009-03-08 11:21:00 +01:00
Volker Lendecke
0a3a7d53eb Convert wb_req_read to tevent_req 2009-03-08 11:21:00 +01:00
Volker Lendecke
9a64d7cfbe Convert wb_req_write to tevent_req 2009-03-08 11:20:59 +01:00
Volker Lendecke
f5ee31602c Add tevent_req wbc helpers 2009-03-08 11:20:59 +01:00
Volker Lendecke
fe486d7b9f Add "queue" to writev_send
Unless higher levels queue themselves somehow, writev will *always* be queued.
So the queueing should be done at the right level.
2009-03-08 11:20:59 +01:00
Jelmer Vernooij
f992416e23 Revert accidental reintroduction of void ** bug. 2009-03-08 06:57:52 +01:00
Stefan Metzmacher
4b6cbe80b2 s3:errormap: add ECANCELED, ERRDOS/ERRbadfid, NT_STATUS_CANCELLED mapping
If someone knows a better dos error, please tell me...

metze
2009-03-06 16:37:19 +01:00
Michael Adam
bb0fb97562 s3:dbwrap_ctdb_marshall_add: don't leak the ctdb_rec_data to the outside
Michael
2009-03-04 22:49:25 +01:00
Michael Adam
9d798494a9 s3:smbconf: move smbconf_share_exists checks into backend
Michael
2009-03-04 22:49:24 +01:00
Steven Danneman
5a9f668dab s3: Remove madvise support
This reverts 193be432.  The MADVISE_PROTECT is inherited by all child
processes and cannot be unset.  The intention of the original patch was
to protect the parent process, but allow children to be killed in low
memory.  Since this isn't possible with the current API, reverting the
whole feature.
2009-03-04 11:07:27 -08:00
Michael Adam
fb70a8a255 s3: Fix a memleak in dbwrap_rbt.
The SMB_MALLOC'ed rbt node data was not free'd on talloc free of
the db context. This is a quick fix using talloc instead of malloc
for allocation of the node data.

Since malloc was originally used for performance reasons, one
might want to reverse to malloc and create a talloc destructor
that walks the tree and frees all the node data if this talloc
approach proves to be too slow..

Michael
2009-03-04 11:23:05 +01:00
Jeremy Allison
4b2955aa7d Fix "ignore return" warning.
Jeremy.
2009-03-03 08:50:35 -08:00
Simo Sorce
1ea0dca50a Fix wbclient.c wrt tevent_req changes too. 2009-03-02 15:38:45 -05:00
Volker Lendecke
9cacb49eb6 Attempt to fix the build
Simo, with which compiler did you build this? I'd be curious to learn about the
compiler settings that make this build.

Thanks,

Volker
2009-03-02 20:17:40 +01:00
Simo Sorce
67d41d0fc7 Make struct tevent_req opaque
Move struct tevent_req in tevent_internal, and ad getters and setters
for private data and the callback function.
This patch also renames 'private_state' into 'data'. What is held in this
pointer is in fact data and not a state like enum tevent_req_state.
Calling it 'state' is confusing.

The functions addedd are:
tevent_req_set_callback() - sets req->async.fn and req->async.private_data
tevent_req_set_print_fn() - sets req->private_print
tevent_req_callback_data() - gets req->async.private_data
tevent_req_data() - gets rea->data

This way it is much simpler to keep API/ABI compatibility in the future.
2009-03-02 11:02:09 -05:00
Jelmer Vernooij
0a3ee53b50 Use samba3's own iconv implementation for now, until all changes are
merged.
2009-03-02 05:04:07 +01:00
Tim Prouty
9b0df441e1 s3: Fix incompatible type warnings 2009-03-01 16:40:17 -08:00
Jelmer Vernooij
9551ab8f7b Merge branch 'master' of git://git.samba.org/samba into convenience 2009-03-01 22:25:57 +01:00
Jelmer Vernooij
7ab8f373c8 Use common header file for character set handling in Samba 3 and Samba 4. 2009-03-01 22:24:34 +01:00
Jelmer Vernooij
da6721e323 Move secacl to top-level. 2009-03-01 18:15:36 +01:00
Jelmer Vernooij
99b288156f Move secace.c to top-level. 2009-03-01 18:00:26 +01:00
Jelmer Vernooij
54bc27e937 Merge branch 'master' of ssh://git.samba.org/data/git/samba into talloc-next 2009-03-01 16:23:53 +01:00
Jelmer Vernooij
d776ac03c3 Move next_token_talloc() to top-level. 2009-03-01 16:16:16 +01:00
Jelmer Vernooij
e6ec32f3ac Eliminate two duplicate SEC_ACE_TYPE constants already provided by
security.idl.
2009-03-01 04:59:07 +01:00
Volker Lendecke
5686a6d91a Fix async reading winbindd_response 2009-02-28 12:32:28 +01:00
Volker Lendecke
6cdcfa3fc1 Remove a temporary debug message -- sorry 2009-02-26 13:26:12 +01:00
Volker Lendecke
a777b4d501 Convert open_socket_out to tevent_req 2009-02-26 13:04:34 +01:00
Michael Adam
bd121b532c s3:libsmbconf: add transactions to the libsmbconf api
This is useful for wrapping higher level aggregate operations
in transactions. The text backend implementations just return
WERR_OK, the registry backend implementatoins use the
regdb_transaction_start|commit|cancel routines just added.

Michael
2009-02-26 11:05:23 +01:00
Volker Lendecke
aeb26fe911 Add db_tdb_parse
Signed-off-by: Michael Adam <obnox@samba.org>
2009-02-26 11:05:22 +01:00
Volker Lendecke
9475e88bea Add dbwrap->parse_record
Signed-off-by: Michael Adam <obnox@samba.org>
2009-02-26 11:05:22 +01:00
Volker Lendecke
16f61a6f90 Speed up "net conf list"
For 1000 shares this speeds up net conf list from .6 to .25 seconds on my box

Signed-off-by: Michael Adam <obnox@samba.org>
2009-02-26 11:05:21 +01:00
Volker Lendecke
26f238466c Speed up "net conf list"
With 1000 shares in the registry, this changed the time of "net conf list" from
1.1 seconds to .6 seconds.

Signed-off-by: Michael Adam <obnox@samba.org>
2009-02-26 11:05:21 +01:00
Tim Prouty
95e428e227 s3: Report the correct path when dumping core on FreeBSD
Utilize the kern.corefile sysctl value on FreeBSD
2009-02-25 13:57:11 -08:00
Tim Prouty
7f33b947e3 s3: Refactor and cleanup the error paths in dump_core_setup 2009-02-25 13:57:11 -08:00
Stefan Metzmacher
543db0f94a s3:events: map TEVENT_DEBUG_TRACE to debug level 10
metze
2009-02-25 15:05:49 +01:00
Tim Prouty
9bb1bea537 s3: Fix a bug that prevent core files from being created
Removed an erroneous free() that was causing the corepath to be NULL
during dump_core().  This prevented dump_core() from actually calling
abort() to create a core file.  The bug was introduced in December by:
07e0094365
2009-02-24 14:07:51 -08:00
Volker Lendecke
5766bf896c Use read_packet for wb_resp_read 2009-02-24 20:40:48 +01:00
Volker Lendecke
0089018270 Use read_packet for wb_req_read 2009-02-24 20:40:48 +01:00
Volker Lendecke
202a31d96d Remove read_pkt 2009-02-24 20:40:48 +01:00
Volker Lendecke
ae1a0b5534 Use async writev for wb_resp_write 2009-02-24 20:40:47 +01:00
Volker Lendecke
53b059fc52 Use async writev in wb_req_write 2009-02-24 20:40:47 +01:00
Volker Lendecke
39976035eb Convert async_connect to tevent_req 2009-02-24 20:40:47 +01:00
Günther Deschner
f21ae452a0 s3-lib: add marshall_sec_desc_buf and unmarshall_sec_desc_buf helpers.
Guenther
2009-02-24 12:41:20 +01:00
Steven Danneman
8d63c596a0 Refactored sys_fork() and sys_pid() into shared util library
This fixes a bug in 116ce19b, where we didn't clear the pid cache in
become_daemon() and thus the /var/run/smbd.pid didn't match the actual
pid of the parent process.

Currently S4 will clear the pid cache on fork but doesn't yet take
advantage of the pid cache by using sys_pid() instead of the direct
get_pid().
2009-02-23 21:17:12 -08:00
Jeremy Allison
faa1100d22 More warning fixes for Solaris.
Jeremy.
2009-02-23 16:22:43 -08:00
Steven Danneman
193be432a2 s3: Refactor of madvise() usage in c441f58d
* move to reinit_after_fork() to protect all Samba daemons
* only protect parent processes
2009-02-20 16:30:13 -08:00
Steven Danneman
116ce19b10 Moved become_daemon() and close_low_fds() to shared util lib 2009-02-20 16:30:12 -08:00
Tim Prouty
e4675ce8db s3: Add extid to the dev/inode pair
This extends the file_id struct to add an additional generic uint64_t
field: extid.  For backwards compatibility with dev/inodes stored in
xattr_tdbs and acl_tdbs, the ext id is ignored for these databases.
This patch should cause no functional change on systems that don't use
SMB_VFS_FILE_ID_CREATE to set the extid.

Existing code that uses the smb_share_mode library will need to be
updated to be compatibile with the new extid.
2009-02-19 20:58:26 -08:00
Tim Prouty
6fbebb5369 s3: Modify SMB_VFS_FILE_ID_CREATE to take a stat struct
Since file_id_create_dev is incompatible with the concept of file_ids,
it is now static and in the one file that needs it.
2009-02-19 20:58:01 -08:00
Volker Lendecke
9823b4343d Fix an uninitialized variable 2009-02-19 21:00:29 +01:00
todd stecher
03421944b2 S3: Stop creating SMBD cores when failing to create a pipe.
This was uncovered when the MAX FD limit was hit, causing an instant core
and invoking error reporting. This fix causes SMBD to exit, but without
building a core.
2009-02-18 18:08:33 -08:00
Jeremy Allison
3737b758d6 Fix warning about missmatch of uint32_t and size_t.
Jeremy.
2009-02-17 13:18:10 -08:00
Günther Deschner
dc7f04aac7 s3-netapi: fix Coverity #881 and #882.
Guenther
2009-02-17 10:21:22 +01:00
Volker Lendecke
0844cca1d5 Replace get_myname() with the talloc version from v3-3-test 2009-02-13 12:15:03 +01:00
Björn Jacke
263b798db9 tidy up timestamp checks
AC_CHECK_MEMBERS should be a sufficient check, there's no need to do manual
compile tests. We can also assume that we have ctime and atime members when we
have the mtime member.
2009-02-12 13:00:44 +01: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
todd stecher
9d4d2f70cb S3: Fixes for coverity issues. 2009-02-10 14:43:14 -08:00
Volker Lendecke
47cb572d40 Add read_pkt_send/recv 2009-02-10 18:29:34 +01:00
Tim Prouty
c6f1f055fd s3 oplocks: Make the level2 oplock contention API more granular
This replaces release_level2_oplocks_on_change with
contend_level2_oplock_begin/end in order to contend level2 oplocks
throughout an operation rather than just at the begining.  This is
necessary for some kernel oplock implementations, and also lays the
groundwork for better correctness in Samba's standard level2 oplock
handling.  The next step for non-kernel oplocks is to add additional
state to the share mode lock struct that prevents any new opens from
granting oplocks while a contending operation is in progress.

All operations that contend level 2 oplocks are now correctly spanned
except for aio and synchronous writes.  The two write paths both have
non-trivial error paths that need extra care to get right.

RAW-OPLOCK and the rest of 'make test' are still passing with this
change.
2009-02-09 23:47:45 -08:00
Tim Prouty
1696298aad s3 async: Fix the build on systems that have ETIMEDOUT but not ETIME
Fallback on EAGAIN
2009-02-09 13:23:44 -08:00
Kai Blin
c3b9b6c8aa async_sock: Use unix errnos instead of NTSTATUS
This also switches wb_reqtrans to use wbcErr instead of NTSTATUS as it would
be pointless to convert to errno first and to wbcErr later.
2009-02-09 08:36:08 +01:00
Günther Deschner
1609dbaf88 netapi: add NetServer testsuite.
Guenther
2009-02-06 11:10:36 +01:00
Günther Deschner
7fa534bd7c netapi: include more SERVER_INFO_X levels in example code.
Guenther
2009-02-06 11:10:36 +01:00
Günther Deschner
bbfc11644d netapi: implement more SERVER_INFO_X levels.
Guenther
2009-02-06 11:10:36 +01:00
Günther Deschner
2e2f511ca3 netapi: add SERVER_INFO_X to public header.
Guenther
2009-02-06 11:10:36 +01:00
Aravind Srinivasan
83cf98f113 Have nmbd check all available interfaces for WINS before failing
When nmbd is acting as WINS, it picks the first interface's IP as WINS
server's IP. If the first interface's IP is zero, we will just quit
(even though we might have other interfaces with valid IPs).

This patch makes nmbd look at all interfaces and pick the first interface
with a valid IP as the WINS server's IP.
2009-02-04 20:26:50 -08:00
Jeremy Allison
553818add8 Fix bug #6082 - smbd_gpfs_getacl failed: Windows client can´t rename or delete file
This fixes the generic rename/delete problem for 3.3.0 and above.
Fixed slightly differently to discussions, user viewable modified
ACLs are not a good idea :-).
Jeremy.
2009-02-02 17:10:27 -08:00
Kai Blin
6ed02233c3 s3-wbclient: Use new tevent data types 2009-02-02 22:14:57 +01:00
Volker Lendecke
d3f9b0fab6 Next step disentangling async_req from NTSTATUS
Now I need to document this :-)
2009-02-02 20:15:03 +01:00
Volker Lendecke
c14b7e648b Split up async_req into a generic and a NTSTATUS specific part 2009-02-01 19:05:39 +01:00
Volker Lendecke
57de60a83f cli_get_pipe_name_from_interface does not really need a talloc_ctx 2009-02-01 14:34:22 +01:00
Volker Lendecke
d94e9c802c Remove the global variable "chain_size" 2009-01-31 11:09:39 +01:00
Stefan Metzmacher
50db8ede23 s3:smbconftort: don't use reserved words ('test:', 'failure:', 'success:')
Temporary results printfs should not contain reserved subunit words.

metze
2009-01-30 19:47:59 +01:00
Jeremy Allison
c1332943db Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba 2009-01-29 15:31:56 -08:00
Tim Prouty
b8f7cdbd79 s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operation
This allows module implementors to customize what allocation size is
returned to the client.
2009-01-29 15:29:33 -08:00
Björn Jacke
d177015a6d add Tru64 sub-second resolution timestamp support 2009-01-29 15:26:13 -08:00
Volker Lendecke
1a87568d99 Fix the build on "opi"
It did not like to include "includes.h" twice
2009-01-29 21:38:05 +01:00
Björn Jacke
29ab9ed933 add missing semicolons
the fixed configure check led to a missing semicolon in the now activated BSD
code. Then this error was even copypasted into the new AIX code. grrr
2009-01-29 12:12:29 -08:00
Björn Jacke
12f57f95b5 setting mtime setted atime on BSD systems, fix this 2009-01-29 09:51:36 -08:00
Björn Jacke
3639e525a9 add AIX sub-second resolution timestamp support 2009-01-29 09:51:36 -08:00
Stefan Metzmacher
7540d13956 s3:ctdbd_conn: canonicalize ips before sending them to ctdbd
This makes samba work with older ctdb versions.

metze
2009-01-29 17:40:13 +01:00
Volker Lendecke
4c7296cc0c Avoid valgrind errors
In event handlers, we might destroy other events that are pending in the lists.
We can only run one event safely per select call.

Yes, I've seen these valgrind errors :-)

Jeremy, with ccdd921e61 you had checked in the change to run multiple events.
Do you remember why it was necessary and could not be solved in a different
way?

Volker
2009-01-28 16:18:16 +01:00
Kai Blin
ab63bad94b async_sock: Move to top level 2009-01-28 11:35:32 +01:00
Michael Adam
eccbc32ae3 s3:tdb_validate: clean up leading tabs/spaces and trailing spaces.
Michael
2009-01-28 09:44:03 +01:00
Michael Adam
59859b547c s3: separate tdb validation code out into its own source file
So this gets now linked only into its single user: winbindd
(needed by winbindd_cache.c)

Michael
2009-01-28 09:43:57 +01:00
todd stecher
7bb3860f49 This change allows for the autoconfigre detection of sub-second time resolution in the FreeBSD stat structure 2009-01-23 21:05:38 -08:00
Tim Prouty
0998d172db s3 ldb: Fix vasprintf segfault that has been the source of build machine failures this week
The bug was introduced when converting samba3's ldb_search interface
to match samba4:
47951fc5d0
f3ecb70133
2009-01-23 16:18:21 -08:00
Kai Blin
85b36d95fb async_req: Move to top level dir 2009-01-23 17:57:33 +01:00
Stefan Metzmacher
240762aefe s3:messages: finally make message_dispatch() static
metze
2009-01-22 12:37:33 +01:00
Stefan Metzmacher
f029b2b058 s3:messaging: start with to use signal events instead of the raw signal interfaces
metze
2009-01-22 12:37:30 +01:00
Stefan Metzmacher
f9dcd3d2b7 s3:events: always run_events() before sys_select()
We might have pending signal events not only timed events.

metze
2009-01-22 12:37:28 +01:00
Volker Lendecke
3b34486f6a Actually complete 3662c2b... 2009-01-22 12:13:55 +01:00
todd stecher
989ad44d32 Memory leaks and other fixes found by Coverity 2009-01-21 17:13:03 -08:00
Michael Adam
a868d2f3d5 libsmbconf: move the non-registry parts of libsmbconf to top level
Michael
2009-01-21 18:40:58 +01:00
Michael Adam
85447ac747 s3:libsmbconf: include smbconf headers with lib/smbconf prefix
Michael
2009-01-21 18:40:57 +01:00
Michael Adam
7ac06f1609 s3:libsmbconf: use talloc_free instead of TALLOC_FREE in reg backend
Michael
2009-01-21 18:40:57 +01:00
Michael Adam
1ed0cc7c9b s3:libsmbconf: use talloc_free instead of TALLOC_FREE in txt backend
Michael
2009-01-21 18:40:56 +01:00
Michael Adam
d0a8c356fb s3:libsmbconf: use talloc_free instead of TALLOC_FREE in smbconf_init
Michael
2009-01-21 18:40:56 +01:00
Michael Adam
f0f5029fd7 s3:libsmbconf: use talloc_free instead of TALLOC_FREE in testsuite
Michael
2009-01-21 18:40:56 +01:00
Michael Adam
53ea574255 s3:libsmbconf: use talloc_free instead of TALLOC_FREE in smbconf_util.c
Michael
2009-01-21 18:40:55 +01:00
Michael Adam
c94fd054ca s3:libsmbconf: use talloc_free instead of TALLOC_FREE in smbconf.c
Michael
2009-01-21 18:40:55 +01:00
Michael Adam
9f3c67e80c s3:libsmbconf: remove the init headers from smbconf.h
give the smbconf_init() dispatcher and the backends
(smbconf_reg and smbconf_txt) a header of their own each.

This allows to use the basic infrastructure and
single backends individually.

Michael
2009-01-21 18:40:54 +01:00
Michael Adam
52b77c928c s3:libsmbconf: remove unused function smbconf_is_writeable_bystring()
Michael
2009-01-21 18:40:54 +01:00
Jelmer Vernooij
1377f28f85 Fix warning; base dn is no longer const. 2009-01-21 18:20:23 +01:00
Jelmer Vernooij
f3ecb70133 Replace ldb_search() with ldb_search_exp_fmt(), like in Samba 4. 2009-01-21 16:15:53 +01:00
Jelmer Vernooij
47951fc5d0 Reorder arguments to ldb_search() to match what is in Samba 4. 2009-01-21 15:18:05 +01:00
Volker Lendecke
55dfad40af "userdom_struct" does not need "full_name" anymore -- unused 2009-01-20 23:10:16 +01:00
Stefan Metzmacher
930b3c15da s3:messaging: also recreate the local messaging backend in messaging_reinit()
This prepares the change to use signal events in the tdb backend.

metze
2009-01-20 00:41:45 +01:00
Stefan Metzmacher
26e863e6dd s3: reinit_after_fork() should reinit the event context before the messaging context
Because messaging_reinit() may add events to the event context, which will
removed by event_context_reinit().

metze
2009-01-20 00:41:20 +01:00
Stefan Metzmacher
8d203d3cab s3:events: add support for signal events
metze
2009-01-20 00:41:09 +01:00
Stefan Metzmacher
535311d187 s3:dbwrap: add dbwrap_delete(), dbwrap_store() and dbwrap_fetch()
The _bystring function are now just tiny wrappers.

metze
2009-01-19 17:06:03 +01:00
Stefan Metzmacher
a83b327f1b s3:dbwrap: add get_flags() hook to db_context
metze
2009-01-19 17:06:02 +01:00
Volker Lendecke
fe9dd8710d Remove unused tdb_search_keys() 2009-01-19 00:05:56 +01:00
Volker Lendecke
eaec865148 simplify gencache_iterate a bit, fix nonempty blank lines 2009-01-19 00:05:56 +01:00
Volker Lendecke
a9542ddcb7 libnetapi_open_pipe does not need to return cli_state
The user session key is also available in rpccli->auth->user_session_key

Guenther, please check!

Thanks,

Volker
2009-01-18 20:10:06 +01:00
Volker Lendecke
0dbd396862 Add a macro async_req_setup()
This streamlines setting up a multi-step async request a bit
2009-01-18 16:45:07 +01:00
Jeremy Allison
fb904194c9 "First thing, kill all the language lawyers" :-). Ensure possible insane compilers
can't kill us later.
Jeremy.
2009-01-16 11:55:01 -08:00
Stefan Metzmacher
dc6edf1ab4 s3:cluster: fix ctdb ipv6 support
We need to use CTDB_CONTROL_TCP_CLIENT instead of CTDB_CONTROL_TCP_ADD.

CTDB_CONTROL_TCP_CLIENT has support for 2 modes in newer ctdb versions:

- with struct ctdb_control_tcp it only supports ipv4.
- with struct ctdb_control_tcp_addr it supports ipv4 and ipv6.

You need new header files which defines struct ctdb_control_tcp_addr,
but at runtime it should be fine to work against older
ctdb versions (<= 1.0.68).

metze
2009-01-16 15:16:59 +01:00
Jeremy Allison
6fd867f036 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.
2009-01-15 15:52:41 -08:00
Günther Deschner
64d8eb0cee s3-util: for convenience, provide format comments in tdb_unpack().
Guenther
2009-01-16 00:28:45 +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
354a2e03ab Fix bug #6040 - Calling Samba print server with an aliased DNS-name fails.
Jeremy.
2009-01-15 10:29:34 -08:00
Jeremy Allison
907f085296 Remove smbclient globals that bled into clidfs.c. Now we only have
the connections list and authentication structures to worry about.
Jeremy
2009-01-14 16:08:19 -08:00
Jeremy Allison
592ee76341 Fix build of netapi.
Jeremy.
2009-01-14 14:33:46 -08:00
Jeremy Allison
0f450623c5 Fix bug noticed by Volker - if sendfile returns zero then
we might have to handle a short send by filling with zeros.
Jeremy.
2009-01-13 13:02:44 -08:00
Jeremy Allison
83c3b28096 Fix bug #6019 File corruption in Clustered SMB/NFS environment managed via CTDB
Jeremy.
2009-01-13 11:19:11 -08:00
Steven Danneman
19a05bf2f4 Make STATEDIR and CACHEDIR configurable through ./configure and loadparm.c
If they are not explicitely set in either place both will default to LOCKDIR.

Signed-off-by: Michael Adam <obnox@samba.org>
2009-01-12 12:16:03 +01:00
Volker Lendecke
ffb53c3574 Even for srclen == 0 we have to return something
This fixes a regression reported by Corinna Vinschen <corinna@vinschen.de>

Thanks,

Volker
2009-01-12 10:52:00 +01:00
Stefan Metzmacher
d524e5f417 s3:events: debug sys_select() errors
metze
2009-01-09 08:45:40 +01:00
Stefan Metzmacher
def5e8e889 s3:events: install a tevent debug handler that calls DEBUG()
metze
2009-01-09 08:45:40 +01:00
Jeremy Allison
c07ea13d30 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.
2009-01-08 10:36:10 -08:00
Volker Lendecke
e1459a2379 Several fixes to our use of splice
The splice manpage explicitly requires loff_t as offset. Copy "offset" there.
Probably not required, but I wanted to make sure it's as required.

Splice blocks with large buffers. For me it worked with 16k and blocked with
32k and beyond. It would be nice to see a clarification in the manpage of
splice for this behaviour.

Splice if used with an offset increments the offset. From the manpage this was
at least not entirely obvious :-)

I haven't yet activated this (try_splice_call ist still false by default), it
needs more testing.

Volker
2009-01-07 12:04:44 +01:00
Günther Deschner
46f55ef5bc s3-samr: avoid all init_samr_user* functions.
Guenther
2009-01-06 16:02:10 +01:00
Stefan Metzmacher
991b294c41 s3:events: use more tevent_common_* functions
metze
2009-01-05 22:44:55 +01:00
Jelmer Vernooij
37e6849d45 Merge branch 'master' of ssh://git.samba.org/data/git/samba 2009-01-05 18:01:04 +01:00
Stefan Metzmacher
303c57ef78 s3:events: register as tevent backend
metze
2009-01-05 15:07:36 +01:00
Stefan Metzmacher
83ff9d3bcd s3:events: get rid of the stupid set_event_dispatch_time() function
metze
2009-01-05 15:07:35 +01:00
Stefan Metzmacher
f1aa4457c3 s3:events: get rid of the stupid cancel_named_event() function
metze
2009-01-05 15:07:35 +01:00
Stefan Metzmacher
c34d5f445a s3:events: change event_add_timed() prototype to match samba4
metze
2009-01-05 15:07:35 +01:00
Stefan Metzmacher
077d5cff71 s3:events: remove unused stuff
metze
2009-01-05 15:07:34 +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
Jelmer Vernooij
af744e0954 Merge branch 'master' of ssh://git.samba.org/data/git/samba 2009-01-04 22:48:23 +01:00
Volker Lendecke
fe56659442 Remove a duplicated comment 2009-01-04 18:03:23 +01:00
Volker Lendecke
0cc63c6416 Add open_socket_out_defer_send/recv 2009-01-04 16:42:40 +01:00
Volker Lendecke
19b783cce9 Async wrapper for open_socket_out_send/recv 2009-01-04 16:42:40 +01:00
Volker Lendecke
4df681abf4 async libwbclient infrastructure 2009-01-04 16:42:40 +01:00
Volker Lendecke
8c1691d213 Remove wb_trans_send/recv 2009-01-04 16:42:40 +01:00
Volker Lendecke
d933362cb7 Move winbindd/winbindd_reqtrans.c to lib/wb_reqtrans.c 2009-01-04 16:42:40 +01:00
Volker Lendecke
c6c33d840b Convert async_connect to "normal" style 2009-01-04 16:42:40 +01:00
Volker Lendecke
34e8945cb5 Actually do a non-blocking connect.... :-) 2009-01-04 16:42:40 +01:00
Volker Lendecke
611f0d7ee6 Add an async queueing mechanism 2009-01-04 16:42:40 +01:00
Volker Lendecke
ebacce2efe Add async timeout helpers 2009-01-04 16:42:40 +01:00
Volker Lendecke
fafb9ecc61 open_socket_out is always used with SOCK_STREAM, remove argument "type" 2009-01-03 19:22:06 +01:00
Volker Lendecke
b6138bf4f2 Fix retval of async_syscall_result_int 2009-01-03 19:07:57 +01:00
Volker Lendecke
27abf6731e struct async_req doesn't really need to carry an event_context 2009-01-03 19:07:57 +01:00
Volker Lendecke
980aa0d464 Replace some SMB_ASSERTs with NT_STATUS_INTERNAL_ERROR 2009-01-02 22:14:23 +01:00
Volker Lendecke
b4e1eb4345 Optimize for the common case that packet.c received exactly one full packet 2009-01-02 22:11:50 +01:00
Volker Lendecke
aed8c7bfcf packet.h API: The callback is now responsible to talloc_free() "buf" 2009-01-02 22:11:50 +01:00
Volker Lendecke
7458111ea4 Fix bug 5913.
Never seen this to be a problem, but it doesn't hurt either :-)
2009-01-01 22:08:24 +01:00
Volker Lendecke
e551f43b4b Remove two pointless globals 2009-01-01 19:08:33 +01:00
Jelmer Vernooij
08259c1c52 Add iconv_convenience argument to size functions. 2009-01-01 04:45:33 +01:00
Jeremy Allison
07e0094365 Fix all warnings in source3 with gcc4.3.
Jeremy.
2008-12-31 18:06:57 -08:00
Volker Lendecke
98f830cdfc Disable the use of splice(2)
On a debian lenny installation with a kernel that calls itself 2.6.28, I could
repeatably block smbd using splice. According to the output of netstat, the
recvq of the TCP connection was full and at the same time according to strace
smbd was stuck in a splice syscall trying to read from that TCP connection. We
can not protect ourselves from this condition, as nobody will ever notify us
that something is broken. So sadly we can't use splice yet at all. Maybe in
2.6.29...
2008-12-31 19:33:25 +01:00
Volker Lendecke
e0fd61f0cb Try to fix recvfile using splice on Linux
According to the splice(2) manpage, one of the file descriptors *must* be a
pipe. With this patch I could successfully run splice(2) on a debian lenny
installation.

Jeremy, please check!
2008-12-31 19:33:25 +01:00
Volker Lendecke
972295f80a Rename parent_dirname_talloc() to parent_dirname() 2008-12-31 19:33:25 +01:00
Volker Lendecke
9b79181f15 Remove unused function parent_dirname 2008-12-31 19:33:25 +01:00