Fossil SCM

Merge recent trunk enhancements and fixes into the smtp branch.

drh 2018-06-29 15:30 UTC smtp merge
Commit 45939f5181f7dc523f99cc84374aadb21981c14eac861d8dca58eca80b3ca46c
+10 -8
--- src/email.c
+++ src/email.c
@@ -415,13 +415,15 @@
415415
416416
/*
417417
** Free an email sender object
418418
*/
419419
void email_sender_free(EmailSender *p){
420
- emailerShutdown(p);
421
- fossil_free(p->zErr);
422
- fossil_free(p);
420
+ if( p ){
421
+ emailerShutdown(p);
422
+ fossil_free(p->zErr);
423
+ fossil_free(p);
424
+ }
423425
}
424426
425427
/*
426428
** Get an email setting value. Report an error if not configured.
427429
** Return 0 on success and one if there is an error.
@@ -2028,15 +2030,15 @@
20282030
20292031
/*
20302032
** WEBPAGE: announce
20312033
**
20322034
** A web-form, available to users with the "Send-Announcement" or "A"
2033
-** capability, that allows one to send an announcements to whomever
2034
-** has subscribed to them. The administrator can also send an announcement
2035
-** to the entire mailing list (including people who have elected to
2036
-** receive no announcements or notifications of any kind, or to
2037
-** individual email to anyone.
2035
+** capability, that allows one to send announcements to whomever
2036
+** has subscribed to receive announcements. The administrator can
2037
+** also send a message to an arbitrary email address and/or to all
2038
+** subscribers regardless of whether or not they have elected to
2039
+** receive announcements.
20382040
*/
20392041
void announce_page(void){
20402042
login_check_credentials();
20412043
if( !g.perm.Announce ){
20422044
login_needed(0);
20432045
--- src/email.c
+++ src/email.c
@@ -415,13 +415,15 @@
415
416 /*
417 ** Free an email sender object
418 */
419 void email_sender_free(EmailSender *p){
420 emailerShutdown(p);
421 fossil_free(p->zErr);
422 fossil_free(p);
 
 
423 }
424
425 /*
426 ** Get an email setting value. Report an error if not configured.
427 ** Return 0 on success and one if there is an error.
@@ -2028,15 +2030,15 @@
2028
2029 /*
2030 ** WEBPAGE: announce
2031 **
2032 ** A web-form, available to users with the "Send-Announcement" or "A"
2033 ** capability, that allows one to send an announcements to whomever
2034 ** has subscribed to them. The administrator can also send an announcement
2035 ** to the entire mailing list (including people who have elected to
2036 ** receive no announcements or notifications of any kind, or to
2037 ** individual email to anyone.
2038 */
2039 void announce_page(void){
2040 login_check_credentials();
2041 if( !g.perm.Announce ){
2042 login_needed(0);
2043
--- src/email.c
+++ src/email.c
@@ -415,13 +415,15 @@
415
416 /*
417 ** Free an email sender object
418 */
419 void email_sender_free(EmailSender *p){
420 if( p ){
421 emailerShutdown(p);
422 fossil_free(p->zErr);
423 fossil_free(p);
424 }
425 }
426
427 /*
428 ** Get an email setting value. Report an error if not configured.
429 ** Return 0 on success and one if there is an error.
@@ -2028,15 +2030,15 @@
2030
2031 /*
2032 ** WEBPAGE: announce
2033 **
2034 ** A web-form, available to users with the "Send-Announcement" or "A"
2035 ** capability, that allows one to send announcements to whomever
2036 ** has subscribed to receive announcements. The administrator can
2037 ** also send a message to an arbitrary email address and/or to all
2038 ** subscribers regardless of whether or not they have elected to
2039 ** receive announcements.
2040 */
2041 void announce_page(void){
2042 login_check_credentials();
2043 if( !g.perm.Announce ){
2044 login_needed(0);
2045
+12
--- src/main.c
+++ src/main.c
@@ -1396,10 +1396,18 @@
13961396
g.zRepositoryName = g.argv[2];
13971397
}
13981398
g.httpOut = stdout;
13991399
repo_list_page();
14001400
}
1401
+
1402
+/*
1403
+** Called whenever a crash is encountered while processing a webpage.
1404
+*/
1405
+void sigsegv_handler(int x){
1406
+ fossil_errorlog("Segfault");
1407
+ exit(1);
1408
+}
14011409
14021410
/*
14031411
** Preconditions:
14041412
**
14051413
** * Environment variables are set up according to the CGI standard.
@@ -1429,10 +1437,14 @@
14291437
const char *zPathInfo = PD("PATH_INFO", "");
14301438
char *zPath = NULL;
14311439
int i;
14321440
const CmdOrPage *pCmd = 0;
14331441
const char *zBase = g.zRepositoryName;
1442
+
1443
+#if !defined(_WIN32)
1444
+ signal(SIGSEGV, sigsegv_handler);
1445
+#endif
14341446
14351447
/* Handle universal query parameters */
14361448
if( PB("utc") ){
14371449
g.fTimeFormat = 1;
14381450
}else if( PB("localtime") ){
14391451
--- src/main.c
+++ src/main.c
@@ -1396,10 +1396,18 @@
1396 g.zRepositoryName = g.argv[2];
1397 }
1398 g.httpOut = stdout;
1399 repo_list_page();
1400 }
 
 
 
 
 
 
 
 
1401
1402 /*
1403 ** Preconditions:
1404 **
1405 ** * Environment variables are set up according to the CGI standard.
@@ -1429,10 +1437,14 @@
1429 const char *zPathInfo = PD("PATH_INFO", "");
1430 char *zPath = NULL;
1431 int i;
1432 const CmdOrPage *pCmd = 0;
1433 const char *zBase = g.zRepositoryName;
 
 
 
 
1434
1435 /* Handle universal query parameters */
1436 if( PB("utc") ){
1437 g.fTimeFormat = 1;
1438 }else if( PB("localtime") ){
1439
--- src/main.c
+++ src/main.c
@@ -1396,10 +1396,18 @@
1396 g.zRepositoryName = g.argv[2];
1397 }
1398 g.httpOut = stdout;
1399 repo_list_page();
1400 }
1401
1402 /*
1403 ** Called whenever a crash is encountered while processing a webpage.
1404 */
1405 void sigsegv_handler(int x){
1406 fossil_errorlog("Segfault");
1407 exit(1);
1408 }
1409
1410 /*
1411 ** Preconditions:
1412 **
1413 ** * Environment variables are set up according to the CGI standard.
@@ -1429,10 +1437,14 @@
1437 const char *zPathInfo = PD("PATH_INFO", "");
1438 char *zPath = NULL;
1439 int i;
1440 const CmdOrPage *pCmd = 0;
1441 const char *zBase = g.zRepositoryName;
1442
1443 #if !defined(_WIN32)
1444 signal(SIGSEGV, sigsegv_handler);
1445 #endif
1446
1447 /* Handle universal query parameters */
1448 if( PB("utc") ){
1449 g.fTimeFormat = 1;
1450 }else if( PB("localtime") ){
1451
+1 -1
--- src/printf.c
+++ src/printf.c
@@ -981,11 +981,11 @@
981981
982982
/*
983983
** Write a message to the error log, if the error log filename is
984984
** defined.
985985
*/
986
-static void fossil_errorlog(const char *zFormat, ...){
986
+void fossil_errorlog(const char *zFormat, ...){
987987
struct tm *pNow;
988988
time_t now;
989989
FILE *out;
990990
const char *z;
991991
int i;
992992
--- src/printf.c
+++ src/printf.c
@@ -981,11 +981,11 @@
981
982 /*
983 ** Write a message to the error log, if the error log filename is
984 ** defined.
985 */
986 static void fossil_errorlog(const char *zFormat, ...){
987 struct tm *pNow;
988 time_t now;
989 FILE *out;
990 const char *z;
991 int i;
992
--- src/printf.c
+++ src/printf.c
@@ -981,11 +981,11 @@
981
982 /*
983 ** Write a message to the error log, if the error log filename is
984 ** defined.
985 */
986 void fossil_errorlog(const char *zFormat, ...){
987 struct tm *pNow;
988 time_t now;
989 FILE *out;
990 const char *z;
991 int i;
992
--- src/security_audit.c
+++ src/security_audit.c
@@ -327,13 +327,11 @@
327327
}
328328
#endif
329329
330330
if( g.zErrlog==0 || fossil_strcmp(g.zErrlog,"-")==0 ){
331331
@ <li><p>
332
- @ <b>Caution:</b>
333
- @ No server error log is defined. It is recommended that you establish
334
- @ an error log on Fossil servers and monitor that log for problems.
332
+ @ The server error log is disabled.
335333
@ To set up an error log:
336334
@ <ul>
337335
@ <li>If running from CGI, make an entry "errorlog: <i>FILENAME</i>"
338336
@ in the CGI script.
339337
@ <li>If running the "fossil server" or "fossil http" commands,
340338
--- src/security_audit.c
+++ src/security_audit.c
@@ -327,13 +327,11 @@
327 }
328 #endif
329
330 if( g.zErrlog==0 || fossil_strcmp(g.zErrlog,"-")==0 ){
331 @ <li><p>
332 @ <b>Caution:</b>
333 @ No server error log is defined. It is recommended that you establish
334 @ an error log on Fossil servers and monitor that log for problems.
335 @ To set up an error log:
336 @ <ul>
337 @ <li>If running from CGI, make an entry "errorlog: <i>FILENAME</i>"
338 @ in the CGI script.
339 @ <li>If running the "fossil server" or "fossil http" commands,
340
--- src/security_audit.c
+++ src/security_audit.c
@@ -327,13 +327,11 @@
327 }
328 #endif
329
330 if( g.zErrlog==0 || fossil_strcmp(g.zErrlog,"-")==0 ){
331 @ <li><p>
332 @ The server error log is disabled.
 
 
333 @ To set up an error log:
334 @ <ul>
335 @ <li>If running from CGI, make an entry "errorlog: <i>FILENAME</i>"
336 @ in the CGI script.
337 @ <li>If running the "fossil server" or "fossil http" commands,
338
+44 -39
--- src/unversioned.c
+++ src/unversioned.c
@@ -218,54 +218,59 @@
218218
** of each UV-file is retained. Changes to an UV-file are permanent and cannot
219219
** be undone, so use appropriate caution with this command.
220220
**
221221
** Subcommands:
222222
**
223
-** add FILE ... Add or update unversioned files in the local
224
-** repository so that it matches FILE on disk.
225
-** Use "--as UVFILE" to give the file a different name
226
-** in the repository than what it called on disk.
227
-** Changes are not pushed to other repositories until
228
-** the next sync.
229
-**
230
-** cat FILE ... Concatenate the content of FILEs to stdout.
231
-**
232
-** edit FILE Bring up FILE in a text editor for modification.
233
-**
234
-** export FILE OUTPUT Write the content of FILE into OUTPUT on disk
235
-**
236
-** list | ls Show all unversioned files held in the local
237
-** repository.
238
-**
239
-** revert ?URL? Restore the state of all unversioned files in the
240
-** local repository to match the remote repository
241
-** URL.
242
-**
243
-** Options:
244
-** -v|--verbose Extra diagnostic output
245
-** -n|--dryrun Show what would have happened
223
+** add FILE ... Add or update one or more unversioned files in
224
+** the local repository so that they match FILEs
225
+** on disk. Changes are not pushed to other
226
+** repositories until the next sync.
227
+**
228
+** add FILE --as UVFILE Add or update a single file named FILE on disk
229
+** and UVFILE in the repository unversioned file
230
+** namespace. This variant of the 'add' command allows
231
+** the name to be different in the repository versus
232
+** what appears on disk, but it only allows adding
233
+** a single file at a time.
234
+**
235
+** cat FILE ... Concatenate the content of FILEs to stdout.
236
+**
237
+** edit FILE Bring up FILE in a text editor for modification.
238
+**
239
+** export FILE OUTPUT Write the content of FILE into OUTPUT on disk
240
+**
241
+** list | ls Show all unversioned files held in the local
242
+** repository.
243
+**
244
+** revert ?URL? Restore the state of all unversioned files in the
245
+** local repository to match the remote repository
246
+** URL.
247
+**
248
+** Options:
249
+** -v|--verbose Extra diagnostic output
250
+** -n|--dryrun Show what would have happened
246251
**
247252
** remove|rm|delete FILE ...
248
-** Remove unversioned files from the local repository.
249
-** Changes are not pushed to other repositories until
250
-** the next sync.
251
-**
252
-** sync ?URL? Synchronize the state of all unversioned files with
253
-** the remote repository URL. The most recent version
254
-** of each file is propagated to all repositories and
255
-** all prior versions are permanently forgotten.
256
-**
257
-** Options:
258
-** -v|--verbose Extra diagnostic output
259
-** -n|--dryrun Show what would have happened
260
-**
261
-** touch FILE ... Update the TIMESTAMP on all of the listed files
253
+** Remove unversioned files from the local repository.
254
+** Changes are not pushed to other repositories until
255
+** the next sync.
256
+**
257
+** sync ?URL? Synchronize the state of all unversioned files with
258
+** the remote repository URL. The most recent version
259
+** of each file is propagated to all repositories and
260
+** all prior versions are permanently forgotten.
261
+**
262
+** Options:
263
+** -v|--verbose Extra diagnostic output
264
+** -n|--dryrun Show what would have happened
265
+**
266
+** touch FILE ... Update the TIMESTAMP on all of the listed files
262267
**
263268
** Options:
264269
**
265
-** --mtime TIMESTAMP Use TIMESTAMP instead of "now" for the "add",
266
-** "edit", "remove", and "touch" subcommands.
270
+** --mtime TIMESTAMP Use TIMESTAMP instead of "now" for the "add",
271
+** "edit", "remove", and "touch" subcommands.
267272
*/
268273
void unversioned_cmd(void){
269274
const char *zCmd;
270275
int nCmd;
271276
const char *zMtime = find_option("mtime", 0, 1);
272277
--- src/unversioned.c
+++ src/unversioned.c
@@ -218,54 +218,59 @@
218 ** of each UV-file is retained. Changes to an UV-file are permanent and cannot
219 ** be undone, so use appropriate caution with this command.
220 **
221 ** Subcommands:
222 **
223 ** add FILE ... Add or update unversioned files in the local
224 ** repository so that it matches FILE on disk.
225 ** Use "--as UVFILE" to give the file a different name
226 ** in the repository than what it called on disk.
227 ** Changes are not pushed to other repositories until
228 ** the next sync.
229 **
230 ** cat FILE ... Concatenate the content of FILEs to stdout.
231 **
232 ** edit FILE Bring up FILE in a text editor for modification.
233 **
234 ** export FILE OUTPUT Write the content of FILE into OUTPUT on disk
235 **
236 ** list | ls Show all unversioned files held in the local
237 ** repository.
238 **
239 ** revert ?URL? Restore the state of all unversioned files in the
240 ** local repository to match the remote repository
241 ** URL.
242 **
243 ** Options:
244 ** -v|--verbose Extra diagnostic output
245 ** -n|--dryrun Show what would have happened
 
 
 
 
 
246 **
247 ** remove|rm|delete FILE ...
248 ** Remove unversioned files from the local repository.
249 ** Changes are not pushed to other repositories until
250 ** the next sync.
251 **
252 ** sync ?URL? Synchronize the state of all unversioned files with
253 ** the remote repository URL. The most recent version
254 ** of each file is propagated to all repositories and
255 ** all prior versions are permanently forgotten.
256 **
257 ** Options:
258 ** -v|--verbose Extra diagnostic output
259 ** -n|--dryrun Show what would have happened
260 **
261 ** touch FILE ... Update the TIMESTAMP on all of the listed files
262 **
263 ** Options:
264 **
265 ** --mtime TIMESTAMP Use TIMESTAMP instead of "now" for the "add",
266 ** "edit", "remove", and "touch" subcommands.
267 */
268 void unversioned_cmd(void){
269 const char *zCmd;
270 int nCmd;
271 const char *zMtime = find_option("mtime", 0, 1);
272
--- src/unversioned.c
+++ src/unversioned.c
@@ -218,54 +218,59 @@
218 ** of each UV-file is retained. Changes to an UV-file are permanent and cannot
219 ** be undone, so use appropriate caution with this command.
220 **
221 ** Subcommands:
222 **
223 ** add FILE ... Add or update one or more unversioned files in
224 ** the local repository so that they match FILEs
225 ** on disk. Changes are not pushed to other
226 ** repositories until the next sync.
227 **
228 ** add FILE --as UVFILE Add or update a single file named FILE on disk
229 ** and UVFILE in the repository unversioned file
230 ** namespace. This variant of the 'add' command allows
231 ** the name to be different in the repository versus
232 ** what appears on disk, but it only allows adding
233 ** a single file at a time.
234 **
235 ** cat FILE ... Concatenate the content of FILEs to stdout.
236 **
237 ** edit FILE Bring up FILE in a text editor for modification.
238 **
239 ** export FILE OUTPUT Write the content of FILE into OUTPUT on disk
240 **
241 ** list | ls Show all unversioned files held in the local
242 ** repository.
243 **
244 ** revert ?URL? Restore the state of all unversioned files in the
245 ** local repository to match the remote repository
246 ** URL.
247 **
248 ** Options:
249 ** -v|--verbose Extra diagnostic output
250 ** -n|--dryrun Show what would have happened
251 **
252 ** remove|rm|delete FILE ...
253 ** Remove unversioned files from the local repository.
254 ** Changes are not pushed to other repositories until
255 ** the next sync.
256 **
257 ** sync ?URL? Synchronize the state of all unversioned files with
258 ** the remote repository URL. The most recent version
259 ** of each file is propagated to all repositories and
260 ** all prior versions are permanently forgotten.
261 **
262 ** Options:
263 ** -v|--verbose Extra diagnostic output
264 ** -n|--dryrun Show what would have happened
265 **
266 ** touch FILE ... Update the TIMESTAMP on all of the listed files
267 **
268 ** Options:
269 **
270 ** --mtime TIMESTAMP Use TIMESTAMP instead of "now" for the "add",
271 ** "edit", "remove", and "touch" subcommands.
272 */
273 void unversioned_cmd(void){
274 const char *zCmd;
275 int nCmd;
276 const char *zMtime = find_option("mtime", 0, 1);
277

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button