OP_GETATTR queries OWNER and OWNER_GROUP
This commit is contained in:
parent
741e8bf0bf
commit
79455f9855
5 changed files with 22 additions and 4 deletions
|
|
@ -98,7 +98,8 @@ static void init_component_args(
|
|||
| FATTR4_WORD0_FSID | FATTR4_WORD0_FILEID;
|
||||
args->attr_request.arr[1] = FATTR4_WORD1_MODE
|
||||
| FATTR4_WORD1_NUMLINKS | FATTR4_WORD1_TIME_ACCESS
|
||||
| FATTR4_WORD1_TIME_CREATE | FATTR4_WORD1_TIME_MODIFY;
|
||||
| FATTR4_WORD1_TIME_CREATE | FATTR4_WORD1_TIME_MODIFY |
|
||||
FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
|
||||
|
||||
args->getrootattr.attr_request = &args->attr_request;
|
||||
res->root.path = path;
|
||||
|
|
|
|||
|
|
@ -1007,7 +1007,8 @@ void init_getattr_request(bitmap4 *attr_request)
|
|||
FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE;
|
||||
attr_request->arr[1] = FATTR4_WORD1_NUMLINKS |
|
||||
FATTR4_WORD1_TIME_ACCESS | FATTR4_WORD1_TIME_CREATE |
|
||||
FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_MODE;
|
||||
FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_MODE |
|
||||
FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
|
||||
attr_request->arr[2] = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -212,6 +212,10 @@ typedef struct __nfs41_file_info {
|
|||
bool_t symlink_dir;
|
||||
bool_t symlink_support;
|
||||
bool_t link_support;
|
||||
unsigned char owner[NFS4_OPAQUE_LIMIT];
|
||||
uint32_t owner_len;
|
||||
unsigned char owner_group[NFS4_OPAQUE_LIMIT];
|
||||
uint32_t owner_group_len;
|
||||
} nfs41_file_info;
|
||||
|
||||
#endif /* !__NFS41_DAEMON_TYPES_H__ */
|
||||
|
|
|
|||
|
|
@ -1665,6 +1665,18 @@ static bool_t decode_file_attrs(
|
|||
if (!xdr_u_int32_t(xdr, &info->numlinks))
|
||||
return FALSE;
|
||||
}
|
||||
if (attrs->attrmask.arr[1] & FATTR4_WORD1_OWNER) {
|
||||
unsigned char *ptr = &info->owner[0];
|
||||
if (!xdr_bytes(xdr, &ptr, &info->owner_len,
|
||||
NFS4_OPAQUE_LIMIT))
|
||||
return FALSE;
|
||||
}
|
||||
if (attrs->attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) {
|
||||
unsigned char *ptr = &info->owner_group[0];
|
||||
if (!xdr_bytes(xdr, &ptr, &info->owner_group_len,
|
||||
NFS4_OPAQUE_LIMIT))
|
||||
return FALSE;
|
||||
}
|
||||
if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_AVAIL) {
|
||||
if (!xdr_u_hyper(xdr, &info->space_avail))
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -489,13 +489,13 @@ static int handle_readdir(nfs41_upcall *upcall)
|
|||
}
|
||||
}
|
||||
|
||||
entry_buf = malloc(args->buf_len);
|
||||
entry_buf = malloc(max(args->buf_len, 4096));
|
||||
if (entry_buf == NULL) {
|
||||
status = GetLastError();
|
||||
goto out_free_cookie;
|
||||
}
|
||||
fetch_entries:
|
||||
entry_buf_len = args->buf_len;
|
||||
entry_buf_len = max(args->buf_len, 4096);
|
||||
|
||||
init_getattr_request(&attr_request);
|
||||
attr_request.arr[0] |= FATTR4_WORD0_RDATTR_ERROR;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue