-
Notifications
You must be signed in to change notification settings - Fork 0
/
xattr0004-set-translator-flag-on-reading-typo.patch
42 lines (36 loc) · 1.27 KB
/
xattr0004-set-translator-flag-on-reading-typo.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 2f8033d9c9c98782b8d70fe75915af75ae22f0f6 Mon Sep 17 00:00:00 2001
From: Justus Winter <justus@gnupg.org>
Date: Sun, 24 Jul 2016 19:40:37 +0200
Subject: [PATCH 4/6] set translator flag on reading; typo
---
ext2fs/inode.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/ext2fs/inode.c b/ext2fs/inode.c
index 5e9f7b1..d97a217 100644
--- a/ext2fs/inode.c
+++ b/ext2fs/inode.c
@@ -167,8 +167,16 @@ diskfs_user_read_node (struct node *np, struct lookup_context *ctx)
{
st->st_mode = di->i_mode | (di->i_mode_high << 16);
st->st_mode &= ~S_ITRANS;
+
if (di->i_translator)
st->st_mode |= S_IPTRANS;
+ else
+ {
+ size_t datalen;
+ err = ext2_get_xattr (np, "gnu.translator", NULL, &datalen);
+ if (! err && datalen > 0)
+ st->st_mode |= S_IPTRANS;
+ }
st->st_uid = di->i_uid | (di->i_uid_high << 16);
st->st_gid = di->i_gid | (di->i_gid_high << 16);
@@ -623,7 +631,7 @@ diskfs_get_translator (struct node *np, char **namep, unsigned *namelen)
if (blkno)
{
- ext2_warning("This is a old translotor record, please update it");
+ ext2_warning("This is an old translotor record, please update it");
transloc = disk_cache_block_ref (blkno);
datalen = ((unsigned char *)transloc)[0] +
--
2.9.2