diff options
| author | Alexander Leidinger <netchild@FreeBSD.org> | 2006-09-17 10:56:15 +0000 |
|---|---|---|
| committer | Alexander Leidinger <netchild@FreeBSD.org> | 2006-09-17 10:56:15 +0000 |
| commit | 9452540b541a80ff1a48f6aa7ef9b6b3a3312eeb (patch) | |
| tree | d33afe8a82915c056bfb9576155426131f733472 | |
| parent | 62ba29c979cf2864df8757d5147b31b79eca4eed (diff) | |
Notes
| -rw-r--r-- | sys/compat/linux/linux_file.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 79a8ba908483..1c5419fddb9f 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include <sys/mount.h> #include <sys/mutex.h> #include <sys/proc.h> +#include <sys/stat.h> #include <sys/syscallsubr.h> #include <sys/sysproto.h> #include <sys/tty.h> @@ -502,6 +503,7 @@ linux_unlink(struct thread *td, struct linux_unlink_args *args) { char *path; int error; + struct stat st; LCONVPATHEXIST(td, args->path, &path); @@ -511,6 +513,11 @@ linux_unlink(struct thread *td, struct linux_unlink_args *args) #endif error = kern_unlink(td, path, UIO_SYSSPACE); + if (error == EPERM) + /* Introduce POSIX noncompliant behaviour of Linux */ + if (kern_stat(td, path, UIO_SYSSPACE, &st) == 0) + if (S_ISDIR(st.st_mode)) + error = EISDIR; LFREEPATH(path); return (error); } |
