From ab5eb9b1a6026dbdc9d9259934b85170422c1538 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sat, 1 Mar 2025 21:46:15 +0800 Subject: HALF WORK: MAX_PATH --- modules/pam_time/tst-pam_time-retval.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/pam_time') diff --git a/modules/pam_time/tst-pam_time-retval.c b/modules/pam_time/tst-pam_time-retval.c index 3fcf4591..22544f35 100644 --- a/modules/pam_time/tst-pam_time-retval.c +++ b/modules/pam_time/tst-pam_time-retval.c @@ -6,6 +6,7 @@ */ #include "test_assert.h" +#include "pam_inline.h" #include #include @@ -25,9 +26,10 @@ main(void) { pam_handle_t *pamh = NULL; FILE *fp; - char cwd[PATH_MAX]; + char *cwd; - ASSERT_NE(NULL, getcwd(cwd, sizeof(cwd))); + cwd = xgetcwd(); + ASSERT_NE(NULL, cwd); /* PAM_USER_UNKNOWN */ ASSERT_NE(NULL, fp = fopen(service_file, "w")); @@ -103,5 +105,7 @@ main(void) ASSERT_EQ(0, unlink(config_file)); ASSERT_EQ(0, unlink(service_file)); + free(cwd); + return 0; } -- cgit v1.2.3