getexecattr.c revision cb5caa98562cf06753163f558cbcfe30b8f4673a
/*
* 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"
#include <secdb.h>
#include <exec_attr.h>
#include "ldap_common.h"
/* exec_attr attributes filters */
#define _EXEC_NAME "cn"
#define _EXEC_POLICY "SolarisKernelSecurityPolicy"
#define _EXEC_TYPE "SolarisProfileType"
#define _EXEC_RES1 "SolarisAttrRes1"
#define _EXEC_RES2 "SolarisAttrRes2"
#define _EXEC_ID "SolarisProfileId"
#define _EXEC_ATTRS "SolarisAttrKeyValue"
#define _EXEC_GETEXECNAME "(&(objectClass=SolarisExecAttr)(cn=%s)"\
"(SolarisKernelSecurityPolicy=%s)"\
"(SolarisProfileType=%s))"
#define _EXEC_GETEXECNAME_SSD "(&(%%s)(cn=%s)"\
"(SolarisKernelSecurityPolicy=%s)"\
"(SolarisProfileType=%s))"
#define _EXEC_GETEXECID "(&(objectClass=SolarisExecAttr)"\
"(SolarisProfileId=%s)"\
"(SolarisKernelSecurityPolicy=%s)"\
"(SolarisProfileType=%s))"
#define _EXEC_GETEXECID_SSD "(&(%%s)"\
"(SolarisProfileId=%s)"\
"(SolarisKernelSecurityPolicy=%s)"\
"(SolarisProfileType=%s))"
#define _EXEC_GETEXECNAMEID "(&(objectClass=SolarisExecAttr)(cn=%s)"\
"(SolarisProfileId=%s)"\
"(SolarisKernelSecurityPolicy=%s)"\
"(SolarisProfileType=%s))"
#define _EXEC_GETEXECNAMEID_SSD "(&(%%s)(cn=%s)"\
"(SolarisProfileId=%s)"\
"(SolarisKernelSecurityPolicy=%s)"\
"(SolarisProfileType=%s))"
/* from libnsl */
extern int _doexeclist(nss_XbyY_args_t *);
extern char *_exec_wild_id(char *, const char *);
static const char *exec_attrs[] = {
(char *)NULL
};
#ifdef DEBUG
static void
{
}
}
}
}
}
}
}
}
#endif /* DEBUG */
static int
{
int i;
unsigned long len = 0L;
int buflen = (int)0;
char *nullstring = (char *)NULL;
for (i = 0; i < entry->attr_count; i++) {
return ((int)NSS_STR_PARSE_PARSE);
}
return ((int)NSS_STR_PARSE_PARSE);
}
return ((int)NSS_STR_PARSE_ERANGE);
}
continue;
}
} else {
return ((int)NSS_STR_PARSE_ERANGE);
}
}
continue;
}
} else {
return ((int)NSS_STR_PARSE_ERANGE);
}
}
continue;
}
} else {
return ((int)NSS_STR_PARSE_ERANGE);
}
}
continue;
}
} else {
return ((int)NSS_STR_PARSE_ERANGE);
}
}
continue;
}
} else {
return ((int)NSS_STR_PARSE_ERANGE);
}
}
continue;
}
} else {
return ((int)NSS_STR_PARSE_ERANGE);
}
}
continue;
}
}
#ifdef DEBUG
#endif /* DEBUG */
return ((int)NSS_STR_PARSE_SUCCESS);
}
/*
* place the results from ldap object structure into the file format
* returns NSS_STR_PARSE_{SUCCESS, ERANGE, PARSE}
*/
static int
{
int status = NSS_STR_PARSE_SUCCESS;
int len;
return (NSS_STR_PARSE_PARSE);
goto result_exec2str;
}
else
policy_str = policy[0];
else
else
else
else
else
/* 7 = 6 ':' + 1 '\0' */
goto result_exec2str;
}
goto result_exec2str;
}
} else
/* The front end marshaller does not need the trailing null */
return (status);
}
static nss_status_t
{
int status;
return (nss_stat);
}
switch (status) {
case NSS_STR_PARSE_SUCCESS:
if (_doexeclist(argp) == 0) {
}
}
break;
case NSS_STR_PARSE_ERANGE:
break;
case NSS_STR_PARSE_PARSE:
break;
default:
break;
}
(nss_stat != NSS_SUCCESS)) {
break;
}
}
return (nss_stat);
}
/*
* Check if we have either an exact match or a wild-card entry for that id.
*/
static nss_status_t
{
char *wild_id;
char searchfilter[SEARCHFILTERLEN];
char userdata[SEARCHFILTERLEN];
char name[SEARCHFILTERLEN];
char id[SEARCHFILTERLEN];
int ret;
return ((nss_status_t)NSS_NOTFOUND);
switch (getby_flag) {
sizeof (name)) != 0)
goto go_out;
break;
}
do {
goto go_out;
} else
switch (getby_flag) {
case NSS_DBOP_EXECATTR_BYID:
goto go_out;
goto go_out;
break;
goto go_out;
goto go_out;
break;
default:
goto go_out;
}
if (nss_stat == NSS_SUCCESS)
break;
return (nss_stat);
}
static nss_status_t
/* ns_ldap_entry_t -> file format */
if (stat == NSS_STR_PARSE_SUCCESS) {
/* file format -> execstr_t */
if (stat == NSS_STR_PARSE_SUCCESS) {
} else {
}
} else {
/* return file format in argp->buf.buffer */
}
} else {
}
} else {
/* GET_ALL */
}
return (nss_stat);
}
static nss_status_t
{
char searchfilter[SEARCHFILTERLEN];
char userdata[SEARCHFILTERLEN];
char name[SEARCHFILTERLEN];
int ret;
return ((nss_status_t)NSS_NOTFOUND);
return ((nss_status_t)NSS_NOTFOUND);
return ((nss_status_t)NSS_NOTFOUND);
if (nss_stat == NSS_SUCCESS)
return (nss_stat);
}
static nss_status_t
{
if (nss_stat == NSS_SUCCESS)
return (nss_stat);
}
static nss_status_t
{
if (nss_stat == NSS_SUCCESS)
return (nss_stat);
}
static ldap_backend_op_t execattr_ops[] = {
};
/*ARGSUSED0*/
_nss_ldap_exec_attr_constr(const char *dummy1,
const char *dummy2,
const char *dummy3,
const char *dummy4,
const char *dummy5,
const char *dummy6,
const char *dummy7)
{
#ifdef DEBUG
"\n[getexecattr.c: _nss_ldap_exec_attr_constr]\n");
#endif
}