Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145624639
D17680.id49547.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D17680.id49547.diff
View Options
Index: sys/geom/eli/g_eli_ctl.c
===================================================================
--- sys/geom/eli/g_eli_ctl.c
+++ sys/geom/eli/g_eli_ctl.c
@@ -59,8 +59,8 @@
struct g_provider *pp;
const char *name;
u_char *key, mkey[G_ELI_DATAIVKEYLEN];
- int *nargs, *detach, *readonly, *dryrun;
- int keysize, error, nkey;
+ int *nargs, *detach, *readonly, *dryrunp;
+ int keysize, error, nkey = -1, dryrun = 0, dummy;
intmax_t *valp;
g_topology_assert();
@@ -81,12 +81,13 @@
return;
}
- valp = gctl_get_paraml(req, "keyno", sizeof(*valp));
- if (valp == NULL) {
- gctl_error(req, "No '%s' argument.", "keyno");
- return;
+ /* "keyno" is optional for backward compatibility */
+ valp = gctl_get_param(req, "keyno", &dummy);
+ if (valp != NULL) {
+ valp = gctl_get_paraml(req, "keyno", sizeof(*valp));
+ if (valp != NULL)
+ nkey = *valp;
}
- nkey = *valp;
if (nkey < -1 || nkey >= G_ELI_MAXMKEYS) {
gctl_error(req, "Invalid '%s' argument.", "keyno");
return;
@@ -98,10 +99,12 @@
return;
}
- dryrun = gctl_get_paraml(req, "dryrun", sizeof(*dryrun));
- if (dryrun == NULL) {
- gctl_error(req, "No '%s' argument.", "dryrun");
- return;
+ /* "dryrun" is optional for backward compatibility */
+ dryrunp = gctl_get_param(req, "dryrun", &dummy);
+ if (dryrunp != NULL) {
+ dryrunp = gctl_get_paraml(req, "dryrun", sizeof(*dryrunp));
+ if (dryrunp != NULL)
+ dryrun = *dryrunp;
}
if (*detach && *readonly) {
@@ -161,7 +164,7 @@
md.md_flags |= G_ELI_FLAG_WO_DETACH;
if (*readonly)
md.md_flags |= G_ELI_FLAG_RO;
- if (!*dryrun)
+ if (!dryrun)
g_eli_create(req, mp, pp, &md, mkey, nkey);
explicit_bzero(mkey, sizeof(mkey));
explicit_bzero(&md, sizeof(md));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 23, 8:18 AM (9 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28953622
Default Alt Text
D17680.id49547.diff (1 KB)
Attached To
Mode
D17680: Restore backward compatibility for "attach" verb.
Attached
Detach File
Event Timeline
Log In to Comment