mirror of
https://github.com/openssh/openssh-portable.git
synced 2026-01-12 00:04:08 +08:00
don't free string returned by login_getcapstr(3)
OpenBSD and NetBSD require the caller to free strings returned bu the login_* functions, but FreeBSD requires that callers don't. Fortunately in this case, we can harmlessly leak as the process is about to exec the shell/command. From https://reviews.freebsd.org/D28617 via Ed Maste; ok dtucker@
This commit is contained in:
@@ -1287,11 +1287,8 @@ do_nologin(struct passwd *pw)
|
||||
return;
|
||||
nl = def_nl;
|
||||
#endif
|
||||
if (stat(nl, &sb) == -1) {
|
||||
if (nl != def_nl)
|
||||
free(nl);
|
||||
if (stat(nl, &sb) == -1)
|
||||
return;
|
||||
}
|
||||
|
||||
/* /etc/nologin exists. Print its contents if we can and exit. */
|
||||
logit("User %.100s not allowed because %s exists", pw->pw_name, nl);
|
||||
|
||||
Reference in New Issue
Block a user