pam: s/MAXPATHLEN/PATH_MAX/g

parent 9f423d09
...@@ -2408,13 +2408,13 @@ static int handle_login(const char *user, uid_t uid, gid_t gid) ...@@ -2408,13 +2408,13 @@ static int handle_login(const char *user, uid_t uid, gid_t gid)
{ {
int idx = 0, ret; int idx = 0, ret;
bool existed; bool existed;
char cg[MAXPATHLEN]; char cg[PATH_MAX];
cg_escape(); cg_escape();
while (idx >= 0) { while (idx >= 0) {
ret = snprintf(cg, MAXPATHLEN, "/user/%s/%d", user, idx); ret = snprintf(cg, PATH_MAX, "/user/%s/%d", user, idx);
if (ret < 0 || ret >= MAXPATHLEN) { if (ret < 0 || ret >= PATH_MAX) {
mysyslog(LOG_ERR, "Username too long\n", NULL); mysyslog(LOG_ERR, "Username too long\n", NULL);
return PAM_SESSION_ERR; return PAM_SESSION_ERR;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment