/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <sys/cred_impl.h>
int
{
proc_t *p;
int error;
int do_nocd = 0;
} else {
}
/*
* Need to pre-allocate the new cred structure before grabbing
* the p_crlock mutex. We cannot hold the mutex across the
* secpolicy functions.
*/
newcr = cralloc_ksid();
mutex_enter(&p->p_crlock);
mutex_exit(&p->p_crlock);
mutex_enter(&p->p_crlock);
goto retry;
error = 0;
mutex_exit(&p->p_crlock);
mutex_enter(&p->p_crlock);
goto retry;
/*
* A privileged process that makes itself look like a
* set-gid process must be marked to produce no core dump.
*/
do_nocd = 1;
mutex_exit(&p->p_crlock);
} else {
}
if (error == 0) {
if (do_nocd) {
mutex_enter(&p->p_lock);
mutex_exit(&p->p_lock);
}
return (0);
}
}
getgid(void)
{
rval_t r;
return (r.r_vals);
}
int
{
proc_t *p;
int do_nocd = 0;
} else {
}
/*
* Need to pre-allocate the new cred structure before grabbing
* the p_crlock mutex.
*/
newcr = cralloc_ksid();
mutex_enter(&p->p_crlock);
mutex_exit(&p->p_crlock);
mutex_enter(&p->p_crlock);
goto retry;
/*
* A privileged process that makes itself look like a
* set-gid process must be marked to produce no core dump.
*/
do_nocd = 1;
error = 0;
mutex_exit(&p->p_crlock);
} else {
}
if (error == 0) {
if (do_nocd) {
mutex_enter(&p->p_lock);
mutex_exit(&p->p_lock);
}
return (0);
}
}
/*
* Buy-back from SunOS 4.x
*
* Like setgid() and setegid() combined -except- that non-root users
* can change cr_rgid to cr_gid, and the semantics of cr_sgid are
* subtly different.
*/
int
{
proc_t *p;
int do_nocd = 0;
} else {
}
/*
* Need to pre-allocate the new cred structure before grabbing
* the p_crlock mutex.
*/
newcr = cralloc_ksid();
mutex_enter(&p->p_crlock);
if ((rgid == -1 ||
if (egid != -1) {
}
if (rgid != -1)
/*
* "If the real gid is being changed, or the effective gid is
* being changed to a value not equal to the real gid, the
* saved gid is set to the new effective gid."
*/
if (rgid != -1 ||
/*
* A privileged process that makes itself look like a
* set-gid process must be marked to produce no core dump.
*/
do_nocd = 1;
error = 0;
}
mutex_exit(&p->p_crlock);
if (error == 0) {
if (do_nocd) {
mutex_enter(&p->p_lock);
mutex_exit(&p->p_lock);
}
return (0);
}
}