Skip to content

Commit

Permalink
add a few error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
avagin committed May 18, 2015
1 parent 61c1936 commit f64c0f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cr-restore.c
Original file line number Diff line number Diff line change
Expand Up @@ -2271,8 +2271,10 @@ static int prepare_creds(int pid, struct task_restore_args *args, char **lsm_pro
return -1;
}

if (!may_restore(ce))
if (!may_restore(ce)) {
pr_err("Operation not permitted\n");
return -1;
}

args->creds = *ce;
args->creds.cap_inh = args->cap_inh;
Expand Down Expand Up @@ -2800,8 +2802,10 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
thread_args = (struct thread_restore_args *)(task_args + 1);

ret = prepare_creds(pid, task_args, &lsm);
if (ret < 0)
if (ret < 0) {
pr_err("Unable to restore credentials\n");
goto err;
}

if (lsm) {
char *rendered;
Expand All @@ -2810,6 +2814,7 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
ret = render_lsm_profile(lsm, &rendered);
xfree(lsm);
if (ret < 0) {
pr_err("Unable to render lsm profile\n");
goto err_nv;
}

Expand Down
1 change: 1 addition & 0 deletions lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ int render_lsm_profile(char *profile, char **val)
}
break;
default:
pr_err("Unknown LSM type: %d\n", lsmtype);
return -1;
}

Expand Down

0 comments on commit f64c0f1

Please sign in to comment.