From 9e31ee3438d4edf14df13555cf74648c2451ae7c Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Wed, 20 Dec 2017 17:14:08 +0100 Subject: [PATCH] main: silence annoying userspace error --- kernel/sy_old/mars_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/sy_old/mars_main.c b/kernel/sy_old/mars_main.c index f3b6b2d5..5cb33730 100644 --- a/kernel/sy_old/mars_main.c +++ b/kernel/sy_old/mars_main.c @@ -5009,7 +5009,7 @@ static const struct main_class main_classes[] = { [CL_GLOBAL_USERSPACE_ITEMS] = { .cl_name = "", .cl_len = 0, // catch any - .cl_type = 'l', + .cl_type = 'L', .cl_father = CL_GLOBAL_USERSPACE, }, @@ -5176,7 +5176,7 @@ static const struct main_class main_classes[] = { [CL_RESOURCE_USERSPACE_ITEMS] = { .cl_name = "", .cl_len = 0, // catch any - .cl_type = 'l', + .cl_type = 'L', .cl_father = CL_RESOURCE_USERSPACE, }, @@ -5569,6 +5569,12 @@ static int main_worker(struct mars_global *global, struct mars_dent *dent, bool return -EINVAL; } break; + case 'L': + if (!S_ISLNK(dent->new_stat.mode)) { + /* ignore silently */ + return -EINVAL; + } + break; } if (likely(class > CL_ROOT)) { int father = main_classes[class].cl_father;