summaryrefslogtreecommitdiff
path: root/src/basic/rm-rf.c
Commit message (Collapse)AuthorAge
* Prep v239: Uncomment header inclusions that are new or needed now.Sven Eden2018-08-24
|
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-08-24
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-08-24
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* Add macro for checking if some flags are setZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | This way we don't need to repeat the argument twice. I didn't replace all instances. I think it's better to leave out: - asserts - comparisons like x & y == x, which are mathematically equivalent, but here we aren't checking if flags are set, but if the argument fits in the flags.
* basic/rm-rf: include the path in error messagesZbigniew Jędrzejewski-Szmek2018-08-24
| | | | Attempted to remove disk file system under "/tmp/systemd-temporary-aWPkbQ", and we can't allow that.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Prep v236 : Add missing SPDX-License-Identifier (2/9) src/basicSven Eden2018-03-26
|
* tree-wide: use IN_SET macro (#6977)Yu Watanabe2017-12-08
|
* tree-wide: use `!IN_SET(..)` for `a != b && a != c && …`Andreas Rammhold2017-09-29
| | | | | | The included cocci was used to generate the changes. Thanks to @flo-wer for pointing this case out.
* basic/rm-rf: allow a symlink to / to be removedZbigniew Jędrzejewski-Szmek2017-07-25
| | | | | | | | We open the target path with O_DIRECTORY|O_NOFOLLOW, and if that doesn't work, we call unlink() on the path. In neither case we will follow the symlink, so we can relax our check to also not follow symlinks. Fixes #5864.
* basic/path-util: allow flags for path_equal_or_files_sameZbigniew Jędrzejewski-Szmek2017-07-25
| | | | | No functional change, just a new parameters and the tests that AT_SYMLINK_NOFOLLOW works as expected.
* tmpfiles: use safe_glob()Zbigniew Jędrzejewski-Szmek2017-07-25
| | | | | | | | | | | | This filters out "." and ".." from glob results. Fixes #5655 and #5644. Any judgements on whether the path is "safe" are removed. We will not remove "/" under any name (including "/../" and such), but we will remove stuff that is specified using paths that include "//", "/./" and "/../". Such paths can be created when joining strings automatically, or for other reasons, and people generally know what ".." and "." is. Tests are added to make sure that the helper functions behave as expected.
* basic: forbid rm_rf() to remove paths ending with ".." (#5653)Jan Synacek2017-07-25
| | | | Fixes: #5644
* Prep v233: Add missing includes in src/basicSven Eden2017-07-17
|
* fs-util: unify code we use to check if dirent's d_name is "." or ".."Lennart Poettering2017-07-17
| | | | | We use different idioms at different places. Let's replace this is the one true new idiom, that is even a bit faster...
* tree-wide: replace all readdir cycles with FOREACH_DIRENT{,_ALL} (#4853)Reverend Homer2017-07-17
|
* Prep v232: Add missing includesSven Eden2017-07-05
|
* nspawn: cleanup and chown the synced cgroup hierarchy (#4223)Evgeny Vereshchagin2017-07-05
| | | | Fixes: #4181
* Prep v230: Apply missing upstream fixes and updates (2/8) src/basic.Sven Eden2017-06-16
|
* Prep v229: Add missing fixes from upstream [1/6] src/basicSven Eden2017-05-17
|
* tree-wide: check if errno is greater than zero (2)Zbigniew Jędrzejewski-Szmek2017-05-17
| | | | | Compare errno with zero in a way that tells gcc that (if the condition is true) errno is positive.
* Prep v228: Add remaining updates from upstream (2/3)Sven Eden2017-04-26
| | | | | Apply remaining fixes and the performed move of utility functions into their own foo-util.[hc] files on libbasic.
* Prep v221: Some more cleanup and a few fixesSven Eden2017-03-14
| | | | | | | | | The files - src/core/org.freedesktop.systemd.policy.in.in and - src/core/systemd.pc.in have been deleted as they are not needed. The other changes are some minor fixes.
* Prep v221: Update and clean up build system to sync with upstreamSven Eden2017-03-14
This commit replays the moving around of source files that have been done between systemd-219 and systemd-221. Further the Makefile.am is synchronized with the upstream version and then "re-cleaned". A lot of functions, that are not used anywhere in elogind have been coated into #if 0/#endif directives to further shorten the list of dependencies. All unneeded files have been removed.