~ubuntu-branches/ubuntu/lucid/rsyslog/lucid-updates

« back to all changes in this revision

Viewing changes to runtime/glbl.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2009-06-23 12:12:43 UTC
  • mfrom: (1.1.11 upstream) (3.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20090623121243-d2fejarzidywnn17
Tags: 4.2.0-1
* New upstream release of the now stable v4 branch.
  - Fix warnings when /etc/rsyslog.d/ is empty. Closes: #530228
* debian/patches/imudp_multiple_udp_sockets.patch
  - Removed, merged upstream.
* debian/rsyslog.default
  - Set default compat mode to '4'.
* debian/rsyslog.logcheck.ignore.server
  - Update logcheck rules files to also ignore rsyslogd and imklog stop
    messages.
* debian/control
  - Bump Standards-Version to 3.8.2. No further changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 * class...
52
52
 */
53
53
static uchar *pszWorkDir = NULL;
 
54
static int bOptimizeUniProc = 1;        /* enable uniprocessor optimizations */
 
55
static int bHUPisRestart = 1;           /* should SIGHUP cause a full system restart? */
 
56
static int bPreserveFQDN = 0;           /* should FQDNs always be preserved? */
54
57
static int iMaxLine = 2048;             /* maximum length of a syslog message */
55
58
static int iDefPFFamily = PF_UNSPEC;     /* protocol family (IPv4, IPv6 or both) */
56
59
static int bDropMalPTRMsgs = 0;/* Drop messages which have malicious PTR records during DNS lookup */
57
60
static int option_DisallowWarning = 1;  /* complain if message from disallowed sender is received */
58
61
static int bDisableDNS = 0; /* don't look up IP addresses of remote messages */
59
62
static uchar *LocalHostName = NULL;/* our hostname  - read-only after startup */
 
63
static uchar *LocalFQDNName = NULL;/* our hostname as FQDN - read-only after startup */
60
64
static uchar *LocalDomain;      /* our local domain name  - read-only after startup */
61
65
static char **StripDomains = NULL;/* these domains may be stripped before writing logs  - r/o after s.u., never touched by init */
62
66
static char **LocalHosts = NULL;/* these hosts are logged with their hostname  - read-only after startup, never touched by init */
85
89
        return(nameVar); \
86
90
}
87
91
 
 
92
SIMP_PROP(OptimizeUniProc, bOptimizeUniProc, int)
 
93
SIMP_PROP(PreserveFQDN, bPreserveFQDN, int)
 
94
SIMP_PROP(HUPisRestart, bHUPisRestart, int)
88
95
SIMP_PROP(MaxLine, iMaxLine, int)
89
96
SIMP_PROP(DefPFFamily, iDefPFFamily, int) /* note that in the future we may check the family argument */
90
97
SIMP_PROP(DropMalPTRMsgs, bDropMalPTRMsgs, int)
94
101
SIMP_PROP(StripDomains, StripDomains, char**)
95
102
SIMP_PROP(LocalHosts, LocalHosts, char**)
96
103
 
 
104
SIMP_PROP_SET(LocalFQDNName, LocalFQDNName, uchar*)
97
105
SIMP_PROP_SET(LocalHostName, LocalHostName, uchar*)
98
106
SIMP_PROP_SET(DfltNetstrmDrvr, pszDfltNetstrmDrvr, uchar*) /* TODO: use custom function which frees existing value */
99
107
SIMP_PROP_SET(DfltNetstrmDrvrCAF, pszDfltNetstrmDrvrCAF, uchar*) /* TODO: use custom function which frees existing value */
110
118
static uchar*
111
119
GetLocalHostName(void)
112
120
{
113
 
        return(LocalHostName == NULL ? (uchar*) "[localhost]" : LocalHostName);
 
121
        uchar *pszRet;
 
122
 
 
123
        if(LocalHostName == NULL)
 
124
                pszRet = (uchar*) "[localhost]";
 
125
        else {
 
126
                if(GetPreserveFQDN() == 1)
 
127
                        pszRet = LocalFQDNName;
 
128
                else
 
129
                        pszRet = LocalHostName;
 
130
        }
 
131
        return(pszRet);
 
132
}
 
133
 
 
134
 
 
135
/* return the current localhost name as FQDN (requires FQDN to be set) 
 
136
 * TODO: we should set the FQDN ourselfs in here!
 
137
 */
 
138
static uchar*
 
139
GetLocalFQDNName(void)
 
140
{
 
141
        return(LocalFQDNName == NULL ? (uchar*) "[localhost]" : LocalFQDNName);
114
142
}
115
143
 
116
144
 
173
201
        pIf->Get##name = Get##name; \
174
202
        pIf->Set##name = Set##name;
175
203
        SIMP_PROP(MaxLine);
 
204
        SIMP_PROP(OptimizeUniProc);
 
205
        SIMP_PROP(PreserveFQDN);
 
206
        SIMP_PROP(HUPisRestart);
176
207
        SIMP_PROP(DefPFFamily);
177
208
        SIMP_PROP(DropMalPTRMsgs);
178
209
        SIMP_PROP(Option_DisallowWarning);
179
210
        SIMP_PROP(DisableDNS);
 
211
        SIMP_PROP(LocalFQDNName)
180
212
        SIMP_PROP(LocalHostName)
181
213
        SIMP_PROP(LocalDomain)
182
214
        SIMP_PROP(StripDomains)
216
248
                pszWorkDir = NULL;
217
249
        }
218
250
        bDropMalPTRMsgs = 0;
 
251
        bOptimizeUniProc = 1;
 
252
        bHUPisRestart = 1;
 
253
        bPreserveFQDN = 0;
219
254
        return RS_RET_OK;
220
255
}
221
256
 
235
270
        CHKiRet(regCfSysLineHdlr((uchar *)"defaultnetstreamdrivercafile", 0, eCmdHdlrGetWord, NULL, &pszDfltNetstrmDrvrCAF, NULL));
236
271
        CHKiRet(regCfSysLineHdlr((uchar *)"defaultnetstreamdriverkeyfile", 0, eCmdHdlrGetWord, NULL, &pszDfltNetstrmDrvrKeyFile, NULL));
237
272
        CHKiRet(regCfSysLineHdlr((uchar *)"defaultnetstreamdrivercertfile", 0, eCmdHdlrGetWord, NULL, &pszDfltNetstrmDrvrCertFile, NULL));
 
273
        CHKiRet(regCfSysLineHdlr((uchar *)"optimizeforuniprocessor", 0, eCmdHdlrBinary, NULL, &bOptimizeUniProc, NULL));
 
274
        CHKiRet(regCfSysLineHdlr((uchar *)"hupisrestart", 0, eCmdHdlrBinary, NULL, &bHUPisRestart, NULL));
 
275
        CHKiRet(regCfSysLineHdlr((uchar *)"preservefqdn", 0, eCmdHdlrBinary, NULL, &bPreserveFQDN, NULL));
238
276
        CHKiRet(regCfSysLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, NULL));
239
277
ENDObjClassInit(glbl)
240
278
 
255
293
                free(pszWorkDir);
256
294
        if(LocalHostName != NULL)
257
295
                free(LocalHostName);
 
296
        if(LocalFQDNName != NULL)
 
297
                free(LocalFQDNName);
258
298
ENDObjClassExit(glbl)
259
299
 
260
300
/* vi:set ai: