always use the same code for creating temporary files

Let's unify our code here, and also always specifiy O_CLOEXEC.
This commit is contained in:
Lennart Poettering
2014-01-28 13:47:35 +01:00
parent 7736202ce9
commit 2d5bdf5bc0
10 changed files with 43 additions and 30 deletions
+1 -4
View File
@@ -325,10 +325,7 @@ int ask_password_agent(
mkdir_p_label("/run/systemd/ask-password", 0755);
RUN_WITH_UMASK(0022) {
fd = mkostemp(temp, O_CLOEXEC|O_CREAT|O_WRONLY);
}
fd = mkostemp_safe(temp, O_WRONLY|O_CLOEXEC);
if (fd < 0) {
log_error("Failed to create password file: %m");
r = -errno;