From 150579c91c289e6a62332b5623226abfbfeb8949 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Thu, 8 Dec 2011 21:24:06 +0900 Subject: [PATCH] --- yaml --- r: 276485 b: refs/heads/master c: 1418a3e5ad4d01b1d4abf2c479c50b0cedd59e3f h: refs/heads/master i: 276483: 8f802f7e085e458f9ec1d97d64fe7cd73babedcd v: v3 --- [refs] | 2 +- trunk/security/tomoyo/realpath.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 00e7a82483e4..b15a0aba1384 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 34a9d2c39afe74a941b9e88efe2762afc4d82443 +refs/heads/master: 1418a3e5ad4d01b1d4abf2c479c50b0cedd59e3f diff --git a/trunk/security/tomoyo/realpath.c b/trunk/security/tomoyo/realpath.c index 36fa7c9bedc4..d9f3ced8756e 100644 --- a/trunk/security/tomoyo/realpath.c +++ b/trunk/security/tomoyo/realpath.c @@ -293,8 +293,16 @@ char *tomoyo_realpath_from_path(struct path *path) pos = tomoyo_get_local_path(path->dentry, buf, buf_len - 1); /* Get absolute name for the rest. */ - else + else { pos = tomoyo_get_absolute_path(path, buf, buf_len - 1); + /* + * Fall back to local name if absolute name is not + * available. + */ + if (pos == ERR_PTR(-EINVAL)) + pos = tomoyo_get_local_path(path->dentry, buf, + buf_len - 1); + } encode: if (IS_ERR(pos)) continue;