(imported topic written by jeremytoo)
The /etc/security/user file in AIX looks like this:
user:
setting = value
setting = value
user:
setting = value
setting = value
so, for example:
steve:
minage = 0
maxage = 7
login = true
joe:
maxage = 3
minlen = 9
I’m trying to get specific settings for specific users. Unfortunately, this file isn’t XML, and it isn’t in .ini file format, so there don’t appear to be any inspectors that can parse the file for me.
I can put the whole file together with:
concatenation " " of (lines of file “/etc/security/user”)
this gives me a nice big mishmash, and I can check simple settings this way. e.g. Are there any accounts with a minlen of 4 or less? (truth be told, the lines don’t need to be concatenated for this particular check).
I need to check 3 things, however.
I need to return a true if any accounts have a maxage of less than 13 AND do not have login=false and rlogin=false set.
Try as I might, I cannot come up with a way of determining this.
I had thought I could say:
(it as string, following texts of firsts “:” of (it as string) of (concatenation " " of lines of file “/etc/security/user”)) of (preceding texts of firsts “:” of lines of file “/etc/passwd”)
this gives me a display of (based on the file above):
A: steve, minage = 0 maxage = 7 login = true joe: maxage = 3 minlen = 9
A: joe, minage = 0 maxage = 7 login = true joe: maxage = 3 minlen = 9
what I WANT is:
A: steve, minage = 0 maxage = 7 login = true
A: joe, maxage = 3 minlen = 9
(space is irrelevant to me)
I think the second ‘it’ is getting overwritten by the concatenation of lines of file “/etc/security/user” – how do I go about bringing in the same ‘it’ that I had before the comma?