35 if (*remaining < dest_len)
40 *remaining -= dest_len;
46 if (*remaining < src_len)
51 *remaining -= src_len;
62 if (*remaining <
len) {
66 *out_name = (
const char*)*
pos;
88 const uint32_t maxresponse =
session->fore_chan_attrs.ca_maxresponsesize;
105 *stable = verf->committed;
106 dprintf(3,
"verify_write: committed to stable storage\n");
113 dprintf(3,
"verify_write: first unstable write, saving verifier\n");
118 dprintf(3,
"verify_write: verifier matches expected\n");
122 dprintf(2,
"verify_write: verifier changed; writes have been lost!\n");
130 dprintf(3,
"verify_commit: verifier matches expected\n");
133 dprintf(2,
"verify_commit: verifier changed; writes have been lost!\n");
145 if (
info->symlink_dir)
148 dprintf(1,
"unhandled file type %d, defaulting to NF4REG\n",
151 if (
info->mode == 0444)
165 OUT PFILE_BASIC_INFO basic_out)
177 OUT PFILE_STANDARD_INFO std_out)
181 std_out->AllocationSize.QuadPart =
183 std_out->NumberOfLinks =
info->numlinks;
184 std_out->DeletePending =
FALSE;
199 net_out->AllocationSize.QuadPart =
224 for (
i = 0;
i < addrs->count;
i++) {
228 if (index_out) *index_out =
i;
239 eprintf(
"nfs_to_windows_error called with non-nfs "
240 "error code %d; returning the error as is\n",
status);
286 dprintf(1,
"nfs error %s not mapped to windows error; "
287 "returning default error %d\n",
289 return default_error;
307 IN const char *path_end,
310 const char *component_end;
313 component->len = (
unsigned short)(component_end - component->name);
314 return component->len > 0;
319 IN const char *path_end,
326 component->len = (
unsigned short)(component_end - component->name);
327 return component->len > 0;
332 IN const char *path_end)
358 dst->fileid =
src->fileid;
359 dst->superblock =
src->superblock;
370 const size_t name_start =
src->name.name -
src->path->path;
371 dst->name.name =
dst->path->path + name_start;
372 dst->name.len =
src->name.len;
390 const unsigned short extra_len = 2 + 16;
392 unsigned char fhmd5[17] = { 0 };
432 tmp = (
char*)silly->name;
434 tmp += silly->len + 2;
436 for (
i = 0;
i < 16;
i++, tmp++)
440 silly->len = silly->len + extra_len;
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
void path_fh_init(OUT nfs41_path_fh *file, IN nfs41_abs_path *path)
bool_t is_last_component(IN const char *path, IN const char *path_end)
void nfs_to_standard_info(IN const nfs41_file_info *info, OUT PFILE_STANDARD_INFO std_out)
ULONG nfs_file_info_to_attributes(IN const nfs41_file_info *info)
bool_t last_component(IN const char *path, IN const char *path_end, OUT nfs41_component *component)
void get_nfs_time(OUT nfstime4 *nfs_time)
void nfs_to_network_openinfo(IN const nfs41_file_info *info, OUT PFILE_NETWORK_OPEN_INFORMATION net_out)
void get_file_time(OUT PLARGE_INTEGER file_time)
void nfs_to_basic_info(IN const nfs41_file_info *info, OUT PFILE_BASIC_INFO basic_out)
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)
int map_symlink_errors(int status)
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)
void path_fh_copy(OUT nfs41_path_fh *dst, IN const nfs41_path_fh *src)
int nfs_to_windows_error(int status, int default_error)
uint32_t max_read_size(IN const nfs41_session *session, IN const nfs41_fh *fh)
int get_name(unsigned char **pos, uint32_t *remaining, const char **out_name)
bool_t next_component(IN const char *path, IN const char *path_end, OUT nfs41_component *component)
const char * strip_path(IN const char *path, OUT uint32_t *len_out)
bool_t verify_write(IN nfs41_write_verf *verf, IN OUT enum stable_how4 *stable)
bool_t verify_commit(IN nfs41_write_verf *verf)
int create_silly_rename(IN nfs41_abs_path *path, IN const nfs41_fh *fh, OUT nfs41_component *silly)
uint32_t max_write_size(IN const nfs41_session *session, IN const nfs41_fh *fh)
bool_t multi_addr_find(IN const multi_addr4 *addrs, IN const netaddr4 *addr, OUT OPTIONAL uint32_t *index_out)
__inline const char * prev_non_delimiter(const char *pos, const char *start)
static __inline void nfs_time_to_file_time(IN const nfstime4 *nfs_time, OUT PLARGE_INTEGER file_time)
__inline const char * next_non_delimiter(const char *pos, const char *end)
__inline const char * next_delimiter(const char *pos, const char *end)
static __inline void file_time_to_nfs_time(IN const PLARGE_INTEGER file_time, OUT nfstime4 *nfs_time)
__inline const char * prev_delimiter(const char *pos, const char *start)
void eprintf(LPCSTR format,...)
const char * nfs_error_string(int status)
BOOL WINAPI CryptCreateHash(HCRYPTPROV hProv, ALG_ID Algid, HCRYPTKEY hKey, DWORD dwFlags, HCRYPTHASH *phHash)
BOOL WINAPI CryptGetHashParam(HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags)
BOOL WINAPI CryptDestroyHash(HCRYPTHASH hHash)
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
BOOL WINAPI CryptHashData(HCRYPTHASH hHash, const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags)
#define ERROR_INVALID_PARAMETER
#define ERROR_NOT_SUPPORTED
#define FILE_ATTRIBUTE_NORMAL
#define ERROR_ACCESS_DENIED
#define ERROR_INVALID_NAME
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG FileAttributes
GLuint GLsizei GLsizei * length
GLenum const GLvoid * addr
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
#define NFS41_MAX_PATH_LEN
#define NFS41_UNIVERSAL_ADDR_LEN
#define NFS41_MAX_COMPONENT_LEN
#define NFS4_VERIFIER_SIZE
#define NFS41_NETWORK_ID_LEN
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_SYSTEM
#define FILE_ATTRIBUTE_ARCHIVE
#define FILE_ATTRIBUTE_DIRECTORY
#define FILE_ATTRIBUTE_REPARSE_POINT
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
PULONG MinorVersion OPTIONAL
char netid[NFS41_NETWORK_ID_LEN+1]
char uaddr[NFS41_UNIVERSAL_ADDR_LEN+1]
DWORD WINAPI GetLastError(void)
#define CRYPT_VERIFYCONTEXT
#define CryptAcquireContext
#define ERROR_BUFFER_OVERFLOW
#define ERROR_NET_WRITE_FAULT
#define ERROR_SHARING_VIOLATION
#define ERROR_TOO_MANY_LINKS
#define ERROR_FILE_EXISTS
#define ERROR_FILE_TOO_LARGE
#define ERROR_LOCK_VIOLATION
#define ERROR_BAD_NET_RESP
#define ERROR_NOT_SAME_DEVICE
#define ERROR_FILE_INVALID
#define ERROR_FILENAME_EXCED_RANGE
#define ERROR_LOCK_FAILED
#define ERROR_ATOMIC_LOCKS_NOT_SUPPORTED
#define ERROR_NOT_A_REPARSE_POINT
#define ERROR_NETWORK_ACCESS_DENIED
#define ERROR_INVALID_REPARSE_DATA
#define ERROR_NETNAME_DELETED