X-Git-Url: https://git.armaanb.net/?a=blobdiff_plain;f=persist_timestamp.c;h=81ea273ce4f0fe4d54c4705eb54845083972ea51;hb=6cf64c20542022569d468403b951065eea99b20b;hp=c30b8f350947dffe1eaa3ab92dc22a257dac8e3f;hpb=5054c7a52d950e0f66a088689a36ca5999987c97;p=opendoas.git diff --git a/persist_timestamp.c b/persist_timestamp.c index c30b8f3..81ea273 100644 --- a/persist_timestamp.c +++ b/persist_timestamp.c @@ -262,11 +262,12 @@ persist_open(int *valid, int secs) if ((fd = openat(dirfd, name, (O_RDWR), (S_IRUSR|S_IWUSR))) == -1) if (errno != ENOENT) - err(1, "open: %s", name); + err(1, "open timestamp file"); if (fd == -1) { - if ((fd = openat(dirfd, name, (O_RDWR|O_CREAT|O_EXCL), (S_IRUSR|S_IWUSR))) == -1) - err(1, "open: %s", name); + if ((fd = openat(dirfd, name, (O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW), + (S_IRUSR|S_IWUSR))) == -1) + err(1, "open timestamp file"); } size_t tssize;