summaryrefslogtreecommitdiff
path: root/src/login/pam-module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/login/pam-module.c')
-rw-r--r--src/login/pam-module.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index 58f974241b..f469244118 100644
--- a/src/login/pam-module.c
+++ b/src/login/pam-module.c
@@ -403,9 +403,8 @@ _public_ PAM_EXTERN int pam_sm_open_session(
}
if (vtnr > 0) {
- char buf[11];
+ char buf[DECIMAL_STR_MAX(vtnr)];
snprintf(buf, sizeof(buf), "%u", vtnr);
- char_array_0(buf);
r = pam_misc_setenv(handle, "XDG_VTNR", buf, 0);
if (r != PAM_SUCCESS) {
@@ -443,14 +442,13 @@ _public_ PAM_EXTERN int pam_sm_close_session(
int flags,
int argc, const char **argv) {
+ _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+ _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
+ _cleanup_bus_unref_ sd_bus *bus = NULL;
const void *p = NULL, *existing = NULL;
const char *id;
int r;
- _cleanup_bus_unref_ sd_bus *bus = NULL;
- _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-
assert(handle);
/* Only release session if it wasn't pre-existing when we