openbsd-ports/comms/conserver/patches/patch-conserver_group_c

49 lines
1.6 KiB
Plaintext

$OpenBSD: patch-conserver_group_c,v 1.2 2005/08/02 07:25:48 pvalchev Exp $
--- conserver/group.c.orig Mon Oct 25 01:25:35 2004
+++ conserver/group.c Tue Aug 2 01:20:46 2005
@@ -2409,7 +2409,7 @@ TelOpt(o)
if (o < sizeof(telopts) / sizeof(char *))
return telopts[o];
else {
- sprintf(opt, "%d", o);
+ snprintf(opt, sizeof(opt), "%d", o);
return opt;
}
}
@@ -3675,13 +3675,12 @@ DoClientRead(pGE, pCLServing)
continue;
}
# if !defined(XTABS) /* XXX hack */
-# define XTABS TAB3
+# define XTABS OXTAB3
# endif
- if (XTABS == (TABDLY & sbuf.c_oflag)) {
- sbuf.c_oflag &= ~TABDLY;
- sbuf.c_oflag |= TAB0;
+ if (XTABS & sbuf.c_oflag) {
+ sbuf.c_oflag &= ~XTABS;
+
} else {
- sbuf.c_oflag &= ~TABDLY;
sbuf.c_oflag |= XTABS;
}
if (-1 ==
@@ -4571,7 +4570,7 @@ Kiddie(pGE, sfd)
BuildString("<unknown>@", pCL->acid);
BuildString((char *)0, pCL->username);
BuildString("<unknown>", pCL->username);
- strcpy(pCL->actym, StrTime(&(pCL->tym)));
+ strlcpy(pCL->actym, StrTime(&(pCL->tym)), sizeof(pCL->actym));
pCL->typetym = pCL->tym;
/* link into the control list for the dummy console
@@ -4681,7 +4680,7 @@ Spawn(pGE)
Error("Spawn(): path to socket too long: %s", portPath->string);
Bye(EX_OSERR);
}
- strcpy(lstn_port.sun_path, portPath->string);
+ strlcpy(lstn_port.sun_path, portPath->string, sizeof(lstn_port.sun_path));
/* create a socket to listen on
* (prepared by master so he can see the port number of the kid)