Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libpam/modules Fix incorrect types
details: https://anonhg.NetBSD.org/src/rev/1334f7fe5e17
branches: trunk
changeset: 792313:1334f7fe5e17
user: christos <christos%NetBSD.org@localhost>
date: Sun Dec 29 22:54:58 2013 +0000
description:
Fix incorrect types
diffstat:
lib/libpam/modules/pam_exec/pam_exec.c | 7 ++++---
lib/libpam/modules/pam_ksu/pam_ksu.c | 16 ++++++++--------
lib/libpam/modules/pam_login_access/login_access.c | 12 ++++++------
lib/libpam/modules/pam_nologin/pam_nologin.c | 13 +++++++------
lib/libpam/modules/pam_unix/pam_unix.c | 8 ++++----
5 files changed, 29 insertions(+), 27 deletions(-)
diffs (210 lines):
diff -r ad1b89cfb345 -r 1334f7fe5e17 lib/libpam/modules/pam_exec/pam_exec.c
--- a/lib/libpam/modules/pam_exec/pam_exec.c Sun Dec 29 21:31:17 2013 +0000
+++ b/lib/libpam/modules/pam_exec/pam_exec.c Sun Dec 29 22:54:58 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pam_exec.c,v 1.6 2012/01/03 19:02:54 christos Exp $ */
+/* $NetBSD: pam_exec.c,v 1.7 2013/12/29 22:54:58 christos Exp $ */
/*-
* Copyright (c) 2001,2003 Networks Associates Technology, Inc.
@@ -38,7 +38,7 @@
#ifdef __FreeBSD__
__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_exec/pam_exec.c,v 1.4 2005/02/01 10:37:07 des Exp $");
#else
-__RCSID("$NetBSD: pam_exec.c,v 1.6 2012/01/03 19:02:54 christos Exp $");
+__RCSID("$NetBSD: pam_exec.c,v 1.7 2013/12/29 22:54:58 christos Exp $");
#endif
#include <sys/types.h>
@@ -70,7 +70,8 @@
_pam_exec(pam_handle_t *pamh __unused, int flags __unused,
int argc, const char *argv[])
{
- int envlen, i, nitems, pam_err, status;
+ size_t envlen, i, nitems;
+ int pam_err, status;
char **envlist, **tmp;
volatile int childerr;
pid_t pid;
diff -r ad1b89cfb345 -r 1334f7fe5e17 lib/libpam/modules/pam_ksu/pam_ksu.c
--- a/lib/libpam/modules/pam_ksu/pam_ksu.c Sun Dec 29 21:31:17 2013 +0000
+++ b/lib/libpam/modules/pam_ksu/pam_ksu.c Sun Dec 29 22:54:58 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pam_ksu.c,v 1.7 2013/12/28 18:04:03 christos Exp $ */
+/* $NetBSD: pam_ksu.c,v 1.8 2013/12/29 22:54:58 christos Exp $ */
/*-
* Copyright (c) 2002 Jacques A. Vidrine <nectar%FreeBSD.org@localhost>
@@ -29,7 +29,7 @@
#ifdef __FreeBSD__
__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_ksu/pam_ksu.c,v 1.5 2004/02/10 10:13:21 des Exp $");
#else
-__RCSID("$NetBSD: pam_ksu.c,v 1.7 2013/12/28 18:04:03 christos Exp $");
+__RCSID("$NetBSD: pam_ksu.c,v 1.8 2013/12/29 22:54:58 christos Exp $");
#endif
#include <sys/param.h>
@@ -53,8 +53,8 @@
static void log_krb5(krb5_context, krb5_error_code, const char *, ...)
__printflike(3, 4);
-static long get_su_principal(krb5_context, const char *, const char *,
- char **, krb5_principal *);
+static krb5_error_code get_su_principal(krb5_context, const char *,
+ const char *, char **, krb5_principal *);
static int auth_krb5(pam_handle_t *, krb5_context, const char *,
krb5_principal);
@@ -67,7 +67,7 @@
const char *user;
const void *ruser;
char *su_principal_name;
- long rv;
+ krb5_error_code rv;
int pamret;
pamret = pam_get_user(pamh, &user, NULL);
@@ -125,7 +125,7 @@
krb5_verify_init_creds_opt vic_opt;
const char *pass;
char prompt[80];
- long rv;
+ krb5_error_code rv;
int pamret;
rv = krb5_get_init_creds_opt_alloc(context, &gic_opt);
@@ -200,14 +200,14 @@
*
* Returns 0 for success, or a com_err error code on failure.
*/
-static long
+static krb5_error_code
get_su_principal(krb5_context context, const char *target_user, const char *current_user,
char **su_principal_name, krb5_principal *su_principal)
{
krb5_principal default_principal;
krb5_ccache ccache;
char *principal_name, *ccname, *p;
- long rv;
+ krb5_error_code rv;
uid_t euid, ruid;
*su_principal = NULL;
diff -r ad1b89cfb345 -r 1334f7fe5e17 lib/libpam/modules/pam_login_access/login_access.c
--- a/lib/libpam/modules/pam_login_access/login_access.c Sun Dec 29 21:31:17 2013 +0000
+++ b/lib/libpam/modules/pam_login_access/login_access.c Sun Dec 29 22:54:58 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: login_access.c,v 1.6 2012/01/03 19:02:55 christos Exp $ */
+/* $NetBSD: login_access.c,v 1.7 2013/12/29 22:54:58 christos Exp $ */
/*
* This module implements a simple but effective form of login access
@@ -19,7 +19,7 @@
#ifdef __FreeBSD__
__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_login_access/login_access.c,v 1.12 2004/03/05 08:10:18 markm Exp $");
#else
-__RCSID("$NetBSD: login_access.c,v 1.6 2012/01/03 19:02:55 christos Exp $");
+__RCSID("$NetBSD: login_access.c,v 1.7 2013/12/29 22:54:58 christos Exp $");
#endif
#include <sys/types.h>
@@ -78,7 +78,7 @@
char *users; /* becomes list of login names */
char *froms; /* becomes list of terminals or hosts */
int match = NO;
- int end;
+ size_t end;
int lineno = 0; /* for diagnostics */
/*
@@ -92,7 +92,7 @@
if ((fp = fopen(_PATH_LOGACCESS, "r")) != NULL) {
while (!match && fgets(line, sizeof(line), fp)) {
lineno++;
- if (line[end = strlen(line) - 1] != '\n') {
+ if ((end = strlen(line)) == 0 || line[end - 1] != '\n') {
logit(LOG_ERR, "%s: line %d: missing newline or line too long",
_PATH_LOGACCESS, lineno);
continue;
@@ -203,8 +203,8 @@
static int
from_match(const char *tok, const char *string)
{
- int tok_len;
- int str_len;
+ size_t tok_len;
+ size_t str_len;
/*
* If a token has the magic value "ALL" the match always succeeds. Return
diff -r ad1b89cfb345 -r 1334f7fe5e17 lib/libpam/modules/pam_nologin/pam_nologin.c
--- a/lib/libpam/modules/pam_nologin/pam_nologin.c Sun Dec 29 21:31:17 2013 +0000
+++ b/lib/libpam/modules/pam_nologin/pam_nologin.c Sun Dec 29 22:54:58 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pam_nologin.c,v 1.9 2013/06/20 20:54:52 christos Exp $ */
+/* $NetBSD: pam_nologin.c,v 1.10 2013/12/29 22:54:58 christos Exp $ */
/*-
* Copyright 2001 Mark R V Murray
@@ -40,7 +40,7 @@
#ifdef __FreeBSD__
__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_nologin/pam_nologin.c,v 1.10 2002/04/12 22:27:21 des Exp $");
#else
-__RCSID("$NetBSD: pam_nologin.c,v 1.9 2013/06/20 20:54:52 christos Exp $");
+__RCSID("$NetBSD: pam_nologin.c,v 1.10 2013/12/29 22:54:58 christos Exp $");
#endif
@@ -74,7 +74,7 @@
struct stat st;
int retval, fd;
int ignorenologin = 0;
- int rootlogin = 0;
+ u_int rootlogin = 0;
const char *user, *nologin;
char *mtmp;
char pwbuf[1024];
@@ -132,10 +132,11 @@
return PAM_AUTH_ERR;
}
- mtmp = malloc(st.st_size + 1);
+ size_t len = (size_t)st.st_size;
+ mtmp = malloc(len + 1);
if (mtmp != NULL) {
- read(fd, mtmp, st.st_size);
- mtmp[st.st_size] = '\0';
+ read(fd, mtmp, len);
+ mtmp[len] = '\0';
pam_error(pamh, "%s", mtmp);
free(mtmp);
}
diff -r ad1b89cfb345 -r 1334f7fe5e17 lib/libpam/modules/pam_unix/pam_unix.c
--- a/lib/libpam/modules/pam_unix/pam_unix.c Sun Dec 29 21:31:17 2013 +0000
+++ b/lib/libpam/modules/pam_unix/pam_unix.c Sun Dec 29 22:54:58 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pam_unix.c,v 1.15 2013/06/20 20:54:52 christos Exp $ */
+/* $NetBSD: pam_unix.c,v 1.16 2013/12/29 22:54:58 christos 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.15 2013/06/20 20:54:52 christos Exp $");
+__RCSID("$NetBSD: pam_unix.c,v 1.16 2013/12/29 22:54:58 christos Exp $");
#endif
@@ -299,8 +299,8 @@
goto malloc_failure;
if ((yppwd.newpw.pw_name = strdup(pwd->pw_name)) == NULL)
goto malloc_failure;
- yppwd.newpw.pw_uid = pwd->pw_uid;
- yppwd.newpw.pw_gid = pwd->pw_gid;
+ yppwd.newpw.pw_uid = (int)pwd->pw_uid;
+ yppwd.newpw.pw_gid = (int)pwd->pw_gid;
if ((yppwd.newpw.pw_gecos = strdup(pwd->pw_gecos)) == NULL)
goto malloc_failure;
if ((yppwd.newpw.pw_dir = strdup(pwd->pw_dir)) == NULL)
Home |
Main Index |
Thread Index |
Old Index