Lines Matching refs:mcp
2201 * Try to load mcp->pwd, if it isn't already.
2210 lookup_pwd(struct method_context *mcp)
2214 if (mcp->pwbuf != NULL && mcp->pwd.pw_uid == mcp->uid)
2217 if (mcp->pwbuf == NULL) {
2218 mcp->pwbufsz = sysconf(_SC_GETPW_R_SIZE_MAX);
2219 assert(mcp->pwbufsz >= 0);
2220 mcp->pwbuf = malloc(mcp->pwbufsz);
2221 if (mcp->pwbuf == NULL)
2227 pwdp = getpwuid_r(mcp->uid, &mcp->pwd, mcp->pwbuf,
2228 mcp->pwbufsz);
2233 free(mcp->pwbuf);
2234 mcp->pwbuf = NULL;
2877 struct method_context *mcp, scf_property_t *prop, scf_value_t *val)
2902 mcp->env_sz = 10;
2904 if ((mcp->env = uu_zalloc(sizeof (*mcp->env) * mcp->env_sz)) == NULL) {
2910 ret = scf_value_get_as_string(val, mcp->vbuf, mcp->vbuf_sz);
2916 if ((mcp->env[i] = strdup(mcp->vbuf)) == NULL) {
2921 if (++i == mcp->env_sz) {
2923 mcp->env_sz *= 2;
2924 env = uu_zalloc(sizeof (*mcp->env) * mcp->env_sz);
2929 (void) memcpy(env, mcp->env,
2930 sizeof (*mcp->env) * (mcp->env_sz / 2));
2931 free(mcp->env);
2932 mcp->env = env;
3889 restarter_free_method_context(struct method_context *mcp)
3893 if (mcp->lpriv_set != NULL)
3894 priv_freeset(mcp->lpriv_set);
3895 if (mcp->priv_set != NULL)
3896 priv_freeset(mcp->priv_set);
3897 if (mcp->xpctxt != NULL)
3898 xpol_context_free(mcp->xpctxt);
3900 if (mcp->env != NULL) {
3901 for (i = 0; i < mcp->env_sz; i++)
3902 free(mcp->env[i]);
3903 free(mcp->env);
3906 free(mcp->working_dir);
3907 free(mcp->corefile_pattern);
3908 free(mcp->project);
3909 free(mcp->resource_pool);
3910 free(mcp);