Ignore:
Timestamp:
Aug 2, 2010, 6:40:21 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.5: vendor update to 3.5.4

Location:
vendor/current/source3/printing
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/printing/lpq_parse.c

    r414 r478  
    1919
    2020#include "includes.h"
     21#include "printing.h"
    2122
    2223static const char *Months[13] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
     
    11511152        return ret;
    11521153}
     1154
     1155/****************************************************************************
     1156 Parse a file name from the system spooler to generate a jobid.
     1157****************************************************************************/
     1158
     1159uint32_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  
    9292        {"Statement",0x1,0x221b4,0x34b5c,0x0,0x0,0x221b4,0x34b5c},
    9393        {"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},
    9496        {"A3",0x1,0x48828,0x668a0,0x0,0x0,0x48828,0x668a0},
    9597        {"A4",0x1,0x33450,0x48828,0x0,0x0,0x33450,0x48828},
     
    16031605
    16041606#define strip_driver_path(_mem_ctx, _element) do { \
    1605         if ((_p = strrchr((_element), '\\')) != NULL) { \
     1607        if (_element && ((_p = strrchr((_element), '\\')) != NULL)) { \
    16061608                (_element) = talloc_asprintf((_mem_ctx), "%s", _p+1); \
    16071609                W_ERROR_HAVE_NO_MEMORY((_element)); \
     
    16241626        char *_p;
    16251627
     1628        if (!*driver_path || !*data_file || !*config_file) {
     1629                return WERR_INVALID_PARAM;
     1630        }
     1631
    16261632        /* clean up the driver name.
    16271633         * we can get .\driver.dll
     
    16331639        strip_driver_path(mem_ctx, *data_file);
    16341640        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        }
    16361644
    16371645        if (dependent_files && dependent_files->string) {
  • vendor/current/source3/printing/print_cups.c

    r427 r478  
    919919        char *filename = NULL;
    920920        size_t size;
     921        uint32_t jobid = (uint32_t)-1;
    921922        char addr[INET6_ADDRSTRLEN];
    922923
     
    985986                      clientname);
    986987
     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
    987996        if (!push_utf8_talloc(frame, &jobname, pjob->jobname, &size)) {
    988997                goto out;
     
    990999        new_jobname = talloc_asprintf(frame,
    9911000                        "%s%.8u %s", PRINT_SPOOL_PREFIX,
    992                         (unsigned int)pjob->smbjob,
     1001                        (unsigned int)jobid,
    9931002                        jobname);
    9941003        if (new_jobname == NULL) {
  • vendor/current/source3/printing/printing.c

    r414 r478  
    645645
    646646/****************************************************************************
    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 /****************************************************************************
    666647 List a unix job in the print database.
    667648****************************************************************************/
     
    26102591                return True;
    26112592        }
    2612 
    2613         pjob->smbjob = jobid;
    26142593
    26152594        ret = (*(current_printif->job_submit))(snum, pjob);
Note: See TracChangeset for help on using the changeset viewer.