summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2010-10-25 12:57:14 +0400
committerKozlov Dmitry <xeb@mail.ru>2010-10-25 12:57:14 +0400
commitf2a757b4e08fef2859dd7fc7bb4798d933e56783 (patch)
treeac3247e5fe095784f6a600485a9b001c276c2944
parent8c0d2ca4709fdbf429b8fd59fcec30f0d266dcde (diff)
downloadaccel-ppp-f2a757b4e08fef2859dd7fc7bb4798d933e56783.tar.gz
accel-ppp-f2a757b4e08fef2859dd7fc7bb4798d933e56783.zip
pppd_compat: fixed incorrect array size for environment variables
-rw-r--r--accel-pptpd/extra/pppd_compat.c14
-rw-r--r--driver/CMakeLists.txt13
-rw-r--r--driver/Makefile1
3 files changed, 21 insertions, 7 deletions
diff --git a/accel-pptpd/extra/pppd_compat.c b/accel-pptpd/extra/pppd_compat.c
index 9655269a..db46dd47 100644
--- a/accel-pptpd/extra/pppd_compat.c
+++ b/accel-pptpd/extra/pppd_compat.c
@@ -230,9 +230,9 @@ static void ev_ppp_finished(struct ppp_t *ppp)
char ipaddr[16];
char peer_ipaddr[16];
char peername[64];
- char connect_time[16];
- char bytes_sent[12];
- char bytes_rcvd[12];
+ char connect_time[24];
+ char bytes_sent[24];
+ char bytes_rcvd[24];
struct pppd_compat_pd_t *pd = find_pd(ppp);
if (!pd)
@@ -463,13 +463,13 @@ static void fill_argv(char **argv, struct ppp_t *ppp, char *path)
static void fill_env(char **env, struct pppd_compat_pd_t *pd)
{
- sprintf(env[0], "PEERNAME=%s", pd->ppp->username);
+ snprintf(env[0], 64, "PEERNAME=%s", pd->ppp->username);
if (pd->ppp->stop_time) {
- sprintf(env[1], "CONNECT_TIME=%lu", pd->ppp->stop_time - pd->ppp->start_time);
- sprintf(env[2], "BYTES_SENT=%u", pd->bytes_sent);
- sprintf(env[3], "BYTES_RCVD=%u", pd->bytes_rcvd);
+ snprintf(env[1], 24, "CONNECT_TIME=%lu", pd->ppp->stop_time - pd->ppp->start_time);
+ snprintf(env[2], 24, "BYTES_SENT=%u", pd->bytes_sent);
+ snprintf(env[3], 24, "BYTES_RCVD=%u", pd->bytes_rcvd);
}
}
diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt
index 1daeb080..844cb5ac 100644
--- a/driver/CMakeLists.txt
+++ b/driver/CMakeLists.txt
@@ -14,5 +14,18 @@ ADD_CUSTOM_TARGET(pptp_drv ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/driver/pptp.ko
)
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/driver/isg.ko
+ COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/driver
+ COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/driver
+ COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/* ${CMAKE_CURRENT_BINARY_DIR}/driver
+ COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/driver modules
+ DEPENDS isg.c
+)
+
+ADD_CUSTOM_TARGET(isg_drv ALL
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/driver/isg.ko
+)
+
+
INSTALL(CODE "EXECUTE_PROCESS(COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/driver modules_install)")
diff --git a/driver/Makefile b/driver/Makefile
index 8ccbbedf..fafc843e 100644
--- a/driver/Makefile
+++ b/driver/Makefile
@@ -1,4 +1,5 @@
obj-m += pptp.o
+obj-m += isg.o
default:
make -C $(KDIR) M=$(PWD) modules