verbs: add a new VERB_MUSTBEROOT flag

Given that we regularly have verbs that require privileges, let's just
make this a flag of the verb.
This commit is contained in:
Lennart Poettering
2017-12-11 23:19:46 +01:00
parent fba868fa71
commit 0c63eb7138
4 changed files with 21 additions and 23 deletions
+7 -3
View File
@@ -21,13 +21,17 @@
***/
#define VERB_ANY ((unsigned) -1)
#define VERB_DEFAULT 1U
#define VERB_NOCHROOT 2U
typedef enum VerbFlags {
VERB_DEFAULT = 1 << 0,
VERB_NOCHROOT = 1 << 1,
VERB_MUSTBEROOT = 1 << 2,
} VerbFlags;
typedef struct {
const char *verb;
unsigned min_args, max_args;
unsigned flags;
VerbFlags flags;
int (* const dispatch)(int argc, char *argv[], void *userdata);
} Verb;