Take the tour ×  I want to make sure that nobody changed a file.
In order to accomplish that, I want not only to check MD5 sum of
the file, but also check its size, since as far as I understand
this additional simple check can sophisticate falsification by
several digits.  May I trust the size that stat returns? I don't
mean if changes were made to stat itself. I don't go that deep.
But, for instance, may one compromise the file size that stat
returns by hacking the directory file? Or by similar means, that
do not require superuser privileges?  It's Linux.  share|improve
this question add comment  3 Answers  up vote 1 down vote
accepted  You ask if someone may compromise the size of the file
returned by stat by hacking the directory file. No, that's not
possible. The directory is simply is a list of file names and
inode numbers. All of the other file information (owner, group,
mode, size, etc.) is contained in the inode (at least in POSIX
compliant file systems) and that is from where stat collects
this infor