diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-03-01 21:46:15 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-03-01 21:47:38 +0800 |
commit | ab5eb9b1a6026dbdc9d9259934b85170422c1538 (patch) | |
tree | 862b4dc5a38c333de5617fd74ec6a7d301007029 /modules/pam_namespace/pam_namespace.c | |
parent | 5cb97aee88271dfd25c20629052b3d89f05e63c2 (diff) | |
download | pam-ab5eb9b1a6026dbdc9d9259934b85170422c1538.tar.gz pam-ab5eb9b1a6026dbdc9d9259934b85170422c1538.tar.bz2 pam-ab5eb9b1a6026dbdc9d9259934b85170422c1538.zip |
HALF WORK: MAX_PATHdev
Diffstat (limited to 'modules/pam_namespace/pam_namespace.c')
-rw-r--r-- | modules/pam_namespace/pam_namespace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c index 4b62700d..b0bc138b 100644 --- a/modules/pam_namespace/pam_namespace.c +++ b/modules/pam_namespace/pam_namespace.c @@ -1778,9 +1778,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; } @@ -1794,6 +1795,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; } |