Commit graph

14 commits

Author SHA1 Message Date
Olga Kornievskaia
006bdfa47a ref counting for nfs41_open_state 2010-10-27 16:18:12 -04:00
Casey Bodley
ae4c67c21e upcall: added upcall_cleanup() to interface
added call to upcall_cleanup() after both upcall_marshall() and upcall_cancel()
individual upcall operations define their nfs41_upcall_op structs locally, instead of putting tons of function prototypes in upcall.c
made the upcall_marshall() function optional; most marshall functions are noops

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-27 16:16:17 -04:00
unknown
bacbf060e3 making eprintfs include filename in symlink 2010-10-19 11:18:32 -04:00
Casey Bodley
870b389e8f symlink: limit symlink depth to avoid following cyclical links
/* msdn: There is a maximum of 31 reparse points (and
 * therefore symbolic links) allowed in a particular path. */
#define NFS41_MAX_SYMLINK_DEPTH     31

also added checks for the return value of nfs41_symlink_target() on open/link/rename

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-15 17:24:04 -04:00
Casey Bodley
59526ba9d8 symlink: convert windows slashes when setting symlink
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-15 14:56:13 -04:00
Casey Bodley
1ad1c0f262 symlink: rename and link handle ERROR_REPARSE
when rename or link call nfs41_lookup() for the destination directory, they need to be able to handle ERROR_REPARSE and find the real dest dir

open now does the same thing when it sees ERROR_REPARSE; previously, it was only replacing the first symlink in the path, and could require multiple reparses on a path

modified nfs41_symlink_target() to support the case where the source and destination paths are the same (used by rename/link)

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-15 14:56:06 -04:00
Casey Bodley
eb9d9bbd4c symlink: nfs41_symlink_follow() for readdir and open
added nfs41_file_info.symlink_dir to replace readdir's info.cansettime hack.  when nfs_file_info_to_attributes() finds info.type==NF4LNK, it adds the FILE_ATTRIBUTE_DIRECTORY flag if info.symlink_dir is set

renamed nfs41_symlink_follow() to nfs41_symlink_target()
generalized lookup_symlink() into nfs41_symlink_follow(), which is called by readdir and open (also avoids an extra lookup)

added queries for symlink target type when doing normal GETATTRs (getattr.c) and opens with OPEN_REPARSE_POINT set (open.c)

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-14 16:57:53 -04:00
unknown
c414d5b84e fixing license in symlink.c 2010-10-14 13:23:48 -04:00
Casey Bodley
ccdaa169eb symlink: handle_open() detects symlink creation
added check in handle_open() to avoid calling CREATE/OPEN when we're creating a symlink:

if (args->disposition == FILE_CREATE &&
    args->access_mask == (FILE_WRITE_ATTRIBUTES | SYNCHRONIZE | DELETE) &&
    args->access_mode == 0 &&
    args->create_opts & FILE_OPEN_REPARSE_POINT)

these are the open arguments we get from the CreateSymbolicLink() syscall.  by avoiding the call to CREATE/OPEN on handle_open(), we save ourselves from having to REMOVE the file before creating the symlink

added a check to handle_symlink() in case the file was actually created on open (an application could open the file with different arguments, and send the FSCTL_SET_REPARSE_POINT manually), and removes the file first

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-14 12:42:36 -04:00
Casey Bodley
62fa6176be symlink: FSCTL_SET_REPARSE_POINT
driver handles FSCTL_SET_REPARSE_POINT by sending a symlink set upcall
daemon handles symlink set upcall by calling nfs41_create()

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-14 12:42:36 -04:00
Casey Bodley
08c2618551 symlink: FSCTL_GET_REPARSE_POINT
driver handles FSCTL_GET_REPARSE_POINT by sending a symlink query upcall
daemon handles symlink query upcall by calling nfs41_readlink()

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-14 12:42:34 -04:00
Casey Bodley
8ea0ca1893 symlink: generalized follow_link()
no longer depends on nfs41_open_state or open_upcall_args
renamed to nfs41_symlink_follow() and added prototype to nfs41_ops.h

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-14 12:42:34 -04:00
Casey Bodley
dd48ca17c3 symlink: moved follow_link() to symlink.c [cosmetic]
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-14 12:42:33 -04:00
Casey Bodley
0db42ed126 symlink: daemon parses SYMLINK upcall
added symlink.c for parse_symlink() and marshall_symlink()

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-14 12:42:33 -04:00