#include "utils.h"
#include "threadpool.h"
#include "seccomp_profile.h"
+#include "options.h"
+#include "capabilities.h"
/* maximum size of request buffer */
#define TPM_REQ_MAX 4096
" : Choose the action of the seccomp profile when a\n"
" blacklisted syscall is executed; default is kill\n"
#endif
+"--print-capabilites : print capabilities and terminate\n"
"-h|--help : display this help screen and terminate\n"
"\n";
#ifdef WITH_SECCOMP
{"seccomp" , required_argument, 0, 'S'},
#endif
+ {"print-capabilities"
+ , no_argument, 0, 'a'},
{NULL , 0 , 0, 0 },
};
struct cuse_info cinfo;
case 'h': /* help */
fprintf(stdout, usage, prgname, iface);
goto exit;
+ case 'a':
+ ret = capabilities_print_json(true);
+ goto exit;
case 'v': /* version */
fprintf(stdout, "TPM emulator CUSE interface version %d.%d.%d, "
"Copyright (c) 2014-2015 IBM Corp.\n",
#include "sys_dependencies.h"
#include "osx.h"
#include "seccomp_profile.h"
+#include "options.h"
+#include "capabilities.h"
/* local variables */
static int notify_fd[2] = {-1, -1};
" : Choose the action of the seccomp profile when a\n"
" blacklisted syscall is executed; default is kill\n"
#endif
+ "--print-capabilites\n"
+ " : print capabilities and terminate\n"
"-h|--help : display this help screen and terminate\n"
"\n",
prgname, iface);
{
TPM_RESULT rc = 0;
int daemonize = FALSE;
- int opt, longindex;
+ int opt, longindex, ret;
struct stat statbuf;
struct mainLoopParams mlp = {
.cc = NULL,
#ifdef WITH_SECCOMP
{"seccomp" , required_argument, 0, 'S'},
#endif
+ {"print-capabilities"
+ , no_argument, 0, 'a'},
{NULL , 0 , 0, 0 },
};
usage(stdout, prgname, iface);
exit(EXIT_SUCCESS);
+ case 'a':
+ ret = capabilities_print_json(false);
+ exit(ret ? EXIT_FAILURE : EXIT_SUCCESS);
+
case 'r':
runas = optarg;
break;
#include "tpmstate.h"
#include "osx.h"
#include "seccomp_profile.h"
+#include "options.h"
+#include "capabilities.h"
/* local variables */
static int notify_fd[2] = {-1, -1};
{
TPM_RESULT rc = 0;
int daemonize = FALSE;
- int opt, longindex;
+ int opt, longindex, ret;
struct stat statbuf;
struct mainLoopParams mlp = {
.cc = NULL,
#ifdef WITH_SECCOMP
{"seccomp" , required_argument, 0, 'S'},
#endif
+ {"print-capabilities"
+ , no_argument, 0, 'a'},
{NULL , 0 , 0, 0 },
};
usage(stdout, prgname, iface);
exit(EXIT_SUCCESS);
+ case 'a':
+ ret = capabilities_print_json(false);
+ exit(ret ? EXIT_FAILURE : EXIT_SUCCESS);
+
case 'r':
runas = optarg;
break;