summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-08-28 22:33:49 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-08-28 22:33:49 +0000
commit0a26d1b8937ba3c4fda6f66e57cd418e314affba (patch)
tree7207f8b7f8fcd8ad2b2a81331e7fc7a67f72b6a3
parent16006b9403d4e26f56d6492e0fa99b483e5dac31 (diff)
parentbb581bde62d77b367c13bd56821f279ce1701c1b (diff)
downloadextras-0a26d1b8937ba3c4fda6f66e57cd418e314affba.tar.gz
Merge "ext4_utils: skip symbolic links in basefs file" into oc-mr1-dev
-rw-r--r--ext4_utils/make_ext4fs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index 58069f31..0151026a 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -628,6 +628,13 @@ static void extract_base_fs_allocations(const char *directory, const char *mount
int start_block, end_block;
u32 block_file_size;
u32 real_file_block_size;
+ struct stat buf;
+
+ if (lstat(real_file_name, &buf) == -1)
+ critical_error(err_msg);
+
+ if (!S_ISREG(buf.st_mode))
+ continue;
real_file_fd = open(real_file_name, O_RDONLY);
if (real_file_fd == -1) {