aboutsummaryrefslogtreecommitdiffstats
path: root/src/initlog.c
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2003-06-13 21:46:08 +0000
committerBill Nottingham <notting@redhat.com>2003-06-13 21:46:08 +0000
commita1264de80fbb439076f4314b16e869fc198fb388 (patch)
treedc5c973c1fbdf36a20a776055a5c9b24a8f94b6b /src/initlog.c
parent781b0f41187b41c3cf1d2e0f570ec2432b146660 (diff)
downloadinitscripts-a1264de80fbb439076f4314b16e869fc198fb388.tar
initscripts-a1264de80fbb439076f4314b16e869fc198fb388.tar.gz
initscripts-a1264de80fbb439076f4314b16e869fc198fb388.tar.bz2
initscripts-a1264de80fbb439076f4314b16e869fc198fb388.tar.xz
initscripts-a1264de80fbb439076f4314b16e869fc198fb388.zip
fix leaked fd, potential usernetctl badness, and initlog/process bogons (<linux_4ever@yahoo.com>)
Diffstat (limited to 'src/initlog.c')
-rw-r--r--src/initlog.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/initlog.c b/src/initlog.c
index 39579eeb..ee7dbd42 100644
--- a/src/initlog.c
+++ b/src/initlog.c
@@ -272,8 +272,9 @@ int logEvent(char *cmd, int eventtype,char *string) {
if (cmd) {
logentry.cmd = strdup(basename(cmd));
- if ((logentry.cmd[0] =='K' || logentry.cmd[0] == 'S') && ( 30 <= logentry.cmd[1] <= 39 )
- && ( 30 <= logentry.cmd[2] <= 39 ) )
+ if ((logentry.cmd[0] =='K' || logentry.cmd[0] == 'S') &&
+ ( logentry.cmd[1] >= '0' && logentry.cmd[1] <= '9' ) &&
+ ( logentry.cmd[2] >= '0' && logentry.cmd[2] <= '9' ) )
logentry.cmd+=3;
} else
logentry.cmd = strdup(_("(none)"));
@@ -298,8 +299,9 @@ int logString(char *cmd, char *string) {
if (cmd) {
logentry.cmd = strdup(basename(cmd));
- if ((logentry.cmd[0] =='K' || logentry.cmd[0] == 'S') && ( 30 <= logentry.cmd[1] <= 39 )
- && ( 30 <= logentry.cmd[2] <= 39 ) )
+ if ((logentry.cmd[0] =='K' || logentry.cmd[0] == 'S') &&
+ ( logentry.cmd[1] >= '0' && logentry.cmd[1] <= 0x39 ) &&
+ ( logentry.cmd[2] >= '0' && logentry.cmd[2] <= 0x39 ) )
logentry.cmd+=3;
} else
logentry.cmd = strdup(_(""));