Changeset 480 for trunk/server/source3/printing
- Timestamp:
- Aug 2, 2010, 8:16:45 PM (15 years ago)
- Location:
- trunk/server
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 453,478
- Property svn:mergeinfo changed
-
trunk/server/source3/printing/lpq_parse.c
r414 r480 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 } -
trunk/server/source3/printing/nt_printing.c
r429 r480 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) { -
trunk/server/source3/printing/print_cups.c
r464 r480 923 923 char *filename = NULL; 924 924 size_t size; 925 uint32_t jobid = (uint32_t)-1; 925 926 char addr[INET6_ADDRSTRLEN]; 926 927 … … 989 990 clientname); 990 991 992 /* Get the jobid from the filename. */ 993 jobid = print_parse_jobid(pjob->filename); 994 if (jobid == (uint32_t)-1) { 995 DEBUG(0,("cups_job_submit: failed to parse jobid from name %s\n", 996 pjob->filename )); 997 jobid = 0; 998 } 999 991 1000 if (!push_utf8_talloc(frame, &jobname, pjob->jobname, &size)) { 992 1001 goto out; … … 994 1003 new_jobname = talloc_asprintf(frame, 995 1004 "%s%.8u %s", PRINT_SPOOL_PREFIX, 996 (unsigned int) pjob->smbjob,1005 (unsigned int)jobid, 997 1006 jobname); 998 1007 if (new_jobname == NULL) { -
trunk/server/source3/printing/printing.c
r454 r480 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 ****************************************************************************/ … … 2614 2595 return True; 2615 2596 } 2616 2617 pjob->smbjob = jobid;2618 2597 2619 2598 ret = (*(current_printif->job_submit))(snum, pjob);
Note:
See TracChangeset
for help on using the changeset viewer.