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

Commits (7)
...@@ -460,6 +460,7 @@ void synclist(char *inpath, int dirnum) ...@@ -460,6 +460,7 @@ void synclist(char *inpath, int dirnum)
int result = smb_open_dir(&scfg, &smb, dirnum); int result = smb_open_dir(&scfg, &smb, dirnum);
if(result != SMB_SUCCESS) { if(result != SMB_SUCCESS) {
fprintf(stderr, "!Error %d (%s) opening %s\n", result, smb.last_error, smb.file); fprintf(stderr, "!Error %d (%s) opening %s\n", result, smb.last_error, smb.file);
fclose(stream);
return; return;
} }
size_t file_count; size_t file_count;
......
...@@ -1152,7 +1152,7 @@ int main(int argc, char **argv) ...@@ -1152,7 +1152,7 @@ int main(int argc, char **argv)
printf("%-39.39s: %-8lu %13s bytes used\n" printf("%-39.39s: %-8lu %13s bytes used\n"
,"Total Active Messages" ,"Total Active Messages"
,totalmsgs,ultoac(totalmsgbytes,str)); ,totalmsgs,ultoac(totalmsgbytes,str));
if(totallzhmsgs && totalmsgs!=smb.status.total_msgs) if(totallzhmsgs)
printf("%-39.39s: %-8lu %13s bytes saved\n" printf("%-39.39s: %-8lu %13s bytes saved\n"
,"Total LZH Compressed Messages" ,"Total LZH Compressed Messages"
,totallzhmsgs,ultoac(totallzhsaved,str)); ,totallzhmsgs,ultoac(totallzhsaved,str));
......
...@@ -72,12 +72,19 @@ void sbbs_t::showfileinfo(file_t* f, bool show_extdesc) ...@@ -72,12 +72,19 @@ void sbbs_t::showfileinfo(file_t* f, bool show_extdesc)
if(p != NULL && *p != '\0') if(p != NULL && *p != '\0')
bprintf(P_TRUNCATE, text[FiUploadedBy], p); bprintf(P_TRUNCATE, text[FiUploadedBy], p);
if(is_op) { if(is_op) {
*tmp = '\0';
if(f->from_ip != NULL) if(f->from_ip != NULL)
bprintf(P_TRUNCATE, text[FiUploadedBy], f->from_ip); SAFEPRINTF(tmp, "[%s] ", f->from_ip);
if(f->from_host != NULL) if(f->from_host != NULL) {
bprintf(P_TRUNCATE, text[FiUploadedBy], f->from_host); SAFEPRINTF(tmp2, "%s ", f->from_host);
if(f->from_prot != NULL) SAFECAT(tmp, tmp2);
bprintf(P_TRUNCATE, text[FiUploadedBy], f->from_prot); }
if(f->from_prot != NULL) {
SAFEPRINTF(tmp2, "via %s ", f->from_prot);
SAFECAT(tmp, tmp2);
}
if(*tmp != '\0')
bprintf(P_TRUNCATE, text[FiUploadedBy], tmp);
} }
if(f->to_list != NULL && *f->to_list != '\0') if(f->to_list != NULL && *f->to_list != '\0')
bprintf(P_TRUNCATE, text[FiUploadedTo], f->to_list); bprintf(P_TRUNCATE, text[FiUploadedTo], f->to_list);
......
...@@ -378,7 +378,7 @@ bool sbbs_t::listfile(file_t* f, uint dirnum, const char *search, const char let ...@@ -378,7 +378,7 @@ bool sbbs_t::listfile(file_t* f, uint dirnum, const char *search, const char let
else else
outchar(' '); outchar(' ');
if(useron.misc&BATCHFLAG) { if(useron.misc&BATCHFLAG) {
attr(cfg.color[clr_filedesc]); attr(curatr ^ HIGH);
bprintf("%c",letter); bprintf("%c",letter);
} }
cdt = f->cost; cdt = f->cost;
......
...@@ -84,23 +84,23 @@ void bail(int code) ...@@ -84,23 +84,23 @@ void bail(int code)
exit(code); exit(code);
} }
char *loadmsgtail(smbmsg_t msg) char *loadmsgtail(smbmsg_t* msg)
{ {
char *buf=NULL; char *buf=NULL;
uint16_t xlat; uint16_t xlat;
int i; int i;
long l=0,length; long l=0,length;
for(i=0;i<msg.hdr.total_dfields;i++) { for(i=0;i<msg->hdr.total_dfields;i++) {
if(msg.dfield[i].type!=TEXT_TAIL) if(msg->dfield[i].type!=TEXT_TAIL)
continue; continue;
fseek(smb.sdt_fp,msg.hdr.offset+msg.dfield[i].offset fseek(smb.sdt_fp,msg->hdr.offset+msg->dfield[i].offset
,SEEK_SET); ,SEEK_SET);
fread(&xlat,2,1,smb.sdt_fp); fread(&xlat,2,1,smb.sdt_fp);
if(xlat!=XLAT_NONE) /* no translations supported */ if(xlat!=XLAT_NONE) /* no translations supported */
continue; continue;
length=msg.dfield[i].length-2; length=msg->dfield[i].length-2;
if((buf=realloc(buf,l+msg.dfield[i].length+1))==NULL) if((buf=realloc(buf,l+msg->dfield[i].length+1))==NULL)
return(buf); return(buf);
l+=fread(buf+l,1,length,smb.sdt_fp); l+=fread(buf+l,1,length,smb.sdt_fp);
buf[l]=0; buf[l]=0;
...@@ -109,7 +109,7 @@ char *loadmsgtail(smbmsg_t msg) ...@@ -109,7 +109,7 @@ char *loadmsgtail(smbmsg_t msg)
} }
void gettag(smbmsg_t msg, char *tag) void gettag(smbmsg_t* msg, char *tag)
{ {
char *buf,*p; char *buf,*p;
...@@ -368,7 +368,7 @@ int main(int argc, char **argv) ...@@ -368,7 +368,7 @@ int main(int argc, char **argv)
} }
if(cmd&NODES && msg.from_net.type==NET_QWK) { if(cmd&NODES && msg.from_net.type==NET_QWK) {
if(mode&TAGS) if(mode&TAGS)
gettag(msg,tag); gettag(&msg,tag);
if(mode&FEED) if(mode&FEED)
sprintf(str,"%s/%s",cfg.sys_id,(char *)msg.from_net.addr); sprintf(str,"%s/%s",cfg.sys_id,(char *)msg.from_net.addr);
else else
......
...@@ -709,9 +709,8 @@ int putusername(scfg_t* cfg, int number, const char *name) ...@@ -709,9 +709,8 @@ int putusername(scfg_t* cfg, int number, const char *name)
return(-3); return(-3);
} }
if(length<(((long)number-1)*(LEN_ALIAS+2))) { if(length<(((long)number-1)*(LEN_ALIAS+2))) {
SAFEPRINTF2(str,"%*s",LEN_ALIAS,nulstr); SAFEPRINTF2(str,"%*s\r\n",LEN_ALIAS,nulstr);
memset(str,ETX,LEN_ALIAS); memset(str,ETX,LEN_ALIAS);
strcat(str,crlf);
lseek(file,0L,SEEK_END); lseek(file,0L,SEEK_END);
while(filelength(file)<((long)number*(LEN_ALIAS+2))) while(filelength(file)<((long)number*(LEN_ALIAS+2)))
write(file,str,(LEN_ALIAS+2)); write(file,str,(LEN_ALIAS+2));
......
...@@ -863,7 +863,6 @@ void sbbs_t::removeline(char *str, char *str2, char num, char skip) ...@@ -863,7 +863,6 @@ void sbbs_t::removeline(char *str, char *str2, char num, char skip)
} }
close(file); close(file);
if((stream=fnopen(&file,str,O_WRONLY|O_TRUNC))==NULL) { if((stream=fnopen(&file,str,O_WRONLY|O_TRUNC))==NULL) {
close(file);
errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_TRUNC); errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_TRUNC);
free(buf); free(buf);
return; return;
......