Module Name:    othersrc
Committed By:   riz
Date:           Sun Jun 26 22:50:27 UTC 2011

Modified Files:
        othersrc/external/bsd/iscsi/sys/dev/iscsi: iscsi_ioctl.c

Log Message:
Use copyinstr(), not strlcpy, to copy a string from userland.  I can
now use iscsi on my macppc box.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
    othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c
diff -u othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c:1.5 othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c:1.6
--- othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c:1.5	Sat Jun 11 06:49:24 2011
+++ othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c	Sun Jun 26 22:50:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_ioctl.c,v 1.5 2011/06/11 06:49:24 riz Exp $	*/
+/*	$NetBSD: iscsi_ioctl.c,v 1.6 2011/06/26 22:50:27 riz Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -948,8 +948,8 @@
 
 	/* Session established, map LUNs? */
 	if (par->login_type == ISCSI_LOGINTYPE_MAP) {
-		(void) strlcpy(session->tgtname,
-			par->TargetName, sizeof(session->tgtname));
+		copyinstr(par->TargetName, session->tgtname,
+		    sizeof(session->tgtname), NULL);
 		if (!map_session(session)) {
 			kill_session(session, ISCSI_STATUS_MAP_FAILED,
 					LOGOUT_SESSION, FALSE);

Reply via email to