git: unlink(2): Fail with EPERM when trying to unlink a directory

Aaron LI aly at crater.dragonflybsd.org
Tue Nov 17 01:30:56 PST 2026


commit 1e56f005fa0beed0acf1bc93c41a106fa6a6127f
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Nov 7 17:09:21 2026 +0800

    unlink(2): Fail with EPERM when trying to unlink a directory
    
    As specified by POSIX and documented in the unlink(2) man page,
    unlinking a directory fails with EPERM instead of EISDIR.  Fix
    kern_unlink() to return EPERM when trying to unlink a directory.
    
    Found-by: pjdfstest (https://github.com/pjd/pjdfstest)
    Assisted-by: DeepSeek-v4.1-flash (with Pi Coding Agent)

Summary of changes:
 sys/kern/vfs_syscalls.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1e56f005fa0beed0acf1bc93c41a106fa6a6127f


-- 
DragonFly BSD source repository


More information about the Commits mailing list