Relevant BUGIDs: 1976310

Purpose of commit: feature

Commit summary:
---------------

2008-07-09  Thorsten Kukuk  <kukuk@thkukuk.de>

        * 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).
This commit is contained in:
Thorsten Kukuk 2008-07-09 14:37:51 +00:00
parent 42f4dc06c3
commit 6377bdbbfc
3 changed files with 14 additions and 6 deletions

View File

@ -1,7 +1,14 @@
2008-07-09 Thorsten Kukuk <kukuk@thkukuk.de>
* 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006 Thorsten Kukuk <kukuk@thkukuk.de>
* Copyright (c) 2006, 2008 Thorsten Kukuk <kukuk@thkukuk.de>
*
* 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.

View File

@ -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;