matchjobs.c (139464) | matchjobs.c (220586) |
---|---|
1/* 2 * ------+---------+---------+---------+---------+---------+---------+---------* | 1/* 2 * ------+---------+---------+---------+---------+---------+---------+---------* |
3 * Copyright (c) 2002 - Garance Alistair Drosehn | 3 * Copyright (c) 2002,2011 - Garance Alistair Drosehn <gad@FreeBSD.org>. |
4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright --- 16 unchanged lines hidden (view full) --- 28 * are those of the authors and should not be interpreted as representing 29 * official policies, either expressed or implied, of the FreeBSD Project 30 * or FreeBSD, Inc. 31 * 32 * ------+---------+---------+---------+---------+---------+---------+---------* 33 */ 34 35#include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */ | 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright --- 16 unchanged lines hidden (view full) --- 28 * are those of the authors and should not be interpreted as representing 29 * official policies, either expressed or implied, of the FreeBSD Project 30 * or FreeBSD, Inc. 31 * 32 * ------+---------+---------+---------+---------+---------+---------+---------* 33 */ 34 35#include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */ |
36__FBSDID("$FreeBSD: head/usr.sbin/lpr/common_source/matchjobs.c 139464 2004-12-31 00:36:28Z gad $"); | 36__FBSDID("$FreeBSD: head/usr.sbin/lpr/common_source/matchjobs.c 220586 2011-04-13 00:36:19Z gad $"); |
37 38/* 39 * movejobs.c - The lpc commands which move jobs around. 40 */ 41 42#include <sys/file.h> 43#include <sys/param.h> 44#include <sys/queue.h> --- 403 unchanged lines hidden (view full) --- 448 /* 449 * Check for a match on the user name. This has to be done 450 * by reading the control file. 451 */ 452 if (jspec->wanteduser != NULL) { 453 cfinf = ctl_readcf("fakeq", jq->job_cfname); 454 if (cfinf == NULL) 455 goto nomatch; | 37 38/* 39 * movejobs.c - The lpc commands which move jobs around. 40 */ 41 42#include <sys/file.h> 43#include <sys/param.h> 44#include <sys/queue.h> --- 403 unchanged lines hidden (view full) --- 448 /* 449 * Check for a match on the user name. This has to be done 450 * by reading the control file. 451 */ 452 if (jspec->wanteduser != NULL) { 453 cfinf = ctl_readcf("fakeq", jq->job_cfname); 454 if (cfinf == NULL) 455 goto nomatch; |
456 if (fnmatch(jspec->wanteduser, cfinf->cji_username, 0) != 0) | 456 if (fnmatch(jspec->wanteduser, cfinf->cji_acctuser, 0) != 0) |
457 goto nomatch; 458 } 459 460 /* This job matches all of the specified criteria. */ 461 match = 1; 462 jq->job_matched = 1; /* avoid matching the job twice */ 463 jspec->matchcnt++; 464 if (jspec->wanteduser != NULL) { 465 /* 466 * If the user specified a userid (which may have been a 467 * pattern), then the caller's "doentry()" routine might 468 * want to know the userid of this job that matched. 469 */ | 457 goto nomatch; 458 } 459 460 /* This job matches all of the specified criteria. */ 461 match = 1; 462 jq->job_matched = 1; /* avoid matching the job twice */ 463 jspec->matchcnt++; 464 if (jspec->wanteduser != NULL) { 465 /* 466 * If the user specified a userid (which may have been a 467 * pattern), then the caller's "doentry()" routine might 468 * want to know the userid of this job that matched. 469 */ |
470 jspec->matcheduser = strdup(cfinf->cji_username); | 470 jspec->matcheduser = strdup(cfinf->cji_acctuser); |
471 } 472#if DEBUG_SCANJS 473 printf("\t [ job matched! ]\n"); 474#endif 475 476nomatch: 477 if (cfinf != NULL) 478 ctl_freeinf(cfinf); --- 90 unchanged lines hidden --- | 471 } 472#if DEBUG_SCANJS 473 printf("\t [ job matched! ]\n"); 474#endif 475 476nomatch: 477 if (cfinf != NULL) 478 ctl_freeinf(cfinf); --- 90 unchanged lines hidden --- |