ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * CDDL HEADER START
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * The contents of this file are subject to the terms of the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * Common Development and Distribution License (the "License").
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * You may not use this file except in compliance with the License.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * See the License for the specific language governing permissions
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * and limitations under the License.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * When distributing Covered Code, include this CDDL HEADER in each
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * If applicable, add the following below this CDDL HEADER, with the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * fields enclosed by brackets "[]" replaced with your own identifying
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * information: Portions Copyright [yyyy] [name of copyright owner]
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * CDDL HEADER END
6f269e977ae7318d374676a38d516ed59c43135eMark J. Nelson * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
1f2ca518aeecee8616fccc0c46a339773faea7d5Dan McDonald * Use is subject to license terms.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza/* headers for key2str/str2key routines */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * functions in nss_dbdefs.c deal more with the mechanics of
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * the data structures like nss_XbyY_args_t and the interaction
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * with the packed buffers etc. versus the mechanics of the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * actual policy component operations such as nss_search sequencing.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * ALIGN? is there an official definition of this?
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * We use sizeof(long) to cover what we want
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * for both the 32-bit world and 64-bit world.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#define ALIGN(x) ((((long)(x)) + sizeof (long) - 1) & ~(sizeof (long) - 1))
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza_nss_XbyY_buf_alloc(int struct_size, int buffer_size)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* Use one malloc for dbargs, result struct and buffer */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza malloc(ALIGN(sizeof (*b)) + struct_size + buffer_size);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if (b == 0) {
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson b->buffer = (char *)(b->result) + struct_size;
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson if (b != 0) {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza/* === Comment: used by fget{gr,pw,sp}ent */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza/* ==== Should do ye olde syslog()ing of suspiciously long lines */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* End of file */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* len >= 0 (otherwise we would have got EOF) */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* Line too long for buffer; too bad */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* case where the file is not terminated with a Newline */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza parsestat = (*b->str2ent)(buf, (len - 1), b->buf.result, b->buf.buffer,
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza } else if (parsestat == NSS_STR_PARSE_SUCCESS) {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * parse the aliases string into the buffer and if successful return
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * a char ** pointer to the beginning of the aliases.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * CAUTION: (instr, instr+lenstr) and (buffer, buffer+buflen) are
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * non-intersecting memory areas. Since this is an internal interface,
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson * we should be able to live with that.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza_nss_netdb_aliases(const char *instr, int lenstr, char *buffer, int buflen)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* "instr" is the beginning of the aliases string */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* "buffer" has the return val for success */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* "buflen" is the length of the buffer available for aliases */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * Build the alias-list in the start of the buffer, and copy
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * the strings to the end of the buffer.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza char **aliasp = (char **)ROUND_UP(buffer, sizeof (*aliasp));
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza while (instr < instr_limit && isspace(*instr)) {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza while (instr < instr_limit && !isspace(*instr)) {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if (copyptr <= (char *)(&aliasp[nstrings + 1])) {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* Has to be room for the pointer to */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* the alias we're about to add, */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* as well as the final NULL ptr. */
9f9230833b50b8271840dc2c12bd1e94d9df7d12Alexander Pyhalovextern nss_status_t process_cstr(const char *, int, struct nss_groupsbymem *);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * pack well known getXbyY keys to packed buffer prior to the door_call
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * to nscd. Some consideration is given to ordering the tests based on
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * usage. Note: buf is nssuint_t aligned.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazatypedef struct {
77c29b8ee88bf82021ff549b17b44e17f2ef7d7bRichard Lowe { NSS_DBNAM_##x, NSS_DEFCONF_##x, "_nss_initf_" f, "str2" f, \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza { NSS_DBNAM_##x, NSS_DEFCONF_##x, "_nss_initf_" f, "str2" f, \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza { NSS_DBNAM_##x, NSS_DEFCONF_##b, "_nss_initf_" f, s, \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza { NSS_DBNAM_##x, NSS_DEFCONF_##x, "_nss_initf_" f, s, \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza { NSS_DBNAM_##x, NSS_DEFCONF_##x, "_nss_initf_" i, "str2" f, \
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross { NSS_DBNAM_##x, NSS_DEFCONF_##x, "_nss_initf_" f, s, \
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross "process_cstr", NULL, NULL, NSS_DBOP_##x##_##a, (e) }
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross * The getXbyY_to_dbop structure is hashed on first call in order to
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross * reduce the search time for the well known getXbyY operations.
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross * A binary search was not fast enough. There were on average
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross * 3-4 tests (strcmps) per getXbyY call.
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross * DBOP_PRIME_HASH must be a prime number (reasonably small) but that
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross * is sufficient to uniquely map the entries in the following table
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross * without collision.
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross * The DBOP_PRIME_HASH was selected as the smallest hash value
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross * for this table without collisions. Changing this table WILL
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross * necessitate re-testing for possible collisions.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazastatic int getXbyYdbopHASH[DBOP_PRIME_HASH] = { 0 };
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazastatic mutex_t getXbydbop_hash_lock = DEFAULTMUTEX;
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * If the size of getXbyY_to_dbop[] is changed then hash function must be
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * corrected to be without collisions in nss_dbop_search().
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble /* NSS_MK_GETXYDBOP(ALIASES, ?, ?), */
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble NSS_MK_GETXYDBOPD(AUDITUSER, BYNAME, "auuser", "audituser", "n"),
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble NSS_MK_GETXYDBOP(AUTHATTR, BYNAME, "authattr", "n"),
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble /* NSS_MK_GETXYDBOP(AUTOMOUNT, ?, ?), */
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble NSS_MK_GETXYDBOP(BOOTPARAMS, BYNAME, "bootparams", "n"),
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble NSS_MK_GETXYDBOPC(ETHERS, HOSTTON, "ethers", "str2ether", "n"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(ETHERS, NTOHOST, "ethers", "str2ether", "e"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOP(EXECATTR, BYNAME, "execattr", "A"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOP(EXECATTR, BYID, "execattr", "A"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOP(EXECATTR, BYNAMEID, "execattr", "A"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPCSTR(GROUP, BYMEMBER, "group", "str2group", "I"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(HOSTS, BYNAME, "hosts", "str2hostent", "n"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(HOSTS, BYADDR, "hosts", "str2hostent", "h"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(IPNODES, BYNAME, "ipnodes", "str2hostent", "i"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(IPNODES, BYADDR, "ipnodes", "str2hostent", "h"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOP(NETGROUP, IN, "netgroup", "t"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOP(NETGROUP, SET, "netgroup", "T"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(NETMASKS, BYNET, "netmasks", "str2addr", "n"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(NETWORKS, BYNAME, "net", "str2netent", "n"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(NETWORKS, BYADDR, "net", "str2netent", "a"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOP(PASSWD, BYNAME, "passwd", "n"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOP(PRINTERS, BYNAME, "printers", "n"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOP(PROFATTR, BYNAME, "profattr", "n"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOP(PROJECT, BYNAME, "project", "n"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOP(PROJECT, BYID, "project", "p"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(PROTOCOLS, BYNAME, "proto", "str2protoent", "n"),
0ea64585698b885134cf212069f5ff7ebda376a6Liane Praza NSS_MK_GETXYDBOPC(PROTOCOLS, BYNUMBER, "proto", "str2protoent", "N"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPA(PUBLICKEY, KEYS_BYNAME, "publickey", "k"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(RPC, BYNAME, "rpc", "str2rpcent", "n"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(RPC, BYNUMBER, "rpc", "str2rpcent", "N"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(SERVICES, BYNAME, "services", "str2servent", "s"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(SERVICES, BYPORT, "services", "str2servent", "S"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPB(SHADOW, PASSWD, PASSWD_BYNAME, "shadow",
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(TSOL_RH, BYADDR, "tsol_rh", "str_to_rhstr", "h"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(TSOL_TP, BYNAME, "tsol_tp", "str_to_tpstr", "n"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOPC(TSOL_ZC, BYNAME, "tsol_zc", "str_to_zcstr", "n"),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NSS_MK_GETXYDBOP(USERATTR, BYNAME, "userattr", "n"),
ae39239e04452933e89d03a1fb502e3e2836a332Mark J. Nelsonnss_dbop_search(const char *name, uint32_t dbop)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza int count = (sizeof (getXbyY_to_dbop) / sizeof (getXbyY_to_dbop_t));
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* Uses a table size is known to have no collisions */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza for (i = 0; i < count; i++) {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* hash table collision-see above */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza return (-1);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza return (-1);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza return (-1);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if (hptr->dbop != dbop || strcmp(name, hptr->name) != 0)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza return (-1);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * nss_pack_key2str
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * Private key to string packing function for getXbyY routines
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * This routine performs a printf like parse over the argument
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * key, given a string of items to pack and assembles the key in
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * the packed structure. This routine is called (currently) by
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * nss_default_key2str, but will be used by other external
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * APIs in the future.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * buffer - Start of the key buffer location [in packed buffer]
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * length - Length of key buffer component
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * Key offsets are relative to start of key buffer location.
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson * Pack fields Key
e3c7c8f87921d6207a2ea7e79b31f9762e18116fMark J. Nelson * key.number N
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * key.ipnode i
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * key.projid p
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * key.serv(name) s
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * key.serv(port) S
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * key.ether e
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * key.pkey k
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * key.netaddr a
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * key.attrp A
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * groupsbymember I
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * innetgr_args t
3d312ee2210d825807c3486aa998ebd8bc2f3a43Mark J. Nelson * setnetgr_args T
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazanss_pack_key2str(void *buffer, size_t length, nss_XbyY_args_t *arg,
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza const char *dbname, int dbop, size_t *rlen, const char *typestr)
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson if (buffer == NULL || length == 0 || arg == NULL ||
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson dbname == NULL || rlen == NULL || typestr == NULL)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza *(nssuint_t *)buffer = (nssuint_t)arg->key.number;
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson *(nssuint_t *)buffer = (nssuint_t)arg->key.gid;
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza return (-1);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza buffer = (void *)((char *)buffer + sizeof (nssuint_t));
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza buffer = (void *)((char *)buffer + sizeof (nssuint_t));
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza buffer = (void *)((char *)buffer + sizeof (nssuint_t));
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza buffer = (void *)((char *)buffer + sizeof (nssuint_t));
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza (void) strlcpy(buffer, arg->key.ipnode.name, len);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza *(nssuint_t *)buffer = (nssuint_t)arg->key.projid;
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price (void) strlcpy(buffer, arg->key.serv.serv.name, len);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza (void) strlcpy(buffer, arg->key.pkey.name, len);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza (void) strlcpy(buffer, arg->key.pkey.keytype, len2);
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson /* for search flag */
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson /* for sizeof (_priv_execattr) static buffer */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* Plus lots of slop just in case... */
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /* head_exec, prev_exec - are client side only... */
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price uptr = (nssuint_t *)((void *)((char *)buffer + slop));
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza (void) strlcpy((void *)uptr, gbm->username, len);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza for (j = 0; j < NSS_NETGR_N; j++) {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * Double argv space. Reason:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * First 1/2 offsets
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * Second 1/2 for client side pointer arrays
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * resolves malloc/free issues with unpacked argvs
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza pptr->machine_argc = ing->arg[NSS_NETGR_MACHINE].argc;
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza pptr->user_argc = ing->arg[NSS_NETGR_USER].argc;
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza pptr->domain_argc = ing->arg[NSS_NETGR_DOMAIN].argc;
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson uptr = (nssuint_t *)((void *)((char *)buffer + offv));
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson for (; --i >= 0; ) {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza for (; --i >= 0; ) {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza for (; --i >= 0; ) {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza for (; --i >= 0; ) {
return (NSS_ERROR);
return (NSS_TRYLOCAL);
sizeof (gid_t);
* key.hostaddr h
* key.serv(name) s
* key.serv(port) S
static nss_status_t
return (NSS_ERROR);
while (*strtype) {
switch (*strtype++) {
bptr++;
bptr++;
bptr++;
uptr++;
for (j = 0; j < NSS_NETGR_N; j++) {
return (NSS_ERROR);
return (NSS_ERROR);
return (NSS_ERROR);
return (NSS_SUCCESS);
static nss_status_t
return (NSS_ERROR);
if (htmp)
if (initf) {
return (NSS_ERROR);
if (s2e) {
return (NSS_ERROR);
return (NSS_SUCCESS);
return (NSS_ERROR);
return (NSS_ERROR);
return (NSS_ERROR);
const char *instr,
int lenstr,
char *buffer,
int buflen
return (NSS_STR_PARSE_ERANGE);
return (NSS_STR_PARSE_SUCCESS);
return (NSS_ERROR);
return (NSS_ERROR);
return (NSS_ERROR);
return (NSS_ERROR);
return (NSS_ERROR);
return (NSS_SUCCESS);
return (NSS_SUCCESS);
return (NSS_ERROR);
return (NSS_SUCCESS);
return (NSS_SUCCESS);