openat("./...", O_CREAT) fails even though the directory exists
Date: Mon, 13 Oct 2025 08:32:45 UTC
hello,
i'm trying to debug an issue with sendmail in main where smmsp stops
working after upgrading the FreeBSD-sendmail package. i've narrowed
this down to the following sequence of system calls:
44288: fstatat(AT_FDCWD,"./df59D8I2px044288",0xecbda905210,0x0) ERR#2 'No such file or directory'
44288: fstatat(AT_FDCWD,".",{ mode=drwxr-xr-x ,inode=129826,size=2,blksize=131072 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
44288: geteuid() = 0 (0x0)
44288: fstatat(AT_FDCWD,".",{ mode=drwxr-xr-x ,inode=129826,size=2,blksize=131072 },0x0) = 0 (0x0)
44288: openat(AT_FDCWD,"./df59D8I2px044288",O_RDWR|O_CREAT|O_EXCL,0600) ERR#2 'No such file or directory'
this doesn't make sense to me: since "." exists, how can openat() return
ENOENT here?
the process cwd is /var/spool/clientmqueue, and i've checked that the
inode number for this directory doesn't change across upgrade, so we
aren't deleting and recreating it.
the full truss output is available here:
https://people.freebsd.org/~ivy/tmp/smmsp.trace.txt
does anyone have an idea what's going on here?