/*
* 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
*/
/*
*/
#include "files_common.h"
#include <prof_attr.h>
#include <string.h>
#include <stdlib.h>
#include <alloca.h>
#include <secdb.h>
/*
* files/getprofattr.c --
* "files" backend for nsswitch "prof_attr" database
*/
sizeof (profattr_t),
sizeof (hash_prof)/sizeof (files_hash_func),
};
static nss_status_t
{
nss_XbyY_args_t *a = arg;
return (NSS_SUCCESS);
}
}
};
/*
* Push all the prof/user_attrs with the same key for later merging.
* NOTE user_attr and prof_attr are similar structures with the interesting
* fields, attrs, at the same place. We define yet another structure,
* attrstr_t so we can use an index and we can use _str2profattr()
* to parse this structure as it structures have five char *s.
*/
typedef struct attrstr {
char *f[ATTRSIZE];
} attrstr_t;
/* Merge attr2 into attr1; attr1 needs to be freed */
static char *
{
int i;
int len;
int res;
/*
* Three things to merge for profiles
* PROFATTR_AUTHS_KW PROFATTR_PROFS_KW PROFATTR_PRIVS_KW
* pairs.
*/
return (NULL);
}
/*
* Two steps: move the attributes not found in kv1 from kv2;
* the kva routines are not very useful here so we need
* to do somethings by hand.
*/
return (NULL);
}
}
}
if ((flags & FC_FLAG_PROFATTR) != 0) {
int blen;
char *nbuf;
/* Same value, ignore it. */
continue;
}
}
}
if (res == 0)
else
return (NULL);
}
static void
{
int i;
for (i = 0; i < ATTRSIZE; i++)
}
extern int _str2profattr(const char *, int, void *, char *, int);
static nss_status_t
{
int i;
if (res != NSS_SUCCESS) {
return (res);
}
/*
* What we have here is a line to merge and earlier entries;
* we only merge the auth and profile attributes; the rest
* are kept but the first one gets it. We can't user str2ent
* because nscd replaces it with a function which doesn't
* parse and doesn't fill myat.
*/
!= NSS_STR_PARSE_SUCCESS) {
return (NSS_NOTFOUND);
}
for (i = 0; i < ATTRSIZE - 1; i++) {
}
else
/* Failed to allocate, return failure */
res = NSS_NOTFOUND;
}
return (res);
}
{
char *buf;
int len;
return (res);
if (res != NSS_SUCCESS) {
attrstr_free(&attr);
return (res);
}
int i;
if (res != NSS_SUCCESS) {
attrstr_free(&attr);
return (res);
}
for (i = 0; i < ATTRSIZE; i++)
for (i = 0; i < ATTRSIZE; i++)
for (i = 0; i < ATTRSIZE; i++)
/* pa was freed by combine_attrs */
} else {
}
res = NSS_NOTFOUND;
} else {
}
}
attrstr_free(&attr);
return (res);
}
/*ARGSUSED*/
const char *dummy2,
const char *dummy3,
const char *dummy4,
const char *dummy5)
{
return (_nss_files_constr(profattr_ops,
sizeof (profattr_ops) / sizeof (profattr_ops[0]),
&hashinfo,
}