diff options
author | bustos <none@none> | 2006-09-15 17:22:50 -0700 |
---|---|---|
committer | bustos <none@none> | 2006-09-15 17:22:50 -0700 |
commit | 56e2393871ebc8ef99ec6ceaded2cd17f208ee61 (patch) | |
tree | 359d51362411ea7c306895ea3abf1d7f810827ef /usr/src/cmd/mdb/common/modules/svc.startd/startd.c | |
parent | ff2b18550948b1149db5d915293d7c25db25bba4 (diff) | |
download | illumos-gate-56e2393871ebc8ef99ec6ceaded2cd17f208ee61.tar.gz |
6448732 shutdown is vulnerable to restarting services
6468801 ::startd_log doesn't work on snv_48 and beyond
Diffstat (limited to 'usr/src/cmd/mdb/common/modules/svc.startd/startd.c')
-rw-r--r-- | usr/src/cmd/mdb/common/modules/svc.startd/startd.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr/src/cmd/mdb/common/modules/svc.startd/startd.c b/usr/src/cmd/mdb/common/modules/svc.startd/startd.c index 53fc3d0956..1f163db4a0 100644 --- a/usr/src/cmd/mdb/common/modules/svc.startd/startd.c +++ b/usr/src/cmd/mdb/common/modules/svc.startd/startd.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -279,18 +278,18 @@ pr_vertex(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) static int logbuf(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) { - size_t logbuf_sz; + GElf_Sym sym; char *buf; char *cp; - if (mdb_readvar(&logbuf_sz, "logbuf_sz") == -1) { - mdb_warn("failed to read 'logbuf_sz'\n"); + if (mdb_lookup_by_name("logbuf", &sym) == -1) { + mdb_warn("The 'logbuf' symbol is missing.\n"); return (DCMD_ERR); } - buf = mdb_alloc(logbuf_sz, UM_SLEEP | UM_GC); + buf = mdb_alloc(sym.st_size, UM_SLEEP | UM_GC); - if (mdb_readsym(buf, logbuf_sz, "logbuf") == -1) { + if (mdb_vread(buf, sym.st_size, sym.st_value) == -1) { mdb_warn("failed to read 'logbuf'\n"); return (DCMD_ERR); } @@ -301,7 +300,8 @@ logbuf(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) /* Empty */ return (DCMD_OK); - if (cp >= buf + logbuf_sz || strchr(cp + 1, '\0') >= buf + logbuf_sz) { + if (cp >= buf + sym.st_size || + strchr(cp + 1, '\0') >= buf + sym.st_size) { mdb_warn("'logbuf' is corrupt\n"); return (DCMD_ERR); } |