getexecattr.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <nss_dbdefs.h>
#include <deflt.h>
#include <exec_attr.h>
#include <user_attr.h>
#include <auth_attr.h>
#include <prof_attr.h>
#include <getxby_door.h>
/* Externs from libnsl */
extern void _setexecattr(void);
extern void _endexecattr(void);
extern execstr_t *_getexecprof(const char *, const char *, const char *, int,
execstr_t *, char *, int, int *);
extern char *_strtok_escape(char *, char *, char **);
extern char *_strdup_null(char *);
static execattr_t *userprof(const char *, const char *, const char *, int);
{
int err = 0;
char buf[NSS_BUFLEN_EXECATTR];
return (execstr2attr(tmp));
}
{
int len_unique;
int err = 0;
int ndata = 0;
int adata = 0;
char unique[NSS_BUFLEN_EXECATTR];
char buf[NSS_BUFLEN_EXECATTR];
union {
char s_b[NSS_BUFLEN_EXECATTR];
} space;
return ((execattr_t *)NULL);
}
setexecattr();
switch (search_flag) {
case GET_ONE:
head = getexecattr();
break;
case GET_ALL:
head = getexecattr();
};
break;
default:
break;
}
endexecattr();
return (head);
}
#ifdef PIC
/*
* If the search criteria is completely specified
* and we only want a single entry,
* then attempt to look up the entry using the nscd.
* Only commands are cached.
*/
(search_flag == GET_ONE)) {
return ((execattr_t *)NULL);
}
return ((execattr_t *)NULL);
}
case SUCCESS: /* positive cache hit */
break;
case NOTFOUND: /* negative cache hit */
return ((execattr_t *)NULL);
default:
return (execstr2attr(resptr));
}
sptr);
/*
* check if doors reallocated the memory underneath us
* if they did munmap it or suffer a memory leak
*/
return (execstr2attr(resptr));
} /* end if (name && type && id && search_flag == GET_ONE) */
#endif /* PIC */
type,
id,
&exec,
buf,
&err);
return (execstr2attr(tmp));
}
int search_flag)
{
int err = 0;
char buf[NSS_BUFLEN_USERATTR];
return ((execattr_t *)NULL);
}
setuserattr();
/* avoid userstr2attr mallocs by calling libnsl directly */
return (head);
}
switch (search_flag) {
case GET_ONE:
break;
case GET_ALL:
}
if ((new =
} else {
}
}
}
break;
default:
break;
}
enduserattr();
} else {
}
return (head);
}
const char *id)
{
continue;
}
return (execp);
}
void
{
_setexecattr();
}
void
{
_endexecattr();
}
void
{
}
}
static execattr_t *
int search_flag)
{
int err = 0;
char *last;
char *sep = ",";
char buf[NSS_BUFLEN_USERATTR];
char pwdb[NSS_BUFLEN_PASSWD];
int profcnt = 0;
int i;
/*
* Check if specified username is valid user
*/
return (head);
}
/* Get the list of profiles for this user */
}
}
}
/* Get the list of default profiles */
}
}
}
if (profcnt == 0) {
return (head);
}
/* Get execs from the list of profiles */
for (i = 0; i < profcnt; i++) {
NULL) {
if (search_flag == GET_ONE) {
break;
} else if (search_flag == GET_ALL) {
} else {
}
}
}
}
return (head);
}
static execattr_t *
{
} else {
}
}
}
return (j_exec);
}
static execattr_t *
{
return ((execattr_t *)NULL);
}
return ((execattr_t *)NULL);
}
} else {
}
return (newexec);
}
static execstr_t *
char *buffer,
int buflen,
{
char *fixed;
#ifdef _LP64
#else
#endif
#ifdef _LP64
> buflen)
#else
> buflen)
#endif
{
}
#ifdef _LP64
#else
#endif
return (result);
}
#ifdef DEBUG
void
{
char *empty = "empty";
printf("attr=\n");
}
} else {
printf("NULL\n");
}
}
#endif /* DEBUG */