{
int i, ret;
+ /* remove trailing slashes from base-dir arg */
+ if (conf.base_dir_given) {
+ size_t len = strlen(conf.base_dir_arg);
+ for (;;) {
+ if (!len) /* empty string */
+ return -ERRNO_TO_ERROR(EINVAL);
+ if (!--len) /* length 1 is always OK */
+ break;
+ if (conf.base_dir_arg[len] != '/')
+ break; /* no trailing slash, also OK */
+ conf.base_dir_arg[len] = '\0';
+ }
+ }
if (!conf.uid_given)
return 0;
-
admissible_uids = para_malloc(conf.uid_given * sizeof(*admissible_uids));
-
for (i = 0; i < conf.uid_given; i++) {
ret = parse_uid_range(conf.uid_arg[i], admissible_uids + i);
if (ret < 0)