git: fa59de726fa2 - stable/14 - Fix enum warning in keyserv
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 04 Aug 2024 10:23:23 UTC
The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=fa59de726fa2ed25c79ca8400b38f9feab905f85 commit fa59de726fa2ed25c79ca8400b38f9feab905f85 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-07-30 22:35:03 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-08-04 10:21:22 +0000 Fix enum warning in keyserv This fixes a clang 19 warning: usr.sbin/keyserv/crypt_server.c:237:53: error: comparison of different enumeration types ('des_mode' (aka 'enum des_mode') and 'enum desmode') [-Werror,-Wenum-compare] 237 | if (_my_crypt != &_arcfour_crypt && argp->des_mode == CBC) { | ~~~~~~~~~~~~~~ ^ ~~~ The type of `argp->des_mode` (aka `desargs::des_mode`) is `enum des_mode` from `/usr/include/rpcsvc/crypt.h`, not `enum desmode` from `/usr/include/rpc/des.h` (which is used in `struct desparams`). Luckily the integer values of `enum desmode`'s `CBC` and `ECB` are identical to those of `enum des_mode`'s `CBC_DES` and `ECB_DES`, so replace both values. MFC after: 3 days (cherry picked from commit 1d5a5500ad4b1f5187f40baaf58ab6868b18fc08) --- usr.sbin/keyserv/crypt_server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/keyserv/crypt_server.c b/usr.sbin/keyserv/crypt_server.c index 04290326cf3b..ccd593fe4e97 100644 --- a/usr.sbin/keyserv/crypt_server.c +++ b/usr.sbin/keyserv/crypt_server.c @@ -236,9 +236,9 @@ des_crypt_1_svc(desargs *argp, struct svc_req *rqstp) * getting ECB mode. */ #ifdef BROKEN_DES - if (_my_crypt != &_arcfour_crypt && argp->des_mode == CBC) { + if (_my_crypt != &_arcfour_crypt && argp->des_mode == CBC_DES) { #else - if (_my_crypt != &_arcfour_crypt && argp->des_mode == ECB) { + if (_my_crypt != &_arcfour_crypt && argp->des_mode == ECB_DES) { #endif int i; char *dptr;