ucredsys.c revision 45916cd2fec6e79bca5dee0421bd39e3c2910d1e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Getpeerucred system call implementation.
*/
static int
{
int err;
case VFIFO:
case VSOCK:
break;
case VCHR: {
break;
}
/*
* Map all unexpected error codes to ENOTSUP.
*/
switch (err) {
case 0:
case ENOTSUP:
case ENOTCONN:
case ENOMEM:
break;
default:
break;
}
break;
}
default:
break;
}
/*
* If someone gave us a credential, err will be 0.
*/
if (err != 0)
return (0);
}
}
static int
{
proc_t *p;
int err;
} else {
if (pid < 0)
if (audit_active)
if (p == NULL) {
}
/*
* Assure that audit data in cred is up-to-date.
* updcred will be used or freed.
*/
if (audit_active)
if (err != 0)
}
if (err)
return (0);
}
int
{
switch (code) {
case UCREDSYS_UCREDGET:
case UCREDSYS_GETPEERUCRED:
default:
}
}
#ifdef _SYSCALL32_IMPL
int
{
}
#endif