From 59526ba9d868fcc00458dc7c90050c4ba9a0aad5 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 15 Oct 2010 14:49:43 -0400 Subject: [PATCH] symlink: convert windows slashes when setting symlink Signed-off-by: Casey Bodley --- daemon/symlink.c | 4 ++++ daemon/upcall.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon/symlink.c b/daemon/symlink.c index 68f8426..f54c1e3 100644 --- a/daemon/symlink.c +++ b/daemon/symlink.c @@ -225,6 +225,10 @@ int handle_symlink(nfs41_upcall *upcall) int status = NO_ERROR; if (args->set) { + /* don't send windows slashes to the server */ + char *p; + for (p = args->target_set; *p; p++) if (*p == '\\') *p = '/'; + if (state->file.fh.len) { /* the check in handle_open() didn't catch that we're creating * a symlink, so we have to remove the file it already created */ diff --git a/daemon/upcall.h b/daemon/upcall.h index 4215e75..fe47df5 100644 --- a/daemon/upcall.h +++ b/daemon/upcall.h @@ -137,7 +137,7 @@ typedef struct __readdir_upcall_args { typedef struct __symlink_upcall_args { nfs41_abs_path target_get; - const char *target_set; + char *target_set; nfs41_root *root; nfs41_open_state *state; const char *path;