Propose for new option in syslogd

From: Anders Rosendal (rosendal@bostream.com)
Date: Tue Apr 08 2003 - 10:08:22 CEST

  • Next message: Martin Schulze: "Re: Propose for new option in syslogd"

    Hi
    I have a suggestion for another option is syslogd.

    I want to be able to keep the fqdn for all hosts that sends logmessages
    to the loghost, even thou they reside in the same domain as the loghost.
    This option is the oposit of the "-s" and "-l" options.

    I have named the option "-k".

    Below is the diff from the original source.

    Are there any comments?

    Regards Anders Rosendal

    ? klogd
    ? syslogd
    ? syslogd.c.diff
    Index: syslogd.c
    ===================================================================
    RCS file: /var/cvs/infodrom/sysklogd/syslogd.c,v
    retrieving revision 1.34
    diff -r1.34 syslogd.c
    733a734
    > int KeepFQDN = 0; /* Keep the fqdn even for hosts on the
    same domain as loghost*/
    832c833
    < while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:v")) != EOF)

    ---
    > 	while ((ch = getopt(argc, argv, "a:dhf:kl:m:np:rs:v")) != EOF)
    848a850,852
    > 		case 'k':
    > 			KeepFQDN = 1;
    > 			break;
    2035,2046c2039,2050
    < 		if (strcmp(p + 1, LocalDomain) == 0) {
    < 			*p = '\0';
    < 			return (hp->h_name);
    < 		} else {
    < 			if (StripDomains) {
    < 				count=0;
    < 				while (StripDomains[count]) {
    < 					if (strcmp(p + 1,
    StripDomains[count]) == 0) {
    < 						*p = '\0';
    < 						return (hp->h_name);
    < 					}
    < 					count++;
    ---
    > 		if(!KeepFQDN) {
    > 			if (strcmp(p + 1, LocalDomain) == 0) {
    > 				*p = '\0';
    > 				return (hp->h_name);
    > 			}
    > 		}
    > 		if (StripDomains) {
    > 			count=0;
    > 			while (StripDomains[count]) {
    > 				if (strcmp(p + 1, StripDomains[count])
    == 0) {
    > 					*p = '\0';
    > 					return (hp->h_name);
    2047a2052
    > 				count++;
    2049,2056c2054,2060
    < 			if (LocalHosts) {
    < 				count=0;
    < 				while (LocalHosts[count]) {
    < 					if (!strcmp(hp->h_name,
    LocalHosts[count])) {
    < 						*p = '\0';
    < 						return (hp->h_name);
    < 					}
    < 					count++;
    ---
    > 		}
    > 		if (LocalHosts) {
    > 			count=0;
    > 			while (LocalHosts[count]) {
    > 				if (!strcmp(hp->h_name,
    LocalHosts[count])) {
    > 					*p = '\0';
    > 					return (hp->h_name);
    2057a2062
    > 				count++;
    2061c2066,2067
    < 
    ---
    > 	
    > 	
    

    -------------------------------------------------------------- Anders Rosendal rosendal@bostream.com Bostream AB Phone: (+46) 90 2080912 Östra Rådhusgatan 6 Fax : (+46) 90 2080901 903 27 Umea, Sweden PGP-KeyID: 0x46ACEB37 --------------------------------------------------------------



    This archive was generated by hypermail 2.1.4 : Tue Apr 08 2003 - 10:27:10 CEST