Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jun 2017 08:10:26 GMT
From:      kneitinger@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r323841 - soc2017/kneitinger/libbe-head/sbin/be
Message-ID:  <201706220810.v5M8AQI6027864@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706220810.v5M8AQI6027864>