From nobody Tue May 07 07:40:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYVZ05QNBz5KGPD; Tue, 07 May 2024 07:40:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VYVZ03chgz4Mhg; Tue, 7 May 2024 07:40:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715067640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fLRtNoy/yJ9rBg0pm1Q3xAX6YM6S9LfI/vDgNfbuwUQ=; b=u3QrmLXjKcLOtuO5mKPFK0EA2HIaRtEdYIlbyO30rmQ1KE/TKWv4ogRdmx6e5gnVK0TgMm 6SgqDNzrSEVn+bJknxGv/mmDpq3H85BEHVNhd1ZSBdS09KnMFEI6NquVit6wQ4QXZpklxI Z/lwGxOwmQBhx6vqEPtbbQu2+1QdZyZ1iqj7++zv/IbRZW1Uh0G1Vhu/0zPZu6C9jkheez MyVpVDGAkAm3gf0np1O1b5xcm5/r6ws6YwgTZNtu+lNiumjsP4jtTz+QGCqKb7Sq8eUkKo twhMzFsLbq+OpEGgz3wtw5Mve6Few178jMy0QHMtuSlJsysBn43N2Otm2d7tWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715067640; a=rsa-sha256; cv=none; b=x0zVnWSj7WfGM+vcpaYYjICQsHbi+e5Xpi5KnhJ03GKvPd2kxAjv/D/a3Ou3oaSZ7IHgTz ZF6woWfkEH//KGTaY9djUydgRgKD69nn6cbT540F+6rZIgPRXTrP1EZKsNJJa/gnE5/uSO urmi3nQjTeM7ROal+V7umY7WQ24TTLa7isacZwWzWWyvyzRPWDmqcltxrxsbP6+Sy5YUla 5+9S14GNtxRX2sFdYUbNfD2kh3lRxU5VMS44EE6zusaqC+64TI52w6t2K0wVzJCCngyUgi 4UHRJAU5fDYr7gDA2pil+QjFVyJXY8DCWhEagDvXeK9BUe7wvKj7TZN6BzsRig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715067640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fLRtNoy/yJ9rBg0pm1Q3xAX6YM6S9LfI/vDgNfbuwUQ=; b=Vgnbw/8vIfz0/uIgU55pAgBNXcg6+hZ6OCLIeQXPeSoCaDWGvjVAEOokFT4NNrQ8ckZ783 Xn01QP3I4IpMaOiUOpnX8ggn4bWPaK5qrwb8boEOFIk5OnvMHxJo2IW2w+rFU2NdApR4Ke MfHXKaRwTtf8T/IBeyGOi8K0+AQSBu+s6W2/SxuS4DjeYtS0veQN24EU/mb6CVW6NCDuS/ ulJr4DQfntuQNTpU4muPa5rjgLlhO9z7RJiO/Z/EwiAMGR397vORHio9RONglnnkZzgDNf cv8pT85/oebMxBTuJYiFRFmKWMgxlPyGF/PgpOFLZo3ZoNxolPhRAfu4SxjHtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYVZ03CvczXWC; Tue, 7 May 2024 07:40:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4477ee8G094722; Tue, 7 May 2024 07:40:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4477eeQ0094719; Tue, 7 May 2024 07:40:40 GMT (envelope-from git) Date: Tue, 7 May 2024 07:40:40 GMT Message-Id: <202405070740.4477eeQ0094719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: 14b475c47905 - main - Remove gbde support from swapon(8) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14b475c47905357c4cf64b3b72d822b2feb23c36 Auto-Submitted: auto-generated The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=14b475c47905357c4cf64b3b72d822b2feb23c36 commit 14b475c47905357c4cf64b3b72d822b2feb23c36 Author: Poul-Henning Kamp AuthorDate: 2024-05-07 07:21:46 +0000 Commit: Poul-Henning Kamp CommitDate: 2024-05-07 07:21:46 +0000 Remove gbde support from swapon(8) --- include/paths.h | 1 - sbin/swapon/swapon.c | 60 -------------------------------------------------- share/man/man5/fstab.5 | 3 +-- 3 files changed, 1 insertion(+), 63 deletions(-) diff --git a/include/paths.h b/include/paths.h index 9f9071af915c..86900664230b 100644 --- a/include/paths.h +++ b/include/paths.h @@ -61,7 +61,6 @@ #define _PATH_FIRMWARE "/usr/share/firmware" #define _PATH_FTPUSERS "/etc/ftpusers" #define _PATH_FWMEM "/dev/fwmem" -#define _PATH_GBDE "/sbin/gbde" #define _PATH_GELI "/sbin/geli" #define _PATH_HALT "/sbin/halt" #ifdef COMPAT_libcompat diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index 26a7dc22654a..a09f2598e2ac 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -56,7 +56,6 @@ static void usage(void) __dead2; static const char *swap_on_off(const char *, int, char *); -static const char *swap_on_off_gbde(const char *, int); static const char *swap_on_off_geli(const char *, char *, int); static const char *swap_on_off_md(const char *, char *, int); static const char *swap_on_off_sfile(const char *, int); @@ -238,12 +237,6 @@ swap_on_off(const char *name, int doingall, char *mntops) basebuf = strdup(name); base = basename(basebuf); - /* Swap on encrypted device by GEOM_BDE. */ - if (fnmatch("*.bde", base, 0) == 0) { - free(basebuf); - return (swap_on_off_gbde(name, doingall)); - } - /* Swap on encrypted device by GEOM_ELI. */ if (fnmatch("*.eli", base, 0) == 0) { free(basebuf); @@ -269,59 +262,6 @@ swap_basename(const char *name) return (dname); } -static const char * -swap_on_off_gbde(const char *name, int doingall) -{ - const char *ret; - char pass[64 * 2 + 1]; - unsigned char bpass[64]; - char *dname; - int i, error; - - dname = swap_basename(name); - if (dname == NULL) - return (NULL); - - if (which_prog == SWAPON) { - arc4random_buf(bpass, sizeof(bpass)); - for (i = 0; i < (int)sizeof(bpass); i++) - sprintf(&pass[2 * i], "%02x", bpass[i]); - pass[sizeof(pass) - 1] = '\0'; - - error = run_cmd(NULL, "%s init %s -P %s", _PATH_GBDE, - dname, pass); - if (error) { - /* bde device found. Ignore it. */ - free(dname); - if (qflag == 0) - warnx("%s: Device already in use", name); - return (NULL); - } - error = run_cmd(NULL, "%s attach %s -p %s", _PATH_GBDE, - dname, pass); - free(dname); - if (error) { - warnx("gbde (attach) error: %s", name); - return (NULL); - } - } - - ret = swap_on_off_sfile(name, doingall); - - if (which_prog == SWAPOFF) { - error = run_cmd(NULL, "%s detach %s", _PATH_GBDE, dname); - free(dname); - if (error) { - /* bde device not found. Ignore it. */ - if (qflag == 0) - warnx("%s: Device not found", name); - return (NULL); - } - } - - return (ret); -} - /* Build geli(8) arguments from mntops */ static char * swap_on_geli_args(const char *mntops) diff --git a/share/man/man5/fstab.5 b/share/man/man5/fstab.5 index 6a357e497ca7..9cdcf818cf32 100644 --- a/share/man/man5/fstab.5 +++ b/share/man/man5/fstab.5 @@ -423,10 +423,9 @@ resides in # Swap space on a block device. /dev/da0p1 none swap sw 0 0 # -# Swap space using a block device with GBDE/GELI encryption. +# Swap space using a block device with GELI encryption. # aalgo, ealgo, keylen, sectorsize options are available # for .eli devices. -/dev/da1p1.bde none swap sw 0 0 /dev/da1p2.eli none swap sw 0 0 # # tmpfs.