mirror of
https://github.com/samba-team/samba.git
synced 2025-09-25 09:44:20 +03:00
r2700: Fix bug where we could incorrectly set sparse attribute. Don't use
st_blksize, it isn't what you think.... Jeremy. --his line, and those below, will be ignored-- M source/smbd/dosmode.c
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
5d57058d91
commit
0a40c1a50f
@@ -135,8 +135,8 @@ uint32 dos_mode_from_sbuf(connection_struct *conn, SMB_STRUCT_STAT *sbuf)
|
|||||||
if (S_ISDIR(sbuf->st_mode))
|
if (S_ISDIR(sbuf->st_mode))
|
||||||
result = aDIR | (result & aRONLY);
|
result = aDIR | (result & aRONLY);
|
||||||
|
|
||||||
#if defined (HAVE_STAT_ST_BLOCKS) && defined (HAVE_STAT_ST_BLKSIZE)
|
#if defined (HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE)
|
||||||
if (sbuf->st_size > sbuf->st_blocks * (SMB_OFF_T)sbuf->st_blksize) {
|
if (sbuf->st_size > sbuf->st_blocks * (SMB_OFF_T)STAT_ST_BLOCKSIZE) {
|
||||||
result |= FILE_ATTRIBUTE_SPARSE;
|
result |= FILE_ATTRIBUTE_SPARSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user