Lines Matching refs:tmpname
86 static char tmpname[] = "/tmp/SUIDXXXXXX";
115 maketemp(tmpname);
116 if(strcmp(p,tmpname)==0)
138 if(stat(tmpname,&statb) < 0 || statb.st_nlink != 1 ||
377 * linked a valuable file to tmpname?
379 unlink(tmpname); /* should normally fail */
381 if((n = open(tmpname, O_WRONLY | O_CREAT | O_EXCL, SPECIAL)) < 0 ||
382 unlink(tmpname) < 0)
384 if((n = open(tmpname, O_WRONLY | O_CREAT ,SPECIAL)) < 0 || unlink(tmpname) < 0)
408 while(unlink(tmpname) < 0 && errno == ETXTBSY)
429 if((n = open(tmpname,O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, mode)) < 0)
431 unlink(tmpname);
432 if((n = open(tmpname,O_WRONLY|O_CREAT|O_TRUNC, mode)) < 0)
437 if(chmod(tmpname,mode) <0)
446 arglist[0] = (char*)tmpname;
466 execv(tmpname,arglist);