rename to a mor general name

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/genlink@2460 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one
2010-10-03 09:25:35 +00:00
commit 2ec1bbf0be
403 changed files with 32261 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
description="Linkstation/Kurobox/Terastation micro controller daemon"
depend() {
need localmount
use logger
}
start() {
# micro_evtd doesn't start properly from s-s-d, need to investigate
ebegin "Starting ${description}"
#start-stop-daemon --start --exec /usr/sbin/micro_evtd
/usr/sbin/micro_evtd
eend $?
}
stop() {
ebegin "Stopping ${description}"
start-stop-daemon --stop --exec /usr/sbin/micro_evtd
eend $?
}

View File

@@ -0,0 +1,31 @@
diff -Naur micro-evtd-3.3.3.orig/micro_evtd.c micro-evtd-3.3.3/micro_evtd.c
--- micro-evtd-3.3.3.orig/micro_evtd.c 2009-03-15 11:41:36.011723240 -0700
+++ micro-evtd-3.3.3/micro_evtd.c 2009-03-15 11:48:35.531745776 -0700
@@ -400,10 +400,12 @@
static int execute_command2(char cmd, char* cmdstring, char type, char cmd2, long cmd3)
{
- char strEventScript[50];
+ char strEventScript[256];
+ int ret;
// Create the command line
- sprintf(strEventScript, "/%s/micro_evtd.event %c %d %ld %s %s %d %c",
+ ret = snprintf(strEventScript, 256,
+ "/%s/micro_evtd.event %c %d %ld %s %s %d %c",
(CP_SCRIPT == cmd? "usr/sbin" : strTmpPath),
cmd,
cmd2,
@@ -411,6 +413,12 @@
cmdstring,
(CP_SCRIPT == cmd? strTmpPath : log_path),
iDebugLevel, (CALL_NO_WAIT == type ? '&' : ' '));
+
+ // Check that string was not truncated
+ if(ret >= 256) {
+ syslog(LOG_ERR, "execute_command2(): command would overflow buffer");
+ return -1;
+ }
// Invoke request
system(strEventScript);