summaryrefslogtreecommitdiff
path: root/sbin/swapon/swapon.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/swapon/swapon.c')
-rw-r--r--sbin/swapon/swapon.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c
index 84c9b42304a4..cf9b979c1451 100644
--- a/sbin/swapon/swapon.c
+++ b/sbin/swapon/swapon.c
@@ -76,6 +76,8 @@ static int run_cmd(int *, const char *, ...) __printflike(2, 3);
static enum { SWAPON, SWAPOFF, SWAPCTL } orig_prog, which_prog = SWAPCTL;
static int qflag;
+static char aalgo_default[] = "hmac/sha256";
+static char ealgo_default[] = "aes";
int
main(int argc, char **argv)
@@ -319,7 +321,7 @@ swap_on_off_gbde(char *name, int doingall)
static const char *
swap_on_off_geli(char *name, char *mntops, int doingall)
{
- const char *ops, *aalgo, *ealgo, *keylen_str, *sectorsize_str;
+ char *ops, *aalgo, *ealgo, *keylen_str, *sectorsize_str;
char *dname, *p;
char args[4096];
struct stat sb;
@@ -337,8 +339,8 @@ swap_on_off_geli(char *name, char *mntops, int doingall)
ops = strdup(mntops);
/* Default parameters for geli(8). */
- aalgo = "hmac/sha256";
- ealgo = "aes";
+ aalgo = aalgo_default;
+ ealgo = ealgo_default;
keylen = 256;
sectorsize = 4096;