aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto97 <albertop2197@gmail.com>2017-05-23 21:47:00 +0200
committerMoyster <oysterized@gmail.com>2017-05-24 00:12:57 +0200
commit33b5c4110cbd5fe07a18f757f3c5bbdfec9002aa (patch)
tree708bbac3e7261f7a13a4f82c3ff98b25eeff913b
parente7116a1f882176f465b978def59092aa5cffe076 (diff)
Fix "hide su" patch for 3.10
Without this, "ls system/xbin" returns "ls: system/xbin/su: No such file or directory" if root is disabled in Developer Settings. This happens because EXT4 uses "readdir" instead of "iterate". 3.18 kernel, instead, unconditionally goes for the "iterate" way here and that explains why I'm not seeing this error there. Change-Id: I26426683df0fd199a80f053294f352e31754bec5
-rw-r--r--fs/readdir.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/readdir.c b/fs/readdir.c
index d52d18d98..e1b7e1910 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -43,6 +43,7 @@ int iterate_dir(struct file *file, struct dir_context *ctx)
res = file->f_op->iterate(file, ctx);
file->f_pos = ctx->pos;
} else {
+ ctx->romnt = (inode->i_sb->s_flags & MS_RDONLY);
res = file->f_op->readdir(file, ctx, ctx->actor);
ctx->pos = file->f_pos;
}