Skip to content

Commit 6b19283

Browse files
Roman ZippelLinus Torvalds
authored andcommitted
[PATCH] hfs: set type/creator for symlinks
Set the correct type and creator for symlinks. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent af8c85b commit 6b19283

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎fs/hfsplus/catalog.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,13 @@ static int hfsplus_cat_build_record(hfsplus_cat_entry *entry, u32 cnid, struct i
119119
file->access_date = hfsp_now2mt();
120120
if (cnid == inode->i_ino) {
121121
hfsplus_set_perms(inode, &file->permissions);
122-
file->user_info.fdType = cpu_to_be32(HFSPLUS_SB(inode->i_sb).type);
123-
file->user_info.fdCreator = cpu_to_be32(HFSPLUS_SB(inode->i_sb).creator);
122+
if (S_ISLNK(inode->i_mode)) {
123+
file->user_info.fdType = cpu_to_be32(HFSP_SYMLINK_TYPE);
124+
file->user_info.fdCreator = cpu_to_be32(HFSP_SYMLINK_CREATOR);
125+
} else {
126+
file->user_info.fdType = cpu_to_be32(HFSPLUS_SB(inode->i_sb).type);
127+
file->user_info.fdCreator = cpu_to_be32(HFSPLUS_SB(inode->i_sb).creator);
128+
}
124129
if ((file->permissions.rootflags | file->permissions.userflags) & HFSPLUS_FLG_IMMUTABLE)
125130
file->flags |= cpu_to_be16(HFSPLUS_FILE_LOCKED);
126131
} else {

‎fs/hfsplus/hfsplus_raw.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
#define HFSP_HARDLINK_TYPE 0x686c6e6b /* 'hlnk' */
4444
#define HFSP_HFSPLUS_CREATOR 0x6866732b /* 'hfs+' */
4545

46+
#define HFSP_SYMLINK_TYPE 0x736c6e6b /* 'slnk' */
47+
#define HFSP_SYMLINK_CREATOR 0x72686170 /* 'rhap' */
48+
4649
#define HFSP_MOUNT_VERSION 0x482b4c78 /* 'H+Lx' */
4750

4851
/* Structures used on disk */

0 commit comments

Comments
 (0)