aboutsummaryrefslogtreecommitdiffstats
path: root/extlinux
diff options
context:
space:
mode:
authorChen Baozi <baozich@gmail.com>2012-07-08 10:10:11 +0800
committerPaulo Alcantara <pcacjr@zytor.com>2012-07-21 01:21:45 -0300
commit3f7455cd963b4136e495bf62296b82bc2dbfc2e7 (patch)
treec63ec6535082a1c3197f56f7dd0351b4048e9a0a /extlinux
parentabd3b454729a3a7b6cf032ddb38e924123b72494 (diff)
downloadsyslinux-3f7455cd963b4136e495bf62296b82bc2dbfc2e7.tar.gz
syslinux-3f7455cd963b4136e495bf62296b82bc2dbfc2e7.tar.xz
syslinux-3f7455cd963b4136e495bf62296b82bc2dbfc2e7.zip
extlinux: put set_attributes() back to ext2_fat_install_file().
rewrite_boot_image() wraps the logic from previous ext2_fat_install_file(). The deleted lines includes the set_attributes(), while it is actually not within the rewrite_boot_image(). We add set_attributes() and some helper judgement just as what we do in xfs_install_file(). Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
Diffstat (limited to 'extlinux')
-rw-r--r--extlinux/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/extlinux/main.c b/extlinux/main.c
index a9531d5c..bbcc8db3 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -510,6 +510,12 @@ int ext2_fat_install_file(const char *path, int devfd, struct stat *rst)
close(fd);
fd = rewrite_boot_image(devfd, file);
+ if (fd < 0)
+ goto bail;
+
+ /* Attempt to set immutable flag and remove all write access */
+ /* Only set immutable flag if file is owned by root */
+ set_attributes(fd);
if (fstat(fd, rst)) {
perror(file);