]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/bsddev/DINetBootHook.cpp
xnu-1228.7.58.tar.gz
[apple/xnu.git] / iokit / bsddev / DINetBootHook.cpp
index 9ba7b5b91e6bb66de10009554fc308e47bf67bd9..ebf591eb036011fe56c6f6f2d798ced59ab1884d 100644 (file)
@@ -1,17 +1,53 @@
+/*
+ * Copyright (c) 2002-2006 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ * 
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ * 
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
 /*
  *  DINetBootHook.c
  *  DiskImages
  *
  *  Created by Byron Han on Sat Apr 13 2002.
- *  Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
  *
  *     Revision History
  *
  *     $Log: DINetBootHook.cpp,v $
+ *     Revision 1.4  2005/07/29 21:49:57  lindak
+ *     Merge of branch "chardonnay" to pick up all chardonnay changes in Leopard
+ *     as of xnu-792.7.4
+ *
+ *     Revision 1.3.1558.1  2005/06/24 01:47:25  lindak
+ *     Bringing over all of the Karma changes into chardonnay.
+ *     
+ *     Revision 1.1.1.1  2005/02/24 21:48:06  akosut
+ *     Import xnu-764 from Tiger8A395
+ *     
  *     Revision 1.3  2002/06/16 20:36:02  lindak
  *     Merged PR-2957314 into Jaguar (siegmund: netboot kernel code needs to set
  *     com.apple.AppleDiskImageController.load to boolean Yes)
- *
+ *     
  *     Revision 1.2.40.2  2002/06/15 03:50:38  dieter
  *     - corrected com.apple.AppleDiskImageController.load string
  *     
@@ -143,9 +179,10 @@ int di_root_image(const char *path, char devname[], dev_t *dev_p)
        }
                
        myDevName = OSDynamicCast(OSString, controller->getProperty(kDIRootImageDevNameKey));
-       if (myDevName)
-               strcpy(devname, myDevName->getCStringNoCopy());
-       else {
+       if (myDevName) {
+               /* rootdevice is 16 chars in bsd_init.c */
+               strlcpy(devname, myDevName->getCStringNoCopy(), 16);
+       } else {
                IOLog("could not get %s\n", kDIRootImageDevNameKey);
                res = kIOReturnError;
                goto di_root_image_FAILED;