aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_env
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2024-01-01 21:38:50 +0100
committerTobias Stoeckmann <tobias@stoeckmann.org>2024-01-02 18:09:28 +0100
commit47b035539550f5800e3fdcd2eb6ed4613841e93f (patch)
tree97176fa66d7802e60feb3698ba340840d7445b7f /modules/pam_env
parent99dc8ca692ff51bf8f5c2d53e56681a84dd969b4 (diff)
downloadpam-47b035539550f5800e3fdcd2eb6ed4613841e93f.tar.gz
pam-47b035539550f5800e3fdcd2eb6ed4613841e93f.tar.bz2
pam-47b035539550f5800e3fdcd2eb6ed4613841e93f.zip
pam_env: reduce variable visibility
This will simplify further changes. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Diffstat (limited to 'modules/pam_env')
-rw-r--r--modules/pam_env/pam_env.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/pam_env/pam_env.c b/modules/pam_env/pam_env.c
index ccf792ae..0b1a7afe 100644
--- a/modules/pam_env/pam_env.c
+++ b/modules/pam_env/pam_env.c
@@ -575,15 +575,7 @@ _pam_get_item_byname(pam_handle_t *pamh, const char *name)
static int
_expand_arg(pam_handle_t *pamh, char **value)
{
- const char *orig=*value, *tmpptr=NULL;
- char *ptr; /*
- * Sure would be nice to use tmpptr but it needs to be
- * a constant so that the compiler will shut up when I
- * call pam_getenv and _pam_get_item_byname -- sigh
- */
- const char *tmpval;
-
- char type;
+ const char *orig=*value;
/* I know this shouldn't be hard-coded but it's so much easier this way */
char tmp[MAX_ENV] = {};
@@ -627,6 +619,14 @@ _expand_arg(pam_handle_t *pamh, char **value)
}
continue;
} else {
+ const char *tmpptr=NULL, *tmpval;
+ char *ptr; /*
+ * Sure would be nice to use tmpptr but it needs to be
+ * a constant so that the compiler will shut up when I
+ * call pam_getenv and _pam_get_item_byname -- sigh
+ */
+ char type;
+
D(("Expandable argument: <%s>", orig));
type = *orig;
orig+=2; /* skip the ${ or @{ characters */