Suggestion on the 'Ensure All Files Are Owned...' items

Steve Grubb sgrubb at redhat.com
Tue Jul 23 20:04:16 UTC 2013


On Tuesday, July 23, 2013 03:30:45 PM Steve Grubb wrote:

> I'd also be curious if the find command gets it right.

      setpwent ();
      while ((pw = getpwent ()) != NULL)
        {
          if ((unsigned) pw->pw_uid >= uid_allocated)
            {
              unsigned new_allocated = (unsigned) pw->pw_uid + ALLOC_STEP;
              uid_unused = xrealloc (uid_unused, new_allocated);
              memset (uid_unused + uid_allocated, 1,
                      new_allocated - uid_allocated);
              uid_allocated = new_allocated;
            }
          uid_unused[(unsigned) pw->pw_uid] = 0;
        }
      endpwent ();


In shell script, this would be equivalent to, "getent passwd" which could be 
called from XCCDF. It could also create a huge user listing. But the output of 
that could be run through the regex.

-Steve


More information about the scap-security-guide mailing list