summaryrefslogtreecommitdiffstats
path: root/source3/lib/util.c
Commit message (Collapse)AuthorAgeFilesLines
* s3: Remove is_ntfs_stream_name() and split_ntfs_stream_name()Tim Prouty2009-07-081-90/+0
| | | | | Actually I moved split_ntfs_stream_name into torture.c which is the one consumer of it. This could probably be changed at some point.
* s3:util: let parent_dirname() correctly return toplevel filenamesStefan Metzmacher2009-07-011-1/+1
| | | | metze
* s3: Call va_end() after all va_start()/va_copy() calls.Andrew Kroeger2009-06-121-1/+1
| | | | | | | | There are error paths in S3 where va_end() is not properly called after va_start() or va_copy() have been called. These issues were noted while performing an inspection for S4 bug #6129. Thanks to Erik Hovland <erik@hovland.org> for the original bug report.
* util: move add_gid_to_array_unique to toplevel and add add_uid_to_array_unique.Günther Deschner2009-05-291-33/+0
| | | | Guenther
* s3: Allow child processes to exit gracefully if we are out of fdsMarc VanHeyningen2009-05-271-6/+6
| | | | | | | | | | 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>
* Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke2009-05-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
* Remove smb_mkstemp() - libreplace will now provide a secure mkstemp() ifJelmer Vernooij2009-04-201-18/+0
| | | | the system one is broken.
* s3: remove POLICY_HND.Günther Deschner2009-03-181-2/+2
| | | | Guenther
* Remove the global "struct cm_cred_struct" and associated calls, makeJeremy Allison2009-03-171-0/+40
| | | | | | | | | 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.
* Add some appropriate const.Jeremy Allison2009-03-161-8/+8
| | | | Jeremy.
* s3: Remove madvise supportSteven Danneman2009-03-041-7/+0
| | | | | | | | 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.
* Remove read_pktVolker Lendecke2009-02-241-99/+0
|
* s3: Refactor of madvise() usage in c441f58dSteven Danneman2009-02-201-0/+7
| | | | | * move to reinit_after_fork() to protect all Samba daemons * only protect parent processes
* Moved become_daemon() and close_low_fds() to shared util libSteven Danneman2009-02-201-67/+0
|
* Replace get_myname() with the talloc version from v3-3-testVolker Lendecke2009-02-131-30/+1
|
* Add read_pkt_send/recvVolker Lendecke2009-02-101-0/+99
|
* Remove the global variable "chain_size"Volker Lendecke2009-01-311-3/+0
|
* s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operationTim Prouty2009-01-291-1/+10
| | | | | This allows module implementors to customize what allocation size is returned to the client.
* s3: reinit_after_fork() should reinit the event context before the messaging ↵Stefan Metzmacher2009-01-201-4/+4
| | | | | | | | | context Because messaging_reinit() may add events to the event context, which will removed by event_context_reinit(). metze
* Allow reinit_after_fork to be called safely from within swat and other ↵Jeremy Allison2009-01-151-10/+14
| | | | | | | binaries that don't have an event context or a msg context. Fixes crash bug in swat. Jeremy.
* Make STATEDIR and CACHEDIR configurable through ./configure and loadparm.cSteven Danneman2009-01-121-14/+46
| | | | | | If they are not explicitely set in either place both will default to LOCKDIR. Signed-off-by: Michael Adam <obnox@samba.org>
* clean event context after child is forked.Bo Yang2009-01-051-0/+3
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Rename parent_dirname_talloc() to parent_dirname()Volker Lendecke2008-12-311-2/+2
|
* Remove unused function parent_dirnameVolker Lendecke2008-12-311-13/+0
|
* Make use of TALLOC_MEMDUP in parent_dirname_talloc()Volker Lendecke2008-12-311-2/+1
|
* Remove unused function get_numlist()Volker Lendecke2008-12-311-51/+0
|
* Remove the global "cmdline_auth_info" from source3/lib/util.cVolker Lendecke2008-12-141-62/+81
| | | | This involves changing all our clients, that's why it's so large.
* Move cli_trans_oob to lib/util.cVolker Lendecke2008-11-281-0/+19
| | | | Rename it to trans_oob, it will be used in the server routines.
* Make us clean under valgrind --leak-check=full by using ↵Jeremy Allison2008-11-061-3/+3
| | | | | | | | | | talloc_autofree_context() instead of NULL. Remove the code in memcache that does a TALLOC_FREE on stored pointers. That's a disaster waiting to happen. If you're storing talloc'ed pointers, you can't know their lifecycle and they should be deleted when their parent context is deleted, so freeing them at some arbitrary point later will be a double-free. Jeremy.
* Remove silly safe_free() function which is a wrapper around SAFE_FREE().Jelmer Vernooij2008-10-191-11/+0
| | | | | | | | Since it's a function it just sets the local pointer to NULL and basically is an equivalent to free(). It also claims it's being used for callbacks but isn't used that way anywhere.
* Fix const, dupes.Jelmer Vernooij2008-10-181-35/+0
|
* Use separate make variables for libutil and libcrypto.Jelmer Vernooij2008-10-181-1/+1
|
* Use shared util.c.Jelmer Vernooij2008-10-181-323/+5
|
* Use standard va_copy.Jelmer Vernooij2008-10-181-1/+1
|
* Share ndrdump implementation.Jelmer Vernooij2008-10-131-7/+66
|
* Add a utility function to append a DATA_BLOB to a talloc objectVolker Lendecke2008-09-091-0/+26
| | | | (This used to be commit d8259cbe666d96cc468203a64fb208c02a64849f)
* Add modules_path() to construct paths to files in MODULESDIR.Michael Adam2008-08-151-0/+13
| | | | | Michael (This used to be commit 5ef9da6f4f04b07804b389902862fae0fbbfed13)
* Fix bug 5686 - libsmbclient segfaults with more than one SMBCCTX.Jeremy Allison2008-08-121-4/+1
| | | | | | | | | | Here is a patch to allow many subsystems to be re-initialized. The only functional change I made was to remove the null context tracking, as the memory allocated here is designed to be left for the complete lifetime of the program. Freeing this early (when all smb contexts are destroyed) could crash other users of talloc. Jeremy. (This used to be commit 8c630efd25cf17aff59448ca05c1b44a41964b16)
* Remove an unused variable, process.c has its static copyVolker Lendecke2008-08-101-2/+0
| | | | (This used to be commit 59136544ec16b6ceb14a75259aedd22856832bf1)
* util: add policy_hnd_equal().Günther Deschner2008-07-171-0/+10
| | | | | Guenther (This used to be commit 6aca163e898bfeeff824725bb27b2ef4f7b729f9)
* [BUG 5580] Allow access to DFS shares via libsmbclientDerrell Lipman2008-07-081-0/+5
| | | | | | | | | | Brian Sheehan provided a nice patch intended for the 3.0 code base. This commit applies a similar patch for the 3.3 code base. It adds a new public function to libsmbclient -- smbc_set_credentials() -- that may be called from the authentication callback when DFS referrals are in use. Derrell (This used to be commit 888f922bd0d1c84a687d404e95ae314a9dd0aee1)
* If no node number is given, default to the current node in smbcontrolVolker Lendecke2008-05-191-1/+1
| | | | (This used to be commit b4b3b6b1c6a336220c6afd68b153a769397ecded)
* util: add strip_hostname() to strip of leading '\\'.Günther Deschner2008-05-091-0/+19
| | | | | Guenther (This used to be commit dbf96120d8b33e592bfd3e9df1777f1670e218be)
* Make the namelist arg to set_namearray constVolker Lendecke2008-05-051-2/+2
| | | | (This used to be commit e7ce4bce5cd7eddb14982028538e965e12ccef84)
* Fix client authentication with -P switch in client tools (Bug 5435).Günther Deschner2008-05-051-1/+48
| | | | | Guenther (This used to be commit d077ef64cd1d9bbaeb936566c2c70da508de829f)
* Fix CLEAR_IF_FIRST handling of messages.tdbVolker Lendecke2008-04-231-2/+3
| | | | | | | | 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 4f4781c6d17fe2db34dd5945fec52a7685448aec)
* util: add reinit_after_fork() functionStefan Metzmacher2008-04-181-0/+30
| | | | | metze (This used to be commit 5f6c3a4f6db68c985884cbe9401a4dbe515f756b)
* Move is_valid_policy_hnd() out of net.Günther Deschner2008-04-081-0/+8
| | | | | Guenther (This used to be commit aae4d91e726ef8dcad173cdd1d6f719d94462948)
* Patch from Nicholas Brealey <nick@brealey.org> to distinguish between WinXP ↵Gerald W. Carter2008-03-311-1/+4
| | | | | | | and WinXP64. Defines a new value for the %a variable when detecting a Windows XP 64-bit client. (This used to be commit 0c94918fb52c5345ce30490046b79f81712c30bf)
* Adding missing calls to va_end().Tim Potter2008-01-271-0/+1
| | | | | | | | | Just a small commit to get a handle on this git thingy. This patch fixes some missing calls to va_end() to match various calls to va_start() and VA_COPY(). Tim. (This used to be commit ec367f307dff7948722b9ac97beb960efd91991f)