1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +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 used to be commit 0a40c1a50f)
This commit is contained in:
Jeremy Allison 2004-09-27 23:57:59 +00:00 committed by Gerald (Jerry) Carter
parent 2d5bf9ec40
commit 8df096a75e

View File

@ -135,8 +135,8 @@ uint32 dos_mode_from_sbuf(connection_struct *conn, SMB_STRUCT_STAT *sbuf)
if (S_ISDIR(sbuf->st_mode))
result = aDIR | (result & aRONLY);
#if defined (HAVE_STAT_ST_BLOCKS) && defined (HAVE_STAT_ST_BLKSIZE)
if (sbuf->st_size > sbuf->st_blocks * (SMB_OFF_T)sbuf->st_blksize) {
#if defined (HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE)
if (sbuf->st_size > sbuf->st_blocks * (SMB_OFF_T)STAT_ST_BLOCKSIZE) {
result |= FILE_ATTRIBUTE_SPARSE;
}
#endif