Ignore:
Timestamp:
Aug 2, 2010, 8:16:45 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: trunk update to 3.5.4

Location:
trunk/server
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/printing/lpq_parse.c

    r414 r480  
    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}
  • trunk/server/source3/printing/nt_printing.c

    r429 r480  
    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) {
  • trunk/server/source3/printing/print_cups.c

    r464 r480  
    923923        char *filename = NULL;
    924924        size_t size;
     925        uint32_t jobid = (uint32_t)-1;
    925926        char addr[INET6_ADDRSTRLEN];
    926927
     
    989990                      clientname);
    990991
     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
    9911000        if (!push_utf8_talloc(frame, &jobname, pjob->jobname, &size)) {
    9921001                goto out;
     
    9941003        new_jobname = talloc_asprintf(frame,
    9951004                        "%s%.8u %s", PRINT_SPOOL_PREFIX,
    996                         (unsigned int)pjob->smbjob,
     1005                        (unsigned int)jobid,
    9971006                        jobname);
    9981007        if (new_jobname == NULL) {
  • trunk/server/source3/printing/printing.c

    r454 r480  
    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****************************************************************************/
     
    26142595                return True;
    26152596        }
    2616 
    2617         pjob->smbjob = jobid;
    26182597
    26192598        ret = (*(current_printif->job_submit))(snum, pjob);
Note: See TracChangeset for help on using the changeset viewer.