Skip to content

Commit

Permalink
Merge pull request #2817 from Rachid-Koucha/patch-5
Browse files Browse the repository at this point in the history
More accurate error msg for template file
  • Loading branch information
brauner committed Jan 29, 2019
2 parents dea31fe + b275efe commit 9fc6fd2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/lxc/utils.c
Expand Up @@ -910,9 +910,13 @@ char *get_template_path(const char *t)
int ret, len;
char *tpath;

if (t[0] == '/' && access(t, X_OK) == 0) {
tpath = strdup(t);
return tpath;
if (t[0] == '/') {
if (access(t, X_OK) == 0) {
return strdup(t);
} else {
SYSERROR("Bad template pathname: %s", t);
return NULL;
}
}

len = strlen(LXCTEMPLATEDIR) + strlen(t) + strlen("/lxc-") + 1;
Expand Down

0 comments on commit 9fc6fd2

Please sign in to comment.