Changes merged from APPLIANCE_HEAD:
authorDavid O'Neill <dmo@samba.org>
Mon, 8 Jan 2001 19:58:30 +0000 (19:58 +0000)
committerDavid O'Neill <dmo@samba.org>
Mon, 8 Jan 2001 19:58:30 +0000 (19:58 +0000)
    source/printing/printing.c
    source/rpc_server/srv_spoolss_nt.c
        - convert args for print command to unix codepage.
(This used to be commit 1c0ae957f8f1abee7d22a18b6df092eb2a884ae1)

source3/printing/printing.c
source3/rpc_server/srv_spoolss_nt.c

index 57d0c2b8a3728d886cd6da26b0f0f18ef1b04a8c..cfe194ab1739b4ff3e326f6332c92e311c34ee1a 100644 (file)
@@ -168,7 +168,9 @@ static int print_run_command(int snum,char *command,
   
        pstring_sub(syscmd, "%p", p);
        standard_sub_snum(snum,syscmd);
-  
+
+       /* Convert script args to unix-codepage */
+       dos_to_unix(syscmd, True);
        ret = smbrun(syscmd,outfile,False);
 
        DEBUG(3,("Running the command `%s' gave %d\n",syscmd,ret));
@@ -1202,8 +1204,7 @@ BOOL print_queue_purge(struct current_user *user, int snum, int *errcode)
 
        njobs = print_queue_status(snum, &queue, &status);
        for (i=0;i<njobs;i++) {
-               if (print_access_check(user, snum, 
-                                      PRINTER_ACCESS_ADMINISTER)) {
+               if (print_access_check(user, snum, PRINTER_ACCESS_ADMINISTER)) {
                        print_job_delete1(queue[i].job);
                }
        }
index bcd9b4625655b1795feb9b9af34a1396d09a7b22..74cc19eee1579774ff8d9c3f94242e56f508e4aa 100644 (file)
@@ -3546,6 +3546,9 @@ static BOOL add_printer_hook(NT_PRINTER_INFO_LEVEL *printer)
                        printer->info_2->location, driverlocation);
 
        unlink(tmp_file);
+
+       /* Convert script args to unix-codepage */
+       dos_to_unix(command, True);
        DEBUG(10,("Running [%s > %s]\n", command,tmp_file));
        ret = smbrun(command, tmp_file, False);
        DEBUGADD(10,("returned [%d]\n", ret));
@@ -3556,9 +3559,10 @@ static BOOL add_printer_hook(NT_PRINTER_INFO_LEVEL *printer)
        }
 
        numlines = 0;
+       /* Get lines and convert them back to dos-codepage */
        qlines = file_lines_load(tmp_file, &numlines, True);
        DEBUGADD(10,("Lines returned = [%d]\n", numlines));
-       DEBUGADD(10,("Unlinking port file [%s]\n", tmp_file));
+       DEBUGADD(10,("Unlinking script output file [%s]\n", tmp_file));
        unlink(tmp_file);
 
        if(numlines) {