On Mon, 25.11.13 16:01, Shawn Landden ([email protected]) wrote:

> ---
>  src/nspawn/nspawn.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
> index 0973a00..1ee4ab3 100644
> --- a/src/nspawn/nspawn.c
> +++ b/src/nspawn/nspawn.c
> @@ -200,6 +200,11 @@ static int parse_argv(int argc, char *argv[]) {
>  
>                  case 'D':
>                          free(arg_directory);
> +                        if (access(optarg, F_OK) < 0) {
> +                                log_error("Root directory %s is not 
> accessable: %m", optarg);
> +                                return -EACCES;
> +                        }
> +
>                          arg_directory =
> canonicalize_file_name(optarg);

canonicalize_file_name() generates an error if the specified path cannot
be resolved. I now made sure the error message shown incorporates that
error to indicate more clearly what is going on. That should suffice to
make the error more helpful.

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to