[PATCH 2/8] busybox -- SELinux option support for coreutils: ver3

Bernhard Fischer rep.dot.nop at gmail.com
Thu Mar 8 04:31:42 PST 2007


On Mon, Feb 26, 2007 at 10:52:49AM +0900, Yuichi Nakamura wrote:
>Attached is revised patch(v4).

Could you please use diff --show-c-function, makes a review easier, TIA.

In a couple of places there is still a space missing; E.g.
+               if(!is_selinux_enabled()) {
et al.

Index: coreutils/install.c
===================================================================
--- coreutils/install.c (revision 17961)
+++ coreutils/install.c (working copy)
...
+#if ENABLE_SELINUX
+static int use_default_selinux_context = 1;

smallint / bool smaller?

In
+static void setdefaultfilecon(const char *path) {
There are several
+       if (whatever) {
+               freecon(scontext);
+               return;
+       }

Smaller to goto one single freecon(scontext) ? (i.e. near strcmp just
goto outtahere)

Your error strings in e.g. install_main are too verbose for my taste,
would it be possible to chop them a bit?

+#if ENABLE_SELINUX
+               if (((flags & FILEUTILS_PRESERVE_SECURITY_CONTEXT)
+                || (flags & FILEUTILS_SET_SECURITY_CONTEXT))
+                && is_selinux_enabled() > 0) {
+                       security_context_t con;
+                       if(getfscreatecon(&con) == -1) {

missing space

+                               bb_perror_msg ("cannot getfscreatecon");

s/cannot //

+                               return -1;
+                       }
same for setfilecon




More information about the busybox mailing list