summaryrefslogtreecommitdiff
path: root/src/shared/path-util.c
AgeCommit message (Collapse)Author
2014-02-14shared: include root when canonicalizing conf pathsMichael Marineau
The conf_files_list family accepts an alternate root path to prefix all directories in the list but path_strv_canonicalize_uniq doesn't use it. This results in the suspicious behavior of resolving directory symlinks based on the contents of / instead of the alternate root. This adds a prefix argument to path_strv_canonicalize which will now prepend the prefix, if given, to every path in the list. To avoid answering what a relative path means when called with a root prefix path_strv_canonicalize is now path_strv_canonicalize_absolute and only considers absolute paths. Fortunately all users of already call path_strv_canonicalize with a list of absolute paths.
2014-01-08No need to canonicalize fixed pathsZbigniew Jędrzejewski-Szmek
2013-12-24log: log_error() and friends add a newline after each line anyway, so avoid ↵Lennart Poettering
including it in the log strings
2013-12-06Get rid of our reimplementation of basenameZbigniew Jędrzejewski-Szmek
The only problem is that libgen.h #defines basename to point to it's own broken implementation instead of the GNU one. This can be fixed by #undefining basename.
2013-11-06path-util: paths_check_timestamp() opimizationsLennart Poettering
2013-10-29path_check_timestamp: only keep the most recent timestampTom Gundersen
There is no point in keeping one timestamp for each directory, as we only ever care about the most recent one.
2013-10-26udev: move udev_rules_check_timestamp to sharedTom Gundersen
I want to use this from a bulitin in a subsequent patch.
2013-09-09Fix two compiler warningsZbigniew Jędrzejewski-Szmek
2013-09-09run: allow non-absolute paths as commandZbigniew Jędrzejewski-Szmek
2013-09-09path-util.c: small modernizationZbigniew Jędrzejewski-Szmek
2013-05-02time-dst: use _cleanup_Zbigniew Jędrzejewski-Szmek
2013-04-16path-util: unify code for detecting OS treesLennart Poettering
This also makes sure we always detect an OS tree the same way, by checking for /etc/os-release.
2013-02-11binfmt,tmpfiles,modules-load,sysctl: rework the various early-boot services ↵Lennart Poettering
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()
2013-02-11path-util: fix memory leakLennart Poettering
2013-02-06shared: remove now unused functionZbigniew Jędrzejewski-Szmek
2013-02-06systemd: do not remove empty paths from unit lookup pathZbigniew Jędrzejewski-Szmek
The ability to start a new unit with 'systemctl start ...' should not depend on whether there are other units in the directory. Previously, an additional 'systemctl daemon-reload' would be necessary to tell systemd to update the list of unit lookup paths.
2012-12-17path-util: set pointer to null after calling free()Michal Sekletar
In cases where path_strv_canonicalize() returns NULL, strv_free() is called afterwards and it will call free() on pointers which were freed already in path_strv_canonicalize()
2012-09-14timedate: assorted improvementsLennart Poettering
- Make writing/reading of /etc/timezone dependendent of HAVE_SYSV_COMPAT - Introduce symlink_atomic() after all, and use it - Use relative symlink for /etc/localtime
2012-09-10path-util: fall back to stat() if kernel does not support name_to_handle_at()Mantas Mikulėnas
Fixes instant hang on kernels that do not have CONFIG_FHANDLE enabled.
2012-09-10path-util: do not fail in path_is_mountpoint() if path doesn't existMantas Mikulėnas
This was accidentally lost in commit 1640a0b6b05b.
2012-09-04path: fix invalid variable access in path_is_mount_point()Lennart Poettering
2012-09-04path-util: in path_is_mount_point() fall back to the classic stat() test if ↵Lennart Poettering
fs does not support name_to_handle_at()
2012-09-04missing: define name_to_handle_at on our own if it is missingLennart Poettering
2012-09-03util: make path_is_mount_point() recognize bind mounts, tooLennart Poettering
2012-07-13util: rename join() to strjoin()Lennart Poettering
This is to match strappend() and the other string related functions.
2012-05-08util: split-out path-util.[ch]Kay Sievers