summaryrefslogtreecommitdiff
path: root/usr/src/cmd/dlmgmtd
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2015-03-06 18:10:56 +0000
committerRobert Mustacchi <rm@joyent.com>2015-03-06 19:05:47 +0000
commitaf38478c0f8beb8c668884bae80b254bd96a1e67 (patch)
tree19291496e1fe394b8cda68f8ed6afaf3dce313b0 /usr/src/cmd/dlmgmtd
parent472fcc43e5fc651dd71e9feb752a728b25e2d8e2 (diff)
downloadillumos-joyent-af38478c0f8beb8c668884bae80b254bd96a1e67.tar.gz
OS-3839 dlmgmtd clobbers its cachefile with excessive use of /native
Diffstat (limited to 'usr/src/cmd/dlmgmtd')
-rw-r--r--usr/src/cmd/dlmgmtd/dlmgmt_db.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr/src/cmd/dlmgmtd/dlmgmt_db.c b/usr/src/cmd/dlmgmtd/dlmgmt_db.c
index a03ce65d6b..dc977f1d74 100644
--- a/usr/src/cmd/dlmgmtd/dlmgmt_db.c
+++ b/usr/src/cmd/dlmgmtd/dlmgmt_db.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2014, Joyent Inc. All rights reserved.
+ * Copyright 2015, Joyent Inc.
*/
#include <assert.h>
@@ -1470,6 +1470,8 @@ dlmgmt_db_init(zoneid_t zoneid, char *zoneroot)
dlmgmt_db_req_t *req;
int err;
boolean_t boot = B_FALSE;
+ char tdir[MAXPATHLEN];
+ char *path = cachefile;
if ((req = dlmgmt_db_req_alloc(DLMGMT_DB_OP_READ, NULL,
DATALINK_INVALID_LINKID, zoneid, DLMGMT_ACTIVE, &err)) == NULL)
@@ -1477,13 +1479,11 @@ dlmgmt_db_init(zoneid_t zoneid, char *zoneroot)
/* Handle running in a non-native branded zone (i.e. has /native) */
if (zone_file_exists(zoneroot, "/native" DLMGMT_TMPFS_DIR)) {
- char tdir[MAXPATHLEN];
-
(void) snprintf(tdir, sizeof (tdir), "/native%s", cachefile);
- (void) strlcpy(cachefile, tdir, sizeof (cachefile));
+ path = cachefile;
}
- if (zone_file_exists(zoneroot, cachefile)) {
+ if (zone_file_exists(zoneroot, path)) {
if ((err = dlmgmt_process_db_req(req)) != 0) {
/*
* If we get back ENOENT, that means that the active