From 731f957965a6ad48deb6522ff87bcf52b1e523e4 Mon Sep 17 00:00:00 2001 From: Nadav Har'El Date: Tue, 11 Jan 2011 07:53:07 -0700 Subject: [PATCH] rm: ignore errno related to invalid file names * src/remove.c (nonexistent_file_errno): Also skip EINVAL and EILSEQ, for at least smbfs rejection of '*' in file names. * NEWS: Mention the fix. --- NEWS | 3 +++ src/remove.c | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 5a70243..9ccad63 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,9 @@ GNU coreutils NEWS -*- outline -*- argument following the one containing the moved sub-tree. [bug introduced in coreutils-5.1.0] + rm -f no longer fails for EINVAL or EILSEQ on file systems that + reject file names invalid for that file system. + * Noteworthy changes in release 8.9 (2011-01-04) [stable] diff --git a/src/remove.c b/src/remove.c index f7b00c6..3814232 100644 --- a/src/remove.c +++ b/src/remove.c @@ -378,10 +378,18 @@ nonexistent_file_errno (int errnum) exist, but be (in)accessible only via too long a symlink chain. Likewise for ENAMETOOLONG, since rm -f ./././.../foo may fail if the "..." part expands to a long enough sequence of "./"s, - even though ./foo does indeed exist. */ + even though ./foo does indeed exist. + + Another case to consider is when a particular name is invalid for + a given file system. In 2011, smbfs returns EINVAL, but the next + revision of POSIX will require EILSEQ for that situation: + http://austingroupbugs.net/view.php?id=293 + */ switch (errnum) { + case EILSEQ: + case EINVAL: case ENOENT: case ENOTDIR: return true; -- 2.7.4