From 6377bdbbfc0af3c88572f5108f55344af745a010 Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Wed, 9 Jul 2008 14:37:51 +0000 Subject: Relevant BUGIDs: 1976310 Purpose of commit: feature Commit summary: --------------- 2008-07-09 Thorsten Kukuk * modules/pam_exec/pam_exec.c (call_exec): Move all variable declaration to begin of a block (#1976310). * xtests/tst-pam_group1.c (run_test): Move no_grps declaration to begin of function (#1976310). --- ChangeLog | 9 ++++++++- modules/pam_exec/pam_exec.c | 8 ++++---- xtests/tst-pam_group1.c | 3 ++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdd43466..52841d5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,14 @@ 2008-07-09 Thorsten Kukuk + * modules/pam_exec/pam_exec.c (call_exec): Move all variable + declaration to begin of a block (#1976310). + + * xtests/tst-pam_group1.c (run_test): Move no_grps declaration + to begin of function (#1976310). + * modules/pam_securetty/pam_securetty.8.xml: Replace - PAM_IGNORE with PAM_USER_UNKNOWN (#1994330) + PAM_IGNORE with PAM_USER_UNKNOWN (#1994330). + * modules/pam_tally/pam_tally.c: Add support for silent and no_log_info options. * modules/pam_tally/pam_tally.8.xml: Document silent and diff --git a/modules/pam_exec/pam_exec.c b/modules/pam_exec/pam_exec.c index 14dddd54..dce65730 100644 --- a/modules/pam_exec/pam_exec.c +++ b/modules/pam_exec/pam_exec.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006 Thorsten Kukuk + * Copyright (c) 2006, 2008 Thorsten Kukuk * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -117,6 +117,7 @@ call_exec (pam_handle_t *pamh, int argc, const char **argv) { int status = 0; pid_t retval; + while ((retval = waitpid (pid, &status, 0)) == -1 && errno == EINTR); if (retval == (pid_t)-1) @@ -160,6 +161,8 @@ call_exec (pam_handle_t *pamh, int argc, const char **argv) { char **arggv; int i; + char **envlist, **tmp; + int envlen, nitems; for (i = 0; i < sysconf (_SC_OPEN_MAX); i++) close (i); @@ -229,9 +232,6 @@ call_exec (pam_handle_t *pamh, int argc, const char **argv) arggv[i] = strdup(argv[i+optargc]); arggv[i] = NULL; - char **envlist, **tmp; - int envlen, nitems; - /* * Set up the child's environment list. It consists of the PAM * environment, plus a few hand-picked PAM items. diff --git a/xtests/tst-pam_group1.c b/xtests/tst-pam_group1.c index ca0c2ac9..e5e5ae1c 100644 --- a/xtests/tst-pam_group1.c +++ b/xtests/tst-pam_group1.c @@ -100,6 +100,7 @@ run_test (const char *user, gid_t groupid, int needit) { pam_handle_t *pamh = NULL; int retval; + int no_grps; retval = pam_start("tst-pam_group1", user, &conv, &pamh); if (retval != PAM_SUCCESS) @@ -136,7 +137,7 @@ run_test (const char *user, gid_t groupid, int needit) } - int no_grps = getgroups(0, NULL); /* find the current number of groups */ + no_grps = getgroups(0, NULL); /* find the current number of groups */ if (no_grps > 0) { int i, found; -- cgit v1.2.3