~ubuntu-branches/ubuntu/maverick/postfix/maverick-security

« back to all changes in this revision

Viewing changes to src/master/master_ent.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones, Wietse Venema, LaMont Jones
  • Date: 2009-06-03 14:17:08 UTC
  • mfrom: (1.1.22 upstream)
  • Revision ID: james.westby@ubuntu.com-20090603141708-o9u59xlor7nmd2x1
[Wietse Venema]

* New upstream release: 2.6.2~rc1

[LaMont Jones]

* move postfix-add-{filter,policy} manpages to section 8, and deliver
* provide: default-mta on ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
 
91
91
/* Global library. */
92
92
 
 
93
#include <match_service.h>
93
94
#include <mail_proto.h>
94
95
#include <mail_params.h>
95
96
#include <own_inet_addr.h>
104
105
static char *master_path;               /* config file name */
105
106
static VSTREAM *master_fp;              /* config file pointer */
106
107
static int master_line;                 /* config file line number */
 
108
static ARGV *master_disable;            /* disabled service patterns */
107
109
 
108
110
static char master_blanks[] = " \t\r\n";/* field delimiters */
109
111
 
132
134
    if ((master_fp = vstream_fopen(master_path, O_RDONLY, 0)) == 0)
133
135
        msg_fatal("open %s: %m", master_path);
134
136
    master_line = 0;
 
137
    if (master_disable != 0)
 
138
        msg_panic("%s: service disable list still exists", myname);
 
139
    master_disable = match_service_init(var_master_disable);
135
140
}
136
141
 
137
142
/* end_master_ent - close configuration file */
145
150
    if (vstream_fclose(master_fp) != 0)
146
151
        msg_fatal("%s: close configuration file: %m", myname);
147
152
    master_fp = 0;
 
153
    if (master_disable == 0)
 
154
        msg_panic("%s: no service disable list", myname);
 
155
    match_service_free(master_disable);
 
156
    master_disable = 0;
148
157
}
149
158
 
150
159
/* fatal_with_context - print fatal error with file/line context */
242
251
 
243
252
    if (master_fp == 0)
244
253
        msg_panic("get_master_ent: config file not open");
 
254
    if (master_disable == 0)
 
255
        msg_panic("get_master_ent: no service disable list");
245
256
 
246
257
    /*
247
258
     * XXX We cannot change the inet_interfaces setting for a running master
268
279
            return (0);
269
280
        }
270
281
        bufp = vstring_str(buf);
271
 
    } while ((cp = mystrtok(&bufp, master_blanks)) == 0);
 
282
        if ((cp = mystrtok(&bufp, master_blanks)) == 0)
 
283
            continue;
 
284
        name = cp;
 
285
        transport = get_str_ent(&bufp, "transport type", (char *) 0);
 
286
        vstring_sprintf(junk, "%s.%s", name, transport);
 
287
    } while (match_service_match(master_disable, vstring_str(junk)) != 0);
272
288
 
273
289
    /*
274
290
     * Parse one logical line from the configuration file. Initialize service
290
306
    /*
291
307
     * Service name. Syntax is transport-specific.
292
308
     */
293
 
    serv->ext_name = mystrdup(cp);
294
 
    name = cp;
 
309
    serv->ext_name = mystrdup(name);
295
310
 
296
311
    /*
297
312
     * Transport type: inet (wild-card listen or virtual) or unix.
298
313
     */
299
314
#define STR_SAME        !strcmp
300
315
 
301
 
    transport = get_str_ent(&bufp, "transport type", (char *) 0);
302
316
    if (STR_SAME(transport, MASTER_XPORT_NAME_INET)) {
303
317
        if (!STR_SAME(saved_interfaces, var_inet_interfaces)) {
304
318
            msg_warn("service %s: ignoring %s change",