summaryrefslogtreecommitdiffstats
path: root/source3/lib/util.c
Commit message (Collapse)AuthorAgeFilesLines
* s3-util: Fix authentication with long hostnames.Andreas Schneider2015-01-121-1/+3
| | | | | | | | | | | | | If the hostname is longer than MAX_NETBIOSNAME_LEN we fail to correctly check the hostname. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11008 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Jan 12 23:10:30 CET 2015 on sn-devel-104
* lib: Split out write_data[_iov]Volker Lendecke2014-12-071-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Split out sys_[read|write] & friendsVolker Lendecke2014-12-071-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: reset tracepoint handler in reinit_after fork.Michael Adam2014-09-211-2/+5
| | | | | | | | | | This for instance fixes panics in the scavenger process due to talloc stackframes not freed in order. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Typo: Specifing -> specifying.Jelmer Vernooij2014-04-131-1/+1
| | | | | | | Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Change-Id: I80286441b32cd0b8384610b5b6db7790b8a22d48 Reviewed-on: https://gerrit.samba.org/221 Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3-lib/util: fix logic inside set_namearray loops.Jeremy Allison2014-04-091-10/+16
| | | | | | | | | | | | | Additional fix for bug #10544 - s3-lib/util: set_namearray reads across end of namelist string. Not strictly needed as the initial fix addresses the problem, but corrects the internal logic inside the loops. https://bugzilla.samba.org/show_bug.cgi?id=10544 Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
* s3-lib/util: fix read across end of namelist stringBjörn Baumbach2014-04-081-2/+5
| | | | | | | | | | | | If the namelist is not terminated with a '/', we try to read the next character after the string termination '\0'. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Apr 8 21:44:16 CEST 2014 on sn-devel-104
* s3: smbd/nmbd/winbindd - fix append on trailing slash on system paths.Jeremy Allison2014-04-051-1/+1
| | | | | | | | | | | | | | | | | | The xx_path() function incorrectly uses talloc_asprintf_append() instead of talloc_asprintf() on a path that may have been modified by the trim_string() call previously. talloc_asprintf_append() always sticks the new text at the *end* of the allocated buffer, not at the end of the string. Fix bug #10538 - Daemons crashing when lock/state/cache directory parameter has a trailing slash https://bugzilla.samba.org/show_bug.cgi?id=10538 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Apr 5 13:40:30 CEST 2014 on sn-devel-104
* lib: Avoid a strlen call in xx_path()Volker Lendecke2014-02-201-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Kai Blin <kai@samba.org>
* auth: Make new_server_id_task() static to auth_samba4Volker Lendecke2014-02-121-42/+0
| | | | | | | | This is not used in other parts of source3, so this patch improves modularity and isolation of features. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib/param: Remove special handling for 'state dir' and 'cache dir'Andrew Bartlett2014-02-121-2/+2
| | | | | | | | | | | | | | | The build system gives these two parameters different defaults (compared with lock dir) in both the --enable-fhs and default mode, so the logic to use lock dir no longer applies unless the build has been very specially constructed. Therefore, remove the special case handling and make these normal parameters again. Reviewed-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: rename lp function and variable from "nis_home_map_name" to "homedir_map"Garming Sam2014-02-071-2/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from 'lockdir' to 'lock_directory'Garming Sam2014-02-071-1/+1
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-lib: smbclient shows no error if deleting a directory with del failedJeremy Allison2013-11-141-0/+42
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10260 Move dir_check_ftype() to util.c Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* Fix bug #10063 - source3/lib/util.c:1493 leaking memory w/ pam_winbind.so / ↵Jeremy Allison2013-08-241-2/+4
| | | | | | | | | | | | winbind Don't use talloc_tos() in something that can be linked to in pam_winbindd.so Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Simo Sorce <idra@samba.org> Autobuild-Date(master): Sat Aug 24 02:28:28 CEST 2013 on sn-devel-104
* s3:lib: remove unused interpret_protocol()Stefan Metzmacher2013-08-151-25/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Fix xx_path() - return check from mkdir() is incorrect.Jeremy Allison2013-06-181-3/+8
| | | | | | | | | This is very old code, but mkdir() fails with -1, not 0. Only print the error message is mkdir failed with anything other than EEXIST. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* s3:lib: s/struct event_context/struct tevent_contextStefan Metzmacher2013-02-191-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* Avoid a very small memleak on talloc_tos()Volker Lendecke2013-01-251-4/+1
| | | | | | | | | | "fname" did leak on talloc_tos(). Not really a bad memleak, but as I just came across it I thought I might just fix it Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jan 25 00:54:01 CET 2013 on sn-devel-104
* s3:lib: remove unused processes_exist()Stefan Metzmacher2012-08-241-70/+0
| | | | metze
* s3:lib: implement process_exists() as wrapper of serverid_exists()Stefan Metzmacher2012-08-241-14/+2
| | | | | | | The changes the behavior of process_exists() it checks the pid.unique_id now, if it's not SERVERID_UNIQUE_ID_NOT_TO_VERIFY. metze
* s3:lib: implement interpret_pid() as wrapper of server_id_from_string()Stefan Metzmacher2012-08-171-30/+1
| | | | metze
* Correctly check for errors in strlower_m() returns.Jeremy Allison2012-08-091-2/+8
|
* loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell2012-07-181-2/+2
| | | | | | | | | | They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* Make check_same_stat() and check_same_dev_ino() common functions.Jeremy Allison2012-07-091-0/+29
|
* Move copy_unix_token() from locking/locking.c to lib/util.c.Jeremy Allison2012-07-031-0/+30
| | | | Make public.
* s3:move serverid_equal() to serverid.cMichael Adam2012-06-211-21/+0
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:util: rename procid_equal() to serverid_equal()Michael Adam2012-06-211-1/+1
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:util: remove (now) unused cluster_id_equal()Michael Adam2012-06-211-6/+0
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:util: reformat procid_equal() to adhere to coding guidelinesMichael Adam2012-06-211-7/+14
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:util: also compare the unique_id in procid_equal().Michael Adam2012-06-211-0/+3
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* lib/util: move tevent_req_poll_ntstatus() to tevent_ntstatus.cStefan Metzmacher2012-05-141-11/+0
| | | | metze
* s3:lib/util: use map_nt_error_from_unix_common() in tevent_req_poll_ntstatus()Stefan Metzmacher2012-05-141-1/+1
| | | | metze
* s3-lib Add a way to allocate the task_id value in server_idAndrew Bartlett2012-04-301-0/+42
| | | | | | | | This safely allocates the task_id so that when we have multiple event contexts, they can each have their own messaging context, particularly for the imessaging subsystem under source4. Andrew Bartlett
* build: Remove SMB_OFF_T, replace with off_tAndrew Bartlett2012-04-061-3/+3
| | | | | | | | | Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104
* build: Remove SMB_F* locking definesAndrew Bartlett2012-04-051-1/+1
|
* build: Remove SMB_STRUCT_FLOCK defineAndrew Bartlett2012-04-051-1/+1
|
* build: Remove SMB_STRUCT_DIR defineAndrew Bartlett2012-04-051-1/+1
|
* build: Remove SMB_STRUCT_DIRENT defineAndrew Bartlett2012-04-051-2/+2
|
* build: Remove sys_readdir wrapperAndrew Bartlett2012-04-051-1/+1
|
* build: Remove sys_lseek wrapperAndrew Bartlett2012-04-051-1/+1
|
* s3-smbd: Inline init_modules() into only callerAndrew Bartlett2012-04-031-9/+0
|
* lib/util: Remove obsolete sys_getpid() and sys_fork().Jelmer Vernooij2012-03-241-4/+4
| | | | | | | | | The performance of these is minimal (these days) and they can return invalid results when used as part of applications that do not use sys_fork(). Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
* lib/util: Remove dummy wrapper for getgrnam().Jelmer Vernooij2012-03-241-1/+1
|
* Make reinit_after_fork_pipe_handler code with reads being interrupted by a ↵Jeremy Allison2012-03-151-1/+1
| | | | | | | signal. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Mar 15 23:29:47 CET 2012 on sn-devel-104
* s3:smbd: let smbd/nmbd/winbindd child processes terminate if the parent ↵Michael Adam2012-03-151-0/+56
| | | | | | | | | | | process died. This applies to all child processes making use of reinit_after_fork(). It is implemented by establishing a pipe between parent and child. The child watches for EOF on the read end of the pipe, indidcating an exited parent. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
* s3-lib: Remove unused is_myworkgroup()Andrew Bartlett2012-02-101-17/+0
| | | | | | Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html Andrew Bartlett
* s3-lib: Remove unused pid_path()Andrew Bartlett2012-02-101-13/+0
| | | | | | | | piddir.c calls lp_piddir() directly. Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html Andrew Bartlett
* Remove unused get_file_size() function.Jeremy Allison2012-02-071-13/+0
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Feb 7 20:56:28 CET 2012 on sn-devel-104
* s3: Remove a bunch of calls to procid_self()Volker Lendecke2011-12-121-2/+1
| | | | All callers to messaging_[re]init only used procid_self()