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 (3)
  • Rob Swindell's avatar
    Log the current Git branch and hash along with every error · 3d1e05e5
    Rob Swindell authored
    This eliminates any ambiguity about what exact version was in use when each error is logged.
    3d1e05e5
  • Rob Swindell's avatar
    Don't attempt to remove files that have already been removed · be0c953e
    Rob Swindell authored
    This is the likely cause of Phil's reported errors when removing files:
    access=-110 info=smb_removefile name not found
    
    The only way I was able to reproduce these errors was to attempt to remove the same file multiple times in the same file listing. In other worse, use 'R', remove a file, then 'P'revious back to the first file and try to remove it again. Or to remove it a file from the batch flag prompt and then attempt to remove it again. <shrug>
    be0c953e
  • Rob Swindell's avatar
    Log local address in passthru connection failure · 4a705a46
    Rob Swindell authored
    Altere reported via IRC:
    !ERROR -1 (113) connecting to passthru socket
    
    It might be helpful to know the address the passthru socket is bound to and the connection is being attempted on, so log that with the error.
    4a705a46
......@@ -676,7 +676,7 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, ulong* row, uint total
if(!p) p=strchr(str+c,',');
if(p) *p=0;
for(i=0;i<total;i++) {
if(filematch(bf[i]->name, str+c)) {
if(!(bf[i]->hdr.attr & MSG_DELETE) && filematch(bf[i]->name, str+c)) {
if(ch=='R') {
if(removefile(smb, bf[i])) {
if(remfile) {
......@@ -696,18 +696,20 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, ulong* row, uint total
c+=strlen(str+c);
else if(str[c]<'A'+(char)total && str[c]>='A') {
file_t* f = bf[str[c]-'A'];
if(ch=='R') {
if(removefile(smb, f)) {
if(remfile) {
if(remove(getfilepath(&cfg, f, path)) != 0 && fexist(path))
errormsg(WHERE, ERR_REMOVE, path);
if(!(f->hdr.attr & MSG_DELETE)) {
if(ch=='R') {
if(removefile(smb, f)) {
if(remfile) {
if(remove(getfilepath(&cfg, f, path)) != 0 && fexist(path))
errormsg(WHERE, ERR_REMOVE, path);
}
if(remcdt)
removefcdt(f);
}
if(remcdt)
removefcdt(f);
}
else if(ch=='M')
movefile(smb, f, usrdir[ml][md]);
}
else if(ch=='M')
movefile(smb, f, usrdir[ml][md]);
}
}
return(2);
......@@ -769,6 +771,8 @@ int sbbs_t::listfileinfo(uint dirnum, const char *filespec, long mode)
break;
}
m++;
if(f->hdr.attr & MSG_DELETE)
continue;
if(mode==FI_OLD && f->hdr.last_downloaded > ns_time)
continue;
if((mode==FI_OLDUL || mode==FI_OLD) && f->hdr.when_written.time > ns_time)
......
......@@ -20,6 +20,8 @@
****************************************************************************/
#include "sbbs.h"
#include "git_branch.h"
#include "git_hash.h"
const char* log_line_ending = "\r\n";
......@@ -113,8 +115,10 @@ extern "C" int errorlog(scfg_t* cfg, int level, const char* host, const char* te
SAFEPRINTF(path, "%serror.log", cfg->logs_dir);
if((fp = fnopen(NULL,path,O_WRONLY|O_CREAT|O_APPEND))==NULL)
return -1;
fprintf(fp,"%.24s %s%s%s%s%s"
fprintf(fp,"%.24s %s/%s %s%s%s%s%s"
,ctime_r(&now, buf)
,GIT_BRANCH
,GIT_HASH
,host==NULL ? "":host
,log_line_ending
,text
......
......@@ -5641,6 +5641,7 @@ NO_SSH:
SOCKET tmp_sock;
SOCKADDR_IN tmp_addr={0};
socklen_t tmp_addr_len;
char addr_str[INET6_ADDRSTRLEN] = "";
/* open a socket and connect to yourself */
......@@ -5705,8 +5706,9 @@ NO_SSH:
result = connect(new_node->passthru_socket, (struct sockaddr *)&tmp_addr, tmp_addr_len);
if(result != 0) {
lprintf(LOG_ERR,"Node %d !ERROR %d (%d) connecting to passthru socket"
,new_node->cfg.node_num, result, ERROR_VALUE);
inet_ntop(tmp_addr.sin_family, &tmp_addr.sin_addr, addr_str, sizeof(addr_str));
lprintf(LOG_ERR,"Node %d !ERROR %d (%d) connecting to passthru socket: %s port %u"
,new_node->cfg.node_num, result, ERROR_VALUE, addr_str, addr_str, htons(tmp_addr.sin_port));
close_socket(new_node->passthru_socket);
new_node->passthru_socket=INVALID_SOCKET;
close_socket(tmp_sock);
......