Additional hardlink test for check file, fifo or directory service entries

Merged
#124 · Created  · Last updated

Merged pull request

Merged in issue_1074 (pull request #124)

41e495a·Author: ·Closed by: ·2023-07-18

Description

See issue #1074 for some more information.

I add some code to add an additional hardlink test (based on "st_nlink", the number of used hardlinks) similar to the size test (based on "st_size", file size in bytes).

The hardlink statement may be used in a check file, fifo or directory service entry.

  • Add the hardlink test documentation.

  • Add the hardlink test and post proper resource events.

  • Use the hardlink test in the file check.

  • Use the hardlink test in the directory check.

  • Use the hardlink test in the fifo check.

  • Add hardlink to the resource list, resource events are used for nlink to post events.

  • Add the nlink object.

  • Use nlink in the file info.

  • Use nlink in the directory info.

  • Use nlink in the fifo info.

  • Use the nlink object in the service data.

  • Use hardlink in the xml file output.

  • Use hardlink in the xml directory output.

  • Use hardlink in the xml fifo output.

  • Use hardlink in the file output.

  • Use hardlink in the directory output.

  • Use hardlink in the fifo output.

  • Use nlink in print service to include the defined hardlink rules in the output.

  • Add the token hardlink and hardlinks.

  • Add nlink object handling.

  • Add the hardlink token.

  • Add the hardlink test.

  • Use hardlink in the file tests.

  • Use hardlink in the directory tests.

  • Use hardlink in the fifo tests.

  • Use nlink in the object initialization.

  • Use the nlink object in the service hardlink debug data.

  • Initialize the nlink file value.

  • Initialize the nlink directory value.

  • Initialize the nlink fifo value.

  • Use long long instead of nlink_t, the number of used hard links does not fit to nlink_t, sometimes.

  • Indent the code and use long long with nlink. The number of used hard links does not fit to nlink_t, sometimes.

  • Validate the values.

  • Use -1 for invalid values.

  • Free the allocated nlink list.

The used data from "nlink_st" (see "/usr/include/sys/stat.h") based on "nlink_t" is a "unsigned short" only, but in some/the most file systems the data can be above "65535", therefore "long long" is more useful. Filesystems like the MacOS hfs do not support hardlinks well and count files and folder in "nlink_st".

The "Event_Resource" event is used to handle the events, therefore "Resource_HardLink" was added to "Resource_Type" as a placeholder.

A suggestion only,
with regards,
Lutz

0 attachments

0 comments

Loading commits...