Lines Matching refs:shp
85 static int test_strmatch(Shell_t *shp,const char *str, const char *pat)
107 sh_setmatch(shp, str, -1, n, match, 0);
116 tdata.sh = context->shp;
313 int test_unop(Shell_t *shp,register int op,register const char *arg)
411 return(statb.st_uid==shp->gd->userid);
412 return(statb.st_gid==shp->gd->groupid);
436 if(!(np = nv_open(arg,shp->var_tree,NV_VARNAME|NV_NOFAIL|NV_NOADD|NV_NOREF)))
464 int test_binop(Shell_t *shp,register int op,const char *left,const char *right)
473 lnum = sh_arith(shp,left);
474 rnum = sh_arith(shp,right);
483 return(test_strmatch(shp, left, right));
485 return(!test_strmatch(shp, left, right));
560 Shell_t *shp = sh_getinterp();
567 if(mode==X_OK && shp->gd->euserid==0)
569 if(shp->gd->userid==shp->gd->euserid && shp->gd->groupid==shp->gd->egroupid)
574 if(shp->gd->groupid==shp->gd->euserid || setregid(shp->gd->egroupid,shp->gd->groupid)==0)
577 if(shp->gd->userid==shp->gd->euserid || setreuid(shp->gd->euserid,shp->gd->userid)==0)
581 if(shp->gd->userid!=shp->gd->euserid)
582 setreuid(shp->gd->userid,shp->gd->euserid);
583 if(shp->gd->groupid!=shp->gd->egroupid)
584 setregid(shp->gd->groupid,shp->gd->egroupid);
587 else if(shp->gd->groupid!=shp->gd->egroupid)
588 setregid(shp->gd->groupid,shp->gd->egroupid);
596 else if(shp->gd->euserid == 0)
603 else if(shp->gd->euserid == statb.st_uid)
605 else if(shp->gd->egroupid == statb.st_gid)