]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: rename fix_permissions() → fix_permissions_and_link()
authorLennart Poettering <lennart@poettering.net>
Wed, 26 Mar 2025 15:20:12 +0000 (11:20 -0400)
committerLennart Poettering <lennart@poettering.net>
Wed, 26 Mar 2025 15:33:38 +0000 (11:33 -0400)
The function doesn't just adjust permissions, it actually moves the
file into place. The function name should really make this fundamental
fact clear.

src/coredump/coredump.c

index 0c81922e077e5f6330ffc31016bb2732338001a6..3086f09287823e32245c0da80299ee15df8f3126 100644 (file)
@@ -304,7 +304,7 @@ static const char *coredump_tmpfile_name(const char *s) {
         return s ?: "(unnamed temporary file)";
 }
 
-static int fix_permissions(
+static int fix_permissions_and_link(
                 int fd,
                 const char *filename,
                 const char *target,
@@ -595,7 +595,7 @@ static int save_external_coredump(
                         uncompressed_size += partial_uncompressed_size;
                 }
 
-                r = fix_permissions(fd_compressed, tmp_compressed, fn_compressed, context, allow_user);
+                r = fix_permissions_and_link(fd_compressed, tmp_compressed, fn_compressed, context, allow_user);
                 if (r < 0)
                         return r;
 
@@ -622,7 +622,7 @@ static int save_external_coredump(
                            LOG_ITEM("SIZE_LIMIT=%"PRIu64, max_size),
                            LOG_MESSAGE_ID(SD_MESSAGE_TRUNCATED_CORE_STR));
 
-        r = fix_permissions(fd, tmp, fn, context, allow_user);
+        r = fix_permissions_and_link(fd, tmp, fn, context, allow_user);
         if (r < 0)
                 return log_error_errno(r, "Failed to fix permissions and finalize coredump %s into %s: %m", coredump_tmpfile_name(tmp), fn);