summaryrefslogtreecommitdiff
path: root/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
diff options
context:
space:
mode:
Diffstat (limited to 'ubifs-utils/mkfs.ubifs/mkfs.ubifs.c')
-rw-r--r--ubifs-utils/mkfs.ubifs/mkfs.ubifs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
index e0c42f3..4b31979 100644
--- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
+++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
@@ -1531,12 +1531,13 @@ static int add_inode(struct stat *st, ino_t inum, void *data,
ino->flags = cpu_to_le32(use_flags);
ino->compr_type = cpu_to_le16(c->default_compr);
if (data_len) {
- if (!S_ISLNK(st->st_mode))
- return err_msg("Expected symlink");
-
if (!fctx) {
memcpy(&ino->data, data, data_len);
} else {
+ /* TODO: what about device files? */
+ if (!S_ISLNK(st->st_mode))
+ return err_msg("Expected symlink");
+
ret = encrypt_symlink(&ino->data, data, data_len, fctx);
if (ret < 0)
return ret;