When I tried to fix it with the following patch, the `openat(dirfd, dest,
O_WRONLY|O_CREAT, 0200)` still failed with a message "No such file or
directory". In this case, the open does not seem to cover this scenario.
```
diff --git a/lib/fsm.c b/lib/fsm.c
index c9ab3e1..4ceca3d 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -282,6 +282,12 @@ static int fsmOpen(int *wfdp, int dirfd, const char *dest)
/* Create the file with 0200 permissions (write by owner). */
int fd = openat(dirfd, dest, O_WRONLY|O_EXCL|O_CREAT, 0200);
+ if (fd < 0 && errno == EEXIST) {
+ rpmlog(RPMLOG_WARNING, "xujing: %8s (%s [%d]) %s\n", __func__,
+ dest, fd, (rc < 0 ? strerror(errno) : ""));
+ fd = openat(dirfd, dest, O_WRONLY|O_CREAT, 0200);
+ }
+
if (fd < 0)
rc = RPMERR_OPEN_FAILED;
```
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2273#issuecomment-1352469285
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/2273/1352469...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint