mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
r14946: added a smbcli_ftruncate() call, useful for torture testing
(This used to be commit b8b9acc60003c86fb1f0377b46f65155c3b898a9)
This commit is contained in:
parent
fa91368fb4
commit
8be91f2d0f
@ -576,16 +576,13 @@ NTSTATUS smbcli_setatr(struct smbcli_tree *tree, const char *fname, uint16_t mod
|
||||
time_t t)
|
||||
{
|
||||
union smb_setfileinfo parms;
|
||||
NTSTATUS status;
|
||||
|
||||
parms.setattr.level = RAW_SFILEINFO_SETATTR;
|
||||
parms.setattr.in.file.path = fname;
|
||||
parms.setattr.in.attrib = mode;
|
||||
parms.setattr.in.write_time = t;
|
||||
|
||||
status = smb_raw_setpathinfo(tree, &parms);
|
||||
|
||||
return status;
|
||||
return smb_raw_setpathinfo(tree, &parms);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -596,7 +593,6 @@ NTSTATUS smbcli_fsetatr(struct smbcli_tree *tree, int fnum, uint16_t mode,
|
||||
NTTIME write_time, NTTIME change_time)
|
||||
{
|
||||
union smb_setfileinfo parms;
|
||||
NTSTATUS status;
|
||||
|
||||
parms.basic_info.level = RAW_SFILEINFO_BASIC_INFO;
|
||||
parms.basic_info.in.file.fnum = fnum;
|
||||
@ -606,9 +602,22 @@ NTSTATUS smbcli_fsetatr(struct smbcli_tree *tree, int fnum, uint16_t mode,
|
||||
parms.basic_info.in.write_time = write_time;
|
||||
parms.basic_info.in.change_time = change_time;
|
||||
|
||||
status = smb_raw_setfileinfo(tree, &parms);
|
||||
return smb_raw_setfileinfo(tree, &parms);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
/****************************************************************************
|
||||
truncate a file to a given size
|
||||
****************************************************************************/
|
||||
NTSTATUS smbcli_ftruncate(struct smbcli_tree *tree, int fnum, uint64_t size)
|
||||
{
|
||||
union smb_setfileinfo parms;
|
||||
|
||||
parms.end_of_file_info.level = RAW_SFILEINFO_END_OF_FILE_INFO;
|
||||
parms.end_of_file_info.in.file.fnum = fnum;
|
||||
parms.end_of_file_info.in.size = size;
|
||||
|
||||
return smb_raw_setfileinfo(tree, &parms);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user