Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177382342
D59439.1794251922.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D59439.1794251922.diff
View Options
diff --git a/sbin/bectl/bectl_jail.c b/sbin/bectl/bectl_jail.c
--- a/sbin/bectl/bectl_jail.c
+++ b/sbin/bectl/bectl_jail.c
@@ -21,9 +21,9 @@
#define MNTTYPE_ZFS 222
static void jailparam_add(const char *name, const char *val);
-static int jailparam_del(const char *name);
+static void jailparam_del(const char *name);
static bool jailparam_addarg(char *arg);
-static int jailparam_delarg(char *arg);
+static void jailparam_delarg(char * _Nonnull arg);
static int bectl_search_jail_paths(const char *mnt);
static int bectl_locate_jail(const char *ident);
@@ -44,12 +44,11 @@
nvlist_add_string(jailparams, name, val);
}
-static int
+static void
jailparam_del(const char *name)
{
nvlist_remove_all(jailparams, name);
- return (0);
}
static bool
@@ -90,20 +89,17 @@
return (true);
}
-static int
-jailparam_delarg(char *arg)
+static void
+jailparam_delarg(char * _Nonnull arg)
{
char *name, *val;
- if (arg == NULL)
- return (EINVAL);
+ assert(arg != NULL);
name = arg;
if ((val = strchr(name, '=')) != NULL)
*val++ = '\0';
- if (strcmp(name, "path") == 0)
- *mnt_loc = '\0';
- return (jailparam_del(name));
+ jailparam_del(name);
}
static int
@@ -215,7 +211,7 @@
bectl_cmd_jail(int argc, char *argv[])
{
char *bootenv, **jargv, *mountpoint;
- int i, jid, mntflags, opt, ret;
+ int i, jid, mntflags, opt;
bool default_hostname, interactive, unjail;
pid_t pid;
@@ -255,15 +251,12 @@
unjail = false;
break;
case 'u':
- if ((ret = jailparam_delarg(optarg)) == 0) {
- if (strcmp(optarg, "host.hostname") == 0)
- default_hostname = true;
- } else if (ret != ENOENT) {
- fprintf(stderr,
- "bectl jail: error unsetting \"%s\"\n",
- optarg);
- return (ret);
- }
+ jailparam_delarg(optarg);
+ if (strcmp(optarg, "host.hostname") == 0)
+ default_hostname = true;
+ else if (strcmp(optarg, "path") == 0)
+ *mnt_loc = '\0';
+
break;
default:
fprintf(stderr, "bectl jail: unknown option '-%c'\n",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 9, 7:18 PM (5 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38380571
Default Alt Text
D59439.1794251922.diff (1 KB)
Attached To
Mode
D59439: bectl: stop pretending that jailparam_delarg can fail
Attached
Detach File
Event Timeline