Implement two types of suid/sgid support for BusyBox:
1) tinylogin like with compile time selection and a chown root.root
2) Runtime configurable via /etc/busybox.conf (docu is in the works)
[Parts of this patch may overlap with my other two patches]
diff --git a/include/busybox.h b/include/busybox.h
index ea58c0c..2e54ac5 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -39,6 +39,7 @@
#include <features.h>
+#include "libbb.h"
enum Location {
_BB_DIR_ROOT = 0,
@@ -48,10 +49,17 @@
_BB_DIR_USR_SBIN
};
+enum SUIDRoot {
+ _BB_SUID_NEVER = 0,
+ _BB_SUID_MAYBE,
+ _BB_SUID_ALWAYS
+};
+
struct BB_applet {
const char* name;
int (*main)(int argc, char** argv);
- enum Location location;
+ enum Location location : 4;
+ enum SUIDRoot need_suid : 4;
};
/* From busybox.c */
extern const struct BB_applet applets[];
@@ -99,7 +107,7 @@
/* Pull in the utility routines from libbb */
-#include "libbb.h"
+// #include "libbb.h"
/* Try to pull in PATH_MAX */
#include <limits.h>