]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Drop usage of CHASE_WARN
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 4 Oct 2022 11:35:36 +0000 (13:35 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 4 Oct 2022 20:48:06 +0000 (21:48 +0100)
CHASE_WARN only makes sense when CHASE_SAFE or CHASE_NO_AUTOFS are
used. repart uses neither so let's drop usage of CHASE_WARN.

src/partition/repart.c

index 29c9b579397a977a01b8e67253e59617d92332a9..92aa9a25eb29533885b3c6d497a8d59b7bf2a917 100644 (file)
@@ -3232,7 +3232,7 @@ static int do_copy_files(Partition *p, const char *root) {
         STRV_FOREACH_PAIR(source, target, p->copy_files) {
                 _cleanup_close_ int sfd = -1, pfd = -1, tfd = -1;
 
-                sfd = chase_symlinks_and_open(*source, arg_root, CHASE_PREFIX_ROOT|CHASE_WARN, O_CLOEXEC|O_NOCTTY, NULL);
+                sfd = chase_symlinks_and_open(*source, arg_root, CHASE_PREFIX_ROOT, O_CLOEXEC|O_NOCTTY, NULL);
                 if (sfd < 0)
                         return log_error_errno(sfd, "Failed to open source file '%s%s': %m", strempty(arg_root), *source);
 
@@ -3242,7 +3242,7 @@ static int do_copy_files(Partition *p, const char *root) {
                                 return log_error_errno(r, "Failed to check type of source file '%s': %m", *source);
 
                         /* We are looking at a directory */
-                        tfd = chase_symlinks_and_open(*target, root, CHASE_PREFIX_ROOT|CHASE_WARN, O_RDONLY|O_DIRECTORY|O_CLOEXEC, NULL);
+                        tfd = chase_symlinks_and_open(*target, root, CHASE_PREFIX_ROOT, O_RDONLY|O_DIRECTORY|O_CLOEXEC, NULL);
                         if (tfd < 0) {
                                 _cleanup_free_ char *dn = NULL, *fn = NULL;
 
@@ -3261,7 +3261,7 @@ static int do_copy_files(Partition *p, const char *root) {
                                 if (r < 0)
                                         return log_error_errno(r, "Failed to create parent directory '%s': %m", dn);
 
-                                pfd = chase_symlinks_and_open(dn, root, CHASE_PREFIX_ROOT|CHASE_WARN, O_RDONLY|O_DIRECTORY|O_CLOEXEC, NULL);
+                                pfd = chase_symlinks_and_open(dn, root, CHASE_PREFIX_ROOT, O_RDONLY|O_DIRECTORY|O_CLOEXEC, NULL);
                                 if (pfd < 0)
                                         return log_error_errno(pfd, "Failed to open parent directory of target: %m");
 
@@ -3298,7 +3298,7 @@ static int do_copy_files(Partition *p, const char *root) {
                         if (r < 0)
                                 return log_error_errno(r, "Failed to create parent directory: %m");
 
-                        pfd = chase_symlinks_and_open(dn, root, CHASE_PREFIX_ROOT|CHASE_WARN, O_RDONLY|O_DIRECTORY|O_CLOEXEC, NULL);
+                        pfd = chase_symlinks_and_open(dn, root, CHASE_PREFIX_ROOT, O_RDONLY|O_DIRECTORY|O_CLOEXEC, NULL);
                         if (pfd < 0)
                                 return log_error_errno(pfd, "Failed to open parent directory of target: %m");
 
@@ -3361,7 +3361,7 @@ static int partition_populate_directory(Partition *p, char **ret_root, char **re
         if (strv_length(p->copy_files) == 2 && strv_length(p->make_directories) == 0 && streq(p->copy_files[1], "/")) {
                 _cleanup_free_ char *s = NULL;
 
-                r = chase_symlinks(p->copy_files[0], arg_root, CHASE_PREFIX_ROOT|CHASE_WARN, &s, NULL);
+                r = chase_symlinks(p->copy_files[0], arg_root, CHASE_PREFIX_ROOT, &s, NULL);
                 if (r < 0)
                         return log_error_errno(r, "Failed to resolve source '%s%s': %m", strempty(arg_root), p->copy_files[0]);