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;