Lines Matching refs:rp

85 	RSTATUS			*rp;
108 if ((rp = NewRequest = new_rstatus(NULL, NULL)) == NULL)
123 rp->req_file = Strdup(req_file);
125 freerequest(rp->request);
126 rp->request = r;
128 rp->request->outcome = 0;
129 rp->secure->uid = md->uid;
130 rp->secure->gid = md->gid;
132 rp->secure->slabel = Strdup(md->slabel);
137 rp->secure->user = Strdup(pw->pw_name);
139 rp->secure->user = Strdup(BIGGEST_NUMBER_S);
140 (void) sprintf(rp->secure->user, "%u",
144 if ((rp->request->actions & ACT_SPECIAL) == ACT_HOLD)
145 rp->request->outcome |= RS_HELD;
146 if ((rp->request->actions & ACT_SPECIAL) == ACT_RESUME)
147 rp->request->outcome &= ~RS_HELD;
148 if ((rp->request->actions & ACT_SPECIAL) ==
154 rp->request->outcome |= RS_IMMEDIATE;
157 size = chfiles(rp->request->file_list, Lp_Uid, Lp_Gid);
189 size = chfiles(rp->request->file_list,
213 if (!(rp->request->outcome & RS_HELD) && size == 0) {
217 rp->secure->size = size;
219 (void) time(&rp->secure->date);
220 rp->secure->req_id = NULL;
222 if (!rp->request->title) {
223 if (strlen(*rp->request->file_list) <
225 rp->request->title =
226 Strdup(*rp->request->file_list);
230 *rp->request->file_list, '/'))
233 r = *rp->request->file_list;
235 rp->request->title = malloc(25);
236 sprintf(rp->request->title,
241 if ((err = validate_request(rp, &req_id, 0)) != MOK)
248 if (rp->secure->req_id == NULL) {
251 rp->secure->req_id = req_id;
253 req_id = rp->secure->req_id;
298 if ((Putsecure(req_file, rp->secure) == -1) ||
299 (putrequest(req_file, rp->request) == -1))
305 insertr(rp);
308 if (rp->slow)
309 schedule(EV_SLOWF, rp);
312 rp->printer);
324 if (status != MOK && rp) {
325 rmfiles(rp, 0);
326 free_rstatus(rp);
341 RSTATUS *rp;
350 if (!(rp = request_by_id(req_id)))
353 (md->slabel != NULL) && (rp->secure->slabel != NULL) &&
354 (!STREQU(md->slabel, rp->secure->slabel)))
356 else if (rp->request->outcome & RS_DONE)
358 else if (!md->admin && md->uid != rp->secure->uid)
360 else if (rp->request->outcome & RS_CHANGING)
362 else if (rp->request->outcome & RS_NOTIFYING)
367 if (rp->request->outcome & RS_FILTERING &&
368 !(rp->request->outcome & RS_STOPPED)) {
369 rp->request->outcome |= (RS_REFILTER|RS_STOPPED);
370 terminate(rp->exec);
373 if (rp->request->outcome & RS_PRINTING &&
374 !(rp->request->outcome & RS_STOPPED)) {
375 rp->request->outcome |= RS_STOPPED;
376 terminate(rp->printer->exec);
379 rp->request->outcome |= RS_CHANGING;
383 * Either this is identical to "rp->secure->uid", or it is
389 path = makepath(Lp_Tmp, rp->req_file, (char *)0);
390 (void) Chown(path, md->uid, rp->secure->gid);
398 * Either this is identical to "rp->secure->uid", or it is
405 "%s-%s", strtok(strdup(rp->req_file), "-"),
419 (void) Chown(path, md->uid, rp->secure->gid);
429 add_flt_act(md, FLT_CHANGE, rp);
430 req_file = rp->req_file;
445 RSTATUS *rp;
462 if (!(rp = request_by_id(req_id)))
465 (md->slabel != NULL) && (rp->secure->slabel != NULL) &&
466 (!STREQU(md->slabel, rp->secure->slabel)))
468 else if (!(rp->request->outcome & RS_CHANGING))
471 path = makepath(Lp_Tmp, rp->req_file, (char *)0);
484 "%s-%s", strtok(strdup(rp->req_file), "-"),
507 rp->request->outcome &= ~(RS_CHANGING);
517 if (!(r = Getrequest(rp->req_file)))
520 oldr = *(rp->request);
521 *(rp->request) = *r;
529 rp->request->outcome = oldr.outcome;
542 rp->request->actions |=
545 if ((rp->request->actions & ACT_SPECIAL) ==
547 rp->request->outcome |= RS_HELD;
556 if (md->uid != rp->secure->uid)
557 rp->request->outcome |=
561 if ((rp->request->actions & ACT_SPECIAL) ==
563 if ((rp->request->outcome & RS_ADMINHELD) &&
568 rp->request->outcome &=
572 if ((rp->request->actions & ACT_SPECIAL)
578 rp->request->outcome |= RS_IMMEDIATE;
581 size = chfiles(rp->request->file_list, Lp_Uid,
587 if (!(rp->request->outcome & RS_HELD) &&
593 osize = rp->secure->size;
594 rp->secure->size = size;
598 if ((status = mv_file(rp, dest)) == MOK)
599 rp->secure->size = osize;
601 } else if ((err = validate_request(rp, (char **)0,
604 rp->secure->size = osize;
608 if ((rp->request->outcome & RS_IMMEDIATE) ||
609 (rp->request->priority != oldr.priority)) {
610 remover(rp);
611 insertr(rp);
615 (void) putrequest(rp->req_file, rp->request);
620 (void) Putsecure(rp->req_file, rp->secure);
626 if (status != MOK && rp) {
629 *(rp->request) = oldr;
632 (void) putrequest(rp->req_file, rp->request);
636 maybe_schedule(rp);
649 static RSTATUS *rp;
667 rp = Request_List;
675 while (rp != NULL) {
676 crp = rp;
677 rp = rp->next;
799 RSTATUS *rp;
816 for (rp = Request_List; rp != NULL; rp = rp->next) {
817 if (rp->printer && !(rp->request->outcome & RS_DONE))
818 rp->printer->nrequests++;
820 if (*form && !SAME(form, rp->request->form))
823 if (*dest && !STREQU(dest, rp->request->destination)) {
824 if (!rp->printer)
826 if (!STREQU(dest, rp->printer->printer->name))
830 if (*req_id && !STREQU(req_id, rp->secure->req_id))
833 if (*user && !bangequ(user, rp->secure->user))
836 if (*pwheel && !SAME(pwheel, rp->pwheel_name))
844 (md->slabel != NULL) && (rp->secure->slabel != NULL) &&
845 (!STREQU(md->slabel, rp->secure->slabel)))
865 found = rp;
890 mv_file(RSTATUS *rp, char *dest)
899 oldexec = rp->printer->exec;
900 olddest = rp->request->destination;
901 rp->request->destination = Strdup(dest);
902 if ((stat = validate_request(rp, (char **)0, 1)) == MOK) {
905 if (rp->request->outcome & RS_FILTERED) {
911 reqno = getreqno(rp->secure->req_id);
912 for (listp = rp->request->file_list; *listp; listp++) {
919 rp->request->outcome &= ~RS_FILTERED;
923 if (putrequest(rp->req_file, rp->request) < 0) {
929 if ((securep = Getsecure(rp->req_file))) {
937 (void) rmsecure(rp->secure->req_id);
938 if (Putsecure(rp->req_file, securep) < 0) {
948 if (prs = request_by_id(rp->secure->req_id)) {
971 if (rp->request->outcome & RS_PRINTING &&
972 !(rp->request->outcome & RS_STOPPED)) {
973 rp->request->outcome |= RS_STOPPED;
977 maybe_schedule(rp);
981 Free(rp->request->destination);
982 rp->request->destination = olddest;
993 RSTATUS *rp;
1008 if ((rp = request_by_id(req_id))) {
1009 if (STREQU(rp->request->destination, dest)) {
1013 if (rp->request->outcome & (RS_DONE|RS_NOTIFYING)) {
1017 if (rp->request->outcome & RS_CHANGING) {
1021 if ((err = mv_file(rp, dest)) == MOK) {
1040 RSTATUS *rp;
1063 for (rp = Request_List; rp != NULL; rp = rp->next) {
1064 if ((STREQU(rp->request->destination, fromdest)) &&
1065 (!(rp->request->outcome &
1067 if (mv_file(rp, dest) == MOK) {
1076 found = rp->secure->req_id;