admin update-kernel: Ensure initramfs has correct owner/mode
It was 0600, and owned by the creating process (in the fuse case, non-root!). We want it 0644/root/root.
This commit is contained in:
1 parent
9795f4a67e
commit
6b868d84d8
2 files changed
+17
-1
No files matched your search
+1
-1
Submodule src/libgsystem updated: b4e8a2ae86...fe898ee93b.
@@ -256,9 +256,25 @@ update_initramfs (OtAdminUpdateKernel *self,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!gs_file_chmod (initramfs_tmp_file, 0644, cancellable, error))
|
||||||
|
{
|
||||||
|
g_prefix_error (error, "Failed to chmod initramfs: ");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (!gs_file_linkcopy_sync_data (initramfs_tmp_file, initramfs_file, cancellable, error))
|
if (!gs_file_linkcopy_sync_data (initramfs_tmp_file, initramfs_file, cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
/* In the fuse case, we need to chown after copying */
|
||||||
|
if (getuid () != 0)
|
||||||
|
{
|
||||||
|
if (!gs_file_chown (initramfs_file, 0, 0, cancellable, error))
|
||||||
|
{
|
||||||
|
g_prefix_error (error, "Failed to chown initramfs: ");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_print ("Created: %s\n", gs_file_get_path_cached (initramfs_file));
|
g_print ("Created: %s\n", gs_file_get_path_cached (initramfs_file));
|
||||||
|
|
||||||
(void) gs_file_unlink (initramfs_tmp_file, NULL, NULL);
|
(void) gs_file_unlink (initramfs_tmp_file, NULL, NULL);
|
||||||
|
|||||||
Reference in new issue
Block a user