socsvn commit: r323841 - soc2017/kneitinger/libbe-head/sbin/be
kneitinger at FreeBSD.org
kneitinger at FreeBSD.org
Thu Jun 22 08:10:26 UTC 2017
Author: kneitinger
Date: Thu Jun 22 08:10:25 2017
New Revision: 323841
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=323841
Log:
dd parser for be unjail command
Modified:
soc2017/kneitinger/libbe-head/sbin/be/be.c
Modified: soc2017/kneitinger/libbe-head/sbin/be/be.c
==============================================================================
--- soc2017/kneitinger/libbe-head/sbin/be/be.c Thu Jun 22 07:57:29 2017 (r323840)
+++ soc2017/kneitinger/libbe-head/sbin/be/be.c Thu Jun 22 08:10:25 2017 (r323841)
@@ -266,6 +266,8 @@
jail = argv[1];
bootenv = argv[2];
+ /* jail logic goes here */
+
return (0);
}
@@ -331,6 +333,8 @@
bootenv = argv[1];
mountpoint = argc == 3 ? argv[2] : NULL;
+ /* mount logic goes here */
+
return (0);
}
@@ -354,6 +358,8 @@
src = argv[1];
dest = argv[2];
+ /* rename logic goes here */
+
return (0);
}
@@ -361,7 +367,38 @@
static int
be_unjail(int argc, char *argv[])
{
- return (EX_USAGE);
+ int opt;
+ char *cmd, *target;
+
+ /* Store alias used */
+ cmd = argv[0];
+
+ force = false;
+ while ((opt = getopt(argc, argv, "f")) != -1) {
+ switch (opt) {
+ case 'f':
+ force = true;
+ break;
+ default:
+ fprintf(stderr, "be %s: unknown option '-%c'\n",
+ cmd, optopt);
+ return (usage(false));
+ }
+ }
+
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 1) {
+ fprintf(stderr, "be %s: wrong number of arguments\n", cmd);
+ return (usage(false));
+ }
+
+ target = argv[0];
+
+ /* unjail logic goes here */
+
+ return (0);
}
@@ -398,7 +435,7 @@
mountpoint = argv[0];
- /* activate logic goes here */
+ /* unmount logic goes here */
return (0);
}
More information about the svn-soc-all
mailing list