Menu

#37 -d argiment logs truncated in syslog startin message

v1.0.0
open
nobody
None
5
2019-02-13
2019-02-13
Igor Velkov
No

sid-filter.c
main()
syslog(LOG_INFO, "%s v%s starting (%s)", SID_PRODUCT, SID_VERSION, argstr);

If argument list contains more than one domain in -d key like -d yahoo.com,dhl.com prints into syslog only first domain.
for line

./sid-filter -p inet:8896@localhost  -f -l -d yahoo.com,dhl.com -T 10 -h -r 2

produces syslog

sid-filter[18367]: Sendmail Sender-ID Filter v1.0.0 starting (args: -p inet:8896@localhost -f -l -d yahoo.com -T 10 -h -r 2)

I think it goes from
first: when command line swich parses ther does
domlist = optarg;
then
when domain list splits to records - commas replaces with nulls just in argv[n] array in code

        for (p = strtok(domlist, ",");
             p != NULL;
             p = strtok(NULL, ","))
            domains[n++] = p;

        domains[n] = NULL;

I think it can be fixed by copying data from argv[n] or making malloc and strncpy for domain names

Discussion


Log in to post a comment.