Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/openpam/dist Appease new lint enum errors



details:   https://anonhg.NetBSD.org/src/rev/8c61d457e834
branches:  trunk
changeset: 953423:8c61d457e834
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 08 19:38:10 2021 +0000

description:
Appease new lint enum errors

diffstat:

 external/bsd/openpam/dist/include/security/openpam.h       |   6 +++---
 external/bsd/openpam/dist/include/security/pam_constants.h |   6 +++---
 external/bsd/openpam/dist/lib/libpam/openpam_dispatch.c    |  11 +++++++----
 external/bsd/openpam/dist/lib/libpam/openpam_log.c         |   6 +++---
 external/bsd/openpam/dist/lib/libpam/openpam_ttyconv.c     |   6 +++---
 external/bsd/openpam/dist/lib/libpam/pam_get_authtok.c     |   6 +++---
 external/bsd/openpam/dist/lib/libpam/pam_get_item.c        |   6 +++---
 external/bsd/openpam/dist/lib/libpam/pam_set_item.c        |   6 +++---
 8 files changed, 28 insertions(+), 25 deletions(-)

diffs (242 lines):

diff -r 08e604bffff1 -r 8c61d457e834 external/bsd/openpam/dist/include/security/openpam.h
--- a/external/bsd/openpam/dist/include/security/openpam.h      Mon Mar 08 19:21:41 2021 +0000
+++ b/external/bsd/openpam/dist/include/security/openpam.h      Mon Mar 08 19:38:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: openpam.h,v 1.10 2020/04/29 02:16:56 riastradh Exp $   */
+/*     $NetBSD: openpam.h,v 1.11 2021/03/08 19:38:10 christos Exp $    */
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -201,7 +201,7 @@
 /*
  * Log levels
  */
-enum {
+enum openpam_log_primitives {
        PAM_LOG_LIBDEBUG = -1,
        PAM_LOG_DEBUG,
        PAM_LOG_VERBOSE,
@@ -264,7 +264,7 @@
 /*
  * PAM primitives
  */
-enum {
+enum openpam_sm_primitives {
        PAM_SM_AUTHENTICATE,
        PAM_SM_SETCRED,
        PAM_SM_ACCT_MGMT,
diff -r 08e604bffff1 -r 8c61d457e834 external/bsd/openpam/dist/include/security/pam_constants.h
--- a/external/bsd/openpam/dist/include/security/pam_constants.h        Mon Mar 08 19:21:41 2021 +0000
+++ b/external/bsd/openpam/dist/include/security/pam_constants.h        Mon Mar 08 19:38:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pam_constants.h,v 1.6 2017/05/06 19:50:09 christos Exp $       */
+/*     $NetBSD: pam_constants.h,v 1.7 2021/03/08 19:38:10 christos Exp $       */
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -90,7 +90,7 @@
 /*
  * XSSO 5.3
  */
-enum {
+enum openpam_message_items {
        PAM_PROMPT_ECHO_OFF             =   1,
        PAM_PROMPT_ECHO_ON              =   2,
        PAM_ERROR_MSG                   =   3,
@@ -119,7 +119,7 @@
 /*
  * XSSO 5.5
  */
-enum {
+enum openpam_item_primitives {
        PAM_SERVICE                     =   1,
        PAM_USER                        =   2,
        PAM_TTY                         =   3,
diff -r 08e604bffff1 -r 8c61d457e834 external/bsd/openpam/dist/lib/libpam/openpam_dispatch.c
--- a/external/bsd/openpam/dist/lib/libpam/openpam_dispatch.c   Mon Mar 08 19:21:41 2021 +0000
+++ b/external/bsd/openpam/dist/lib/libpam/openpam_dispatch.c   Mon Mar 08 19:38:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: openpam_dispatch.c,v 1.3 2017/05/06 19:50:09 christos Exp $    */
+/*     $NetBSD: openpam_dispatch.c,v 1.4 2021/03/08 19:38:10 christos Exp $    */
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -42,7 +42,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: openpam_dispatch.c,v 1.3 2017/05/06 19:50:09 christos Exp $");
+__RCSID("$NetBSD: openpam_dispatch.c,v 1.4 2021/03/08 19:38:10 christos Exp $");
 
 #include <sys/param.h>
 
@@ -86,7 +86,7 @@
        }
 
        /* pick a chain */
-       switch (primitive) {
+       switch ((enum openpam_sm_primitives)primitive) {
        case PAM_SM_AUTHENTICATE:
        case PAM_SM_SETCRED:
                chain = pamh->chains[PAM_AUTH];
@@ -101,6 +101,7 @@
        case PAM_SM_CHAUTHTOK:
                chain = pamh->chains[PAM_PASSWORD];
                break;
+       case PAM_NUM_PRIMITIVES:
        default:
                RETURNC(PAM_SYSTEM_ERR);
        }
@@ -208,7 +209,7 @@
                return;
 
        /* specific error codes */
-       switch (primitive) {
+       switch ((enum openpam_sm_primitives)primitive) {
        case PAM_SM_AUTHENTICATE:
                if (r == PAM_AUTH_ERR ||
                    r == PAM_CRED_INSUFFICIENT ||
@@ -245,6 +246,8 @@
                    r == PAM_TRY_AGAIN)
                        return;
                break;
+       case PAM_NUM_PRIMITIVES:
+               break;
        }
 
        openpam_log(PAM_LOG_ERROR, "%s(): unexpected return value %d",
diff -r 08e604bffff1 -r 8c61d457e834 external/bsd/openpam/dist/lib/libpam/openpam_log.c
--- a/external/bsd/openpam/dist/lib/libpam/openpam_log.c        Mon Mar 08 19:21:41 2021 +0000
+++ b/external/bsd/openpam/dist/lib/libpam/openpam_log.c        Mon Mar 08 19:38:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: openpam_log.c,v 1.3 2017/05/06 19:50:09 christos Exp $ */
+/*     $NetBSD: openpam_log.c,v 1.4 2021/03/08 19:38:10 christos Exp $ */
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -42,7 +42,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: openpam_log.c,v 1.3 2017/05/06 19:50:09 christos Exp $");
+__RCSID("$NetBSD: openpam_log.c,v 1.4 2021/03/08 19:38:10 christos Exp $");
 
 #include <errno.h>
 #include <stdarg.h>
@@ -110,7 +110,7 @@
        int priority;
        int serrno;
 
-       switch (level) {
+       switch ((enum openpam_log_primitives)level) {
        case PAM_LOG_LIBDEBUG:
        case PAM_LOG_DEBUG:
                if (!openpam_debug)
diff -r 08e604bffff1 -r 8c61d457e834 external/bsd/openpam/dist/lib/libpam/openpam_ttyconv.c
--- a/external/bsd/openpam/dist/lib/libpam/openpam_ttyconv.c    Mon Mar 08 19:21:41 2021 +0000
+++ b/external/bsd/openpam/dist/lib/libpam/openpam_ttyconv.c    Mon Mar 08 19:38:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: openpam_ttyconv.c,v 1.3 2017/05/06 19:50:09 christos Exp $     */
+/*     $NetBSD: openpam_ttyconv.c,v 1.4 2021/03/08 19:38:10 christos Exp $     */
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -42,7 +42,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: openpam_ttyconv.c,v 1.3 2017/05/06 19:50:09 christos Exp $");
+__RCSID("$NetBSD: openpam_ttyconv.c,v 1.4 2021/03/08 19:38:10 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/poll.h>
@@ -372,7 +372,7 @@
        for (i = 0; i < n; ++i) {
                aresp[i].resp_retcode = 0;
                aresp[i].resp = NULL;
-               switch (msg[i]->msg_style) {
+               switch ((enum openpam_message_items)msg[i]->msg_style) {
                case PAM_PROMPT_ECHO_OFF:
                        if (prompt(msg[i]->msg, respbuf, 0) < 0 ||
                            (aresp[i].resp = strdup(respbuf)) == NULL)
diff -r 08e604bffff1 -r 8c61d457e834 external/bsd/openpam/dist/lib/libpam/pam_get_authtok.c
--- a/external/bsd/openpam/dist/lib/libpam/pam_get_authtok.c    Mon Mar 08 19:21:41 2021 +0000
+++ b/external/bsd/openpam/dist/lib/libpam/pam_get_authtok.c    Mon Mar 08 19:38:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pam_get_authtok.c,v 1.3 2017/05/06 19:50:09 christos Exp $     */
+/*     $NetBSD: pam_get_authtok.c,v 1.4 2021/03/08 19:38:10 christos Exp $     */
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -42,7 +42,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pam_get_authtok.c,v 1.3 2017/05/06 19:50:09 christos Exp $");
+__RCSID("$NetBSD: pam_get_authtok.c,v 1.4 2021/03/08 19:38:10 christos Exp $");
 
 #include <sys/param.h>
 
@@ -83,7 +83,7 @@
        ENTER();
        *authtok = NULL;
        twice = 0;
-       switch (item) {
+       switch ((enum openpam_item_primitives)item) {
        case PAM_AUTHTOK:
                pitem = PAM_AUTHTOK_PROMPT;
                prompt_option = "authtok_prompt";
diff -r 08e604bffff1 -r 8c61d457e834 external/bsd/openpam/dist/lib/libpam/pam_get_item.c
--- a/external/bsd/openpam/dist/lib/libpam/pam_get_item.c       Mon Mar 08 19:21:41 2021 +0000
+++ b/external/bsd/openpam/dist/lib/libpam/pam_get_item.c       Mon Mar 08 19:38:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pam_get_item.c,v 1.3 2017/05/06 19:50:09 christos Exp $        */
+/*     $NetBSD: pam_get_item.c,v 1.4 2021/03/08 19:38:10 christos Exp $        */
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -42,7 +42,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pam_get_item.c,v 1.3 2017/05/06 19:50:09 christos Exp $");
+__RCSID("$NetBSD: pam_get_item.c,v 1.4 2021/03/08 19:38:10 christos Exp $");
 
 #include <sys/param.h>
 
@@ -64,7 +64,7 @@
 {
 
        ENTERI(item_type);
-       switch (item_type) {
+       switch ((enum openpam_item_primitives)item_type) {
        case PAM_SERVICE:
        case PAM_USER:
        case PAM_AUTHTOK:
diff -r 08e604bffff1 -r 8c61d457e834 external/bsd/openpam/dist/lib/libpam/pam_set_item.c
--- a/external/bsd/openpam/dist/lib/libpam/pam_set_item.c       Mon Mar 08 19:21:41 2021 +0000
+++ b/external/bsd/openpam/dist/lib/libpam/pam_set_item.c       Mon Mar 08 19:38:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pam_set_item.c,v 1.3 2017/05/06 19:50:10 christos Exp $        */
+/*     $NetBSD: pam_set_item.c,v 1.4 2021/03/08 19:38:10 christos Exp $        */
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -42,7 +42,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pam_set_item.c,v 1.3 2017/05/06 19:50:10 christos Exp $");
+__RCSID("$NetBSD: pam_set_item.c,v 1.4 2021/03/08 19:38:10 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -72,7 +72,7 @@
        ENTERI(item_type);
        slot = &pamh->item[item_type];
        osize = nsize = 0;
-       switch (item_type) {
+       switch ((enum openpam_item_primitives)item_type) {
        case PAM_SERVICE:
                /* set once only, by pam_start() */
                if (*slot != NULL && item != NULL)



Home | Main Index | Thread Index | Old Index