symlink: create cygwin symlinks

when given a NfsSymlinkTargetName EA on create, marshall the unicode target name to the daemon, which issues a CREATE rpc to create the symlink

modified the driver's marshall_unicode_as_utf8() function to handle the NULL string buffer for non-symlink opens

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2012-05-07 12:24:00 -04:00 committed by Olga Kornievskaia
parent 453c0cc875
commit 0afc5ebb4d
5 changed files with 83 additions and 20 deletions

View file

@ -208,18 +208,6 @@ out:
return status;
}
static int map_symlink_errors(int status)
{
switch (status) {
case NFS4ERR_BADCHAR:
case NFS4ERR_BADNAME: return ERROR_INVALID_REPARSE_DATA;
case NFS4ERR_WRONG_TYPE: return ERROR_NOT_A_REPARSE_POINT;
case NFS4ERR_ACCESS: return ERROR_ACCESS_DENIED;
case NFS4ERR_NOTEMPTY: return ERROR_NOT_EMPTY;
default: return nfs_to_windows_error(status, ERROR_BAD_NET_RESP);
}
}
static int handle_symlink(nfs41_upcall *upcall)
{
symlink_upcall_args *args = &upcall->args.symlink;
@ -250,7 +238,7 @@ static int handle_symlink(nfs41_upcall *upcall)
}
/* create the symlink */
createattrs.attrmask.count = 1;
createattrs.attrmask.count = 2;
createattrs.attrmask.arr[0] = 0;
createattrs.attrmask.arr[1] = FATTR4_WORD1_MODE;
createattrs.mode = 0777;