Source-Changes-HG archive

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

[src/trunk]: src/lib/libpam/modules/pam_unix Improve type safety...



details:   https://anonhg.NetBSD.org/src/rev/c3bf36451dc5
branches:  trunk
changeset: 319099:c3bf36451dc5
user:      joerg <joerg%NetBSD.org@localhost>
date:      Wed May 16 13:55:39 2018 +0000

description:
Improve type safety by using the correct enum values.

diffstat:

 lib/libpam/modules/pam_unix/pam_unix.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 34cbb435d214 -r c3bf36451dc5 lib/libpam/modules/pam_unix/pam_unix.c
--- a/lib/libpam/modules/pam_unix/pam_unix.c    Wed May 16 13:54:48 2018 +0000
+++ b/lib/libpam/modules/pam_unix/pam_unix.c    Wed May 16 13:55:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pam_unix.c,v 1.16 2013/12/29 22:54:58 christos Exp $   */
+/*     $NetBSD: pam_unix.c,v 1.17 2018/05/16 13:55:39 joerg Exp $      */
 
 /*-
  * Copyright 1998 Juniper Networks, Inc.
@@ -40,7 +40,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: src/lib/libpam/modules/pam_unix/pam_unix.c,v 1.49 2004/02/10 10:13:21 des Exp $");
 #else
-__RCSID("$NetBSD: pam_unix.c,v 1.16 2013/12/29 22:54:58 christos Exp $");
+__RCSID("$NetBSD: pam_unix.c,v 1.17 2018/05/16 13:55:39 joerg Exp $");
 #endif
 
 
@@ -248,6 +248,7 @@
 {
        char *master;
        int r, rpcport, status;
+       enum clnt_stat r2;
        struct yppasswd yppwd;
        CLIENT *client;
        uid_t uid;
@@ -318,9 +319,9 @@
        client->cl_auth = authunix_create_default();
        tv.tv_sec = 2;
        tv.tv_usec = 0;
-       r = clnt_call(client, YPPASSWDPROC_UPDATE,
+       r2 = clnt_call(client, YPPASSWDPROC_UPDATE,
            xdr_yppasswd, &yppwd, xdr_int, &status, tv);
-       if (r)
+       if (r2 != RPC_SUCCESS)
                pam_error(pamh, "RPC to yppasswdd failed.");
        else if (status)
                pam_error(pamh, "Couldn't change NIS password.");



Home | Main Index | Thread Index | Old Index