summaryrefslogtreecommitdiff
path: root/src/sysctl
Commit message (Collapse)AuthorAge
* Unify parse_argv styleZbigniew Jędrzejewski-Szmek2014-08-03
| | | | | | | | | | | | | | | | getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
* sysctl: replaces some slashes with dotsZbigniew Jędrzejewski-Szmek2014-04-16
| | | | | | | It turns out that plain sysctl understands a.b/c syntax to write to /proc/sys/a/b.c. Support this for compatibility. https://bugs.freedesktop.org/show_bug.cgi?id=77466
* Use strlen even for constant stringsJosh Triplett2014-03-16
| | | | | | | | | | | GCC optimizes strlen("string constant") to a constant, even with -O0. Thus, replace patterns like sizeof("string constant")-1 with strlen("string constant") where possible, for clarity. In particular, for expressions intended to add up the lengths of components going into a string, this often makes it clearer that the expression counts the trailing '\0' exactly once, by putting the +1 for the '\0' at the end of the expression, rather than hidden in a sizeof in the middle of the expression.
* shared: add root argument to search_and_fopenMichael Marineau2014-03-14
| | | | | | | This adds the same root argument to search_and_fopen that conf_files_list already has. Tools that use those two functions as a pair can now be easily modified to load configuration files from an alternate root filesystem tree.
* Remove unused variablesZbigniew Jędrzejewski-Szmek2014-01-05
|
* strv: multiple cleanupsSimon Peeters2014-01-05
| | | | | | | | | | - turn strv_merge into strv_extend_strv. appending strv b to the end of strv a instead of creating a new strv - strv_append: remove in favor of strv_extend and strv_push. - strv_remove: write slightly more elegant - strv_remove_prefix: remove unused function - strv_overlap: use strv_contains - strv_printf: STRV_FOREACH handles NULL correctly
* log: log_error() and friends add a newline after each line anyway, so avoid ↵Lennart Poettering2013-12-24
| | | | including it in the log strings
* Remove duplicate includesKarel Zak2013-11-18
|
* clients: unify how we invoke getopt_long()Lennart Poettering2013-11-06
| | | | | Among other things this makes sure we always expose a --version command and show it in the help texts.
* sysctl: allow overwriting of values specified in "later" filesKay Sievers2013-08-15
|
* fileio: in envfiles, do not skip lines following empty linesZbigniew Jędrzejewski-Szmek2013-04-13
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=63477
* util: rename write_one_line_file() to write_string_file()Lennart Poettering2013-04-03
| | | | | You can write much more than just one line with this call (and we frequently do), so let's correct the naming.
* systemd-sysctl: Handle missing /etc/sysctl.conf properlyEelco Dolstra2013-03-27
| | | | | | Since fabe5c0e5fce730aa66e10a9c4f9fdd443d7aeda, systemd-sysctl returns a non-zero exit code if /etc/sysctl.conf does not exist, due to a broken ENOENT check.
* honor SELinux labels, when creating and writing config filesHarald Hoyer2013-02-14
| | | | | | | Also split out some fileio functions to fileio.c and provide a SELinux aware pendant in fileio-label.c see https://bugzilla.redhat.com/show_bug.cgi?id=881577
* sysctl: fix uninitalized memory access in error pathZbigniew Jędrzejewski-Szmek2013-02-13
| | | | | src/sysctl/sysctl.c: In function ‘parse_file’: src/sysctl/sysctl.c:172:41: warning: ‘property’ may be used uninitialized in this function [-Wmaybe-uninitialized]
* binfmt,tmpfiles,modules-load,sysctl: rework the various early-boot services ↵Lennart Poettering2013-02-11
| | | | | | | | | | | | | | | | | | | that work on .d/ directories This unifies much of the logic behind them: - All four will now ofllow the rule that the earlier file and earlier assignment in the .d/ directories wins. Before, sysctl was the only outlier, where the later setting always won. - All four now support getopt() and --help on the command line. - All four can now handle specification of configuration file names on the command line to apply. The tools will automatically find them, and apply them. Previously only tmpfiles could do that. This is useful for %post scripts in RPMs and suchlike. - This fixes various error path issues in conf_files_list()
* shared: conf-files - add root parameterKay Sievers2013-02-08
|
* sysctl: parse all keys in a config fileMichal Sekletar2012-10-26
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=869779
* sysctl: avoiding exiting with error on -EEXISTDave Reisner2012-10-06
| | | | | | | If the final key in any sysctl.d file is a duplicate, systemd-sysctl will exit with an error (and no explaination why). Ignore this, as duplicate keys are to be expected when overriding settings in the directory hierarchy.
* sysctl: always return the last error we encounteredLennart Poettering2012-09-21
|
* sysctl: fix error code handlingLukas Nykryn2012-09-21
| | | | | After if (r <= 0) r can't be 0 so if (k < 0 && r == 0) never happens.
* sysctl: apply configuration at onceMichal Sekletar2012-08-06
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=767795 [ Simplified by iterating the config files in the backwards order - no need for hashmap_update(). Other minor cleanups. -- michich ]
* log.h: new log_oom() -> int -ENOMEM, use itShawn Landden2012-07-26
| | | | | | also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
* use "Out of memory." consistantly (or with "\n")Shawn Landden2012-07-25
| | | | | | | | glibc/glib both use "out of memory" consistantly so maybe we should consider that instead of this. Eliminates one string out of a number of binaries. Also fixes extra newline in udev/scsi_id
* util: split-out path-util.[ch]Kay Sievers2012-05-08
|
* util: split-out conf-file.[ch]Kay Sievers2012-05-07
|
* build-sys: add stub makefiles to all subdirs to ease development with emacsLennart Poettering2012-04-13
|
* move all tools to subdirsKay Sievers2012-04-12