write_file()
- Added tmp check to TMP_OPT section (how apropriate).
- Added new consistency checking code from securityfocus
- article by Oliver Friedrichs.
+ article by Oliver Friedrichs, and use O_EXCL if tmp == 1.
- winio.c:
edit_add()
- Off by one display error (fix by Rocco Corsi).
return -1;
else if (ISSET(FOLLOW_SYMLINKS) || !S_ISLNK(st.st_mode)) {
- fd = open(realname, O_WRONLY | O_CREAT | O_TRUNC,
+ /* Use O_EXCL if tmp == 1, I suppose */
+ if (tmp)
+ fd = open(realname, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH |
+ S_IWOTH);
+ else
+ fd = open(realname, O_WRONLY | O_CREAT | O_TRUNC,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH |
S_IWOTH);