ea: initialize named attr paths
zero-initialize the paths for named attrs, and initialize the file.name instead of using a temporary dst_name Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
7bd70cf488
commit
fd591f92d7
2 changed files with 10 additions and 12 deletions
|
|
@ -217,11 +217,10 @@ static int handle_getexattr(nfs41_upcall *upcall)
|
|||
PFILE_FULL_EA_INFORMATION eainfo, entry_pos;
|
||||
unsigned char *entry_buf, buf[NFS4_EASIZE] = { 0 };
|
||||
nfs41_open_state *state = upcall->state_ref;
|
||||
nfs41_path_fh parent, file;
|
||||
nfs41_path_fh parent = { 0 }, file = { 0 };
|
||||
open_claim4 claim;
|
||||
stateid4 open_stateid;
|
||||
stateid_arg stateid;
|
||||
nfs41_component dst_name;
|
||||
open_delegation4 delegation = { 0 };
|
||||
bool_t eof;
|
||||
uint32_t bytes_read = 0;
|
||||
|
|
@ -244,10 +243,10 @@ static int handle_getexattr(nfs41_upcall *upcall)
|
|||
entry_pos = eainfo = (PFILE_FULL_EA_INFORMATION)entry_buf;
|
||||
|
||||
while (gea != prev) {
|
||||
dst_name.name = gea->EaName;
|
||||
dst_name.len = gea->EaNameLength;
|
||||
file.name.name = gea->EaName;
|
||||
file.name.len = gea->EaNameLength;
|
||||
claim.claim = CLAIM_NULL;
|
||||
claim.u.null.filename = &dst_name;
|
||||
claim.u.null.filename = &file.name;
|
||||
status = nfs41_open(state->session, &parent, &file, &state->owner,
|
||||
&claim, OPEN4_SHARE_ACCESS_READ, OPEN4_SHARE_DENY_BOTH,
|
||||
OPEN4_NOCREATE, UNCHECKED4, 0, TRUE, &open_stateid,
|
||||
|
|
|
|||
|
|
@ -538,10 +538,9 @@ static int handle_setexattr(nfs41_upcall *upcall)
|
|||
nfs41_file_info createattrs, info = { 0 };
|
||||
PFILE_FULL_EA_INFORMATION eainfo =
|
||||
(PFILE_FULL_EA_INFORMATION)args->buf, prev = NULL;
|
||||
nfs41_path_fh parent, file;
|
||||
nfs41_path_fh parent = { 0 }, file = { 0 };
|
||||
open_claim4 claim;
|
||||
stateid4 open_stateid;
|
||||
nfs41_component dst_name;
|
||||
nfs41_write_verf verf;
|
||||
uint32_t bytes_written;
|
||||
UCHAR *buf;
|
||||
|
|
@ -591,10 +590,10 @@ static int handle_setexattr(nfs41_upcall *upcall)
|
|||
status = ERROR_INVALID_DATA;
|
||||
goto out;
|
||||
}
|
||||
dst_name.name = eainfo->EaName;
|
||||
dst_name.len = eainfo->EaNameLength;
|
||||
file.name.name = eainfo->EaName;
|
||||
file.name.len = eainfo->EaNameLength;
|
||||
claim.claim = CLAIM_NULL;
|
||||
claim.u.null.filename = &dst_name;
|
||||
claim.u.null.filename = &file.name;
|
||||
status = nfs41_open(state->session, &parent, &file, &state->owner, &claim,
|
||||
OPEN4_SHARE_ACCESS_WRITE, OPEN4_SHARE_DENY_BOTH, OPEN4_CREATE,
|
||||
UNCHECKED4, &createattrs, TRUE, &open_stateid, &delegation, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue