Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jul 2012 03:46:58 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r238735 - stable/7/sys/cddl/compat/opensolaris/sys
Message-ID:  <201207240346.q6O3kwgH083405@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Tue Jul 24 03:46:58 2012
New Revision: 238735
URL: http://svn.freebsd.org/changeset/base/238735

Log:
  MFC r230454:
  
  Use provided name when allocating ksid domain. It isn't really used on FreeBSD, but should fix a panic when pool is imported from another OS that is using this.
  
  Requested by:	nox
  No objections:	pjd
  Approved by:	cperciva (implicit)

Modified:
  stable/7/sys/cddl/compat/opensolaris/sys/sid.h
Directory Properties:
  stable/7/sys/   (props changed)

Modified: stable/7/sys/cddl/compat/opensolaris/sys/sid.h
==============================================================================
--- stable/7/sys/cddl/compat/opensolaris/sys/sid.h	Tue Jul 24 03:03:12 2012	(r238734)
+++ stable/7/sys/cddl/compat/opensolaris/sys/sid.h	Tue Jul 24 03:46:58 2012	(r238735)
@@ -30,7 +30,7 @@
 #define	_OPENSOLARIS_SYS_SID_H_
 
 typedef struct ksiddomain {
-	char	kd_name[16];	/* Domain part of SID */
+	char	kd_name[1];	/* Domain part of SID */
 } ksiddomain_t;
 typedef void	ksid_t;
 
@@ -39,8 +39,8 @@ ksid_lookupdomain(const char *domain)
 {
 	ksiddomain_t *kd;
 
-	kd = kmem_alloc(sizeof(*kd), KM_SLEEP);
-	strlcpy(kd->kd_name, "FreeBSD", sizeof(kd->kd_name));
+	kd = kmem_alloc(sizeof(*kd) + strlen(domain), KM_SLEEP);
+	strcpy(kd->kd_name, domain);
 	return (kd);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207240346.q6O3kwgH083405>