I'm trying to check a user account and send an allert if it's changed.
But I'm having trouble with my RegEx; it's not matching the way it
should.

####
control:
user_httpd = ( ExecResult(/usr/sbin/pw show user httpd) )
classes:
user_httpd_ok = ( RegCmp("httpd:\*:80:80::0:0:World Wide Web
Owner:/nonexistent:/usr/sbin/nologin",${user_httpd}) )
alerts:
!user_httpd_ok::
"httpd user NOT OK: ${user_httpd}"
####

But I can't get it to match unless I pair it all the way down to
####
user_httpd_ok = ( RegCmp("httpd",${user_httpd}) )
####

If I add even one more character (the colon) it won't match anymore.
None of these will match:
"httpd:"
"httpd."
"httpd\:"
"httpd[:]"
"httpd[\:]"
"httpd\W"


--
--
Perfection is just a word I use occasionally with mustard.
--Atom Powers--


_______________________________________________
Help-cfengine mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-cfengine

Reply via email to