Date: Thu, 7 Sep 2006 15:17:31 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 105797 for review Message-ID: <200609071517.k87FHVQn024423@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105797 Change 105797 by millert@millert_g5tower on 2006/09/07 15:17:14 o Conditionalize FreeBSD bits. o Use kauth_cred_dup_add(). o Fix fallback conditionals. o Export sbuf_len, _kauth_cred_dup and _kauth_cred_dup_add. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/config/MACFramework.exports#3 edit .. //depot/projects/trustedbsd/sedarwin8/policies/console/mac_console.c#4 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/config/MACFramework.exports#3 (text+ko) ==== @@ -17,6 +17,7 @@ _sbuf_printf _sbuf_putc _sbuf_vprintf +_sbuf_len _strsep _IS_64BIT_PROCESS @@ -24,6 +25,9 @@ _VNOP_SETXATTR _VNOP_GETXATTR +_kauth_cred_dup +_kauth_cred_dup_add + _mac_kalloc _mac_kfree _mac_wire ==== //depot/projects/trustedbsd/sedarwin8/policies/console/mac_console.c#4 (text+ko) ==== @@ -369,11 +369,9 @@ struct mac_console *mc; int error; +#if defined(__FreeBSD__) if (strcmp(MAC_CONSOLE_LABEL_NAME, element_name) != 0) -#if defined(__FreeBSD__) return (0); -#elif defined(__APPLE__) - return (EINVAL); #endif mc = SLOT(label); @@ -414,11 +412,9 @@ struct mac_console *mc; int error; +#if defined(__FreeBSD__) if (strcmp(MAC_CONSOLE_LABEL_NAME, element_name) != 0) -#if defined(__FreeBSD__) return (0); -#elif defined(__APPLE__) - return (EINVAL); #endif mc = SLOT(label); @@ -457,11 +453,9 @@ { struct mac_console *mc; +#if defined(__FreeBSD__) if (strcmp(MAC_CONSOLE_LABEL_NAME, element_name) != 0) -#if defined(__FreeBSD__) return (0); -#elif defined(__APPLE__) - return (EINVAL); #endif mc = SLOT(label); @@ -506,7 +500,7 @@ crfree(oldcred); #elif defined (__APPLE__) oldcred = proc_ucred(p); - newcred = kauth_cred_dup(oldcred); + newcred = kauth_cred_dup_add(oldcred); p->p_ucred = newcred; kauth_cred_rele(oldcred); #endif @@ -583,7 +577,7 @@ #endif /* Fall back to the fslabel. */ - if (error == ENOATTR || error == EOPNOTSUPP || blen == 0) { + if (error == ENOATTR || error == ENOTSUP || error == EPERM || blen == 0) { /* Fall back to the fslabel. */ mac_console_copy_label(fslabel, vlabel); return (0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609071517.k87FHVQn024423>