52 dprintf(1,
"parsing NFS41_FILE_SET: filename='%s' info_class=%d "
53 "buf_len=%d\n",
args->path,
args->set_class,
args->buf_len);
60 PFILE_BASIC_INFO basic_info = (PFILE_BASIC_INFO)
args->buf;
67 if (basic_info->FileAttributes) {
72 state->file.fh.fileid, &old_info);
74 if (getattr_status ||
info.hidden != old_info.hidden) {
78 if (getattr_status ||
info.archive != old_info.archive) {
82 if (getattr_status ||
info.system != old_info.system) {
87 if (old_info.mode == 0444 &&
100 if (basic_info->CreationTime.QuadPart > 0) {
107 if (basic_info->LastAccessTime.QuadPart > 0) {
114 if (basic_info->LastWriteTime.QuadPart > 0) {
143 dprintf(1,
"nfs41_setattr() failed with error %s.\n",
164 dprintf(1,
"nfs41_remove() failed with error %s.\n",
180 &
state->parent.name);
215 PFILE_RENAME_INFO
rename = (PFILE_RENAME_INFO)
args->buf;
222 src_name = &
state->file.name;
224 if (
rename->FileNameLength == 0) {
242 &
state->parent, src_name,
243 &dst_dir, &dst_name);
245 dprintf(1,
"nfs41_rename() failed with error %s.\n",
258 if (dst_path.len == 0) {
259 eprintf(
"WideCharToMultiByte failed to convert destination "
260 "filename %S.\n",
rename->FileName);
268 &dst_path, &dst_dir, &
dst,
NULL, &dst_session);
279 eprintf(
"nfs41_symlink_target() for %s failed with %d\n",
286 &dst_path, &dst_dir,
NULL,
NULL, &dst_session);
290 last_component(dst_path.path, dst_path.path + dst_path.len, &dst_name);
294 if (!
rename->ReplaceIfExists) {
302 dprintf(1,
"nfs41_lookup('%s') failed to find destination "
303 "directory with %d\n", dst_path.path,
status);
320 eprintf(
"handle_nfs41_rename: %s is opened\n", dst_path.path);
330 &
state->parent, src_name,
331 &dst_dir, &dst_name);
333 dprintf(1,
"nfs41_rename() failed with error %s.\n",
364 dprintf(2,
"calling setattr() with size=%lld\n",
info.size);
367 dprintf(1,
"nfs41_setattr() failed with error %s.\n",
396 if (dst_path.len == 0) {
397 eprintf(
"WideCharToMultiByte failed to convert destination "
398 "filename %S.\n",
link->FileName);
406 &dst_path, &dst_dir, &
dst,
NULL, &dst_session);
417 eprintf(
"nfs41_symlink_target() for %s failed with %d\n",
424 &dst_path, &dst_dir, &
dst,
NULL, &dst_session);
428 last_component(dst_path.path, dst_path.path + dst_path.len, &dst_name);
432 if (!
link->ReplaceIfExists) {
437 dprintf(1,
"nfs41_lookup('%s') failed to find destination "
438 "directory with %d\n", dst_path.path,
status);
458 &dst_dir, &dst_name,
dst.fh.fileid);
460 dprintf(1,
"nfs41_remove() failed with error %s.\n",
474 dprintf(1,
"nfs41_link() failed with error %s.\n",
488 switch (
args->set_class) {
506 eprintf(
"unknown set_file information class %d\n",
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
#define list_container(entry, type, field)
static struct list_entry * list_search(const struct list_entry *head, const void *value, list_compare_fn compare)
int nfs41_lookup(IN nfs41_root *root, IN nfs41_session *session, IN OUT nfs41_abs_path *path_inout, OUT OPTIONAL nfs41_path_fh *parent_out, OUT OPTIONAL nfs41_path_fh *target_out, OUT OPTIONAL nfs41_file_info *info_out, OUT nfs41_session **session_out)
void path_fh_init(OUT nfs41_path_fh *file, IN nfs41_abs_path *path)
bool_t last_component(IN const char *path, IN const char *path_end, OUT nfs41_component *component)
int safe_write(unsigned char **pos, uint32_t *remaining, void *src, uint32_t src_len)
void fh_copy(OUT nfs41_fh *dst, IN const nfs41_fh *src)
void abs_path_copy(OUT nfs41_abs_path *dst, IN const nfs41_abs_path *src)
int safe_read(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len)
int nfs_to_windows_error(int status, int default_error)
int get_name(unsigned char **pos, uint32_t *remaining, const char **out_name)
int create_silly_rename(IN nfs41_abs_path *path, IN const nfs41_fh *fh, OUT nfs41_component *silly)
static __inline void file_time_to_nfs_time(IN const PLARGE_INTEGER file_time, OUT nfstime4 *nfs_time)
void eprintf(LPCSTR format,...)
const char * nfs_error_string(int status)
int nfs41_delegation_return(IN nfs41_session *session, IN nfs41_path_fh *file, IN enum open_delegation_type4 access, IN bool_t truncate)
#define ERROR_INVALID_PARAMETER
#define ERROR_NOT_SUPPORTED
#define WideCharToMultiByte
#define ERROR_ACCESS_DENIED
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
@ FileEndOfFileInformation
@ FileAllocationInformation
@ FileDispositionInformation
struct _FILE_LINK_INFORMATION * PFILE_LINK_INFORMATION
GLint GLint GLsizei GLsizei GLsizei depth
GLuint GLsizei GLsizei * length
#define ERROR_FILE_NOT_FOUND
int nfs41_attr_cache_lookup(IN struct nfs41_name_cache *cache, IN uint64_t fileid, OUT nfs41_file_info *info_out)
static __inline struct nfs41_name_cache * session_name_cache(IN nfs41_session *session)
#define client_entry(pos)
static __inline void nfs41_superblock_supported_attrs(IN const nfs41_superblock *superblock, IN OUT bitmap4 *attrs)
static __inline nfs41_session * nfs41_root_session(IN nfs41_root *root)
void nfs41_open_stateid_arg(IN nfs41_open_state *state, OUT struct __stateid_arg *arg)
#define NFS41_MAX_PATH_LEN
@ FATTR4_WORD1_TIME_CREATE
@ FATTR4_WORD1_TIME_ACCESS_SET
@ FATTR4_WORD1_TIME_MODIFY_SET
#define NFS41_MAX_SYMLINK_DEPTH
nfs41_updowncall_list upcall
int nfs41_remove(IN nfs41_session *session, IN nfs41_path_fh *parent, IN const nfs41_component *target, IN uint64_t fileid)
int nfs41_setattr(IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN nfs41_file_info *info)
int nfs41_rename(IN nfs41_session *session, IN nfs41_path_fh *src_dir, IN const nfs41_component *src_name, IN nfs41_path_fh *dst_dir, IN const nfs41_component *dst_name)
int nfs41_link(IN nfs41_session *session, IN nfs41_path_fh *src, IN nfs41_path_fh *dst_dir, IN const nfs41_component *target, OUT nfs41_file_info *cinfo)
int nfs41_symlink_target(IN nfs41_session *session, IN nfs41_path_fh *file, OUT nfs41_abs_path *target)
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_SYSTEM
#define FILE_ATTRIBUTE_ARCHIVE
_Check_return_ int __cdecl rename(_In_z_ const char *_OldFilename, _In_z_ const char *_NewFilename)
static int handle_nfs41_rename(setattr_upcall_args *args)
static int handle_nfs41_link(setattr_upcall_args *args)
static int handle_setattr(nfs41_upcall *upcall)
static int nfs41_abs_path_compare(IN const struct list_entry *entry, IN const void *value)
static int handle_nfs41_set_size(setattr_upcall_args *args)
static void open_state_rename(OUT nfs41_open_state *state, IN const nfs41_abs_path *path)
const nfs41_upcall_op nfs41_op_setattr
static int parse_setattr(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
static int marshall_setattr(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
static int handle_nfs41_remove(setattr_upcall_args *args)
static int handle_nfs41_setattr(setattr_upcall_args *args)
static int is_dst_name_opened(nfs41_abs_path *dst_path, nfs41_session *dst_session)
char path[NFS41_MAX_PATH_LEN]
struct __nfs41_superblock * superblock
union _LARGE_INTEGER * PLARGE_INTEGER
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define ERROR_TOO_MANY_LINKS
#define ERROR_FILE_EXISTS
#define ERROR_NOT_SAME_DEVICE