Date: Sun, 22 Jan 2012 10:58:17 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r230454 - head/sys/cddl/compat/opensolaris/sys Message-ID: <201201221058.q0MAwHXx072886@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Sun Jan 22 10:58:17 2012 New Revision: 230454 URL: http://svn.freebsd.org/changeset/base/230454 Log: 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. MFC after: 1 week Modified: head/sys/cddl/compat/opensolaris/sys/sid.h Modified: head/sys/cddl/compat/opensolaris/sys/sid.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/sid.h Sun Jan 22 10:57:32 2012 (r230453) +++ head/sys/cddl/compat/opensolaris/sys/sid.h Sun Jan 22 10:58:17 2012 (r230454) @@ -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?201201221058.q0MAwHXx072886>