mirror of
https://github.com/bstansell/conserver.git
synced 2025-02-06 10:49:09 +00:00
Merge branch 'master' into increase-gss-buffers
This commit is contained in:
commit
ccf3a7a21f
@ -3,7 +3,7 @@ env:
|
||||
|
||||
freebsd_13_task:
|
||||
freebsd_instance:
|
||||
image_family: freebsd-13-2
|
||||
image_family: freebsd-13-3
|
||||
install_script:
|
||||
- pkg install -y autoconf automake
|
||||
- ./package/setup-configure
|
||||
|
@ -385,11 +385,14 @@ Turn redirection on or off (see the
|
||||
.B \-R
|
||||
command-line flag).
|
||||
.TP
|
||||
\f3reinitcheck\fP \f2number\fP
|
||||
\f3reinitcheck\fP \f2number\fP[\f3s\fP|\f3m\fP]
|
||||
.br
|
||||
Set the number of minutes used between reinitialization checks (see the
|
||||
.B \-O
|
||||
command-line flag).
|
||||
If an `s' or `m' is used after
|
||||
.IR number ,
|
||||
the specified time is interpreted as seconds or minutes.
|
||||
.TP
|
||||
\f3secondaryport\fP \f2number\fP|\f2name\fP
|
||||
.br
|
||||
|
@ -1,6 +1,7 @@
|
||||
### Path settings
|
||||
datarootdir = @datarootdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
@ -146,6 +146,12 @@ AccType(INADDR_STYPE *addr, char **peername)
|
||||
so = sizeof(*addr);
|
||||
|
||||
#if USE_IPV6
|
||||
/*
|
||||
* XXX where is the TRUST_REVERSE_DNS support for IPv6???
|
||||
*
|
||||
* XXX IPv4 should use getnameinfo() et al as well
|
||||
* (if available, they are in IEEE Std 1003.1g-2000)
|
||||
*/
|
||||
error =
|
||||
getnameinfo((struct sockaddr *)addr, so, ipaddr, sizeof(ipaddr),
|
||||
NULL, 0, NI_NUMERICHOST);
|
||||
@ -153,7 +159,11 @@ AccType(INADDR_STYPE *addr, char **peername)
|
||||
Error("AccType(): getnameinfo failed: %s", gai_strerror(error));
|
||||
goto common_ret;
|
||||
}
|
||||
CONDDEBUG((1, "AccType(): ip=%s", ipaddr));
|
||||
CONDDEBUG((1, "AccType(): ip=%s (%s)", ipaddr,
|
||||
addr->ss_family == AF_UNSPEC ? "AF_UNSPEC" :
|
||||
addr->ss_family == AF_LOCAL ? "AF_LOCAL" :
|
||||
addr->ss_family == AF_INET ? "AF_INET" :
|
||||
addr->ss_family == AF_INET6 ? "AF_INET6" : "IF_???"));
|
||||
|
||||
error =
|
||||
getnameinfo((struct sockaddr *)addr, so, host, sizeof(host), NULL,
|
||||
@ -189,7 +199,7 @@ AccType(INADDR_STYPE *addr, char **peername)
|
||||
common_ret:
|
||||
if (config->loghostnames == FLAGTRUE && !error)
|
||||
*peername = StrDup(host);
|
||||
#else
|
||||
#else /* !USE_IPV6 */
|
||||
# if TRUST_REVERSE_DNS
|
||||
/* if we trust reverse dns, we get the names associated with
|
||||
* the address we're checking and then check each of those
|
||||
|
@ -798,6 +798,8 @@ ConsDown(CONSENT *pCE, FLAG downHard, FLAG force)
|
||||
if (pCE->type == EXEC && pCE->execSlaveFD != 0) {
|
||||
close(pCE->execSlaveFD);
|
||||
pCE->execSlaveFD = 0;
|
||||
free(pCE->execSlave);
|
||||
pCE->execSlave = NULL;
|
||||
}
|
||||
pCE->fup = 0;
|
||||
pCE->nolog = 0;
|
||||
@ -913,6 +915,9 @@ ConsInit(CONSENT *pCE)
|
||||
case HOST:
|
||||
{
|
||||
#if USE_IPV6
|
||||
/* XXX IPv4 should use getaddrinfo() and getnameinfo() as well,
|
||||
* (if available, they are in IEEE Std 1003.1g-2000)
|
||||
*/
|
||||
int error;
|
||||
char host[NI_MAXHOST];
|
||||
char serv[NI_MAXSERV];
|
||||
@ -927,7 +932,7 @@ ConsInit(CONSENT *pCE)
|
||||
Sleep(100000); /* Not all terminal servers can keep up */
|
||||
|
||||
#if USE_IPV6
|
||||
# if HAVE_MEMSET
|
||||
# if HAVE_MEMSET /* XXX memset() is C89!!! */
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
# else
|
||||
bzero(&hints, sizeof(hints));
|
||||
@ -964,8 +969,12 @@ ConsInit(CONSENT *pCE)
|
||||
# if HAVE_SETSOCKOPT
|
||||
if (setsockopt
|
||||
(cofile, SOL_SOCKET, SO_KEEPALIVE,
|
||||
(char *)&one, sizeof(one)) < 0)
|
||||
(char *)&one, sizeof(one)) < 0) {
|
||||
Error
|
||||
("[%s] %s:%s setsockopt(%u,SO_KEEPALIVE): %s",
|
||||
pCE->server, host, serv, cofile, strerror(errno));
|
||||
goto fail;
|
||||
}
|
||||
# endif
|
||||
if (!SetFlags(cofile, O_NONBLOCK, 0))
|
||||
goto fail;
|
||||
@ -973,20 +982,25 @@ ConsInit(CONSENT *pCE)
|
||||
ret = connect(cofile, rp->ai_addr, rp->ai_addrlen);
|
||||
if (ret == 0 || errno == EINPROGRESS)
|
||||
goto success;
|
||||
|
||||
Error("[%s] %s:%s connect(%u): %s",
|
||||
pCE->server, host, serv, cofile, strerror(errno));
|
||||
fail:
|
||||
close(cofile);
|
||||
} else {
|
||||
Error
|
||||
("[%s] %s:%s socket(AF_INET,SOCK_STREAM): %s",
|
||||
pCE->server, host, serv, strerror(errno));
|
||||
}
|
||||
rp = rp->ai_next;
|
||||
}
|
||||
|
||||
Error("[%s]: Unable to connect to %s:%s", pCE->server,
|
||||
host, serv);
|
||||
Error("[%s] Unable to connect to %s:%s, forcing down", pCE->server,
|
||||
pCE->host, serv);
|
||||
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
||||
return;
|
||||
success:
|
||||
freeaddrinfo(ai);
|
||||
#else
|
||||
#else /* !USE_IPV6 */
|
||||
# if HAVE_MEMSET
|
||||
memset((void *)&port, 0, sizeof(port));
|
||||
# else
|
||||
|
@ -262,7 +262,7 @@ DestroyString(STRING *msg)
|
||||
{
|
||||
if (msg->prev == (STRING *)0 && msg->next == (STRING *)0 &&
|
||||
allStrings != msg) {
|
||||
CONDDEBUG((1, "DestroyString(): 0x%lx non-pooled string destroyed",
|
||||
CONDDEBUG((3, "DestroyString(): 0x%lx non-pooled string destroyed",
|
||||
(void *)msg, stringCount));
|
||||
} else {
|
||||
if (msg->prev != (STRING *)0)
|
||||
@ -273,7 +273,7 @@ DestroyString(STRING *msg)
|
||||
allStrings = msg->next;
|
||||
}
|
||||
stringCount--;
|
||||
CONDDEBUG((1,
|
||||
CONDDEBUG((3,
|
||||
"DestroyString(): 0x%lx string destroyed (count==%d)",
|
||||
(void *)msg, stringCount));
|
||||
}
|
||||
@ -296,7 +296,7 @@ AllocString(void)
|
||||
allStrings = s;
|
||||
InitString(s);
|
||||
stringCount++;
|
||||
CONDDEBUG((1, "AllocString(): 0x%lx created string #%d", (void *)s,
|
||||
CONDDEBUG((3, "AllocString(): 0x%lx created string #%d", (void *)s,
|
||||
stringCount));
|
||||
return s;
|
||||
}
|
||||
@ -2415,7 +2415,7 @@ GetWord(FILE *fp, int *line, short spaceok, STRING *word)
|
||||
while ((c = fgetc(fp)) != EOF) {
|
||||
if (c == '\n') {
|
||||
(*line)++;
|
||||
if (checkInc == -2)
|
||||
if (checkInc == -2 || checkInc == 0)
|
||||
checkInc = -1;
|
||||
}
|
||||
if (comment) {
|
||||
@ -2592,11 +2592,17 @@ ParseFile(char *filename, FILE *fp, int level)
|
||||
strerror(errno));
|
||||
} else {
|
||||
char *fname;
|
||||
char *sfile;
|
||||
int sline;
|
||||
/* word gets destroyed, so save the name */
|
||||
fname = StrDup(word->string);
|
||||
sfile = file;
|
||||
sline = line;
|
||||
ParseFile(fname, lfp, level + 1);
|
||||
fclose(lfp);
|
||||
free(fname);
|
||||
file = sfile;
|
||||
line = sline;
|
||||
}
|
||||
} else {
|
||||
switch (state) {
|
||||
|
@ -1023,7 +1023,7 @@ ReUp(GRPENT *pGE, short automatic)
|
||||
/* update all the timers */
|
||||
if (automatic == 0 || automatic == 2) {
|
||||
if (config->reinitcheck)
|
||||
timers[T_REINIT] = tyme + (config->reinitcheck * 60);
|
||||
timers[T_REINIT] = tyme + config->reinitcheck;
|
||||
}
|
||||
if (!fNoautoreup)
|
||||
timers[T_AUTOUP] = tyme + 60;
|
||||
@ -2183,7 +2183,7 @@ CommandExamine(GRPENT *pGE, CONSCLIENT *pCLServing, CONSENT *pCEServing,
|
||||
char p = '\000';
|
||||
switch (pCE->type) {
|
||||
case EXEC:
|
||||
d = pCE->execSlave;
|
||||
d = (pCE->execSlaveFD > 0) ? pCE->execSlave : "(inactive)";
|
||||
b = "Local";
|
||||
p = ' ';
|
||||
break;
|
||||
@ -2351,7 +2351,8 @@ CommandInfo(GRPENT *pGE, CONSCLIENT *pCLServing, CONSENT *pCEServing,
|
||||
case EXEC:
|
||||
FilePrint(pCLServing->fd, FLAGTRUE, "|:%s,%lu,%s,%d:",
|
||||
(pCE->exec != (char *)0 ? pCE->exec : "/bin/sh"),
|
||||
(unsigned long)pCE->ipid, pCE->execSlave,
|
||||
(unsigned long)pCE->ipid,
|
||||
(pCE->execSlaveFD > 0) ? pCE->execSlave : "(inactive)",
|
||||
FileFDNum(pCE->cofile));
|
||||
break;
|
||||
#if HAVE_FREEIPMI
|
||||
@ -3269,7 +3270,6 @@ DoClientRead(GRPENT *pGE, CONSCLIENT *pCLServing)
|
||||
TagLogfileAct(pCEServing, "%s attached",
|
||||
pCLServing->acid->string);
|
||||
} else {
|
||||
ClientWantsWrite(pCLServing);
|
||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||
"[spy]\r\n", -1);
|
||||
}
|
||||
@ -3816,7 +3816,9 @@ DoClientRead(GRPENT *pGE, CONSCLIENT *pCLServing)
|
||||
|
||||
case 'c':
|
||||
if (!pCLServing->fwr) {
|
||||
goto unknownchar;
|
||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||
"attach to toggle flow control]\r\n", -1);
|
||||
continue;
|
||||
}
|
||||
CommandChangeFlow(pGE, pCLServing,
|
||||
pCEServing, tyme);
|
||||
@ -3824,7 +3826,9 @@ DoClientRead(GRPENT *pGE, CONSCLIENT *pCLServing)
|
||||
|
||||
case 'd': /* down a console */
|
||||
if (!pCLServing->fwr) {
|
||||
goto unknownchar;
|
||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||
"attach to down console]\r\n", -1);
|
||||
continue;
|
||||
}
|
||||
CommandDown(pGE, pCLServing, pCEServing,
|
||||
tyme);
|
||||
@ -3863,7 +3867,9 @@ DoClientRead(GRPENT *pGE, CONSCLIENT *pCLServing)
|
||||
|
||||
case 'L':
|
||||
if (!pCLServing->fwr) {
|
||||
goto unknownchar;
|
||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||
"attach to toggle logging]\r\n", -1);
|
||||
continue;
|
||||
}
|
||||
CommandLogging(pGE, pCLServing, pCEServing,
|
||||
tyme);
|
||||
@ -3871,7 +3877,9 @@ DoClientRead(GRPENT *pGE, CONSCLIENT *pCLServing)
|
||||
|
||||
case 'l': /* halt character 1 */
|
||||
if (!pCLServing->fwr) {
|
||||
goto unknownchar;
|
||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||
"attach to send break]\r\n", -1);
|
||||
continue;
|
||||
}
|
||||
if (pCEServing->fronly) {
|
||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||
@ -3950,10 +3958,12 @@ DoClientRead(GRPENT *pGE, CONSCLIENT *pCLServing)
|
||||
break;
|
||||
|
||||
case 's': /* spy mode */
|
||||
if (!pCLServing->fwr) {
|
||||
goto unknownchar;
|
||||
}
|
||||
pCLServing->fwantwr = 0;
|
||||
if (!pCLServing->fwr) {
|
||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||
"ok]\r\n", -1);
|
||||
continue;
|
||||
}
|
||||
BumpClient(pCEServing, (char *)0);
|
||||
TagLogfileAct(pCEServing, "%s detached",
|
||||
pCLServing->acid->string);
|
||||
@ -4015,7 +4025,9 @@ DoClientRead(GRPENT *pGE, CONSCLIENT *pCLServing)
|
||||
|
||||
case '!': /* invoke a task */
|
||||
if (!pCLServing->fwr) {
|
||||
goto unknownchar;
|
||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||
"attach to invoke task]\r\n", -1);
|
||||
continue;
|
||||
}
|
||||
pCLServing->iState = S_TASK;
|
||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||
|
@ -1365,7 +1365,7 @@ main(int argc, char **argv)
|
||||
break;
|
||||
case 'O':
|
||||
/* How often to try opening all down consoles, in minutes */
|
||||
optConf->reinitcheck = atoi(optarg);
|
||||
optConf->reinitcheck = atoi(optarg) * 60;
|
||||
break;
|
||||
case 'p':
|
||||
if ((optConf->primaryport = StrDup(optarg)) == (char *)0)
|
||||
|
@ -4562,6 +4562,7 @@ void
|
||||
ConfigItemReinitcheck(char *id)
|
||||
{
|
||||
char *p;
|
||||
int factor = 0;
|
||||
|
||||
CONDDEBUG((1, "ConfigItemReinitcheck(%s) [%s:%d]", id, file, line));
|
||||
|
||||
@ -4570,18 +4571,22 @@ ConfigItemReinitcheck(char *id)
|
||||
return;
|
||||
}
|
||||
|
||||
for (p = id; *p != '\000'; p++)
|
||||
if (!isdigit((int)(*p)))
|
||||
for (p = id; factor == 0 && *p != '\000'; p++)
|
||||
if (*p == 's' || *p == 'S')
|
||||
factor = 1;
|
||||
else if (*p == 'm' || *p == 'M')
|
||||
factor = 60;
|
||||
else if (!isdigit((int)(*p)))
|
||||
break;
|
||||
|
||||
/* if it wasn't a number */
|
||||
/* if it wasn't a number or a qualifier wasn't at the end */
|
||||
if (*p != '\000') {
|
||||
if (isMaster)
|
||||
Error("invalid reinitcheck value `%s' [%s:%d]", id, file,
|
||||
line);
|
||||
return;
|
||||
}
|
||||
parserConfigTemp->reinitcheck = atoi(id);
|
||||
parserConfigTemp->reinitcheck = atoi(id) * (factor == 0 ? 60 : factor);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -18,7 +18,7 @@ typedef struct config {
|
||||
char *primaryport;
|
||||
FLAG redirect;
|
||||
FLAG loghostnames;
|
||||
int reinitcheck;
|
||||
int reinitcheck; /* stored in sec, configured in min or sec */
|
||||
char *secondaryport;
|
||||
char *unifiedlog;
|
||||
int initdelay;
|
||||
|
@ -1,6 +1,7 @@
|
||||
### Path settings
|
||||
datarootdir = @datarootdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
@ -7,6 +7,9 @@ default * {
|
||||
timestamp "";
|
||||
include full;
|
||||
}
|
||||
config * {
|
||||
reinitcheck 1s;
|
||||
}
|
||||
break 5 {
|
||||
string "\rtest\r";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user