aboutsummaryrefslogtreecommitdiff
path: root/toys/lsb
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-07-01 14:56:07 -0500
committerRob Landley <rob@landley.net>2015-07-01 14:56:07 -0500
commit8c0d2d2bc557ced86650ab48ab92cf58840efce8 (patch)
treeb5781eb790c0c54198b9bea417be2886c46091fa /toys/lsb
parent56217bb175cdf9506b9b7970edd313c1fef8e122 (diff)
downloadtoybox-8c0d2d2bc557ced86650ab48ab92cf58840efce8.tar.gz
Improve -Z error reporting.
The most likely reason for setfscreatecon to fail is that you don't have permission, and that's reported by the write return EACCES. There isn't really a "bad" context; they're just strings. Before: $ adb shell mkdir -Z x y mkdir: bad -Z 'x' After: $ adb shell mkdir -Z x y mkdir: -Z 'x' failed: Permission denied Other than this, the ToT mkdir works fine with SELinux.
Diffstat (limited to 'toys/lsb')
-rw-r--r--toys/lsb/mknod.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/lsb/mknod.c b/toys/lsb/mknod.c
index d6cd65ce..39073fad 100644
--- a/toys/lsb/mknod.c
+++ b/toys/lsb/mknod.c
@@ -52,7 +52,7 @@ void mknod_main(void)
if (toys.optflags & FLAG_Z)
if (-1 == lsm_set_create(TT.arg_context))
- error_exit("bad -Z '%s'", TT.arg_context);
+ perror_exit("-Z '%s' failed", TT.arg_context);
if (mknod(*toys.optargs, mode|modes[type], makedev(major, minor)))
perror_exit("%s", *toys.optargs);
}