#include #include #include #include #include "util.h" #ifdef HAVE_CONFIG_H #include "../config.h" #endif static void usage(); int main(int argc, char* argv[]) { int i; int jid = 0; /* Remove the program name */ argc--; argv++; if(argc != 1) usage(); if(in_jail()) errx(1, "can't run from inside jail"); jid = translate_jail_id(argv[0]); if(jid == -1) errx(1, "unknown jail host name: %s", argv[0]); printf("%d \n", (int)jid); return 0; } static void usage() { fprintf(stderr, "usage: jid hostname \n"); exit(2); }