diff options
author | claudio <claudio@openbsd.org> | 2012-07-07 12:55:29 +0000 |
---|---|---|
committer | claudio <claudio@openbsd.org> | 2012-07-07 12:55:29 +0000 |
commit | 3b6169f364ddf6e91bcb010762aa8981c79af115 (patch) | |
tree | 3d3dfe3cf75d7fffde7dd792d6c61c36797dca2d /usr.sbin/authpf | |
parent | When aborting a transfer set the halted bit to the QH's qTD and remove (diff) | |
download | wireguard-openbsd-3b6169f364ddf6e91bcb010762aa8981c79af115.tar.xz wireguard-openbsd-3b6169f364ddf6e91bcb010762aa8981c79af115.zip |
Fix file descriptor leak reported by someone on the mailing list long time
ago. OK beck@
Diffstat (limited to 'usr.sbin/authpf')
-rw-r--r-- | usr.sbin/authpf/authpf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/authpf/authpf.c b/usr.sbin/authpf/authpf.c index 4089ac402cf..985563b7a02 100644 --- a/usr.sbin/authpf/authpf.c +++ b/usr.sbin/authpf/authpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: authpf.c,v 1.115 2010/09/02 14:01:04 sobrado Exp $ */ +/* $OpenBSD: authpf.c,v 1.116 2012/07/07 12:55:29 claudio Exp $ */ /* * Copyright (C) 1998 - 2007 Bob Beck (beck@openbsd.org). @@ -523,6 +523,7 @@ allowed_luser(struct passwd *pw) "invalid group '%s' in %s (%s)", buf + 1, PATH_ALLOWFILE, strerror(errno)); + fclose(f); return (0); } @@ -549,8 +550,10 @@ allowed_luser(struct passwd *pw) lbuf = NULL; } - if (matched) + if (matched) { + fclose(f); return (1); /* matched an allowed user/group */ + } } syslog(LOG_INFO, "denied access to %s: not listed in %s", pw->pw_name, PATH_ALLOWFILE); @@ -560,6 +563,7 @@ allowed_luser(struct passwd *pw) fputs(buf, stdout); } fflush(stdout); + fclose(f); return (0); } |