diff options
author | Michael Biebl <biebl@debian.org> | 2008-03-29 12:14:26 +0100 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2008-03-29 12:14:26 +0100 |
commit | 3d4464215f5496ec5d9b95954bac9704f9c7b125 (patch) | |
tree | 5d72c7e5a1d790b171204718eef2f78843da50b7 /omusrmsg.c | |
parent | ea79ad8dae160f0d0966b5a02fa3b73f0c3d1940 (diff) | |
download | rsyslog-3d4464215f5496ec5d9b95954bac9704f9c7b125.tar.gz |
Imported Upstream version 1.19.1upstream/1.19.1
Diffstat (limited to 'omusrmsg.c')
-rw-r--r-- | omusrmsg.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -266,8 +266,16 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1) if(**pp != '*') return RS_RET_CONFLINE_UNPROCESSED; #endif + /* User names must begin with a gnu e-regex: + * [a-zA-Z0-9_.] + * plus '*' for wall + */ + if (!*p || !((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z') + || (*p >= '0' && *p <= '9') || *p == '_' || *p == '.' || *p == '*')) + ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); + if((iRet = createInstance(&pData)) != RS_RET_OK) - return iRet; + goto finalize_it; if(*p == '*') { /* wall */ @@ -276,11 +284,11 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1) pData->bIsWall = 1; /* write to all users */ if((iRet = cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (uchar*) " WallFmt")) != RS_RET_OK) - return iRet; + goto finalize_it; } else { - /* everything else is currently treated as a user name - * TODO: we must reconsider this - see also comment in - * loadBuildInModules() in syslogd.c + /* everything else beginning with the regex above + * is currently treated as a user name + * TODO: is this portable? */ dbgprintf("users: %s\n", p); /* ASP */ pData->bIsWall = 0; /* write to individual users */ @@ -301,7 +309,7 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1) */ if((iRet = cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (uchar*)" StdUsrMsgFmt")) != RS_RET_OK) - return iRet; + goto finalize_it; } CODE_STD_FINALIZERparseSelectorAct ENDparseSelectorAct |