~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to source3/printing/print_iprint.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include "includes.h"
23
23
#include "printing.h"
 
24
#include "printing/pcap.h"
24
25
 
25
26
#ifdef HAVE_IPRINT
26
27
#include <cups/cups.h>
296
297
                */
297
298
 
298
299
                if (name != NULL && !secure && smb_enabled) 
299
 
                        pcap_cache_add(name, info);
 
300
                        pcap_cache_add(name, info, NULL);
300
301
        }
301
302
 
302
303
 out:
574
575
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
575
576
                     "attributes-natural-language", NULL, language->language);
576
577
 
577
 
        slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
 
578
        slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
 
579
                 lp_printername(snum));
578
580
 
579
581
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
580
582
 
587
589
        * Do the request and get back a response...
588
590
        */
589
591
 
590
 
        slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s", PRINTERNAME(snum));
 
592
        slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s",
 
593
                 lp_printername(snum));
591
594
 
592
595
        if ((response = cupsDoRequest(http, request, httpPath)) != NULL) {
593
596
                if (response->request.status.status_code >= IPP_OK_CONFLICT) {
672
675
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
673
676
                     "attributes-natural-language", NULL, language->language);
674
677
 
675
 
        slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
 
678
        slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
 
679
                 lp_printername(snum));
676
680
 
677
681
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
678
682
 
685
689
        * Do the request and get back a response...
686
690
        */
687
691
 
688
 
        slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s", PRINTERNAME(snum));
 
692
        slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s",
 
693
                 lp_printername(snum));
689
694
 
690
695
        if ((response = cupsDoRequest(http, request, httpPath)) != NULL) {
691
696
                if (response->request.status.status_code >= IPP_OK_CONFLICT) {
726
731
        ipp_attribute_t *attr;          /* Current attribute */
727
732
        cups_lang_t     *language = NULL;       /* Default language */
728
733
        char            uri[HTTP_MAX_URI]; /* printer-uri attribute */
729
 
        const char      *clientname = NULL;     /* hostname of client for job-originating-host attribute */
730
 
        char addr[INET6_ADDRSTRLEN];
731
734
 
732
735
        DEBUG(5,("iprint_job_submit(%d, %p (%d))\n", snum, pjob, pjob->sysjob));
733
736
 
771
774
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
772
775
                     "attributes-natural-language", NULL, language->language);
773
776
 
774
 
        slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
 
777
        slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
 
778
                 lp_printername(snum));
775
779
 
776
780
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
777
781
                     "printer-uri", NULL, uri);
779
783
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
780
784
                     NULL, pjob->user);
781
785
 
782
 
        clientname = client_name(get_client_fd());
783
 
        if (strcmp(clientname, "UNKNOWN") == 0) {
784
 
                clientname = client_addr(get_client_fd(),addr,sizeof(addr));
785
 
        }
786
 
        
787
786
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
788
787
                     "job-originating-host-name", NULL,
789
 
                     clientname);
 
788
                     pjob->clientmachine);
790
789
 
791
790
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
792
791
                     pjob->jobname);
795
794
        * Do the request and get back a response...
796
795
        */
797
796
 
798
 
        slprintf(uri, sizeof(uri) - 1, "/ipp/%s", PRINTERNAME(snum));
 
797
        slprintf(uri, sizeof(uri) - 1, "/ipp/%s", lp_printername(snum));
799
798
 
800
799
        if ((response = cupsDoFileRequest(http, request, uri, pjob->filename)) != NULL) {
801
800
                if (response->request.status.status_code >= IPP_OK_CONFLICT) {
802
 
                        DEBUG(0,("Unable to print file to %s - %s\n", PRINTERNAME(snum),
 
801
                        DEBUG(0,("Unable to print file to %s - %s\n",
 
802
                                 lp_printername(snum),
803
803
                                 ippErrorString(cupsLastError())));
804
804
                } else {
805
805
                        ret = 0;
806
806
                }
807
807
        } else {
808
 
                DEBUG(0,("Unable to print file to `%s' - %s\n", PRINTERNAME(snum),
 
808
                DEBUG(0,("Unable to print file to `%s' - %s\n",
 
809
                         lp_printername(snum),
809
810
                         ippErrorString(cupsLastError())));
810
811
        }
811
812