aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_namespace/pam_namespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_namespace/pam_namespace.c')
-rw-r--r--modules/pam_namespace/pam_namespace.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c
index ba7910f6..e224b218 100644
--- a/modules/pam_namespace/pam_namespace.c
+++ b/modules/pam_namespace/pam_namespace.c
@@ -1780,9 +1780,10 @@ cleanup:
static int cwd_in(char *dir, struct instance_data *idata)
{
int retval = 0;
- char cwd[PATH_MAX];
+ char *cwd;
- if (getcwd(cwd, PATH_MAX) == NULL) {
+ cwd = xgetcwd();
+ if (cwd == NULL) {
pam_syslog(idata->pamh, LOG_ERR, "Can't get current dir, %m");
return -1;
}
@@ -1796,6 +1797,7 @@ static int cwd_in(char *dir, struct instance_data *idata)
pam_syslog(idata->pamh, LOG_DEBUG, "cwd is outside %s", dir);
}
+ free(cwd);
return retval;
}