diff options
Diffstat (limited to 'bin/rm/rm.c')
-rw-r--r-- | bin/rm/rm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c index 614479d..c311b6e 100644 --- a/bin/rm/rm.c +++ b/bin/rm/rm.c @@ -400,6 +400,11 @@ rm_overwrite(char *file, struct stat *sbp) } if (!S_ISREG(sbp->st_mode)) return (1); + if (sbp->st_nlink > 1) { + warnx("%s (inode %u): not overwritten due to multiple links", + file, sbp->st_ino); + return (1); + } if ((fd = open(file, O_WRONLY, 0)) == -1) goto err; if (fstatfs(fd, &fsb) == -1) |