summaryrefslogtreecommitdiffstats
path: root/src/tools/files.c
Commit message (Collapse)AuthorAgeFilesLines
* TOOLS: Fix warning maybe-uninitializedLukas Slebodnik2016-05-121-0/+1
| | | | | | | | | | src/tools/files.c: In function ‘copy_file_contents’: src/tools/files.c:413:12: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized] return ret; ^~~ Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* UTIL: Add secure copy functionStephen Gallagher2016-05-111-38/+103
| | | | | | | | | | | This is a precursor to supporting a static default configuration file. We need to be able to copy the default into the mutable location if the infopipe is asked to modify it. This patch opens both the source and destination files together in order to avoid time-of-check/time-of-use bugs. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Add missing new lines to debug messagesLukas Slebodnik2015-03-171-6/+6
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Make DEBUG macro invocations variadicNikolai Kondrashov2014-02-121-56/+56
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix formating of variables with type: ssize_tLukas Slebodnik2013-09-111-1/+1
|
* Do not copy special files when creating homedirOndrej Kos2013-07-091-68/+3
| | | | | | https://fedorahosted.org/sssd/ticket/1778 When trying to copy special file, only message is logged now.
* Fixing critical format string issues.Lukas Slebodnik2013-05-201-3/+3
| | | | | | --missing arguments. --format '%s', but argument is integer. --wrong format string, examle: '%\n'
* Return errno, not -1 on failure in files.cJakub Hrozek2013-04-031-0/+1
| | | | https://fedorahosted.org/sssd/ticket/1862
* Reuse sss_open_cloexec at other places in code.Lukas Slebodnik2013-03-131-66/+4
| | | | | | | | Functions open_cloexec and openat_cloexec were renamed with prefix "sss_" and moved to separete file. Replacing duplicated code of function sss_open_cloexec everywhere in the source code. https://fedorahosted.org/sssd/ticket/1794
* Unchecked return value in files.cMichal Zidek2013-01-291-1/+9
| | | | | Found by coverity. https://fedorahosted.org/sssd/ticket/1791
* TOOLS: Compile on old platforms such as RHEL5Jakub Hrozek2013-01-281-37/+140
| | | | | Provides compatible declarations for modern file management functions such as futimens or opening with the O_CLOEXEC flag
* TOOLS: Use file descriptor to avoid races when creating a home directoryJakub Hrozek2013-01-231-321/+358
| | | | | | | | | | | 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: Use openat/unlinkat when removing the homedirJakub Hrozek2013-01-231-42/+41
| | | | | | | | | | The removal of a home directory is sensitive to concurrent modification of the directory tree being removed and can unlink files outside the directory tree. This security issue was assigned CVE-2013-0219 https://fedorahosted.org/sssd/ticket/1782
* Convert read and write operations to sss_atomic_readJakub Hrozek2012-04-201-32/+19
| | | | https://fedorahosted.org/sssd/ticket/1209
* Fix potential resource leak in remove_tree_with_ctx()Stephen Gallagher2010-06-171-1/+10
| | | | https://fedorahosted.org/sssd/ticket/515
* Fix potential resource leak in copy_tree_ctx()Jakub Hrozek2010-06-141-2/+10
| | | | Ticket #515
* Properly handle read() and write() throughout the SSSDStephen Gallagher2010-06-101-19/+36
| | | | | | | We need to guarantee at all times that reads and writes complete successfully. This means that they must be checked for returning EINTR and EAGAIN, and all writes must be wrapped in a loop to ensure that they do not truncate their output.
* Move SELinux related functions into its own moduleJakub Hrozek2010-04-081-57/+0
| | | | Fix whitespace errors
* Add forgotten \n in DEBUG statementsMartin Nagy2010-03-041-1/+1
| | | | | | Logs from confdb with missing '\n' in the DEBUG statements annoyed me so I decided to fix them. I also made a quick grep through the code and found other places so I fixed them too.
* Rename server/ directory to src/Stephen Gallagher2010-02-181-0/+736
Also update BUILD.txt