summaryrefslogtreecommitdiffstats
path: root/src/tools/tools_util.h
Commit message (Collapse)AuthorAgeFilesLines
* util: Move semanage related functions to src/utilMichal Zidek2014-10-201-2/+0
| | | | | | These functions will be reused by IPA provider. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* Update DEBUG* invocations to use new levelsNikolai Kondrashov2014-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a script to update DEBUG* macro invocations, which use literal numbers for levels, to use bitmask macros instead: grep -rl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e 'use strict; use File::Slurp; my @map=qw" SSSDBG_FATAL_FAILURE SSSDBG_CRIT_FAILURE SSSDBG_OP_FAILURE SSSDBG_MINOR_FAILURE SSSDBG_CONF_SETTINGS SSSDBG_FUNC_DATA SSSDBG_TRACE_FUNC SSSDBG_TRACE_LIBS SSSDBG_TRACE_INTERNAL SSSDBG_TRACE_ALL "; my $text=read_file(\*STDIN); my $repl; $text=~s/ ^ ( .* \b (DEBUG|DEBUG_PAM_DATA|DEBUG_GR_MEM) \s* \(\s* )( [0-9] )( \s*, ) ( \s* ) ( .* ) $ / $repl = $1.$map[$3].$4.$5.$6, length($repl) <= 80 ? $repl : $1.$map[$3].$4."\n".(" " x length($1)).$6 /xmge; print $text; ' < "$f.orig" > "$f" rm "$f.orig" done Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Make DEBUG macro invocations variadicNikolai Kondrashov2014-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use a script to update DEBUG macro invocations to use it as a variadic macro, supplying format string and its arguments directly, instead of wrapping them in parens. This script was used to update the code: grep -rwl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e \ 'use strict; use File::Slurp; my $text=read_file(\*STDIN); $text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs; print $text;' < "$f.orig" > "$f" rm "$f.orig" done Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Move nscd.c from tools to utilOndrej Kos2013-05-211-8/+0
| | | | | | Preparation for the following patch which will include the nscd.c in the monitor code due to newly introduced function for checking the nscd configuration file.
* TOOLS: Use file descriptor to avoid races when creating a home directoryJakub Hrozek2013-01-231-3/+2
| | | | | | | | | | | When creating a home directory, the destination tree can be modified in various ways while it is being constructed because directory permissions are set before populating the directory. This can lead to file creation and permission changes outside the target directory tree, using hard links. This security problem was assigned CVE-2013-0219 https://fedorahosted.org/sssd/ticket/1782
* TOOLS: invalidate parent groups in memory cache, tooJakub Hrozek2013-01-211-1/+2
| | | | | | | | | https://fedorahosted.org/sssd/ticket/1775 In addition to invalidating the group being added to when adding a member group/user, we also need to invalidate all its parent groups, otherwise this getgrnam("parent") wouldn't report the members newly added to its child groups.
* TOOLS: Provide a convenience function to refresh a list of groupsJakub Hrozek2013-01-151-0/+1
|
* TOOLS: Split querying nss responder into a separate functionJakub Hrozek2013-01-151-0/+3
| | | | | | The tools query the responder in order to sync the memcache after performing changes to the local database. The functions will be reused by other tools so I split them into a separate functions.
* TOOLS: move memcache related functions to tools_mc_utils.cJakub Hrozek2013-01-151-0/+1
| | | | | | | The upcoming patches will link only users of this file with client libs, so it's better to have it separate. There is no functional change in this patch
* sss_cache: Small refactor.Michal Zidek2012-11-281-0/+2
| | | | | | | The logic that checks if sssd_nss is running and then sends SIGHUP to monitor or removes the caches was moved to a function sss_memcache_clear_all() and made public in tools_util.h.
* sss_cache: Remove fastcache even if sssd is not running.Michal Zidek2012-11-061-0/+2
| | | | https://fedorahosted.org/sssd/ticket/1584
* tools_util.h provides signal_sssd function.Michal Zidek2012-09-241-0/+5
|
* Always use positional arguments in translatable stringsStephen Gallagher2012-05-221-1/+1
| | | | https://fedorahosted.org/sssd/ticket/1336
* Cleanup: Remove unused parametersJakub Hrozek2011-11-221-4/+2
|
* Fix assorted minor bugs in sss_ toolsJakub Hrozek2010-09-081-0/+6
| | | | Fixes: #585
* tools: remove creation of event_contextSimo Sorce2010-04-121-1/+0
| | | | | Since the sysdb is now synchronous and creates its own event context we don't need an explicit event context anymore in the tools.
* sysdb: remove remaining traces of sysdb_handleSimo Sorce2010-04-121-1/+0
|
* SELinux login managementJakub Hrozek2010-04-081-0/+2
| | | | | | | | | | Adds a new option -Z to sss_useradd and sss_usermod. This option allows user to specify the SELinux login context for the user. On deleting the user with sss_userdel, the login mapping is deleted, so subsequent adding of the same user would result in the default login context unless -Z is specified again. MLS security is not supported as of this patch.
* Move SELinux related functions into its own moduleJakub Hrozek2010-04-081-3/+4
| | | | Fix whitespace errors
* Add userdel_cmd paramJakub Hrozek2010-04-061-0/+2
| | | | Fixes: #231
* Flush NSCD cache after modifying local databaseJakub Hrozek2010-03-151-0/+8
| | | | Fixes: #221
* Rename server/ directory to src/Stephen Gallagher2010-02-181-0/+108
Also update BUILD.txt