~ubuntu-branches/debian/squeeze/sympa/squeeze

« back to all changes in this revision

Viewing changes to src/queue.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Hornburg (Racke)
  • Date: 2005-04-09 23:33:35 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050409233335-fm1lfafyokbq4bsx
Tags: 4.1.5-2

* added /etc/mail to directory list (Closes: #298404, thanks to Massimo
  Cetra <mcetra@navynet.it> for the report)
* fixed typo in package description (Closes: #300038, thanks to Florian
  Zumbiehl <florz@gmx.de> for the report) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* queue.c - This program does the messages spooling
2
 
   RCS Identication ; $Revision: 1.3 $ ; $Date: 2001/12/04 13:19:03 $ 
 
2
   RCS Identication ; $Revision: 1.4.2.1 $ ; $Date: 2005/01/27 08:54:02 $ 
3
3
 
4
4
   Sympa - SYsteme de Multi-Postage Automatique
5
5
   Copyright (c) 1997, 1998, 1999, 2000, 2001 Comite Reseau des Universites
26
26
#include <string.h>
27
27
#include <stdlib.h>
28
28
 
29
 
static char rcsid[] = "(@)$Id: queue.c,v 1.3 2001/12/04 13:19:03 aumont Exp $";
 
29
static char rcsid[] = "(@)$Id: queue.c,v 1.4.2.1 2005/01/27 08:54:02 sympa-authors Exp $";
30
30
 
31
31
static char     qfile[128];
32
32
static char     buf[16384];
33
33
static int      i, fd;
34
34
 
 
35
/* For HP-UX */
 
36
#ifndef EX_CONFIG
 
37
# define EX_CONFIG 78
 
38
#endif
 
39
 
35
40
#ifndef CONFIG
36
41
# define CONFIG         "/etc/sympa.conf"
37
42
#endif
88
93
   if ((argn < 2) || (argn >3)) {
89
94
     fprintf(stderr,"%s: usage error, one one list-name argument expected.\n",
90
95
            argv[0]);
91
 
      exit(EX_TEMPFAIL);
 
96
      exit(EX_USAGE);
92
97
   }
93
98
 
94
99
   if (argn == 2) {
107
112
   if ((queuedir = readconf(CONFIG)) == NULL){
108
113
     fprintf(stderr,"%s: cannot read configuration file '%s'.\n",
109
114
            argv[0],CONFIG);
110
 
      exit(EX_TEMPFAIL);
 
115
      exit(EX_CONFIG);
111
116
   }
112
117
   if (chdir(queuedir) == -1) {
113
118
     char* buffer=(char*)malloc(strlen(argv[0])+strlen(queuedir)+80);
114
119
     sprintf(buffer,"%s: while changing dir to '%s'",argv[0],queuedir);
115
120
     perror(buffer);
116
 
     exit(EX_TEMPFAIL);
 
121
     exit(EX_NOPERM);
117
122
   }
118
123
   umask(027);
119
 
   sprintf(qfile, "T.%s.%ld.%d", listname, time(NULL), getpid());
 
124
   snprintf(qfile, sizeof(qfile), "T.%s.%ld.%d", listname, time(NULL), getpid());
120
125
   fd = open(qfile, O_CREAT|O_WRONLY, 0600);
121
126
   if (fd == -1){
122
127
     char* buffer=(char*)malloc(strlen(argv[0])+strlen(queuedir)+80);