Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153121405
D8245.id21602.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8245.id21602.diff
View Options
Index: head/usr.sbin/pw/grupd.c
===================================================================
--- head/usr.sbin/pw/grupd.c
+++ head/usr.sbin/pw/grupd.c
@@ -34,6 +34,7 @@
#include <libutil.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include "pwupd.h"
@@ -73,8 +74,10 @@
}
if (gr_copy(pfd, tfd, gr, old_gr) == -1) {
gr_fini();
+ close(tfd);
err(1, "gr_copy()");
}
+ close(tfd);
if (gr_mkdb() == -1) {
gr_fini();
err(1, "gr_mkdb()");
Index: head/usr.sbin/pw/pw_nis.c
===================================================================
--- head/usr.sbin/pw/pw_nis.c
+++ head/usr.sbin/pw/pw_nis.c
@@ -34,6 +34,7 @@
#include <err.h>
#include <pwd.h>
#include <libutil.h>
+#include <unistd.h>
#include "pw.h"
@@ -63,8 +64,10 @@
}
if (pw_copy(pfd, tfd, pw, old_pw) == -1) {
pw_fini();
+ close(tfd);
err(1, "pw_copy()");
}
+ close(tfd);
if (chmod(pw_tempname(), 0644) == -1)
err(1, "chmod()");
if (rename(pw_tempname(), path) == -1)
Index: head/usr.sbin/pw/pwupd.c
===================================================================
--- head/usr.sbin/pw/pwupd.c
+++ head/usr.sbin/pw/pwupd.c
@@ -111,8 +111,10 @@
}
if (pw_copy(pfd, tfd, pw, old_pw) == -1) {
pw_fini();
+ close(tfd);
err(1, "pw_copy()");
}
+ close(tfd);
/*
* in case of deletion of a user, the whole database
* needs to be regenerated
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 20, 7:40 AM (21 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31826055
Default Alt Text
D8245.id21602.diff (1 KB)
Attached To
Mode
D8245: Close a file descriptor leak in pw
Attached
Detach File
Event Timeline
Log In to Comment