Changeset 478 for vendor/current/source3/printing
- Timestamp:
- Aug 2, 2010, 6:40:21 PM (15 years ago)
- Location:
- vendor/current/source3/printing
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/printing/lpq_parse.c
r414 r478 19 19 20 20 #include "includes.h" 21 #include "printing.h" 21 22 22 23 static const char *Months[13] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", … … 1151 1152 return ret; 1152 1153 } 1154 1155 /**************************************************************************** 1156 Parse a file name from the system spooler to generate a jobid. 1157 ****************************************************************************/ 1158 1159 uint32_t print_parse_jobid(const char *fname) 1160 { 1161 int jobid; 1162 const char *p = strstr_m(fname,PRINT_SPOOL_PREFIX); 1163 1164 if (!p) { 1165 return (uint32_t)-1; 1166 } 1167 p += strlen(PRINT_SPOOL_PREFIX); 1168 jobid = atoi(p); 1169 if (jobid <= 0) { 1170 return (uint32_t)-1; 1171 } 1172 return (uint32_t)jobid; 1173 } -
vendor/current/source3/printing/nt_printing.c
r427 r478 92 92 {"Statement",0x1,0x221b4,0x34b5c,0x0,0x0,0x221b4,0x34b5c}, 93 93 {"Executive",0x1,0x2cf56,0x411cc,0x0,0x0,0x2cf56,0x411cc}, 94 {"A0",0x1,0xcd528,0x122488,0x0,0x0,0xcd528,0x122488}, 95 {"A1",0x1,0x91050,0xcd528,0x0,0x0,0x91050,0xcd528}, 94 96 {"A3",0x1,0x48828,0x668a0,0x0,0x0,0x48828,0x668a0}, 95 97 {"A4",0x1,0x33450,0x48828,0x0,0x0,0x33450,0x48828}, … … 1603 1605 1604 1606 #define strip_driver_path(_mem_ctx, _element) do { \ 1605 if ( (_p = strrchr((_element), '\\')) != NULL) { \1607 if (_element && ((_p = strrchr((_element), '\\')) != NULL)) { \ 1606 1608 (_element) = talloc_asprintf((_mem_ctx), "%s", _p+1); \ 1607 1609 W_ERROR_HAVE_NO_MEMORY((_element)); \ … … 1624 1626 char *_p; 1625 1627 1628 if (!*driver_path || !*data_file || !*config_file) { 1629 return WERR_INVALID_PARAM; 1630 } 1631 1626 1632 /* clean up the driver name. 1627 1633 * we can get .\driver.dll … … 1633 1639 strip_driver_path(mem_ctx, *data_file); 1634 1640 strip_driver_path(mem_ctx, *config_file); 1635 strip_driver_path(mem_ctx, *help_file); 1641 if (help_file) { 1642 strip_driver_path(mem_ctx, *help_file); 1643 } 1636 1644 1637 1645 if (dependent_files && dependent_files->string) { -
vendor/current/source3/printing/print_cups.c
r427 r478 919 919 char *filename = NULL; 920 920 size_t size; 921 uint32_t jobid = (uint32_t)-1; 921 922 char addr[INET6_ADDRSTRLEN]; 922 923 … … 985 986 clientname); 986 987 988 /* Get the jobid from the filename. */ 989 jobid = print_parse_jobid(pjob->filename); 990 if (jobid == (uint32_t)-1) { 991 DEBUG(0,("cups_job_submit: failed to parse jobid from name %s\n", 992 pjob->filename )); 993 jobid = 0; 994 } 995 987 996 if (!push_utf8_talloc(frame, &jobname, pjob->jobname, &size)) { 988 997 goto out; … … 990 999 new_jobname = talloc_asprintf(frame, 991 1000 "%s%.8u %s", PRINT_SPOOL_PREFIX, 992 (unsigned int) pjob->smbjob,1001 (unsigned int)jobid, 993 1002 jobname); 994 1003 if (new_jobname == NULL) { -
vendor/current/source3/printing/printing.c
r414 r478 645 645 646 646 /**************************************************************************** 647 Parse a file name from the system spooler to generate a jobid.648 ****************************************************************************/649 650 static uint32 print_parse_jobid(char *fname)651 {652 int jobid;653 654 if (strncmp(fname,PRINT_SPOOL_PREFIX,strlen(PRINT_SPOOL_PREFIX)) != 0)655 return (uint32)-1;656 fname += strlen(PRINT_SPOOL_PREFIX);657 658 jobid = atoi(fname);659 if (jobid <= 0)660 return (uint32)-1;661 662 return (uint32)jobid;663 }664 665 /****************************************************************************666 647 List a unix job in the print database. 667 648 ****************************************************************************/ … … 2610 2591 return True; 2611 2592 } 2612 2613 pjob->smbjob = jobid;2614 2593 2615 2594 ret = (*(current_printif->job_submit))(snum, pjob);
Note:
See TracChangeset
for help on using the changeset viewer.