I've created a directory in /tmp/csum-test on AIX 6.1. Then another under AIX 7.1 host called /tmp/csum-test. There is no files in the directories.
When I run csum -h SHA1 /tmp/csum-test on AIX 6.1 host it gives me a different value then if I run csum -h SHA1 /tmp/csum-test under the AIX 7.1 host. Granted the csum binaries are different however should csum have reported a different value and what is it including in it's comparisons for directories and files?
In simpler terms, what is this command comparing? I've searched around but couldn't find an answer that explicitly outlines the logic.
The reason it does not work on directories is because a very vital part of a directory entry is the first two bytes which is the inode number of an entry.
The first two entries of a directory are named . and ..
So, if either inode numbers are different csum and/or cksum will report generally report different values.
od -dc /some/directory
read: octalDump -decimalCharacter /some/directory
This will output two lines for each entry in the directory /some/directory
The first line: first number is the inode number; second line (ignore first two values (are inode number in character notation) - remaining bytes are the file/directory name)
Example: