]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
revert(dracut-install): file created without restricting permissions
authorLaszlo <laszlo.gombos@gmail.com>
Tue, 2 Apr 2024 15:47:28 +0000 (11:47 -0400)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Wed, 3 Apr 2024 02:02:06 +0000 (22:02 -0400)
This reverts commit 3439d139616196f0cd0af2e6244acf6c5f85621f.

src/install/dracut-install.c

index a4d3109a3398312e937c63dd35243d6adf0da304..485143a58ab1548c08366cab1ca6924050d42cdc 100644 (file)
@@ -687,11 +687,9 @@ void mark_hostonly(const char *path)
 
         _asprintf(&fulldstpath, "%s/lib/dracut/hostonly-files", destrootdir);
 
-        int fd = open(fulldstpath, O_RDONLY | O_APPEND, 0600);
-        if (fd != -1)
-                f = fdopen(fd, "a");
+        f = fopen(fulldstpath, "a");
 
-        if (fd == -1 || f == NULL) {
+        if (f == NULL) {
                 log_error("Could not open '%s' for writing.", fulldstpath);
                 return;
         }