nfs4: Fix timespec attribute allocation size
* copying the time attributes was fixed to copy the whole st_?tim timespec struct but the allocation size was still only that of st_?time subfield, which is only a time_t. Signed-off-by: François Revol <[email protected]> Signed-off-by: Pawel Dziepak <[email protected]>
This commit is contained in:
committed by
Pawel Dziepak
parent
2f44d34e5e
commit
fa5d300d6b
@@ -628,16 +628,16 @@ Inode::WriteStat(const struct stat* st, uint32 mask, OpenAttrCookie* cookie)
|
|||||||
if ((mask & B_STAT_ACCESS_TIME) != 0) {
|
if ((mask & B_STAT_ACCESS_TIME) != 0) {
|
||||||
attr[i].fAttribute = FATTR4_TIME_ACCESS_SET;
|
attr[i].fAttribute = FATTR4_TIME_ACCESS_SET;
|
||||||
attr[i].fFreePointer = true;
|
attr[i].fFreePointer = true;
|
||||||
attr[i].fData.fPointer = malloc(sizeof(st->st_atime));
|
attr[i].fData.fPointer = malloc(sizeof(st->st_atim));
|
||||||
memcpy(attr[i].fData.fPointer, &st->st_atime, sizeof(st->st_atim));
|
memcpy(attr[i].fData.fPointer, &st->st_atim, sizeof(st->st_atim));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mask & B_STAT_MODIFICATION_TIME) != 0) {
|
if ((mask & B_STAT_MODIFICATION_TIME) != 0) {
|
||||||
attr[i].fAttribute = FATTR4_TIME_MODIFY_SET;
|
attr[i].fAttribute = FATTR4_TIME_MODIFY_SET;
|
||||||
attr[i].fFreePointer = true;
|
attr[i].fFreePointer = true;
|
||||||
attr[i].fData.fPointer = malloc(sizeof(st->st_mtime));
|
attr[i].fData.fPointer = malloc(sizeof(st->st_mtim));
|
||||||
memcpy(attr[i].fData.fPointer, &st->st_mtime, sizeof(st->st_mtim));
|
memcpy(attr[i].fData.fPointer, &st->st_mtim, sizeof(st->st_mtim));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user