Merge "logd: test: logd.sepolicy* errors"
This commit is contained in:
commit
ebc87c98e3
1 changed files with 9 additions and 7 deletions
|
|
@ -999,16 +999,18 @@ static pid_t sepolicy_rate(unsigned rate, unsigned num) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// We may have DAC, but let's not have MAC
|
// We may have DAC, but let's not have MAC
|
||||||
if (setcon("u:object_r:shell:s0") < 0) {
|
if ((setcon("u:object_r:shell:s0") < 0) && (setcon("u:r:shell:s0") < 0)) {
|
||||||
int save_errno = errno;
|
int save_errno = errno;
|
||||||
security_context_t context;
|
security_context_t context;
|
||||||
getcon(&context);
|
getcon(&context);
|
||||||
fprintf(stderr, "setcon(\"u:r:shell:s0\") failed @\"%s\" %s\n", context,
|
if (strcmp(context, "u:r:shell:s0")) {
|
||||||
strerror(save_errno));
|
fprintf(stderr, "setcon(\"u:r:shell:s0\") failed @\"%s\" %s\n",
|
||||||
freecon(context);
|
context, strerror(save_errno));
|
||||||
_exit(-1);
|
freecon(context);
|
||||||
// NOTREACHED
|
_exit(-1);
|
||||||
return 0;
|
// NOTREACHED
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The key here is we are root, but we are in u:r:shell:s0,
|
// The key here is we are root, but we are in u:r:shell:s0,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue