Browse code

return with 62 (instead of 1) when logger can't be initialized

git-svn: trunk@1529

Tomasz Kojm authored on 2005/05/11 09:54:14
Showing 5 changed files
... ...
@@ -1,3 +1,8 @@
1
+Wed May 11 02:44:41 CEST 2005 (tk)
2
+----------------------------------
3
+  * clamscan, freshclam: return with 62 (instead of 1) when logger can't be
4
+			 initialized
5
+
1 6
 Tue May 10 21:29:45 CEST 2005 (tk)
2 7
 ----------------------------------
3 8
   * libclamav/matcher-ac.c, libclamav/matcher-bm.c: fix detection problem with
... ...
@@ -112,7 +112,7 @@ int clamscan(struct optstruct *opt)
112 112
 	logg_file = getargc(opt, 'l');
113 113
 	if(logg("--------------------------------------\n")) {
114 114
 	    mprintf("!Problem with internal logger.\n");
115
-	    return 1;
115
+	    return 62;
116 116
 	}
117 117
     } else 
118 118
 	logg_file = NULL;
... ...
@@ -122,19 +122,19 @@ int clamscan(struct optstruct *opt)
122 122
 	if(!strchr(getargl(opt, "max-space"), 'M') && !strchr(getargl(opt, "max-space"), 'm'))
123 123
 	    if(!isnumb(getargl(opt, "max-space"))) {
124 124
 		mprintf("!--max-space requires natural number.\n");
125
-		exit(40);
125
+		return 40;
126 126
 	    }
127 127
 
128 128
     if(optl(opt, "max-files"))
129 129
 	if(!isnumb(getargl(opt, "max-files"))) {
130 130
 	    mprintf("!--max-files requires natural number.\n");
131
-	    exit(40);
131
+	    return 40;
132 132
 	}
133 133
 
134 134
     if(optl(opt, "max-recursion"))
135 135
 	if(!isnumb(getargl(opt, "max-recursion"))) {
136 136
 	    mprintf("!--max-recursion requires natural number.\n");
137
-	    exit(40);
137
+	    return 40;
138 138
 	}
139 139
 
140 140
 
... ...
@@ -193,6 +193,8 @@ Note: some return codes may only appear in a one file mode (clamscan is started
193 193
 .TP 
194 194
 61: Can't fork.
195 195
 .TP 
196
+62: Can't initialize logger.
197
+.TP 
196 198
 63: Can't create temporary files/directories (check permissions).
197 199
 .TP 
198 200
 64: Can't write to temporary directory (please specify another one).
... ...
@@ -51,8 +51,8 @@ Check #n times per day for a new database. #n must be between 1 and 50.
51 51
 \fB\-\-daemon\-notify=/path/to/clamd.conf\fR
52 52
 Notify the daemon about the new database. By default it reads a hardcoded config file but you can use an another one. Both local and TCP sockets are supported.
53 53
 .TP 
54
-\fB\-a IP, \-\-local-address=IP\fR
55
-Use (local) IP for HTTP downloads. Useful for multi-homed systems. If binding fails for whatever reason, a warning is issued and freshclam behaves like without this flag.
54
+\fB\-a IP, \-\-local\-address=IP\fR
55
+Use (local) IP for HTTP downloads. Useful for multi\-homed systems. If binding fails for whatever reason, a warning is issued and freshclam behaves like without this flag.
56 56
 .TP 
57 57
 \fB\-\-on\-error\-execute=COMMAND\fR
58 58
 Execute COMMAND if error occured. Remeber, that virus database freshness is the most important thing in anti\-virus system. With this option freshclam can alert you (eg. send SMS) when something is going wrong.
... ...
@@ -86,7 +86,7 @@ Execute COMMAND after succesful update.
86 86
 .TP 
87 87
 52: Connection (network) problem.
88 88
 .TP 
89
-53: Can't unlink a file.
89
+53: Can't unlink file.
90 90
 .TP 
91 91
 54: MD5 or digital signature verification error.
92 92
 .TP 
... ...
@@ -94,7 +94,7 @@ Execute COMMAND after succesful update.
94 94
 .TP 
95 95
 56: Config file error.
96 96
 .TP 
97
-57: Can't create a new file.
97
+57: Can't create new file.
98 98
 .TP 
99 99
 58: Can't read database from remote server.
100 100
 .TP 
... ...
@@ -103,6 +103,8 @@ Execute COMMAND after succesful update.
103 103
 60: Can't get information about clamav user from /etc/passwd.
104 104
 .TP 
105 105
 61: Can't drop privileges.
106
+.TP 
107
+62: Can't initialze logger.
106 108
 .SH "FILES"
107 109
 .LP 
108 110
 @CFGDIR@/freshclam.conf
... ...
@@ -212,13 +212,13 @@ int freshclam(struct optstruct *opt)
212 212
 	logg_file = getargc(opt, 'l');
213 213
 	if(logg("--------------------------------------\n")) {
214 214
 	    mprintf("!Problem with internal logger.\n");
215
-	    exit(1);
215
+	    exit(62);
216 216
 	}
217 217
     } else if((cpt = cfgopt(copt, "UpdateLogFile"))) {
218 218
 	logg_file = cpt->strarg; 
219 219
 	if(logg("--------------------------------------\n")) {
220 220
 	    mprintf("!Problem with internal logger.\n");
221
-	    exit(1);
221
+	    exit(62);
222 222
 	}
223 223
     } else
224 224
 	logg_file = NULL;
... ...
@@ -230,7 +230,7 @@ int freshclam(struct optstruct *opt)
230 230
 	if((cpt = cfgopt(copt, "LogFacility"))) {
231 231
 	    if((fac = logg_facility(cpt->strarg)) == -1) {
232 232
 		mprintf("!LogFacility: %s: No such facility.\n", cpt->strarg);
233
-		exit(1);
233
+		exit(62);
234 234
 	    }
235 235
 	}
236 236