Difference between
modified post f19bdf by Anonymous on Wed 10th Apr 2024 16:30
original post 9e5dd4 by Anonymous on Wed 10th Apr 2024 00:45
Download diff
Show
old version |
new version |
both versions
| 1 | - | diff --git a/daemon/name_cache.c b/daemon/name_cache.c | |
| 1 | + | diff --git a/daemon/getattr.c b/daemon/getattr.c | |
| 2 | - | index 6e9f7bc..39407c4 100644 | |
| 2 | + | index 6708702..ef4507e 100644 | |
| 3 | - | --- a/daemon/name_cache.c | |
| 3 | + | --- a/daemon/getattr.c | |
| 4 | - | +++ b/daemon/name_cache.c | |
| 4 | + | +++ b/daemon/getattr.c | |
| 5 | - | @@ -339,14 +339,31 @@ static void copy_attrs( | |
| 5 | + | @@ -149,7 +149,7 @@ static int handle_getattr(void *daemon_context, nfs41_upcall *upcall) | |
| 6 | - | OUT nfs41_file_info *dst, | |
| 6 | + | ||
| 7 | - | IN const struct attr_cache_entry *src) | |
| 7 | + | switch (args->query_class) { | |
| 8 | - | { | |
| 8 | + | case FileBasicInformation: | |
| 9 | - | + dst->attrmask.count = 2; | |
| 9 | + | - nfs_to_basic_info(&info, &args->basic_info); | |
| 10 | - | + dst->attrmask.arr[0] = FATTR4_WORD0_TYPE | FATTR4_WORD0_CHANGE | |
| 10 | + | + nfs_to_basic_info(state->file.name.name, &info, &args->basic_info); | |
| 11 | - | + | FATTR4_WORD0_SIZE | FATTR4_WORD0_FILEID | |
| 11 | + | args->ctime = info.change; | |
| 12 | - | + | FATTR4_WORD0_HIDDEN | FATTR4_WORD0_ARCHIVE; | |
| 12 | + | break; | |
| 13 | - | + dst->attrmask.arr[1] = FATTR4_WORD1_MODE | |
| 13 | + | case FileStandardInformation: | |
| 14 | - | + | FATTR4_WORD1_NUMLINKS | |
| 14 | + | @@ -164,7 +164,7 @@ static int handle_getattr(void *daemon_context, nfs41_upcall *upcall) | |
| 15 | - | + | FATTR4_WORD1_SYSTEM; | |
| 15 | + | args->intr_info.IndexNumber.QuadPart = info.fileid; | |
| 16 | - | + | |
| 16 | + | break; | |
| 17 | - | dst->change = src->change; | |
| 17 | + | case FileNetworkOpenInformation: | |
| 18 | - | dst->size = src->size; | |
| 18 | + | - nfs_to_network_openinfo(&info, &args->network_info); | |
| 19 | - | + if (!((src->time_access_s == 0) && (src->time_access_ns == 0))) { | |
| 19 | + | + nfs_to_network_openinfo(state->file.name.name, &info, &args->network_info); | |
| 20 | - | + dst->attrmask.arr[1] |= FATTR4_WORD1_TIME_ACCESS; | |
| 20 | + | break; | |
| 21 | - | dst->time_access.seconds = src->time_access_s; | |
| 21 | + | default: | |
| 22 | - | dst->time_access.nseconds = src->time_access_ns; | |
| 22 | + | eprintf("unhandled file query class %d\n", args->query_class); | |
| 23 | - | + } | |
| 23 | + | diff --git a/daemon/name_cache.c b/daemon/name_cache.c | |
| 24 | - | + if (!((src->time_create_s == 0) && (src->time_create_ns == 0))) { | |
| 24 | + | index 6e9f7bc..7ac6050 100644 | |
| 25 | - | + dst->attrmask.arr[1] |= FATTR4_WORD1_TIME_CREATE; | |
| 25 | + | --- a/daemon/name_cache.c | |
| 26 | - | dst->time_create.seconds = src->time_create_s; | |
| 26 | + | +++ b/daemon/name_cache.c | |
| 27 | - | dst->time_create.nseconds = src->time_create_ns; | |
| 27 | + | @@ -339,14 +339,31 @@ static void copy_attrs( | |
| 28 | - | + } | |
| 28 | + | OUT nfs41_file_info *dst, | |
| 29 | - | + if (!((src->time_modify_s == 0) && (src->time_modify_ns == 0))) { | |
| 29 | + | IN const struct attr_cache_entry *src) | |
| 30 | - | + dst->attrmask.arr[1] |= FATTR4_WORD1_TIME_MODIFY; | |
| 30 | + | { | |
| 31 | - | dst->time_modify.seconds = src->time_modify_s; | |
| 31 | + | + dst->attrmask.count = 2; | |
| 32 | - | dst->time_modify.nseconds = src->time_modify_ns; | |
| 32 | + | + dst->attrmask.arr[0] = FATTR4_WORD0_TYPE | FATTR4_WORD0_CHANGE | |
| 33 | - | + } | |
| 33 | + | + | FATTR4_WORD0_SIZE | FATTR4_WORD0_FILEID | |
| 34 | - | dst->type = src->type; | |
| 34 | + | + | FATTR4_WORD0_HIDDEN | FATTR4_WORD0_ARCHIVE; | |
| 35 | - | dst->numlinks = src->numlinks; | |
| 35 | + | + dst->attrmask.arr[1] = FATTR4_WORD1_MODE | |
| 36 | - | dst->mode = src->mode; | |
| 36 | + | + | FATTR4_WORD1_NUMLINKS | |
| 37 | - | @@ -373,14 +390,6 @@ static void copy_attrs( | |
| 37 | + | + | FATTR4_WORD1_SYSTEM; | |
| 38 | - | dst->system = src->system; | |
| 38 | + | + | |
| 39 | - | dst->archive = src->archive; | |
| 39 | + | dst->change = src->change; | |
| 40 | - | ||
| 40 | + | dst->size = src->size; | |
| 41 | - | - dst->attrmask.count = 2; | |
| 41 | + | + if (!((src->time_access_s == 0) && (src->time_access_ns == 0))) { | |
| 42 | - | - dst->attrmask.arr[0] = FATTR4_WORD0_TYPE | FATTR4_WORD0_CHANGE | |
| 42 | + | + dst->attrmask.arr[1] |= FATTR4_WORD1_TIME_ACCESS; | |
| 43 | - | - | FATTR4_WORD0_SIZE | FATTR4_WORD0_FILEID | |
| 43 | + | dst->time_access.seconds = src->time_access_s; | |
| 44 | - | - | FATTR4_WORD0_HIDDEN | FATTR4_WORD0_ARCHIVE; | |
| 44 | + | dst->time_access.nseconds = src->time_access_ns; | |
| 45 | - | - dst->attrmask.arr[1] = FATTR4_WORD1_MODE | |
| 45 | + | + } | |
| 46 | - | - | FATTR4_WORD1_NUMLINKS | FATTR4_WORD1_TIME_ACCESS | |
| 46 | + | + if (!((src->time_create_s == 0) && (src->time_create_ns == 0))) { | |
| 47 | - | - | FATTR4_WORD1_TIME_CREATE | FATTR4_WORD1_TIME_MODIFY | |
| 47 | + | + dst->attrmask.arr[1] |= FATTR4_WORD1_TIME_CREATE; | |
| 48 | - | - | FATTR4_WORD1_SYSTEM; | |
| 48 | + | dst->time_create.seconds = src->time_create_s; | |
| 49 | - | if (dst->owner) | |
| 49 | + | dst->time_create.nseconds = src->time_create_ns; | |
| 50 | - | dst->attrmask.arr[1] |= FATTR4_WORD1_OWNER; | |
| 50 | + | + } | |
| 51 | - | if (dst->owner_group) | |
| 51 | + | + if (!((src->time_modify_s == 0) && (src->time_modify_ns == 0))) { | |
| 52 | - | diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c | |
| 52 | + | + dst->attrmask.arr[1] |= FATTR4_WORD1_TIME_MODIFY; | |
| 53 | - | index 90f0e61..e5b0409 100644 | |
| 53 | + | dst->time_modify.seconds = src->time_modify_s; | |
| 54 | - | --- a/daemon/nfs41_xdr.c | |
| 54 | + | dst->time_modify.nseconds = src->time_modify_ns; | |
| 55 | - | +++ b/daemon/nfs41_xdr.c | |
| 55 | + | + } | |
| 56 | - | @@ -2344,6 +2344,7 @@ static bool_t decode_readdir_entry( | |
| 56 | + | dst->type = src->type; | |
| 57 | - | xdrmem_create(&fattr_xdr, (char *)attrs.attr_vals, attrs.attr_vals_len, XDR_DECODE); | |
| 57 | + | dst->numlinks = src->numlinks; | |
| 58 | - | if (!(decode_file_attrs(&fattr_xdr, &attrs, &entry->attr_info))) | |
| 58 | + | dst->mode = src->mode; | |
| 59 | - | entry->attr_info.rdattr_error = NFS4ERR_BADXDR; | |
| 59 | + | @@ -373,14 +390,6 @@ static void copy_attrs( | |
| 60 | - | + (void)memcpy(&entry->attr_info.attrmask, &attrs.attrmask, sizeof(bitmap4)); | |
| 60 | + | dst->system = src->system; | |
| 61 | - | StringCchCopyA(entry->name, name_len, (STRSAFE_LPCSTR)name); | |
| 61 | + | dst->archive = src->archive; | |
| 62 | 62 | ||
| 63 | - | it->buf_pos += (size_t)entry_len + name_len; | |
| 63 | + | - dst->attrmask.count = 2; | |
| 64 | - | diff --git a/daemon/readdir.c b/daemon/readdir.c | |
| 64 | + | - dst->attrmask.arr[0] = FATTR4_WORD0_TYPE | FATTR4_WORD0_CHANGE | |
| 65 | - | index 07607ef..65ce323 100644 | |
| 65 | + | - | FATTR4_WORD0_SIZE | FATTR4_WORD0_FILEID | |
| 66 | - | --- a/daemon/readdir.c | |
| 66 | + | - | FATTR4_WORD0_HIDDEN | FATTR4_WORD0_ARCHIVE; | |
| 67 | - | +++ b/daemon/readdir.c | |
| 67 | + | - dst->attrmask.arr[1] = FATTR4_WORD1_MODE | |
| 68 | - | @@ -323,15 +323,51 @@ static void readdir_copy_dir_info( | |
| 68 | + | - | FATTR4_WORD1_NUMLINKS | FATTR4_WORD1_TIME_ACCESS | |
| 69 | - | IN PFILE_DIR_INFO_UNION info) | |
| 69 | + | - | FATTR4_WORD1_TIME_CREATE | FATTR4_WORD1_TIME_MODIFY | |
| 70 | - | { | |
| 70 | + | - | FATTR4_WORD1_SYSTEM; | |
| 71 | - | info->fdi.FileIndex = (ULONG)entry->attr_info.fileid; | |
| 71 | + | if (dst->owner) | |
| 72 | - | + | |
| 72 | + | dst->attrmask.arr[1] |= FATTR4_WORD1_OWNER; | |
| 73 | - | + uint32_t attrmask_arr1 = entry->attr_info.attrmask.arr[1]; | |
| 73 | + | if (dst->owner_group) | |
| 74 | - | +#if 0 /* hack */ | |
| 74 | + | diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c | |
| 75 | - | + attrmask_arr1 |= FATTR4_WORD1_TIME_ACCESS | |
| 75 | + | index 74d6e99..4f9bb65 100644 | |
| 76 | - | + | FATTR4_WORD1_TIME_CREATE | |
| 76 | + | --- a/daemon/nfs41_ops.c | |
| 77 | - | + | FATTR4_WORD1_TIME_MODIFY; | |
| 77 | + | +++ b/daemon/nfs41_ops.c | |
| 78 | - | +#endif | |
| 78 | + | @@ -514,7 +514,8 @@ int nfs41_open( | |
| 79 | - | + | |
| 79 | + | ||
| 80 | - | + if (attrmask_arr1 & FATTR4_WORD1_TIME_CREATE) { | |
| 80 | + | compound_add_op(&compound, OP_OPEN, &open_args, &open_res); | |
| 81 | - | nfs_time_to_file_time(&entry->attr_info.time_create, | |
| 81 | + | open_args.seqid = 0; | |
| 82 | - | &info->fdi.CreationTime); | |
| 82 | + | -#ifdef DISABLE_FILE_DELEGATIONS | |
| 83 | - | + } | |
| 83 | + | +//#ifdef DISABLE_FILE_DELEGATIONS | |
| 84 | - | + else { | |
| 84 | + | +#if 1 | |
| 85 | - | + DPRINTF(0, ("readdir_copy_dir_info: time_create not set\n")); | |
| 85 | + | open_args.share_access = allow | OPEN4_SHARE_ACCESS_WANT_NO_DELEG; | |
| 86 | - | + info->fdi.CreationTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 86 | + | #else | |
| 87 | - | + } | |
| 87 | + | open_args.share_access = allow; | |
| 88 | - | + | |
| 88 | + | diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c | |
| 89 | - | + if (attrmask_arr1 & FATTR4_WORD1_TIME_ACCESS) { | |
| 89 | + | index 90f0e61..1b0abf1 100644 | |
| 90 | - | nfs_time_to_file_time(&entry->attr_info.time_access, | |
| 90 | + | --- a/daemon/nfs41_xdr.c | |
| 91 | - | &info->fdi.LastAccessTime); | |
| 91 | + | +++ b/daemon/nfs41_xdr.c | |
| 92 | - | + } | |
| 92 | + | @@ -2344,6 +2344,7 @@ static bool_t decode_readdir_entry( | |
| 93 | - | + else { | |
| 93 | + | xdrmem_create(&fattr_xdr, (char *)attrs.attr_vals, attrs.attr_vals_len, XDR_DECODE); | |
| 94 | - | + DPRINTF(0, ("readdir_copy_dir_info: time_access not set\n")); | |
| 94 | + | if (!(decode_file_attrs(&fattr_xdr, &attrs, &entry->attr_info))) | |
| 95 | - | + info->fdi.LastAccessTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 95 | + | entry->attr_info.rdattr_error = NFS4ERR_BADXDR; | |
| 96 | - | + } | |
| 96 | + | + (void)memcpy(&entry->attr_info.attrmask, &attrs.attrmask, sizeof(bitmap4)); | |
| 97 | - | + | |
| 97 | + | StringCchCopyA(entry->name, name_len, (STRSAFE_LPCSTR)name); | |
| 98 | - | + if (attrmask_arr1 & FATTR4_WORD1_TIME_MODIFY) { | |
| 98 | + | ||
| 99 | - | nfs_time_to_file_time(&entry->attr_info.time_modify, | |
| 99 | + | it->buf_pos += (size_t)entry_len + name_len; | |
| 100 | - | &info->fdi.LastWriteTime); | |
| 100 | + | diff --git a/daemon/open.c b/daemon/open.c | |
| 101 | - | + } | |
| 101 | + | index 15c9c28..40d9204 100644 | |
| 102 | - | + else { | |
| 102 | + | --- a/daemon/open.c | |
| 103 | - | + DPRINTF(0, ("readdir_copy_dir_info: time_modify not set\n")); | |
| 103 | + | +++ b/daemon/open.c | |
| 104 | - | + info->fdi.LastWriteTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 104 | + | @@ -745,7 +745,7 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall) | |
| 105 | - | + } | |
| 105 | + | status = map_symlink_errors(status); | |
| 106 | - | + | |
| 106 | + | goto out_free_state; | |
| 107 | - | /* XXX: was using 'change' attr, but that wasn't giving a time */ | |
| 107 | + | } | |
| 108 | - | + if (attrmask_arr1 & FATTR4_WORD1_TIME_MODIFY) { | |
| 108 | + | - nfs_to_basic_info(&info, &args->basic_info); | |
| 109 | - | nfs_time_to_file_time(&entry->attr_info.time_modify, | |
| 109 | + | + nfs_to_basic_info(state->file.name.name, &info, &args->basic_info); | |
| 110 | - | &info->fdi.ChangeTime); | |
| 110 | + | nfs_to_standard_info(&info, &args->std_info); | |
| 111 | - | + } | |
| 111 | + | args->mode = info.mode; | |
| 112 | - | + else { | |
| 112 | + | args->changeattr = info.change; | |
| 113 | - | + DPRINTF(0, ("readdir_copy_dir_info: time_modify2 not set\n")); | |
| 113 | + | @@ -756,7 +756,7 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall) | |
| 114 | - | + info->fdi.ChangeTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 114 | + | goto out_free_state; | |
| 115 | - | + } | |
| 115 | + | } | |
| 116 | - | + | |
| 116 | + | ||
| 117 | - | info->fdi.EndOfFile.QuadPart = | |
| 117 | + | - nfs_to_basic_info(&info, &args->basic_info); | |
| 118 | - | info->fdi.AllocationSize.QuadPart = | |
| 118 | + | + nfs_to_basic_info(state->file.name.name, &info, &args->basic_info); | |
| 119 | - | entry->attr_info.size; | |
| 119 | + | nfs_to_standard_info(&info, &args->std_info); | |
| 120 | - | diff --git a/daemon/util.c b/daemon/util.c | |
| 120 | + | args->mode = info.mode; | |
| 121 | - | index 382944a..b1a848b 100644 | |
| 121 | + | args->changeattr = info.change; | |
| 122 | - | --- a/daemon/util.c | |
| 122 | + | @@ -941,7 +941,7 @@ supersede_retry: | |
| 123 | - | +++ b/daemon/util.c | |
| 123 | + | status = nfs_to_windows_error(status, ERROR_FILE_NOT_FOUND); | |
| 124 | - | @@ -167,11 +167,39 @@ void nfs_to_basic_info( | |
| 124 | + | goto out_free_state; | |
| 125 | - | IN const nfs41_file_info *info, | |
| 125 | + | } else { | |
| 126 | - | OUT PFILE_BASIC_INFO basic_out) | |
| 126 | + | - nfs_to_basic_info(&info, &args->basic_info); | |
| 127 | - | { | |
| 127 | + | + nfs_to_basic_info(state->file.name.name, &info, &args->basic_info); | |
| 128 | - | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_CREATE) { | |
| 128 | + | nfs_to_standard_info(&info, &args->std_info); | |
| 129 | - | nfs_time_to_file_time(&info->time_create, &basic_out->CreationTime); | |
| 129 | + | args->mode = info.mode; | |
| 130 | - | + } | |
| 130 | + | args->changeattr = info.change; | |
| 131 | - | + else { | |
| 131 | + | diff --git a/daemon/readdir.c b/daemon/readdir.c | |
| 132 | - | + DPRINTF(0, ("nfs_to_basic_info: time_create not set\n")); | |
| 132 | + | index 07607ef..fd9cce2 100644 | |
| 133 | - | + basic_out->CreationTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 133 | + | --- a/daemon/readdir.c | |
| 134 | - | + } | |
| 134 | + | +++ b/daemon/readdir.c | |
| 135 | + | @@ -323,15 +323,55 @@ static void readdir_copy_dir_info( | |
| 135 | 139 | + | |
| 136 | - | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_ACCESS) { | |
| 140 | + | + uint32_t attrmask_arr1 = entry->attr_info.attrmask.arr[1]; | |
| 137 | - | nfs_time_to_file_time(&info->time_access, &basic_out->LastAccessTime); | |
| 141 | + | +#if 0 /* hack */ | |
| 142 | + | + attrmask_arr1 |= FATTR4_WORD1_TIME_ACCESS | |
| 138 | 150 | + } | |
| 139 | 151 | + else { | |
| 140 | - | + DPRINTF(0, ("nfs_to_basic_info: time_access not set\n")); | |
| 152 | + | + DPRINTF(0, ("readdir_copy_dir_info(entry->name='%s'): " | |
| 141 | - | + basic_out->LastAccessTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 153 | + | + "time_create not set\n", entry->name)); | |
| 154 | + | + info->fdi.CreationTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 142 | 155 | + } | |
| 143 | 156 | + | |
| 144 | - | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_MODIFY) { | |
| 157 | + | + if (attrmask_arr1 & FATTR4_WORD1_TIME_ACCESS) { | |
| 145 | - | nfs_time_to_file_time(&info->time_modify, &basic_out->LastWriteTime); | |
| 158 | + | nfs_time_to_file_time(&entry->attr_info.time_access, | |
| 159 | + | &info->fdi.LastAccessTime); | |
| 146 | 160 | + } | |
| 147 | 161 | + else { | |
| 148 | - | + DPRINTF(0, ("nfs_to_basic_info: time_modify not set\n")); | |
| 162 | + | + DPRINTF(0, ("readdir_copy_dir_info(entry->name='%s'): " | |
| 149 | - | + basic_out->LastWriteTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 163 | + | + "time_access not set\n", entry->name)); | |
| 164 | + | + info->fdi.LastAccessTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 150 | 165 | + } | |
| 151 | 166 | + | |
| 152 | - | /* XXX: was using 'change' attr, but that wasn't giving a time */ | |
| 167 | + | + if (attrmask_arr1 & FATTR4_WORD1_TIME_MODIFY) { | |
| 153 | - | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_MODIFY) { | |
| 168 | + | nfs_time_to_file_time(&entry->attr_info.time_modify, | |
| 154 | - | nfs_time_to_file_time(&info->time_modify, &basic_out->ChangeTime); | |
| 169 | + | &info->fdi.LastWriteTime); | |
| 155 | 170 | + } | |
| 156 | 171 | + else { | |
| 157 | - | + DPRINTF(0, ("nfs_to_basic_info: time_modify2 not set\n")); | |
| 172 | + | + DPRINTF(0, ("readdir_copy_dir_info(entry->name='%s'): " | |
| 158 | - | + basic_out->ChangeTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 173 | + | + "time_modify not set\n", entry->name)); | |
| 174 | + | + info->fdi.LastWriteTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 159 | 175 | + } | |
| 160 | 176 | + | |
| 161 | - | basic_out->FileAttributes = nfs_file_info_to_attributes(info); | |
| 177 | + | /* XXX: was using 'change' attr, but that wasn't giving a time */ | |
| 162 | - | } | |
| 178 | + | + if (attrmask_arr1 & FATTR4_WORD1_TIME_MODIFY) { | |
| 163 | - | ||
| 179 | + | nfs_time_to_file_time(&entry->attr_info.time_modify, | |
| 164 | - | @@ -193,12 +221,39 @@ void nfs_to_network_openinfo( | |
| 180 | + | &info->fdi.ChangeTime); | |
| 171 | 181 | + } | |
| 172 | 182 | + else { | |
| 173 | - | + DPRINTF(0, ("nfs_to_network_openinfo: time_create not set\n")); | |
| 183 | + | + DPRINTF(0, ("readdir_copy_dir_info(entry->name='%s'): " | |
| 174 | - | + net_out->CreationTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 184 | + | + "time_modify2 not set\n", entry->name)); | |
| 185 | + | + info->fdi.ChangeTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 175 | 186 | + } | |
| 176 | 187 | + | |
| 177 | - | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_ACCESS) { | |
| 188 | + | info->fdi.EndOfFile.QuadPart = | |
| 178 | - | nfs_time_to_file_time(&info->time_access, &net_out->LastAccessTime); | |
| 189 | + | info->fdi.AllocationSize.QuadPart = | |
| 179 | - | + } | |
| 190 | + | entry->attr_info.size; | |
| 180 | - | + else { | |
| 191 | + | diff --git a/daemon/util.c b/daemon/util.c | |
| 181 | - | + DPRINTF(0, ("nfs_to_network_openinfo: time_access not set\n")); | |
| 192 | + | index 382944a..1b92c60 100644 | |
| 182 | - | + net_out->LastAccessTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 193 | + | --- a/daemon/util.c | |
| 183 | - | + } | |
| 194 | + | +++ b/daemon/util.c | |
| 184 | - | + | |
| 195 | + | @@ -164,14 +164,47 @@ ULONG nfs_file_info_to_attributes( | |
| 185 | - | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_MODIFY) { | |
| 196 | + | } | |
| 186 | - | nfs_time_to_file_time(&info->time_modify, &net_out->LastWriteTime); | |
| 197 | + | ||
| 198 | + | void nfs_to_basic_info( | |
| 187 | 205 | + } | |
| 188 | 206 | + else { | |
| 189 | - | + DPRINTF(0, ("nfs_to_network_openinfo: time_modify not set\n")); | |
| 207 | + | + DPRINTF(0, ("nfs_to_basic_info(name='%s'): " | |
| 190 | - | + net_out->LastWriteTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 208 | + | + "time_create not set\n", name)); | |
| 209 | + | + basic_out->CreationTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 191 | 210 | + } | |
| 192 | 211 | + | |
| 193 | - | /* XXX: was using 'change' attr, but that wasn't giving a time */ | |
| 212 | + | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_ACCESS) { | |
| 213 | + | nfs_time_to_file_time(&info->time_access, &basic_out->LastAccessTime); | |
| 196 | 214 | + } | |
| 197 | 215 | + else { | |
| 198 | - | + DPRINTF(0, ("nfs_to_network_openinfo: time_modify2 not set\n")); | |
| 216 | + | + DPRINTF(0, ("nfs_to_basic_info(name='%s'): " | |
| 199 | - | + net_out->ChangeTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 217 | + | + "time_access not set\n", name)); | |
| 218 | + | + basic_out->LastAccessTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 200 | 219 | + } | |
| 201 | 220 | + | |
| 202 | - | net_out->AllocationSize.QuadPart = | |
| 221 | + | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_MODIFY) { | |
| 203 | - | net_out->EndOfFile.QuadPart = (LONGLONG)info->size; | |
| 222 | + | nfs_time_to_file_time(&info->time_modify, &basic_out->LastWriteTime); | |
| 204 | - | net_out->FileAttributes = nfs_file_info_to_attributes(info); | |
| 223 | + | + } | |
| 205 | - | diff --git a/daemon/util.h b/daemon/util.h | |
| 224 | + | + else { | |
| 206 | - | index bc12f55..f117894 100644 | |
| 225 | + | + DPRINTF(0, ("nfs_to_basic_info(name='%s'): " | |
| 207 | - | --- a/daemon/util.h | |
| 226 | + | + "time_modify not set\n", name)); | |
| 208 | - | +++ b/daemon/util.h | |
| 227 | + | + basic_out->LastWriteTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 209 | - | @@ -32,6 +32,12 @@ struct __nfs41_session; | |
| 228 | + | + } | |
| 218 | 229 | + | |
| 219 | - | int safe_read(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len); | |
| 230 | + | /* XXX: was using 'change' attr, but that wasn't giving a time */ | |
| 220 | - | int safe_write(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len); | |
| 231 | + | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_MODIFY) { | |
| 221 | - | int get_name(unsigned char **pos, uint32_t *remaining, const char **out_name); | |
| 232 | + | nfs_time_to_file_time(&info->time_modify, &basic_out->ChangeTime); | |
| 222 | - | ||
| 233 | + | + } | |
| 223 | - | ||
| 234 | + | + else { | |
| 224 | - | ||
| 235 | + | + DPRINTF(0, ("nfs_to_basic_info(name='%s'): " | |
| 225 | - | ||
| 236 | + | + "time_modify2 not set\n", name)); | |
| 226 | - | ||
| 237 | + | + basic_out->ChangeTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 227 | - | ||
| 238 | + | + } | |
| 228 | - | ||
| 239 | + | + | |
| 229 | - | ||
| 240 | + | basic_out->FileAttributes = nfs_file_info_to_attributes(info); | |
| 230 | - | ||
| 241 | + | } | |
| 231 | 242 | ||
| 232 | - | ||
| 243 | + | @@ -190,15 +223,43 @@ void nfs_to_standard_info( | |
| 233 | - | ||
| 244 | + | } | |
| 234 | 245 | ||
| 235 | - | ||
| 246 | + | void nfs_to_network_openinfo( | |
| 236 | - | ||
| 247 | + | + IN const char *name, | |
| 237 | - | ||
| 248 | + | IN const nfs41_file_info *info, | |
| 238 | - | ||
| 249 | + | OUT PFILE_NETWORK_OPEN_INFORMATION net_out) | |
| 239 | - | ||
| 250 | + | { | |
| 240 | - | ||
| 251 | + | - | |
| 241 | - | ||
| 252 | + | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_CREATE) { | |
| 242 | - | ||
| 253 | + | nfs_time_to_file_time(&info->time_create, &net_out->CreationTime); | |
| 243 | - | ||
| 254 | + | + } | |
| 244 | - | ||
| 255 | + | + else { | |
| 245 | - | ||
| 256 | + | + DPRINTF(0, ("nfs_to_network_openinfo(name='%s'): time_create not set\n", name)); | |
| 246 | - | ||
| 257 | + | + net_out->CreationTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 247 | - | ||
| 258 | + | + } | |
| 248 | - | ||
| 259 | + | + | |
| 249 | - | ||
| 260 | + | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_ACCESS) { | |
| 250 | - | ||
| 261 | + | nfs_time_to_file_time(&info->time_access, &net_out->LastAccessTime); | |
| 251 | - | ||
| 262 | + | + } | |
| 252 | - | ||
| 263 | + | + else { | |
| 253 | - | ||
| 264 | + | + DPRINTF(0, ("nfs_to_network_openinfo(name='%s'): time_access not set\n", name)); | |
| 254 | - | ||
| 265 | + | + net_out->LastAccessTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 255 | - | ||
| 266 | + | + } | |
| 256 | - | ||
| 267 | + | + | |
| 257 | - | ||
| 268 | + | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_MODIFY) { | |
| 258 | - | ||
| 269 | + | nfs_time_to_file_time(&info->time_modify, &net_out->LastWriteTime); | |
| 259 | - | ||
| 270 | + | + } | |
| 260 | - | ||
| 271 | + | + else { | |
| 261 | - | ||
| 272 | + | + DPRINTF(0, ("nfs_to_network_openinfo(name='%s'): time_modify not set\n", name)); | |
| 262 | - | ||
| 273 | + | + net_out->LastWriteTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 263 | - | ||
| 274 | + | + } | |
| 264 | - | ||
| 275 | + | + | |
| 265 | - | ||
| 276 | + | /* XXX: was using 'change' attr, but that wasn't giving a time */ | |
| 266 | - | ||
| 277 | + | + if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_MODIFY) { | |
| 267 | - | ||
| 278 | + | nfs_time_to_file_time(&info->time_modify, &net_out->ChangeTime); | |
| 268 | - | ||
| 279 | + | + } | |
| 269 | - | ||
| 280 | + | + else { | |
| 270 | - | ||
| 281 | + | + DPRINTF(0, ("nfs_to_network_openinfo(name='%s'): time_modify2 not set\n", name)); | |
| 271 | - | ||
| 282 | + | + net_out->ChangeTime.QuadPart = FILE_INFO_TIME_NOT_SET; | |
| 272 | - | ||
| 283 | + | + } | |
| 273 | - | ||
| 284 | + | + | |
| 274 | - | ||
| 285 | + | net_out->AllocationSize.QuadPart = | |
| 275 | - | ||
| 286 | + | net_out->EndOfFile.QuadPart = (LONGLONG)info->size; | |
| 276 | - | ||
| 287 | + | net_out->FileAttributes = nfs_file_info_to_attributes(info); | |
| 277 | - | ||
| 288 | + | diff --git a/daemon/util.h b/daemon/util.h | |
| 278 | - | ||
| 289 | + | index bc12f55..952cb19 100644 | |
| 279 | - | ||
| 290 | + | --- a/daemon/util.h | |
| 280 | - | ||
| 291 | + | +++ b/daemon/util.h | |
| 281 | - | ||
| 292 | + | @@ -32,6 +32,12 @@ struct __nfs41_session; | |
| 282 | - | ||
| 293 | + | struct __nfs41_write_verf; | |
| 283 | - | ||
| 294 | + | enum stable_how4; | |
| 284 | 295 | ||
| 285 | - | ||
| 296 | + | +/* | |
| 286 | - | ||
| 297 | + | + * LargeInteger.QuadPart value to indicate a time value was not | |
| 287 | - | ||
| 298 | + | + * available | |
| 288 | - | ||
| 299 | + | + */ | |
| 289 | - | ||
| 300 | + | +#define FILE_INFO_TIME_NOT_SET (0LL) | |
| 290 | - | ||
| 301 | + | + | |
| 291 | - | ||
| 302 | + | int safe_read(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len); | |
| 292 | - | ||
| 303 | + | int safe_write(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len); | |
| 293 | - | ||
| 304 | + | int get_name(unsigned char **pos, uint32_t *remaining, const char **out_name); | |
| 294 | - | ||
| 305 | + | @@ -100,12 +106,14 @@ static __inline void bitmap_intersect( | |
| 295 | - | ||
| 306 | + | ULONG nfs_file_info_to_attributes( | |
| 296 | - | ||
| 307 | + | IN const nfs41_file_info *info); | |
| 297 | - | ||
| 308 | + | void nfs_to_basic_info( | |
| 298 | - | ||
| 309 | + | + IN const char *name, | |
| 299 | - | ||
| 310 | + | IN const nfs41_file_info *info, | |
| 300 | - | ||
| 311 | + | OUT PFILE_BASIC_INFO basic_out); | |
| 301 | - | ||
| 312 | + | void nfs_to_standard_info( | |
| 302 | - | ||
| 313 | + | IN const nfs41_file_info *info, | |
| 303 | - | ||
| 314 | + | OUT PFILE_STANDARD_INFO std_out); | |
| 304 | - | ||
| 315 | + | void nfs_to_network_openinfo( | |
| 305 | - | ||
| 316 | + | + IN const char *name, | |
| 306 | - | ||
| 317 | + | IN const nfs41_file_info *info, | |
| 307 | - | ||
| 318 | + | OUT PFILE_NETWORK_OPEN_INFORMATION std_out); | |
| 308 | - | ||
| 319 | + | void nfs41_file_info_cpy( | |
| 309 | 320 |
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
nrubsig.kpaste.net RSS