sys-apps/micro-evtd: rename th upstream package name

(Portage version: 2.2.0_alpha78-r1/git/Linux x86_64, unsigned Manifest commit)
This commit is contained in:
Mario Fetka
2011-12-07 06:27:01 +01:00
parent c26efff406
commit bcaf6127ef
9 changed files with 299 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#!/sbin/runscript
# Copyright 1999-2011 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,23 @@
#!/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
description="Linkstation/Kurobox/Terastation micro controller daemon"
depend() {
need micro_evtd-boot
after *
}
start() {
ebegin "Starting ${description} final tasks"
# signalize we're up & running
/usr/sbin/microapl -a bz_imhere 120 am4 d4 f4 am4 d4 f4 dm4 dm4 f4 a4 am4 &>/dev/null
eend $?
}
stop() {
ebegin "Stopping ${description} final tasks"
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);