Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151084709
D6628.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
805 B
Referenced Files
None
Subscribers
None
D6628.diff
View Options
Index: head/usr.sbin/services_mkdb/services_mkdb.c
===================================================================
--- head/usr.sbin/services_mkdb/services_mkdb.c
+++ head/usr.sbin/services_mkdb/services_mkdb.c
@@ -92,7 +92,7 @@
size_t cnt = 0;
StringList *sl, ***svc;
size_t port, proto;
- char *dbname_dir;
+ char *dbname_dir, *dbname_dirbuf;
int dbname_dir_fd = -1;
setprogname(argv[0]);
@@ -172,7 +172,8 @@
* fsync() to the directory where file lies
*/
if (rename(tname, dbname) == -1 ||
- (dbname_dir = dirname(dbname)) == NULL ||
+ (dbname_dirbuf = strdup(dbname)) == NULL ||
+ (dbname_dir = dirname(dbname_dirbuf)) == NULL ||
(dbname_dir_fd = open(dbname_dir, O_RDONLY|O_DIRECTORY)) == -1 ||
fsync(dbname_dir_fd) != 0) {
if (dbname_dir_fd != -1)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 6, 9:38 PM (1 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30994029
Default Alt Text
D6628.diff (805 B)
Attached To
Mode
D6628: Invoke the dirname() function in a POSIX compliant way.
Attached
Detach File
Event Timeline
Log In to Comment