From 47b035539550f5800e3fdcd2eb6ed4613841e93f Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Mon, 1 Jan 2024 21:38:50 +0100 Subject: pam_env: reduce variable visibility This will simplify further changes. Signed-off-by: Tobias Stoeckmann --- modules/pam_env/pam_env.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'modules/pam_env') 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 */ -- cgit v1.2.3