Page MenuHomeFreeBSD

D8319.id22331.diff
No OneTemporary

D8319.id22331.diff

Index: head/lib/libutil/gr_util.c
===================================================================
--- head/lib/libutil/gr_util.c
+++ head/lib/libutil/gr_util.c
@@ -141,7 +141,7 @@
errno = ENAMETOOLONG;
return (-1);
}
- if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
+ if ((tfd = mkostemp(tempname, 0)) == -1)
return (-1);
if (mfd != -1) {
while ((nr = read(mfd, buf, sizeof(buf))) > 0)
Index: head/lib/libutil/pw_util.c
===================================================================
--- head/lib/libutil/pw_util.c
+++ head/lib/libutil/pw_util.c
@@ -225,7 +225,7 @@
errno = ENAMETOOLONG;
return (-1);
}
- if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
+ if ((tfd = mkostemp(tempname, 0)) == -1)
return (-1);
if (mfd != -1) {
while ((nr = read(mfd, buf, sizeof(buf))) > 0)
Index: head/usr.sbin/pw/grupd.c
===================================================================
--- head/usr.sbin/pw/grupd.c
+++ head/usr.sbin/pw/grupd.c
@@ -77,6 +77,7 @@
close(tfd);
err(1, "gr_copy()");
}
+ fsync(tfd);
close(tfd);
if (gr_mkdb() == -1) {
gr_fini();
Index: head/usr.sbin/pw/pw_nis.c
===================================================================
--- head/usr.sbin/pw/pw_nis.c
+++ head/usr.sbin/pw/pw_nis.c
@@ -67,6 +67,7 @@
close(tfd);
err(1, "pw_copy()");
}
+ fsync(tfd);
close(tfd);
if (chmod(pw_tempname(), 0644) == -1)
err(1, "chmod()");
Index: head/usr.sbin/pw/pwupd.c
===================================================================
--- head/usr.sbin/pw/pwupd.c
+++ head/usr.sbin/pw/pwupd.c
@@ -114,6 +114,7 @@
close(tfd);
err(1, "pw_copy()");
}
+ fsync(tfd);
close(tfd);
/*
* in case of deletion of a user, the whole database

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 11, 2:32 AM (14 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23559108
Default Alt Text
D8319.id22331.diff (1 KB)

Event Timeline