summaryrefslogtreecommitdiff
path: root/source3/lib
AgeCommit message (Collapse)AuthorFilesLines
2010-12-19s3: FreeBSD has getpeereid(), use itVolker Lendecke1-0/+4
2010-12-19s3: Fix some typosVolker Lendecke1-1/+1
2010-12-19s3: Fix serverid_existsVolker Lendecke1-0/+4
In the cluster case it can happen that a node just died and we did not yet have the time to clean up serverid.tdb. If the corresponding serverid.tdb record that represented a process was migrated away from the dead record, it represents existence of a process where it is already dead.
2010-12-15Fix read/write calls over sockets to cope with EAGAIN/EWOULDBLOCK for ↵Jeremy Allison2-16/+68
non-blocking sockets.
2010-11-28s3: Add gencache_iterate_blobsVolker Lendecke1-57/+87
2010-11-28s3: Convert gencache_get_data_blob to gencache_parseVolker Lendecke1-59/+38
2010-11-28s3: Add gencache_parseVolker Lendecke1-0/+59
2010-11-24s3-libnetapi Load case tables earlierAndrew Bartlett1-2/+3
If we don't load the case tables as the 'first' thing we do, we will segfault on the first case insensitive string comparison. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Nov 24 09:21:05 CET 2010 on sn-devel-104
2010-11-24s3-libnetapi Add function header commentsAndrew Bartlett1-0/+3
Andrew Bartlett
2010-11-24s3-netapi Add libnetapi_net_init(), don't double-init common Samba subsystemsAndrew Bartlett3-12/+60
The issue here is that libnet and net were both trying to load the smb.conf files, the case tables and set the debug levels. The set of the debug levels caused problems, because it would force the level to 0, not (say) 10 as requested on the command line. This regression was apparently introduced in cf4de8ec2c8df2ceabbe3d836d296b058e7b19fb when eliminating AllowDebugChange. Andrew Bartlett
2010-11-14Move error reporting of messaging context creation fail intoJeremy Allison3-6/+3
the daemons themselves. Allows client utilities to silently fail to create a messaging context due to access denied on the messaging tdb (which I need for the following patch). Jeremy.
2010-11-10Fix bug 7781 - Samba transforms ShareName to lowercase (sharename) when ↵Jeremy Allison2-1/+5
adding new share via MMC Change the find_service() interface to not depend on fstring, and create a useable talloc-based interface. Jeremy.
2010-11-03s3:util_str: add strlen_m_ext_term() - variant of strlen_m_ext() counting ↵Michael Adam1-0/+9
terminator
2010-11-03s3:lib/util_str: add strlen_m_ext() that takes input and output charsetMichael Adam1-13/+55
The function calculates the number of units (8 or 16-bit, depending on the destination charset), that would be needed to convert the input string which is expected to be in in src_charset encoding to the dst_charset (which should be a unicode charset).
2010-11-03s3:lib/util_str: clarify the comment header for strlen_m().Michael Adam1-4/+6
2010-11-03s3:lib/charcnv: clarify comments in next_codepoint_ext()Michael Adam1-2/+2
(giving the unicod U+<hexnumber> notation of the codepoints referred to in the comments)
2010-11-03s3:lib/charcnv: rename a parameter for clarity in next_codepoint_ext()Michael Adam1-5/+5
2010-11-03s3:lib/charcnv: reformat comments in next_codepoint_ext()Michael Adam1-12/+18
2010-11-03s3:lib/charcnv: add next_codepoint_ext() that accepts input charset.Michael Adam1-11/+32
next_codepoint() takes as string in CH_UNIX encoding and returns the unicode codepoint of the next (possibly multibyte) character of the input string. The new next_codepoint_ext() function adds the encoding of the input string as a parameter. next_codepoint() now only calls next_codepoint_ext() with CH_UNIX als src_charset argument.
2010-11-02s3: Do not connect to ctdb if it is blocked for some reasonVolker Lendecke1-0/+58
2010-11-02cluster_fatal() exit code should not indicate success.Martin Schwenke1-1/+1
cluster_fatal() logs a fatal event and then exits with 0. This seems wrong. Sometimes command like "net" use this code and return incorrect empty output but then exit with 0. This simply changes the exit code to 1. Signed-off-by: Martin Schwenke <martin@meltin.net>
2010-11-02s3-libsmbclient Add comments to describe the behaviour of DEBUG()Andrew Bartlett1-0/+5
This isn't quite what you would expect from this interface, but actually avoids some really nasty situations if you ever have more than one libsmbclient context in a process. In the real world, if you have asked for DEBUG() to stderr in one part of the code, you will want it globally, even in a different thread (which in the past would have rest everything to stdout again, at least while starting up). Andrew Bartlett
2010-11-02debug Explain the behaviour of setup_logging() more clearlyAndrew Bartlett1-0/+6
2010-11-02s3-debug Clarify the handling of invalid state.fd values in debug.cAndrew Bartlett1-9/+10
This makes it clear that -1 and 0 are both invalid file descriptor values for DEBUG output. Andrew Bartlett
2010-11-02s3-debug Convert from x_file to real file descriptors.Andrew Bartlett1-47/+31
X_FILE does not gain us anything in this use case, we want our log messages on disk, not in a buffer, and we don't gain anything from the X_FILE api. I discussed the matter with tridge, who feels that to use FILE in the first place was a mistake, and that X_FILE isn't any better, but was a stop-gap to avoid issues on solaris. Andrew Bartlett
2010-11-02s3-debug Remove 'AllowDebugChange' and use lp_set_cmdline() insteadAndrew Bartlett3-18/+3
By removing this global variable, the API between the two different debug systems is made more similar. Both s3 and s4 now have lp_set_cmdline() which ensures that the smb.conf cannot overwrite these the user-specified log level. Andrew Bartlett
2010-11-02s3-debug Impove setup_logging() to specify logging to stderrAndrew Bartlett3-79/+92
This change improves the setup_logging() API so that callers which wish to set up logging to stderr can simply ask for it, rather than directly modify the dbf global variable. Andrew Bartlett
2010-10-26s3: Pass tdb_flags to ctdbd when attaching to a dbVolker Lendecke1-1/+1
This is required to make ctdb create databases with INCOMPATIBLE_HASH
2010-10-20s3: Add any_nt_status_not_okVolker Lendecke1-0/+13
This helps avoid quite a bit of repetitive code when looking at dcerpc_xx_recv results.
2010-10-20Make getpwnam_alloc() static to lib/username.c, and ensure all username ↵Jeremy Allison3-90/+74
lookups go through Get_Pwnam_alloc(), which is the correct wrapper function. We were using it *some* of the time anyway, so this just makes us properly consistent. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Oct 20 16:02:12 UTC 2010 on sn-devel-104
2010-10-14libcli/auth Merge source4/libcli/security and util_sid.c into the common codeAndrew Bartlett1-313/+1
This should ensure we only have one copy of these core functions in the tree. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14libcli/security Move source3/lib/util_seaccess.c into the common codeAndrew Bartlett1-251/+0
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14s3-acl Use uint32_t for counting the ACEsAndrew Bartlett1-1/+1
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14s3-acl Merge source4-supported privileges into se_access_checkAndrew Bartlett1-5/+9
This will shortly be the common se_access_check function. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14s3-util_nttoken.c Also copy the rights_mask when copying a security_tokenAndrew Bartlett1-0/+4
These are unused in source3/ code at the moment, but it would be unfortunate if that were to change, and this function not be updated. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14s3 Replace is_sid_in_token() with security_token_has_sid() from common codeAndrew Bartlett2-15/+4
The two routines are identical, so there is no need to keep both. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-12libcli/security Provide a common, top level libcli/security/security.hAndrew Bartlett15-5/+15
This will reduce the noise from merges of the rest of the libcli/security code, without this commit changing what code is actually used. This includes (along with other security headers) dom_sid.h and security_token.h Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-09More neccessary const.Jeremy Allison1-1/+1
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Oct 9 01:47:25 UTC 2010 on sn-devel-104
2010-10-07samr: for correctness, rename samr_RidTypeArray to samr_RidAttrArray.Günther Deschner1-3/+3
Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Thu Oct 7 12:04:32 UTC 2010 on sn-devel-104
2010-10-07 s3: Adding TCP_KEEPALIVE_THRESHOLD and TCP_KEEPALIVE_ABORT_THRESHOLD to ↵Ira Cooper1-0/+6
the list of accepted socket settings. These are both exclusive to Solaris/OpenSolaris. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Oct 7 00:26:39 UTC 2010 on sn-devel-104
2010-10-04s3: Attempt to get the Tru64 build a bit furtherVolker Lendecke1-1/+0
2010-10-02s3: Attempt to fix bug 7665Volker Lendecke11-136/+295
Quite a few of our internal routines put stuff on talloc_tos() these days. In top-level netapi routines, properly allocate a stackframe and clean it again. Also, don't leak memory in the rpccli_ callers onto the libnetapi context.
2010-10-01s3:events: Call all ready fd event handlers on each iteration of the main loopSteven Danneman1-7/+15
Previously, only one fd handler was being called per main message loop in all smbd child processes. In the case where multiple fds are available for reading the fd corresponding to the event closest to the beginning of the event list would be run. Obviously this is arbitrary and could cause unfairness. Usually, the first event fd is the network socket, meaning heavy load of client requests can starve out other fd events such as oplock or notify upcalls from the kernel. In this patch, I have changed the behavior of run_events() to unset any fd that it has already called a handler function, as well as decrement the number of fds that were returned from select(). This allows the caller of run_events() to iterate it, until all available fds have been handled. I then changed the main loop in smbd child processes to iterate run_events(). This way, all available fds are handled on each wake of select, while still checking for timed or signalled events between each handler function call. I also added an explicit check for EINTR from select(), which previously was masked by the fact that run_events() would handle any signal event before the return code was checked. This required a signature change to run_events() but all other callers should have no change in their behavior. I also fixed a bug in run_events() where it could be called with a selrtn value of -1, doing unecessary looping through the fd_event list when no fds were available. Also, remove the temporary echo handler hack, as all fds should be treated fairly now.
2010-10-01samba: share readline wrappers among all buildsystems.Günther Deschner1-174/+0
Guenther
2010-10-01s3-readline: move cmd_history to smbclient, the only user.Günther Deschner1-21/+0
Guenther
2010-10-01samba: share select wrappers.Günther Deschner6-207/+5
Guenther
2010-09-28s3: Remove talloc_autofree_context() from myhostname()Volker Lendecke1-3/+1
No destructor needed, so we can as well use the NULL context
2010-09-27Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on allJeremy Allison6-11/+11
TDB_CLEAR_IF_FIRST tdb's. For tdb's like gencache where we open without CLEAR_IF_FIRST and then with CLEAR_IF_FIRST if corrupt this is still safe to use as if opening an existing tdb the new hash will be ignored - it's only used on creating a new tdb not opening an old one. Jeremy.
2010-09-26s3: Remove talloc_autofree_context() from nametouid()Volker Lendecke1-1/+1
pass is freed a few lines down
2010-09-26s3: Remove talloc_autofree_context() from getpwnam_alloc()Volker Lendecke1-1/+1
This is given to the memcache a few lines down