diff options
author | Chen Baozi <baozich@gmail.com> | 2012-07-08 10:10:11 +0800 |
---|---|---|
committer | Paulo Alcantara <pcacjr@zytor.com> | 2012-07-21 01:21:45 -0300 |
commit | 3f7455cd963b4136e495bf62296b82bc2dbfc2e7 (patch) | |
tree | c63ec6535082a1c3197f56f7dd0351b4048e9a0a /extlinux | |
parent | abd3b454729a3a7b6cf032ddb38e924123b72494 (diff) | |
download | syslinux-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.c | 6 |
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); |