We need to validate a Linux configuration file. So far I managed to set a rule to verify that the file contains the correct entries (by checking that every entry is one of our wanted entries, and that we have all entries we want). Now I need to verify that the entries are also in the correct order. Does anyone have any idea how to accomplish this?
The configuration file is the /etc/pam.d/system-auth file which contains:
auth include custom-auth
auth include system-auth-ac
And the lines should be in exact this order. The only alternative I can think of is to compare (diff) the file with a depot file which is exactly how we want it to be, but I'm open for suggestions.