main: silence annoying userspace error

This commit is contained in:
Thomas Schoebel-Theuer 2017-12-20 17:14:08 +01:00 committed by Thomas Schoebel-Theuer
parent f895f29e62
commit 9e31ee3438
1 changed files with 8 additions and 2 deletions

View File

@ -5009,7 +5009,7 @@ static const struct main_class main_classes[] = {
[CL_GLOBAL_USERSPACE_ITEMS] = { [CL_GLOBAL_USERSPACE_ITEMS] = {
.cl_name = "", .cl_name = "",
.cl_len = 0, // catch any .cl_len = 0, // catch any
.cl_type = 'l', .cl_type = 'L',
.cl_father = CL_GLOBAL_USERSPACE, .cl_father = CL_GLOBAL_USERSPACE,
}, },
@ -5176,7 +5176,7 @@ static const struct main_class main_classes[] = {
[CL_RESOURCE_USERSPACE_ITEMS] = { [CL_RESOURCE_USERSPACE_ITEMS] = {
.cl_name = "", .cl_name = "",
.cl_len = 0, // catch any .cl_len = 0, // catch any
.cl_type = 'l', .cl_type = 'L',
.cl_father = CL_RESOURCE_USERSPACE, .cl_father = CL_RESOURCE_USERSPACE,
}, },
@ -5569,6 +5569,12 @@ static int main_worker(struct mars_global *global, struct mars_dent *dent, bool
return -EINVAL; return -EINVAL;
} }
break; break;
case 'L':
if (!S_ISLNK(dent->new_stat.mode)) {
/* ignore silently */
return -EINVAL;
}
break;
} }
if (likely(class > CL_ROOT)) { if (likely(class > CL_ROOT)) {
int father = main_classes[class].cl_father; int father = main_classes[class].cl_father;