summaryrefslogtreecommitdiff
path: root/src/kernel/syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r--src/kernel/syscalls.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index af3e0aa..1b91eb7 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -103,7 +103,13 @@ int _syscall_mount(handle_t handle, const char __user *path, int len) {
goto fail;
len = path_simplify(path_buf, path_buf, len);
if (len < 0) goto fail;
- // TODO remove trailing slash
+
+ // remove trailing slash
+ // mounting something under `/this` and `/this/` should be equalivent
+ if (path_buf[len - 1] == '/') {
+ if (len == 0) goto fail;
+ len--;
+ }
if (handle >= 0) { // mounting a real backend?
if (handle >= HANDLE_MAX)