On Tuesday, July 23, 2013 04:04:16 PM Steve Grubb wrote:
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.
After checking the OVAL specification, openscap source code, and getpwent man
page, It looks like you can build the OVAL variable from the password_test.
USGCB takes the simplistic approach of directly parsing the password file. But
you should be able to switch from the file test to password test.
-Steve