#include <getopt.h>
#include <assert.h>
#include <fcntl.h>
+#include <libgen.h>
#define ENSC_WRAPPERS_PREFIX "chcontext: "
#define ENSC_WRAPPERS_VSERVER 1
static void
showHelp(int fd, char const *cmd, int res)
{
+ VSERVER_DECLARE_CMD(cmd);
+
WRITE_MSG(fd, "Usage: ");
WRITE_STR(fd, cmd);
WRITE_MSG(fd,
showVersion()
{
WRITE_MSG(1,
- "chcontext " VERSION " -- allocates/enters a security context\n"
+ "chcontext-compat " VERSION " -- allocates/enters a security context\n"
"This program is part of " PACKAGE_STRING "\n\n"
"Copyright (C) 2003,2004 Enrico Scholz\n"
VERSION_COPYRIGHT_DISCLAIMER);
static inline void
setFlags(char const *str, uint32_t *flags)
{
- char const *err_ptr;
- size_t err_len;
+ struct vc_err_listparser err;
- *flags = vc_textlist2flag(str, 0, &err_ptr, &err_len);
+ *flags = vc_list2flag_compat(str, 0, &err);
- if (err_ptr!=0) {
+ if (err.ptr!=0) {
WRITE_MSG(2, "Unknown flag '");
- write(2, err_ptr, err_len);
+ write(2, err.ptr, err.len);
WRITE_MSG(2, "'\n");
exit(wrapper_exit_code);
}