10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 50Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 60Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 70Sstevel@tonic-gate * with the License. 80Sstevel@tonic-gate * 90Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 100Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 110Sstevel@tonic-gate * See the License for the specific language governing permissions 120Sstevel@tonic-gate * and limitations under the License. 130Sstevel@tonic-gate * 140Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 150Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 160Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 170Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 180Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 190Sstevel@tonic-gate * 200Sstevel@tonic-gate * CDDL HEADER END 210Sstevel@tonic-gate */ 22*132Srobinson 230Sstevel@tonic-gate /* 24*132Srobinson * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 250Sstevel@tonic-gate * Use is subject to license terms. 260Sstevel@tonic-gate */ 270Sstevel@tonic-gate 280Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 290Sstevel@tonic-gate 300Sstevel@tonic-gate #include "mt.h" 310Sstevel@tonic-gate #include <stdio.h> 320Sstevel@tonic-gate #include <stdlib.h> 330Sstevel@tonic-gate #include <sys/types.h> 340Sstevel@tonic-gate #include <nss_dbdefs.h> 350Sstevel@tonic-gate #include <string.h> 360Sstevel@tonic-gate #include <strings.h> 370Sstevel@tonic-gate #include <sys/systeminfo.h> 380Sstevel@tonic-gate #include <thread.h> 390Sstevel@tonic-gate #include <synch.h> 400Sstevel@tonic-gate #include <nsswitch.h> 410Sstevel@tonic-gate #include <prof_attr.h> 420Sstevel@tonic-gate #include <exec_attr.h> 430Sstevel@tonic-gate 440Sstevel@tonic-gate /* externs from libc */ 450Sstevel@tonic-gate extern void _nss_db_state_destr(struct nss_db_state *); 460Sstevel@tonic-gate 470Sstevel@tonic-gate /* externs from parse.c */ 480Sstevel@tonic-gate extern char *_strtok_escape(char *, char *, char **); 490Sstevel@tonic-gate extern char *_strdup_null(char *); 500Sstevel@tonic-gate /* extern from getprofattr.c */ 510Sstevel@tonic-gate extern int str2profattr(const char *, int, void *, char *, int); 520Sstevel@tonic-gate 530Sstevel@tonic-gate char *_exec_wild_id(char *, const char *); 540Sstevel@tonic-gate execstr_t *_dup_execstr(execstr_t *); 550Sstevel@tonic-gate void _free_execstr(execstr_t *); 560Sstevel@tonic-gate 570Sstevel@tonic-gate static char *_nsw_search_path = NULL; 580Sstevel@tonic-gate 590Sstevel@tonic-gate /* 600Sstevel@tonic-gate * Unsynchronized, but it affects only efficiency, not correctness 610Sstevel@tonic-gate */ 620Sstevel@tonic-gate 630Sstevel@tonic-gate static DEFINE_NSS_DB_ROOT(exec_root); 640Sstevel@tonic-gate static DEFINE_NSS_GETENT(context); 650Sstevel@tonic-gate 660Sstevel@tonic-gate void 670Sstevel@tonic-gate _nss_initf_execattr(nss_db_params_t *p) 680Sstevel@tonic-gate { 690Sstevel@tonic-gate p->name = NSS_DBNAM_EXECATTR; 700Sstevel@tonic-gate p->config_name = NSS_DBNAM_PROFATTR; /* use config for "prof_attr" */ 710Sstevel@tonic-gate } 720Sstevel@tonic-gate 730Sstevel@tonic-gate void 740Sstevel@tonic-gate _nsw_initf_execattr(nss_db_params_t *p) 750Sstevel@tonic-gate { 760Sstevel@tonic-gate p->name = NSS_DBNAM_EXECATTR; 770Sstevel@tonic-gate p->flags |= NSS_USE_DEFAULT_CONFIG; 780Sstevel@tonic-gate p->default_config = _nsw_search_path; 790Sstevel@tonic-gate } 800Sstevel@tonic-gate 810Sstevel@tonic-gate void 820Sstevel@tonic-gate _nsw_initf_profattr(nss_db_params_t *p) 830Sstevel@tonic-gate { 840Sstevel@tonic-gate p->name = NSS_DBNAM_PROFATTR; 850Sstevel@tonic-gate p->flags |= NSS_USE_DEFAULT_CONFIG; 860Sstevel@tonic-gate p->default_config = _nsw_search_path; 870Sstevel@tonic-gate } 880Sstevel@tonic-gate 890Sstevel@tonic-gate /* 900Sstevel@tonic-gate * Return values: 0 = success, 1 = parse error, 2 = erange ... The structure 910Sstevel@tonic-gate * pointer passed in is a structure in the caller's space wherein the field 920Sstevel@tonic-gate * pointers would be set to areas in the buffer if need be. instring and buffer 930Sstevel@tonic-gate * should be separate areas. 940Sstevel@tonic-gate */ 950Sstevel@tonic-gate int 960Sstevel@tonic-gate str2execattr(const char *instr, int lenstr, void *ent, char *buffer, int buflen) 970Sstevel@tonic-gate { 98*132Srobinson char *last = NULL; 990Sstevel@tonic-gate char *sep = KV_TOKEN_DELIMIT; 1000Sstevel@tonic-gate execstr_t *exec = (execstr_t *)ent; 1010Sstevel@tonic-gate 102*132Srobinson if (exec == NULL) 1030Sstevel@tonic-gate return (NSS_STR_PARSE_PARSE); 1040Sstevel@tonic-gate 1050Sstevel@tonic-gate if ((instr >= buffer && (buffer + buflen) > instr) || 106*132Srobinson (buffer >= instr && (instr + lenstr) > buffer)) 1070Sstevel@tonic-gate return (NSS_STR_PARSE_PARSE); 108*132Srobinson if (lenstr >= buflen) 1090Sstevel@tonic-gate return (NSS_STR_PARSE_ERANGE); 110*132Srobinson (void) strncpy(buffer, instr, buflen); 1110Sstevel@tonic-gate /* 1120Sstevel@tonic-gate * Remove newline that nis (yp_match) puts at the 1130Sstevel@tonic-gate * end of the entry it retrieves from the map. 1140Sstevel@tonic-gate */ 1150Sstevel@tonic-gate if (buffer[lenstr] == '\n') { 1160Sstevel@tonic-gate buffer[lenstr] = '\0'; 1170Sstevel@tonic-gate } 1180Sstevel@tonic-gate 1190Sstevel@tonic-gate exec->name = _strtok_escape(buffer, sep, &last); 1200Sstevel@tonic-gate exec->policy = _strtok_escape(NULL, sep, &last); 1210Sstevel@tonic-gate exec->type = _strtok_escape(NULL, sep, &last); 1220Sstevel@tonic-gate exec->res1 = _strtok_escape(NULL, sep, &last); 1230Sstevel@tonic-gate exec->res2 = _strtok_escape(NULL, sep, &last); 1240Sstevel@tonic-gate exec->id = _strtok_escape(NULL, sep, &last); 1250Sstevel@tonic-gate exec->attr = _strtok_escape(NULL, sep, &last); 126*132Srobinson exec->next = NULL; 1270Sstevel@tonic-gate 1280Sstevel@tonic-gate return (NSS_STR_PARSE_SUCCESS); 1290Sstevel@tonic-gate } 1300Sstevel@tonic-gate 1310Sstevel@tonic-gate 1320Sstevel@tonic-gate void 1330Sstevel@tonic-gate _setexecattr(void) 1340Sstevel@tonic-gate { 1350Sstevel@tonic-gate nss_setent(&exec_root, _nss_initf_execattr, &context); 1360Sstevel@tonic-gate } 1370Sstevel@tonic-gate 1380Sstevel@tonic-gate 1390Sstevel@tonic-gate void 1400Sstevel@tonic-gate _endexecattr(void) 1410Sstevel@tonic-gate { 1420Sstevel@tonic-gate nss_endent(&exec_root, _nss_initf_execattr, &context); 1430Sstevel@tonic-gate nss_delete(&exec_root); 1440Sstevel@tonic-gate } 1450Sstevel@tonic-gate 1460Sstevel@tonic-gate 1470Sstevel@tonic-gate execstr_t * 1480Sstevel@tonic-gate _getexecattr(execstr_t *result, char *buffer, int buflen, int *errnop) 1490Sstevel@tonic-gate { 1500Sstevel@tonic-gate nss_status_t res; 1510Sstevel@tonic-gate nss_XbyY_args_t arg; 1520Sstevel@tonic-gate 1530Sstevel@tonic-gate NSS_XbyY_INIT(&arg, result, buffer, buflen, str2execattr); 1540Sstevel@tonic-gate res = nss_getent(&exec_root, _nss_initf_execattr, &context, &arg); 1550Sstevel@tonic-gate arg.status = res; 1560Sstevel@tonic-gate *errnop = arg.h_errno; 1570Sstevel@tonic-gate 1580Sstevel@tonic-gate return ((execstr_t *)NSS_XbyY_FINI(&arg)); 1590Sstevel@tonic-gate } 1600Sstevel@tonic-gate 1610Sstevel@tonic-gate execstr_t * 1620Sstevel@tonic-gate _getexecprof(char *name, 1630Sstevel@tonic-gate char *type, 1640Sstevel@tonic-gate char *id, 1650Sstevel@tonic-gate int search_flag, 1660Sstevel@tonic-gate execstr_t *result, 1670Sstevel@tonic-gate char *buffer, 1680Sstevel@tonic-gate int buflen, 1690Sstevel@tonic-gate int *errnop) 1700Sstevel@tonic-gate { 1710Sstevel@tonic-gate int getby_flag; 1720Sstevel@tonic-gate char policy_buf[BUFSIZ]; 173*132Srobinson const char *empty = NULL; 1740Sstevel@tonic-gate nss_status_t res = NSS_NOTFOUND; 1750Sstevel@tonic-gate nss_XbyY_args_t arg; 1760Sstevel@tonic-gate _priv_execattr _priv_exec; 1770Sstevel@tonic-gate static mutex_t _nsw_exec_lock = DEFAULTMUTEX; 1780Sstevel@tonic-gate 1790Sstevel@tonic-gate NSS_XbyY_INIT(&arg, result, buffer, buflen, str2execattr); 1800Sstevel@tonic-gate 1810Sstevel@tonic-gate _priv_exec.name = (name == NULL) ? empty : (const char *)name; 1820Sstevel@tonic-gate _priv_exec.type = (type == NULL) ? empty : (const char *)type; 1830Sstevel@tonic-gate _priv_exec.id = (id == NULL) ? empty : (const char *)id; 1840Sstevel@tonic-gate #ifdef SI_SECPOLICY 1850Sstevel@tonic-gate if (sysinfo(SI_SECPOLICY, policy_buf, BUFSIZ) == -1) 1860Sstevel@tonic-gate #endif /* SI_SECPOLICY */ 187*132Srobinson (void) strncpy(policy_buf, DEFAULT_POLICY, BUFSIZ); 1880Sstevel@tonic-gate 1890Sstevel@tonic-gate retry_policy: 1900Sstevel@tonic-gate _priv_exec.policy = policy_buf; 1910Sstevel@tonic-gate _priv_exec.search_flag = search_flag; 192*132Srobinson _priv_exec.head_exec = NULL; 193*132Srobinson _priv_exec.prev_exec = NULL; 1940Sstevel@tonic-gate 1950Sstevel@tonic-gate if ((name != NULL) && (id != NULL)) { 1960Sstevel@tonic-gate getby_flag = NSS_DBOP_EXECATTR_BYNAMEID; 1970Sstevel@tonic-gate } else if (name != NULL) { 1980Sstevel@tonic-gate getby_flag = NSS_DBOP_EXECATTR_BYNAME; 1990Sstevel@tonic-gate } else if (id != NULL) { 2000Sstevel@tonic-gate getby_flag = NSS_DBOP_EXECATTR_BYID; 2010Sstevel@tonic-gate } 2020Sstevel@tonic-gate 2030Sstevel@tonic-gate arg.key.attrp = &(_priv_exec); 2040Sstevel@tonic-gate 2050Sstevel@tonic-gate switch (getby_flag) { 2060Sstevel@tonic-gate case NSS_DBOP_EXECATTR_BYID: 2070Sstevel@tonic-gate res = nss_search(&exec_root, _nss_initf_execattr, getby_flag, 2080Sstevel@tonic-gate &arg); 2090Sstevel@tonic-gate break; 2100Sstevel@tonic-gate case NSS_DBOP_EXECATTR_BYNAMEID: 2110Sstevel@tonic-gate case NSS_DBOP_EXECATTR_BYNAME: 2120Sstevel@tonic-gate { 2130Sstevel@tonic-gate char pbuf[NSS_BUFLEN_PROFATTR]; 2140Sstevel@tonic-gate profstr_t prof; 2150Sstevel@tonic-gate nss_status_t pres; 2160Sstevel@tonic-gate nss_XbyY_args_t parg; 2170Sstevel@tonic-gate enum __nsw_parse_err pserr; 2180Sstevel@tonic-gate struct __nsw_lookup *lookups = NULL; 2190Sstevel@tonic-gate struct __nsw_switchconfig *conf = NULL; 2200Sstevel@tonic-gate 2210Sstevel@tonic-gate if (conf = __nsw_getconfig(NSS_DBNAM_PROFATTR, &pserr)) 2220Sstevel@tonic-gate if ((lookups = conf->lookups) == NULL) 2230Sstevel@tonic-gate goto out; 2240Sstevel@tonic-gate NSS_XbyY_INIT(&parg, &prof, pbuf, NSS_BUFLEN_PROFATTR, 2250Sstevel@tonic-gate str2profattr); 2260Sstevel@tonic-gate parg.key.name = name; 2270Sstevel@tonic-gate do { 2280Sstevel@tonic-gate /* 2290Sstevel@tonic-gate * search the exec_attr entry only in the scope 2300Sstevel@tonic-gate * that we find the profile in. 2310Sstevel@tonic-gate * if conf = NULL, search in local files only, 2320Sstevel@tonic-gate * as we were not able to read nsswitch.conf. 2330Sstevel@tonic-gate */ 2340Sstevel@tonic-gate DEFINE_NSS_DB_ROOT(prof_root); 2350Sstevel@tonic-gate if (mutex_lock(&_nsw_exec_lock) != 0) 2360Sstevel@tonic-gate goto out; 2370Sstevel@tonic-gate _nsw_search_path = (conf == NULL) 2380Sstevel@tonic-gate ? NSS_FILES_ONLY 2390Sstevel@tonic-gate : lookups->service_name; 2400Sstevel@tonic-gate pres = nss_search(&prof_root, 2410Sstevel@tonic-gate _nsw_initf_profattr, 2420Sstevel@tonic-gate NSS_DBOP_PROFATTR_BYNAME, &parg); 2430Sstevel@tonic-gate if (pres == NSS_SUCCESS) { 2440Sstevel@tonic-gate DEFINE_NSS_DB_ROOT(pexec_root); 2450Sstevel@tonic-gate res = nss_search(&pexec_root, 2460Sstevel@tonic-gate _nsw_initf_execattr, getby_flag, 2470Sstevel@tonic-gate &arg); 2480Sstevel@tonic-gate _nss_db_state_destr(pexec_root.s); 2490Sstevel@tonic-gate } 2500Sstevel@tonic-gate _nss_db_state_destr(prof_root.s); 2510Sstevel@tonic-gate (void) mutex_unlock(&_nsw_exec_lock); 2520Sstevel@tonic-gate if ((pres == NSS_SUCCESS) || (conf == NULL)) 2530Sstevel@tonic-gate break; 2540Sstevel@tonic-gate } while (lookups && (lookups = lookups->next)); 2550Sstevel@tonic-gate } 2560Sstevel@tonic-gate break; 2570Sstevel@tonic-gate default: 2580Sstevel@tonic-gate break; 2590Sstevel@tonic-gate } 2600Sstevel@tonic-gate 2610Sstevel@tonic-gate out: 2620Sstevel@tonic-gate /* 2630Sstevel@tonic-gate * If we can't find an entry for the current default policy 2640Sstevel@tonic-gate * fall back to the old "suser" policy. The nameservice is 2650Sstevel@tonic-gate * shared between different OS releases. 2660Sstevel@tonic-gate */ 2670Sstevel@tonic-gate if (res == NSS_NOTFOUND && strcmp(policy_buf, DEFAULT_POLICY) == 0) { 2680Sstevel@tonic-gate (void) strlcpy(policy_buf, SUSER_POLICY, BUFSIZ); 2690Sstevel@tonic-gate goto retry_policy; 2700Sstevel@tonic-gate } 2710Sstevel@tonic-gate 2720Sstevel@tonic-gate arg.status = res; 2730Sstevel@tonic-gate *errnop = res; 2740Sstevel@tonic-gate return ((execstr_t *)NSS_XbyY_FINI(&arg)); 2750Sstevel@tonic-gate } 2760Sstevel@tonic-gate 2770Sstevel@tonic-gate 2780Sstevel@tonic-gate int 2790Sstevel@tonic-gate _doexeclist(nss_XbyY_args_t *argp) 2800Sstevel@tonic-gate { 2810Sstevel@tonic-gate int status = 1; 2820Sstevel@tonic-gate _priv_execattr *_priv_exec = (_priv_execattr *)(argp->key.attrp); 2830Sstevel@tonic-gate execstr_t *exec = (execstr_t *)((argp->buf.result)); 2840Sstevel@tonic-gate 2850Sstevel@tonic-gate if (_priv_exec->head_exec == NULL) { 2860Sstevel@tonic-gate if (_priv_exec->head_exec = _dup_execstr(exec)) 2870Sstevel@tonic-gate _priv_exec->prev_exec = _priv_exec->head_exec; 2880Sstevel@tonic-gate else 2890Sstevel@tonic-gate status = 0; 2900Sstevel@tonic-gate } else { 2910Sstevel@tonic-gate if (_priv_exec->prev_exec->next = _dup_execstr(exec)) 2920Sstevel@tonic-gate _priv_exec->prev_exec = _priv_exec->prev_exec->next; 2930Sstevel@tonic-gate else 2940Sstevel@tonic-gate status = 0; 2950Sstevel@tonic-gate } 296*132Srobinson (void) memset(argp->buf.buffer, NULL, argp->buf.buflen); 2970Sstevel@tonic-gate 2980Sstevel@tonic-gate return (status); 2990Sstevel@tonic-gate 3000Sstevel@tonic-gate } 3010Sstevel@tonic-gate 3020Sstevel@tonic-gate 3030Sstevel@tonic-gate /* 3040Sstevel@tonic-gate * Converts id to a wildcard string. e.g.: 3050Sstevel@tonic-gate * For type = KV_COMMAND: /usr/ccs/bin/what ---> /usr/ccs/bin/\* ---> \* 3060Sstevel@tonic-gate * For type = KV_ACTION: Dtfile;*;*;*;0 ---> *;*;*;*;* 3070Sstevel@tonic-gate * 3080Sstevel@tonic-gate * Returns NULL if id is already a wild-card. 3090Sstevel@tonic-gate */ 3100Sstevel@tonic-gate char * 3110Sstevel@tonic-gate _exec_wild_id(char *id, const char *type) 3120Sstevel@tonic-gate { 3130Sstevel@tonic-gate char c_id = '/'; 3140Sstevel@tonic-gate char *pchar = NULL; 3150Sstevel@tonic-gate 3160Sstevel@tonic-gate if ((id == NULL) || (type == NULL)) 3170Sstevel@tonic-gate return (NULL); 3180Sstevel@tonic-gate 3190Sstevel@tonic-gate if (strcmp(type, KV_ACTION) == 0) { 3200Sstevel@tonic-gate return ((strcmp(id, KV_ACTION_WILDCARD) == 0) ? NULL : 3210Sstevel@tonic-gate KV_ACTION_WILDCARD); 3220Sstevel@tonic-gate } else if (strcmp(type, KV_COMMAND) == 0) { 3230Sstevel@tonic-gate if ((pchar = rindex(id, c_id)) == NULL) 3240Sstevel@tonic-gate /* 3250Sstevel@tonic-gate * id = \* 3260Sstevel@tonic-gate */ 3270Sstevel@tonic-gate return (NULL); 3280Sstevel@tonic-gate else if (*(++pchar) == KV_WILDCHAR) 3290Sstevel@tonic-gate /* 3300Sstevel@tonic-gate * id = /usr/ccs/bin/\* 3310Sstevel@tonic-gate */ 3320Sstevel@tonic-gate return (pchar); 3330Sstevel@tonic-gate /* 3340Sstevel@tonic-gate * id = /usr/ccs/bin/what 3350Sstevel@tonic-gate */ 336*132Srobinson (void) strcpy(pchar, KV_WILDCARD); 3370Sstevel@tonic-gate return (id); 3380Sstevel@tonic-gate } 3390Sstevel@tonic-gate 3400Sstevel@tonic-gate return (NULL); 3410Sstevel@tonic-gate 3420Sstevel@tonic-gate } 3430Sstevel@tonic-gate 3440Sstevel@tonic-gate 3450Sstevel@tonic-gate execstr_t * 3460Sstevel@tonic-gate _dup_execstr(execstr_t *old_exec) 3470Sstevel@tonic-gate { 348*132Srobinson execstr_t *new_exec = NULL; 3490Sstevel@tonic-gate 350*132Srobinson if (old_exec == NULL) 351*132Srobinson return (NULL); 352*132Srobinson if ((new_exec = malloc(sizeof (execstr_t))) != NULL) { 3530Sstevel@tonic-gate new_exec->name = _strdup_null(old_exec->name); 3540Sstevel@tonic-gate new_exec->type = _strdup_null(old_exec->type); 3550Sstevel@tonic-gate new_exec->policy = _strdup_null(old_exec->policy); 3560Sstevel@tonic-gate new_exec->res1 = _strdup_null(old_exec->res1); 3570Sstevel@tonic-gate new_exec->res2 = _strdup_null(old_exec->res2); 3580Sstevel@tonic-gate new_exec->id = _strdup_null(old_exec->id); 3590Sstevel@tonic-gate new_exec->attr = _strdup_null(old_exec->attr); 3600Sstevel@tonic-gate new_exec->next = old_exec->next; 3610Sstevel@tonic-gate } 3620Sstevel@tonic-gate return (new_exec); 3630Sstevel@tonic-gate } 3640Sstevel@tonic-gate 3650Sstevel@tonic-gate void 3660Sstevel@tonic-gate _free_execstr(execstr_t *exec) 3670Sstevel@tonic-gate { 3680Sstevel@tonic-gate if (exec != NULL) { 3690Sstevel@tonic-gate free(exec->name); 3700Sstevel@tonic-gate free(exec->type); 3710Sstevel@tonic-gate free(exec->policy); 3720Sstevel@tonic-gate free(exec->res1); 3730Sstevel@tonic-gate free(exec->res2); 3740Sstevel@tonic-gate free(exec->id); 3750Sstevel@tonic-gate free(exec->attr); 3760Sstevel@tonic-gate _free_execstr(exec->next); 3770Sstevel@tonic-gate free(exec); 3780Sstevel@tonic-gate } 3790Sstevel@tonic-gate } 3800Sstevel@tonic-gate 3810Sstevel@tonic-gate void 3820Sstevel@tonic-gate _exec_cleanup(nss_status_t res, nss_XbyY_args_t *argp) 3830Sstevel@tonic-gate { 3840Sstevel@tonic-gate _priv_execattr *_priv_exec = (_priv_execattr *)(argp->key.attrp); 3850Sstevel@tonic-gate 3860Sstevel@tonic-gate if (res == NSS_SUCCESS) { 3870Sstevel@tonic-gate if (_priv_exec->head_exec != NULL) { 3880Sstevel@tonic-gate argp->buf.result = _priv_exec->head_exec; 3890Sstevel@tonic-gate argp->returnval = argp->buf.result; 3900Sstevel@tonic-gate } 3910Sstevel@tonic-gate } else { 3920Sstevel@tonic-gate if (_priv_exec->head_exec != NULL) 3930Sstevel@tonic-gate _free_execstr(_priv_exec->head_exec); 3940Sstevel@tonic-gate argp->returnval = NULL; 3950Sstevel@tonic-gate } 3960Sstevel@tonic-gate } 397