summaryrefslogtreecommitdiff
path: root/src/shared/path-util.c
AgeCommit message (Collapse)Author
2015-05-27src/shared/path-util.c: import prefix_root() from upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04path-util: fix fstat fallback in fd_is_mount_pointThomas Hindoe Paaboel Andersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04path-util: make use of "mnt_id" field exported in /proc/self/fdinfo/<fd> to ↵Lennart Poettering
test for mount points Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12path-util: don't eat up ENOENT in path_is_mount_point()Lennart Poettering
There's no reason to eat up ENOENT, it should be OK to simply report the error back. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12path-util: make sure fd_is_mount_point() returns true for root directoryLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12path-util: if parent can do name_to_handle() but relevant dir not, it's a ↵Lennart Poettering
mount point Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12path-util.c: changes for rm-rf: never cross mount pointsLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-19shared: add path_compare(), an ordering path comparisonMichal Schmidt
... and make path_equal() a simple wrapper around it. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18path-util: fix path_is_mount_point() for symlinksHarald Hoyer
path_is_mount_point() compares the mount_id of a directory and the mount_id of the parent directory. When following symlinks, the function to get the parent directory does not take the symlink into account. /bin -> /usr/bin with /usr being a mountpoint: mount_id of /bin with AT_SYMLINK_FOLLOW != mount_id of / Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25Add initialization helper for file_handle_unionZbigniew Jędrzejewski-Szmek
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-17path-util: plug leakTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-20path-util: fix breakage in path_is_mount_pointDave Reisner
This fixes 2 problems introduced by 6feeeab0bc: 1) If name_to_handle_at returns ENOSYS for the child, we'll wrongly return -ENOSYS when it returns the same for the parent. Immediately jump to the fallback logic when we get ENOSYS. 2) If name_to_handle_at returns EOPNOTSUPP for the child but suceeds for the parent, we'll be comparing an uninitialized value (mount_id) to an initialized value (mount_id_parent). Initialize the mount_id variables to invalid mount_ids to avoid this. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-20path: make the check for unsupported name_to_handle_at symmetricZbigniew Jędrzejewski-Szmek
If child supports, but the parent does not, or when the child does not support, but the parent does, assume the child is a mount point. Only if neither supports use the fallback. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-20path: follow symbolic link for parent path (2)Umut Tezduyar Lindskog
c0e57ba9e22ee937722958d8b912ade2a37f206d fixed the fallback path. We should do the same for name_to_handle_at(). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-20path: follow symbolic link for parent pathUmut Tezduyar Lindskog
[zj: When we lstat the target path, symlinks above the last component will be followed by both stat and lstat. So when we look at the parent, we should follow symlinks.] Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-20shared: path-util - memory leakTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17path-util: no need to check whether p is absolute twiceLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-14src/shared/path-util.c: revert change from realpath to canonicalize_file_nameAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-14src/shared: some stylistic changesAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-14src/shared: import more code cleanups from upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-14src/shared: import many code cleanups from upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05src/shared: refactor shared codeAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-15Isolation of udev code from remaining systemdAnthony G. Basile
This commit is a first attempt to isolate the udev code from the remaining code base. It intentionally does not modify any files but purely delete files which, on a first examination, appear to not be needed. This is a sweeping commit which may easily have missed needed code. Files can be retrieved by doing a checkout from the previous commit: git checkout 2944f347d0 -- <filename>
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