Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 2245523d authored by Rob Swindell's avatar Rob Swindell 💬

Better error handling in QWK packet creation

If libarchive creates a 0-byte file or no file at all, then fall-through to the "temp file command-line" (if there is at least one Compressible File Type configured).

If libarchive fails, there will still be a (hopefully helpful) error message logged, but at least the QWK packet may still get created.
parent 04a41e14
Pipeline #2366 passed with stage
in 9 minutes and 19 seconds
......@@ -727,6 +727,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
/*******************/
/* Compress Packet */
/*******************/
remove(packet);
SAFEPRINTF2(path,"%s%s",cfg.temp_dir,ALLFILES);
if(strListFind((str_list_t)supported_archive_formats, useron.tmpext, /* case_sensitive */FALSE) >= 0) {
str_list_t file_list = directory(path);
......@@ -736,13 +737,15 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
lprintf(LOG_ERR, "libarchive error (%s) creating %s", error, packet);
else
lprintf(LOG_INFO, "libarchive created %s from %ld files", packet, file_count);
} else {
}
if(flength(packet) < 1) {
remove(packet);
if((i = external(cmdstr(temp_cmd(),packet,path,NULL), ex|EX_WILDCARD)) != 0)
errormsg(WHERE,ERR_EXEC,cmdstr(temp_cmd(),packet,path,NULL),i);
}
if(!fexist(packet)) {
bputs(text[QWKCompressionFailed]);
return(false);
if(flength(packet) < 1) {
bputs(text[QWKCompressionFailed]);
return(false);
}
}
if(!prepack && useron.rest&FLAG('Q')) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment