]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Remove cupsaddsmb and associated documentation and infrastructure (Issue #5449)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 6 Dec 2018 19:58:01 +0000 (14:58 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 6 Dec 2018 19:58:01 +0000 (14:58 -0500)
12 files changed:
CHANGES.md
configure
configure.ac
cups/adminutil.c
doc/Makefile
doc/help/man-cupsaddsmb.html [deleted file]
man/Makefile
man/cupsaddsmb.man.in [deleted file]
packaging/cups.list.in
packaging/cups.spec.in
systemv/Makefile
systemv/cupsaddsmb.c [deleted file]

index f95b4b2596b25b973f892f3fa521a94bc278cd77..0626f307df96628421aabfbaf1cca1157053f73a 100644 (file)
@@ -45,6 +45,7 @@ Changes in CUPS v2.3b6
 - Kerberos credentials might be truncated (Issue #5435)
 - The handling of `MaxJobTime 0` did not match the documentation (Issue #5438)
 - Fixed a bug adding a queue with the `-E` option (Issue #5440)
+- The `cupsaddsmb` program has been removed (Issue #5449)
 - The `cupstestdsc` program has been removed (Issue #5450)
 - The scheduler was being backgrounded on macOS, causing applications to spin
   (rdar://40436080)
index 6c5fc4597396775b44aea7462f85c9deecb98687..92da333582a1ba3bd369e46676ec604c085d7c0e 100755 (executable)
--- a/configure
+++ b/configure
@@ -10067,7 +10067,7 @@ fi
 
 
 
-ac_config_files="$ac_config_files Makedefs conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf cups-config desktop/cups.desktop doc/index.html man/client.conf.man man/cups-files.conf.man man/cups-lpd.man man/cups-snmp.man man/cupsaddsmb.man man/cupsd.conf.man man/cupsd.man man/lpoptions.man scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cups-lpdAT.service scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket templates/header.tmpl packaging/cups.list $LANGFILES"
+ac_config_files="$ac_config_files Makedefs conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf cups-config desktop/cups.desktop doc/index.html man/client.conf.man man/cups-files.conf.man man/cups-lpd.man man/cups-snmp.man man/cupsd.conf.man man/cupsd.man man/lpoptions.man scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cups-lpdAT.service scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket templates/header.tmpl packaging/cups.list $LANGFILES"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -10786,7 +10786,6 @@ do
     "man/cups-files.conf.man") CONFIG_FILES="$CONFIG_FILES man/cups-files.conf.man" ;;
     "man/cups-lpd.man") CONFIG_FILES="$CONFIG_FILES man/cups-lpd.man" ;;
     "man/cups-snmp.man") CONFIG_FILES="$CONFIG_FILES man/cups-snmp.man" ;;
-    "man/cupsaddsmb.man") CONFIG_FILES="$CONFIG_FILES man/cupsaddsmb.man" ;;
     "man/cupsd.conf.man") CONFIG_FILES="$CONFIG_FILES man/cupsd.conf.man" ;;
     "man/cupsd.man") CONFIG_FILES="$CONFIG_FILES man/cupsd.man" ;;
     "man/lpoptions.man") CONFIG_FILES="$CONFIG_FILES man/lpoptions.man" ;;
index c0620d901fdf316a3064b7a339df951cc259f5d0..b79bc3c5d777025d234e695609da4381290cf421 100644 (file)
@@ -70,7 +70,6 @@ AC_OUTPUT(Makedefs
          man/cups-files.conf.man
          man/cups-lpd.man
          man/cups-snmp.man
-         man/cupsaddsmb.man
          man/cupsd.conf.man
          man/cupsd.man
          man/lpoptions.man
index 97df5797723ae3d9595d532f7b6fd755981e2069..5ecada44c9d63c80270e817bb6b1e07e8d0f8ffb 100644 (file)
@@ -1,10 +1,11 @@
 /*
  * Administration utility API definitions for CUPS.
  *
- * Copyright 2007-2016 by Apple Inc.
- * Copyright 2001-2007 by Easy Software Products.
+ * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 2001-2007 by Easy Software Products.
  *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 /*
  * Local functions...
  */
 
-static int             do_samba_command(const char *command,
-                                        const char *address,
-                                        const char *subcommand,
-                                        const char *authfile,
-                                        FILE *logfile);
 static http_status_t   get_cupsd_conf(http_t *http, _cups_globals_t *cg,
                                       time_t last_update, char *name,
                                       size_t namelen, int *remote);
@@ -57,318 +53,10 @@ cupsAdminCreateWindowsPPD(
     char       *buffer,                        /* I - Filename buffer */
     int        bufsize)                        /* I - Size of filename buffer */
 {
-  const char           *src;           /* Source PPD filename */
-  cups_file_t          *srcfp,         /* Source PPD file */
-                       *dstfp;         /* Destination PPD file */
-  ipp_t                        *request,       /* IPP request */
-                       *response;      /* IPP response */
-  ipp_attribute_t      *suppattr,      /* IPP -supported attribute */
-                       *defattr;       /* IPP -default attribute */
-  cups_lang_t          *language;      /* Current language */
-  char                 line[256],      /* Line from PPD file */
-                       junk[256],      /* Extra junk to throw away */
-                       *ptr,           /* Pointer into line */
-                       uri[1024],      /* Printer URI */
-                       option[41],     /* Option */
-                       choice[41];     /* Choice */
-  int                  jcloption,      /* In a JCL option? */
-                       jclorder,       /* Next JCL order dependency */
-                       linenum;        /* Current line number */
-  time_t               curtime;        /* Current time */
-  struct tm            *curdate;       /* Current date */
-  static const char * const pattrs[] = /* Printer attributes we want */
-                       {
-                         "job-hold-until-supported",
-                         "job-hold-until-default",
-                         "job-sheets-supported",
-                         "job-sheets-default",
-                         "job-priority-supported",
-                         "job-priority-default"
-                       };
-
-
- /*
-  * Range check the input...
-  */
-
   if (buffer)
     *buffer = '\0';
 
-  if (!http)
-    http = _cupsConnect();
-
-  if (!http || !dest || !buffer || bufsize < 2)
-    return (NULL);
-
- /*
-  * Get the PPD file...
-  */
-
-  if ((src = cupsGetPPD2(http, dest)) == NULL)
-    return (NULL);
-
- /*
-  * Get the supported banner pages, etc. for the printer...
-  */
-
-  request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
-
-  httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
-                   "localhost", 0, "/printers/%s", dest);
-  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
-               "printer-uri", NULL, uri);
-
-  ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
-                "requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]),
-               NULL, pattrs);
-
- /*
-  * Do the request and get back a response...
-  */
-
-  response = cupsDoRequest(http, request, "/");
-  if (!response || cupsLastError() > IPP_STATUS_OK_CONFLICTING)
-  {
-    unlink(src);
-    return (NULL);
-  }
-
- /*
-  * Open the original PPD file...
-  */
-
-  if ((srcfp = cupsFileOpen(src, "rb")) == NULL)
-    return (NULL);
-
- /*
-  * Create a temporary output file using the destination buffer...
-  */
-
-  if ((dstfp = cupsTempFile2(buffer, bufsize)) == NULL)
-  {
-    cupsFileClose(srcfp);
-
-    unlink(src);
-
-    return (NULL);
-  }
-
- /*
-  * Write a new header explaining that this isn't the original PPD...
-  */
-
-  cupsFilePuts(dstfp, "*PPD-Adobe: \"4.3\"\n");
-
-  curtime = time(NULL);
-  curdate = gmtime(&curtime);
-
-  cupsFilePrintf(dstfp, "*%% Modified on %04d%02d%02d%02d%02d%02d+0000 "
-                        "for CUPS Windows Driver\n",
-                curdate->tm_year + 1900, curdate->tm_mon + 1, curdate->tm_mday,
-                curdate->tm_hour, curdate->tm_min, curdate->tm_sec);
-
- /*
-  * Read the existing PPD file, converting all PJL commands to CUPS
-  * job ticket comments...
-  */
-
-  jcloption = 0;
-  jclorder  = 0;
-  linenum   = 0;
-  language  = cupsLangDefault();
-
-  while (cupsFileGets(srcfp, line, sizeof(line)))
-  {
-    linenum ++;
-
-    if (!strncmp(line, "*PPD-Adobe:", 11))
-    {
-     /*
-      * Already wrote the PPD header...
-      */
-
-      continue;
-    }
-    else if (!strncmp(line, "*JCLBegin:", 10) ||
-             !strncmp(line, "*JCLToPSInterpreter:", 20) ||
-            !strncmp(line, "*JCLEnd:", 8) ||
-            !strncmp(line, "*Protocols:", 11))
-    {
-     /*
-      * Don't use existing JCL keywords; we'll create our own, below...
-      */
-
-      cupsFilePrintf(dstfp, "*%% Commented out for CUPS Windows Driver...\n"
-                            "*%%%s\n", line + 1);
-      continue;
-    }
-    else if (!strncmp(line, "*JCLOpenUI", 10))
-    {
-      jcloption = 1;
-      cupsFilePrintf(dstfp, "%s\n", line);
-    }
-    else if (!strncmp(line, "*JCLCloseUI", 11))
-    {
-      jcloption = 0;
-      cupsFilePrintf(dstfp, "%s\n", line);
-    }
-    else if (jcloption && !strncmp(line, "*OrderDependency:", 17))
-    {
-      for (ptr = line + 17; _cups_isspace(*ptr); ptr ++);
-
-      ptr = strchr(ptr, ' ');
-
-      if (ptr)
-      {
-       cupsFilePrintf(dstfp, "*OrderDependency: %d%s\n", jclorder, ptr);
-       jclorder ++;
-      }
-      else
-        cupsFilePrintf(dstfp, "%s\n", line);
-    }
-    else if (jcloption &&
-             strncmp(line, "*End", 4) &&
-             strncmp(line, "*Default", 8))
-    {
-      if ((ptr = strchr(line, ':')) == NULL)
-      {
-        snprintf(line, sizeof(line),
-                _cupsLangString(language, _("Missing value on line %d.")),
-                linenum);
-        _cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
-
-        cupsFileClose(srcfp);
-        cupsFileClose(dstfp);
-
-       unlink(src);
-       unlink(buffer);
-
-        *buffer = '\0';
-
-       return (NULL);
-      }
-
-      if ((ptr = strchr(ptr, '\"')) == NULL)
-      {
-        snprintf(line, sizeof(line),
-                _cupsLangString(language,
-                                _("Missing double quote on line %d.")),
-                linenum);
-        _cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
-
-        cupsFileClose(srcfp);
-        cupsFileClose(dstfp);
-
-       unlink(src);
-       unlink(buffer);
-
-        *buffer = '\0';
-
-       return (NULL);
-      }
-
-      if (sscanf(line, "*%40s%*[ \t]%40[^:/]", option, choice) != 2)
-      {
-        snprintf(line, sizeof(line),
-                _cupsLangString(language,
-                                _("Bad option + choice on line %d.")),
-                linenum);
-        _cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
-
-        cupsFileClose(srcfp);
-        cupsFileClose(dstfp);
-
-       unlink(src);
-       unlink(buffer);
-
-        *buffer = '\0';
-
-       return (NULL);
-      }
-
-      if (strchr(ptr + 1, '\"') == NULL)
-      {
-       /*
-        * Skip remaining...
-       */
-
-       while (cupsFileGets(srcfp, junk, sizeof(junk)) != NULL)
-       {
-         linenum ++;
-
-         if (!strncmp(junk, "*End", 4))
-           break;
-       }
-      }
-
-      snprintf(ptr + 1, sizeof(line) - (size_t)(ptr - line + 1),
-               "%%cupsJobTicket: %s=%s\n\"\n*End", option, choice);
-
-      cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s\n",
-                     line);
-    }
-    else
-      cupsFilePrintf(dstfp, "%s\n", line);
-  }
-
-  cupsFileClose(srcfp);
-  unlink(src);
-
-  if (linenum == 0)
-  {
-    _cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, _("Empty PPD file."), 1);
-
-    cupsFileClose(dstfp);
-    unlink(buffer);
-
-    *buffer = '\0';
-
-    return (NULL);
-  }
-
- /*
-  * Now add the CUPS-specific attributes and options...
-  */
-
-  cupsFilePuts(dstfp, "\n*% CUPS Job Ticket support and options...\n");
-  cupsFilePuts(dstfp, "*Protocols: PJL\n");
-  cupsFilePuts(dstfp, "*JCLBegin: \"%!PS-Adobe-3.0<0A>\"\n");
-  cupsFilePuts(dstfp, "*JCLToPSInterpreter: \"\"\n");
-  cupsFilePuts(dstfp, "*JCLEnd: \"\"\n");
-
-  cupsFilePuts(dstfp, "\n*OpenGroup: CUPS/CUPS Options\n\n");
-
-  if ((defattr = ippFindAttribute(response, "job-hold-until-default",
-                                  IPP_TAG_ZERO)) != NULL &&
-      (suppattr = ippFindAttribute(response, "job-hold-until-supported",
-                                   IPP_TAG_ZERO)) != NULL)
-    write_option(dstfp, jclorder ++, "cupsJobHoldUntil", "Hold Until",
-                 "job-hold-until", suppattr, defattr, 0, 1);
-
-  if ((defattr = ippFindAttribute(response, "job-priority-default",
-                                  IPP_TAG_INTEGER)) != NULL &&
-      (suppattr = ippFindAttribute(response, "job-priority-supported",
-                                   IPP_TAG_RANGE)) != NULL)
-    write_option(dstfp, jclorder ++, "cupsJobPriority", "Priority",
-                 "job-priority", suppattr, defattr, 0, 1);
-
-  if ((defattr = ippFindAttribute(response, "job-sheets-default",
-                                  IPP_TAG_ZERO)) != NULL &&
-      (suppattr = ippFindAttribute(response, "job-sheets-supported",
-                                   IPP_TAG_ZERO)) != NULL)
-  {
-    write_option(dstfp, jclorder ++, "cupsJobSheetsStart", "Start Banner",
-                 "job-sheets", suppattr, defattr, 0, 2);
-    write_option(dstfp, jclorder, "cupsJobSheetsEnd", "End Banner",
-                 "job-sheets", suppattr, defattr, 1, 2);
-  }
-
-  cupsFilePuts(dstfp, "*CloseGroup: CUPS\n");
-  cupsFileClose(dstfp);
-
-  ippDelete(response);
-
-  return (buffer);
+  return (NULL);
 }
 
 
@@ -387,435 +75,7 @@ cupsAdminExportSamba(
     const char *samba_password,                /* I - Samba password */
     FILE       *logfile)               /* I - Log file, if any */
 {
-  int                  status;         /* Status of Samba commands */
-  int                  have_drivers;   /* Have drivers? */
-  char                 file[1024],     /* File to test for */
-                       authfile[1024], /* Temporary authentication file */
-                       address[1024],  /* Address for command */
-                       subcmd[1024],   /* Sub-command */
-                       message[1024];  /* Error message */
-  cups_file_t          *fp;            /* Authentication file */
-  cups_lang_t          *language;      /* Current language */
-  _cups_globals_t      *cg = _cupsGlobals();
-                                       /* Global data */
-
-
- /*
-  * Range check input...
-  */
-
-  if (!dest || !ppd || !samba_server || !samba_user || !samba_password)
-  {
-    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
-    return (0);
-  }
-
- /*
-  * Create a temporary authentication file for Samba...
-  */
-
-  if ((fp = cupsTempFile2(authfile, sizeof(authfile))) == NULL)
-  {
-    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
-    return (0);
-  }
-
-  cupsFilePrintf(fp, "username = %s\n", samba_user);
-  cupsFilePrintf(fp, "password = %s\n", samba_password);
-  cupsFileClose(fp);
-
- /*
-  * See which drivers are available; the new CUPS v6 and Adobe drivers
-  * depend on the Windows 2k PS driver, so copy that driver first:
-  *
-  * Files:
-  *
-  *     ps5ui.dll
-  *     pscript.hlp
-  *     pscript.ntf
-  *     pscript5.dll
-  */
-
-  have_drivers = 0;
-  language     = cupsLangDefault();
-
-  snprintf(file, sizeof(file), "%s/drivers/pscript5.dll", cg->cups_datadir);
-  if (!access(file, 0))
-  {
-    have_drivers |= 1;
-
-   /*
-    * Windows 2k driver is installed; do the smbclient commands needed
-    * to copy the Win2k drivers over...
-    */
-
-    snprintf(address, sizeof(address), "//%s/print$", samba_server);
-
-    snprintf(subcmd, sizeof(subcmd),
-             "mkdir W32X86;"
-            "put %s W32X86/%s.ppd;"
-            "put %s/drivers/ps5ui.dll W32X86/ps5ui.dll;"
-            "put %s/drivers/pscript.hlp W32X86/pscript.hlp;"
-            "put %s/drivers/pscript.ntf W32X86/pscript.ntf;"
-            "put %s/drivers/pscript5.dll W32X86/pscript5.dll",
-            ppd, dest, cg->cups_datadir, cg->cups_datadir,
-            cg->cups_datadir, cg->cups_datadir);
-
-    if ((status = do_samba_command("smbclient", address, subcmd,
-                                   authfile, logfile)) != 0)
-    {
-      snprintf(message, sizeof(message),
-               _cupsLangString(language,
-                              _("Unable to copy Windows 2000 printer "
-                                "driver files (%d).")), status);
-
-      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
-
-      if (logfile)
-       _cupsLangPuts(logfile, message);
-
-      unlink(authfile);
-
-      return (0);
-    }
-
-   /*
-    * See if we also have the CUPS driver files; if so, use them!
-    */
-
-    snprintf(file, sizeof(file), "%s/drivers/cupsps6.dll", cg->cups_datadir);
-    if (!access(file, 0))
-    {
-     /*
-      * Copy the CUPS driver files over...
-      */
-
-      snprintf(subcmd, sizeof(subcmd),
-               "put %s/drivers/cups6.ini W32X86/cups6.ini;"
-               "put %s/drivers/cupsps6.dll W32X86/cupsps6.dll;"
-              "put %s/drivers/cupsui6.dll W32X86/cupsui6.dll",
-              cg->cups_datadir, cg->cups_datadir, cg->cups_datadir);
-
-      if ((status = do_samba_command("smbclient", address, subcmd,
-                                     authfile, logfile)) != 0)
-      {
-       snprintf(message, sizeof(message),
-                _cupsLangString(language,
-                                _("Unable to copy CUPS printer driver "
-                                  "files (%d).")), status);
-
-       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
-
-       if (logfile)
-         _cupsLangPuts(logfile, message);
-
-        unlink(authfile);
-
-       return (0);
-      }
-
-     /*
-      * Do the rpcclient command needed for the CUPS drivers...
-      */
-
-      snprintf(subcmd, sizeof(subcmd),
-               "adddriver \"Windows NT x86\" \"%s:"
-              "pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
-              "pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf,"
-              "cups6.ini,cupsps6.dll,cupsui6.dll\"",
-              dest, dest, dest);
-    }
-    else
-    {
-     /*
-      * Don't have the CUPS drivers, so just use the standard Windows
-      * drivers...
-      */
-
-      snprintf(subcmd, sizeof(subcmd),
-               "adddriver \"Windows NT x86\" \"%s:"
-              "pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
-              "pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf\"",
-              dest, dest, dest);
-    }
-
-    if ((status = do_samba_command("rpcclient", samba_server, subcmd,
-                                   authfile, logfile)) != 0)
-    {
-      snprintf(message, sizeof(message),
-               _cupsLangString(language,
-                              _("Unable to install Windows 2000 printer "
-                                "driver files (%d).")), status);
-
-      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
-
-      if (logfile)
-       _cupsLangPuts(logfile, message);
-
-      unlink(authfile);
-
-      return (0);
-    }
-  }
-
- /*
-  * See if we have the Win9x PS driver...
-  */
-
-  snprintf(file, sizeof(file), "%s/drivers/ADOBEPS4.DRV", cg->cups_datadir);
-  if (!access(file, 0))
-  {
-    have_drivers |= 2;
-
-   /*
-    * Do the smbclient commands needed for the Adobe Win9x drivers...
-    */
-
-    snprintf(address, sizeof(address), "//%s/print$", samba_server);
-
-    snprintf(subcmd, sizeof(subcmd),
-             "mkdir WIN40;"
-            "put %s WIN40/%s.PPD;"
-            "put %s/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM;"
-            "put %s/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV;"
-            "put %s/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP;"
-            "put %s/drivers/ICONLIB.DLL WIN40/ICONLIB.DLL;"
-            "put %s/drivers/PSMON.DLL WIN40/PSMON.DLL;",
-            ppd, dest, cg->cups_datadir, cg->cups_datadir,
-            cg->cups_datadir, cg->cups_datadir, cg->cups_datadir);
-
-    if ((status = do_samba_command("smbclient", address, subcmd,
-                                   authfile, logfile)) != 0)
-    {
-      snprintf(message, sizeof(message),
-               _cupsLangString(language,
-                              _("Unable to copy Windows 9x printer "
-                                "driver files (%d).")), status);
-
-      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
-
-      if (logfile)
-       _cupsLangPuts(logfile, message);
-
-      unlink(authfile);
-
-      return (0);
-    }
-
-   /*
-    * Do the rpcclient commands needed for the Adobe Win9x drivers...
-    */
-
-    snprintf(subcmd, sizeof(subcmd),
-            "adddriver \"Windows 4.0\" \"%s:ADOBEPS4.DRV:%s.PPD:NULL:"
-            "ADOBEPS4.HLP:PSMON.DLL:RAW:"
-            "ADOBEPS4.DRV,%s.PPD,ADOBEPS4.HLP,PSMON.DLL,ADFONTS.MFM,"
-            "ICONLIB.DLL\"",
-            dest, dest, dest);
-
-    if ((status = do_samba_command("rpcclient", samba_server, subcmd,
-                                   authfile, logfile)) != 0)
-    {
-      snprintf(message, sizeof(message),
-               _cupsLangString(language,
-                              _("Unable to install Windows 9x printer "
-                                "driver files (%d).")), status);
-
-      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
-
-      if (logfile)
-       _cupsLangPuts(logfile, message);
-
-      unlink(authfile);
-
-      return (0);
-    }
-  }
-
- /*
-  * See if we have the 64-bit Windows PS driver...
-  *
-  * Files:
-  *
-  *     x64/ps5ui.dll
-  *     x64/pscript.hlp
-  *     x64/pscript.ntf
-  *     x64/pscript5.dll
-  */
-
-  snprintf(file, sizeof(file), "%s/drivers/x64/pscript5.dll", cg->cups_datadir);
-  if (!access(file, 0))
-  {
-    have_drivers |= 4;
-
-   /*
-    * 64-bit Windows driver is installed; do the smbclient commands needed
-    * to copy the Win64 drivers over...
-    */
-
-    snprintf(address, sizeof(address), "//%s/print$", samba_server);
-
-    snprintf(subcmd, sizeof(subcmd),
-             "mkdir x64;"
-            "put %s x64/%s.ppd;"
-            "put %s/drivers/x64/ps5ui.dll x64/ps5ui.dll;"
-            "put %s/drivers/x64/pscript.hlp x64/pscript.hlp;"
-            "put %s/drivers/x64/pscript.ntf x64/pscript.ntf;"
-            "put %s/drivers/x64/pscript5.dll x64/pscript5.dll",
-            ppd, dest, cg->cups_datadir, cg->cups_datadir,
-            cg->cups_datadir, cg->cups_datadir);
-
-    if ((status = do_samba_command("smbclient", address, subcmd,
-                                   authfile, logfile)) != 0)
-    {
-      snprintf(message, sizeof(message),
-               _cupsLangString(language,
-                              _("Unable to copy 64-bit Windows printer "
-                                "driver files (%d).")), status);
-
-      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
-
-      if (logfile)
-       _cupsLangPuts(logfile, message);
-
-      unlink(authfile);
-
-      return (0);
-    }
-
-   /*
-    * See if we also have the CUPS driver files; if so, use them!
-    */
-
-    snprintf(file, sizeof(file), "%s/drivers/x64/cupsps6.dll", cg->cups_datadir);
-    if (!access(file, 0))
-    {
-     /*
-      * Copy the CUPS driver files over...
-      */
-
-      snprintf(subcmd, sizeof(subcmd),
-               "put %s/drivers/x64/cups6.ini x64/cups6.ini;"
-               "put %s/drivers/x64/cupsps6.dll x64/cupsps6.dll;"
-              "put %s/drivers/x64/cupsui6.dll x64/cupsui6.dll",
-              cg->cups_datadir, cg->cups_datadir, cg->cups_datadir);
-
-      if ((status = do_samba_command("smbclient", address, subcmd,
-                                     authfile, logfile)) != 0)
-      {
-       snprintf(message, sizeof(message),
-                _cupsLangString(language,
-                                _("Unable to copy 64-bit CUPS printer driver "
-                                  "files (%d).")), status);
-
-       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
-
-       if (logfile)
-         _cupsLangPuts(logfile, message);
-
-        unlink(authfile);
-
-       return (0);
-      }
-
-     /*
-      * Do the rpcclient command needed for the CUPS drivers...
-      */
-
-      snprintf(subcmd, sizeof(subcmd),
-               "adddriver \"Windows x64\" \"%s:"
-              "pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
-              "pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf,"
-              "cups6.ini,cupsps6.dll,cupsui6.dll\"",
-              dest, dest, dest);
-    }
-    else
-    {
-     /*
-      * Don't have the CUPS drivers, so just use the standard Windows
-      * drivers...
-      */
-
-      snprintf(subcmd, sizeof(subcmd),
-               "adddriver \"Windows x64\" \"%s:"
-              "pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
-              "pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf\"",
-              dest, dest, dest);
-    }
-
-    if ((status = do_samba_command("rpcclient", samba_server, subcmd,
-                                   authfile, logfile)) != 0)
-    {
-      snprintf(message, sizeof(message),
-               _cupsLangString(language,
-                              _("Unable to install Windows 2000 printer "
-                                "driver files (%d).")), status);
-
-      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
-
-      if (logfile)
-       _cupsLangPuts(logfile, message);
-
-      unlink(authfile);
-
-      return (0);
-    }
-  }
-
-  if (logfile && !(have_drivers & 1))
-  {
-    if (!have_drivers)
-      strlcpy(message,
-              _cupsLangString(language,
-                             _("No Windows printer drivers are installed.")),
-              sizeof(message));
-    else
-      strlcpy(message,
-              _cupsLangString(language,
-                             _("Warning, no Windows 2000 printer drivers "
-                               "are installed.")),
-              sizeof(message));
-
-    _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, message, 0);
-    _cupsLangPuts(logfile, message);
-  }
-
-  if (have_drivers == 0)
-  {
-    _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, message, 0);
-
-    unlink(authfile);
-
-    return (0);
-  }
-
- /*
-  * Finally, associate the drivers we just added with the queue...
-  */
-
-  snprintf(subcmd, sizeof(subcmd), "setdriver %s %s", dest, dest);
-
-  if ((status = do_samba_command("rpcclient", samba_server, subcmd,
-                                 authfile, logfile)) != 0)
-  {
-    snprintf(message, sizeof(message),
-             _cupsLangString(language,
-                            _("Unable to set Windows printer driver (%d).")),
-                            status);
-
-    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
-
-    if (logfile)
-      _cupsLangPuts(logfile, message);
-
-    unlink(authfile);
-
-    return (0);
-  }
-
-  unlink(authfile);
-
-  return (1);
+  return (0);
 }
 
 
index 01ea3af3c924b175421f6ca06581ebf350c06520..b8c34a84c4b8dd4be886ec1be14164c75bb23825 100644 (file)
@@ -62,7 +62,6 @@ HELPFILES     =       \
                        help/man-cups-lpd.html \
                        help/man-cups-snmp.html \
                        help/man-cupsaccept.html \
-                       help/man-cupsaddsmb.html \
                        help/man-cupsd.conf.html \
                        help/man-cupsd.html \
                        help/man-cupsd-helper.html \
diff --git a/doc/help/man-cupsaddsmb.html b/doc/help/man-cupsaddsmb.html
deleted file mode 100644 (file)
index 9d771c1..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- SECTION: Man Pages -->
-<head>
-       <link rel="stylesheet" type="text/css" href="../cups-printable.css">
-       <title>cupsaddsmb(8)</title>
-</head>
-<body>
-<h1 class="title">cupsaddsmb(8)</h1>
-<h2 class="title"><a name="NAME">Name</a></h2>
-cupsaddsmb - export printers to samba for windows clients
-
-<h2 class="title"><a name="SYNOPSIS">Synopsis</a></h2>
-<b>cupsaddsmb</b>
-[
-<b>-H</b>
-<i>samba-server</i>
-] [
-<b>-U</b>
-<i>samba-user[%samba-password]</i>
-] [
-<b>-h</b>
-<i>cups-server[:port]</i>
-] [
-<b>-v</b>
-]
-<b>-a</b>
-<br>
-<b>cupsaddsmb</b>
-[
-<b>-H</b>
-<i>samba-server</i>
-] [
-<b>-U</b>
-<i>samba-user[%samba-password]</i>
-] [
-<b>-h</b>
-<i>cups-server[:port]</i>
-] [
-<b>-v</b>
-]
-<i>printer</i>
-[ ...
-<i>printer</i>
-]
-<h2 class="title"><a name="DESCRIPTION">Description</a></h2>
-The <b>cupsaddsmb</b> program exports printers to the SAMBA software (version 2.2.0 or higher) for use with Windows clients.
-Depending on the SAMBA configuration, you may need to provide a password to export the printers.
-This program requires the Windows printer driver files described below.
-<h3><a name="SAMBA_CONFIGURATION">Samba Configuration</a></h3>
-<b>cupsaddsmb</b> uses the RPC-based printing support in SAMBA to provide printer drivers and PPD files to Windows client machines.
-In order to use this functionality, you must first configure the SAMBA
-<b>smb.conf</b>(5)
-file to support printing through CUPS and provide a printer driver download
-share, as follows:
-<pre class="man">
-
-    [global]
-       load printers = yes
-       printing = cups
-       printcap name = cups
-
-    [printers]
-       comment = All Printers
-       path = /var/spool/samba
-       browseable = no
-       public = yes
-       guest ok = yes
-       writable = no
-       printable = yes
-
-    [print$]
-       comment = Printer Drivers
-       path = /etc/samba/drivers
-       browseable = yes
-       guest ok = no
-       read only = yes
-       write list = root
-
-</pre>
-This configuration assumes a FHS-compliant installation of SAMBA; adjust the [printers] and [print$] share paths accordingly on your system as needed.
-<h3><a name="MICROSOFT_POSTSCRIPT_DRIVERS_FOR_WINDOWS">Microsoft Postscript Drivers For Windows</a></h3>
-The base driver for Windows 2000 and higher is the Microsoft PostScript driver, which is available on any system running Windows 2000 or higher in the %WINDIR%\SYSTEM32\SPOOL\DRIVERS\W32X86\3 folder for 32-bit drivers and %WINDIR%\SYSTEM32\SPOOL\DRIVERS\X64\3 folder for 64-bit drivers.
-<p>Copy the 32-bit drivers to the <i>/usr/share/cups/drivers</i> directory and the 64-bit drivers to the <i>/usr/share/cups/drivers/x64</i> directory exactly as named below:
-<pre class="man">
-
-    ps5ui.dll
-    pscript.hlp
-    pscript.ntf
-    pscript5.dll
-
-</pre>
-<b>Note:</b> Unlike Windows, case is significant - make sure that you use the lowercase filenames shown above, otherwise <b>cupsaddsmb</b> will fail to export the drivers.
-<h2 class="title"><a name="OPTIONS">Options</a></h2>
-<b>cupsaddsmb</b> supports the following options:
-<dl class="man">
-<dt><b>-H </b><i>samba-server</i>
-<dd style="margin-left: 5.0em">Specifies the SAMBA server which defaults to the CUPS server.
-<dt><b>-U </b><i>samba-user</i>[<b>%</b><i>samba-password</i>]
-<dd style="margin-left: 5.0em">Specifies the SAMBA print admin username which defaults to your current username.
-If the username contains a percent (%) character, then the text following the percent is treated as the SAMBA password to use.
-<dt><b>-a</b>
-<dd style="margin-left: 5.0em">Exports all known printers.
-Otherwise only the named printers are exported.
-<dt><b>-h </b><i>cups-server</i>[<b>:</b><i>port</i>]
-<dd style="margin-left: 5.0em">Specifies a different CUPS server to use.
-<dt><b>-v</b>
-<dd style="margin-left: 5.0em">Specifies that verbose information should be shown.
-This is useful for debugging SAMBA configuration problems.
-</dl>
-<h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
-<b>rpcclient</b>(1),
-<b>smbclient</b>(1),
-<b>smbd</b>(8),
-<b>smb.conf</b>(5),
-CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
-<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright &copy; 2007-2018 by Apple Inc.
-
-</body>
-</html>
index 241a9d6781fbced946f10db604448b9712d40779..1335d7d2bc54bfaaea915bcdefcb249fac8a5217 100644 (file)
@@ -48,7 +48,6 @@ MAN7  =       backend.$(MAN7EXT) \
                filter.$(MAN7EXT) \
                notifier.$(MAN7EXT)
 MAN8   =       cupsaccept.$(MAN8EXT) \
-               cupsaddsmb.$(MAN8EXT) \
                cupsctl.$(MAN8EXT) \
                cupsfilter.$(MAN8EXT) \
                cups-lpd.$(MAN8EXT) \
diff --git a/man/cupsaddsmb.man.in b/man/cupsaddsmb.man.in
deleted file mode 100644 (file)
index dd628b6..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-.\"
-.\" cupsaddsmb man page for CUPS.
-.\"
-.\" Copyright 2007-2014 by Apple Inc.
-.\" Copyright 1997-2006 by Easy Software Products.
-.\"
-.\" Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
-.\"
-.TH cupsaddsmb 8 "CUPS" "11 June 2014" "Apple Inc."
-.SH NAME
-cupsaddsmb \- export printers to samba for windows clients
-
-.SH SYNOPSIS
-.B cupsaddsmb
-[
-.B \-H
-.I samba-server
-] [
-.B \-U
-.I samba-user[%samba-password]
-] [
-.B \-h
-.I cups-server[:port]
-] [
-.B \-v
-]
-.B \-a
-.br
-.B cupsaddsmb
-[
-.B \-H
-.I samba-server
-] [
-.B \-U
-.I samba-user[%samba-password]
-] [
-.B \-h
-.I cups-server[:port]
-] [
-.B \-v
-]
-.I printer
-[ ...
-.I printer
-]
-.SH DESCRIPTION
-The \fBcupsaddsmb\fR program exports printers to the SAMBA software (version 2.2.0 or higher) for use with Windows clients.
-Depending on the SAMBA configuration, you may need to provide a password to export the printers.
-This program requires the Windows printer driver files described below.
-.SS SAMBA CONFIGURATION
-\fBcupsaddsmb\fR uses the RPC-based printing support in SAMBA to provide printer drivers and PPD files to Windows client machines.
-In order to use this functionality, you must first configure the SAMBA
-.BR smb.conf (5)
-file to support printing through CUPS and provide a printer driver download
-share, as follows:
-.nf
-
-    [global]
-       load printers = yes
-       printing = cups
-       printcap name = cups
-
-    [printers]
-       comment = All Printers
-       path = /var/spool/samba
-       browseable = no
-       public = yes
-       guest ok = yes
-       writable = no
-       printable = yes
-
-    [print$]
-       comment = Printer Drivers
-       path = /etc/samba/drivers
-       browseable = yes
-       guest ok = no
-       read only = yes
-       write list = root
-
-.fi
-This configuration assumes a FHS-compliant installation of SAMBA; adjust the [printers] and [print$] share paths accordingly on your system as needed.
-.SS MICROSOFT POSTSCRIPT DRIVERS FOR WINDOWS
-The base driver for Windows 2000 and higher is the Microsoft PostScript driver, which is available on any system running Windows 2000 or higher in the %WINDIR%\\SYSTEM32\\SPOOL\\DRIVERS\\W32X86\\3 folder for 32-bit drivers and %WINDIR%\\SYSTEM32\\SPOOL\\DRIVERS\\X64\\3 folder for 64-bit drivers.
-.LP
-Copy the 32-bit drivers to the \fI/usr/share/cups/drivers\fR directory and the 64-bit drivers to the \fI/usr/share/cups/drivers/x64\fR directory exactly as named below:
-.nf
-
-    ps5ui.dll
-    pscript.hlp
-    pscript.ntf
-    pscript5.dll
-
-.fi
-\fBNote:\fR Unlike Windows, case is significant - make sure that you use the lowercase filenames shown above, otherwise \fBcupsaddsmb\fR will fail to export the drivers.
-.SH OPTIONS
-\fBcupsaddsmb\fR supports the following options:
-.TP 5
-\fB\-H \fIsamba-server\fR
-Specifies the SAMBA server which defaults to the CUPS server.
-.TP 5
-\fB\-U \fIsamba-user\fR[\fB%\fIsamba-password\fR]
-Specifies the SAMBA print admin username which defaults to your current username.
-If the username contains a percent (%) character, then the text following the percent is treated as the SAMBA password to use.
-.TP 5
-.B \-a
-Exports all known printers.
-Otherwise only the named printers are exported.
-.TP 5
-\fB\-h \fIcups-server\fR[\fB:\fIport\fR]
-Specifies a different CUPS server to use.
-.TP 5
-.B \-v
-Specifies that verbose information should be shown.
-This is useful for debugging SAMBA configuration problems.
-.SH SEE ALSO
-.BR rpcclient (1),
-.BR smbclient (1),
-.BR smbd (8),
-.BR smb.conf (5),
-CUPS Online Help (http://localhost:631/help)
-.SH COPYRIGHT
-Copyright \[co] 2007-2018 by Apple Inc.
index 407d222a0138e97e94ae3c0c8f793b12db939345..4844d7ade0de3c4f6b3ea36fa9361b4de1b0ceeb 100644 (file)
@@ -317,7 +317,6 @@ l 0755 root sys $LIBDIR/reject $SBINDIR/cupsaccept
 d 0755 root sys $SBINDIR -
 l 0755 root sys $SBINDIR/accept cupsaccept
 f 0555 root sys $SBINDIR/cupsaccept systemv/cupsaccept
-f 0555 root sys $SBINDIR/cupsaddsmb systemv/cupsaddsmb
 f 0555 root sys $SBINDIR/cupsctl systemv/cupsctl
 l 0755 root sys $SBINDIR/cupsdisable accept
 l 0755 root sys $SBINDIR/cupsenable accept
@@ -647,7 +646,6 @@ f 0444 root sys $MANDIR/man5/printers.conf.$MAN5EXT man/printers.conf.$MAN5EXT
 
 l 0644 root sys $AMANDIR/man$MAN8DIR/accept.$MAN8EXT cupsaccept.$MAN8EXT
 f 0444 root sys $AMANDIR/man$MAN8DIR/cupsaccept.$MAN8EXT man/cupsaccept.$MAN8EXT
-f 0444 root sys $AMANDIR/man$MAN8DIR/cupsaddsmb.$MAN8EXT man/cupsaddsmb.$MAN8EXT
 l 0644 root sys $AMANDIR/man$MAN8DIR/cupsreject.$MAN8EXT cupsaccept.$MAN8EXT
 f 0444 root sys $AMANDIR/man$MAN8DIR/cupsctl.$MAN8EXT man/cupsctl.$MAN8EXT
 f 0444 root sys $AMANDIR/man$MAN8DIR/cupsfilter.$MAN8EXT man/cupsfilter.$MAN8EXT
index 450ee06450d7e6cb0b2dc77208613d32e3ca16f5..4c43b7efe3f6e63cf3f11f6d48130fb9fbab8353 100644 (file)
@@ -355,7 +355,6 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/man/man8/cups-driverd.8.gz
 /usr/share/man/man8/cups-exec.8.gz
 /usr/share/man/man8/cups-snmp.8.gz
-/usr/share/man/man8/cupsaddsmb.8.gz
 /usr/share/man/man8/cupsaccept.8.gz
 /usr/share/man/man8/cupsctl.8.gz
 /usr/share/man/man8/cupsfilter.8.gz
index ead90f78ad8464348e96906c2238d5b0b2821d97..a205ed3baa2e1f68dfbcdb66df80171545e5095f 100644 (file)
@@ -10,9 +10,9 @@
 
 include ../Makedefs
 
-TARGETS        =       cancel cupsaccept cupsaddsmb cupsctl cupstestppd \
+TARGETS        =       cancel cupsaccept cupsctl cupstestppd \
                lp lpadmin lpinfo lpmove lpoptions lpstat
-OBJS   =       cancel.o cupsaccept.o cupsaddsmb.o cupsctl.o \
+OBJS   =       cancel.o cupsaccept.o cupsctl.o \
                cupstestppd.o lp.o lpadmin.o lpinfo.o lpmove.o lpoptions.o \
                lpstat.o
 
@@ -77,7 +77,6 @@ install-exec:
        echo Installing System V admin printing commands in $(SBINDIR)
        $(INSTALL_DIR) -m 755 $(SBINDIR)
        $(INSTALL_BIN) cupsaccept $(SBINDIR)
-       $(INSTALL_BIN) cupsaddsmb $(SBINDIR)
        $(INSTALL_BIN) cupsctl $(SBINDIR)
        $(INSTALL_BIN) lpadmin $(SBINDIR)
        $(INSTALL_BIN) lpinfo $(SBINDIR)
@@ -135,7 +134,6 @@ uninstall:
        -$(RMDIR) $(BINDIR)
        $(RM) $(SBINDIR)/accept
        $(RM) $(SBINDIR)/cupsaccept
-       $(RM) $(SBINDIR)/cupsaddsmb
        $(RM) $(SBINDIR)/cupsaccept
        $(RM) $(SBINDIR)/cupsdisable
        $(RM) $(SBINDIR)/cupsenable
@@ -171,16 +169,6 @@ cupsaccept:        cupsaccept.o ../cups/$(LIBCUPS)
        done
 
 
-#
-# cupsaddsmb
-#
-
-cupsaddsmb:    cupsaddsmb.o ../cups/$(LIBCUPS)
-       echo Linking $@...
-       $(LD_CC) $(LDFLAGS) -o cupsaddsmb cupsaddsmb.o $(LIBS)
-       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
-
-
 #
 # cupsctl
 #
diff --git a/systemv/cupsaddsmb.c b/systemv/cupsaddsmb.c
deleted file mode 100644 (file)
index d1f9ac2..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * "cupsaddsmb" command for CUPS.
- *
- * Copyright 2007-2012 by Apple Inc.
- * Copyright 2001-2006 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
- */
-
-/*
- * Include necessary headers...
- */
-
-#include <cups/cups-private.h>
-#include <cups/adminutil.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/wait.h>
-
-
-/*
- * Local globals...
- */
-
-int            Verbosity = 0;
-const char     *SAMBAUser,
-               *SAMBAPassword,
-               *SAMBAServer;
-
-
-/*
- * Local functions...
- */
-
-int    export_dest(http_t *http, const char *dest);
-void   usage(void) _CUPS_NORETURN;
-
-
-/*
- * 'main()' - Export printers on the command-line.
- */
-
-int                                    /* O - Exit status */
-main(int  argc,                                /* I - Number of command-line arguments */
-     char *argv[])                     /* I - Command-line arguments */
-{
-  int          i, j;                   /* Looping vars */
-  int          status;                 /* Status from export_dest() */
-  int          export_all;             /* Export all printers? */
-  http_t       *http;                  /* Connection to server */
-  int          num_dests;              /* Number of printers */
-  cups_dest_t  *dests;                 /* Printers */
-
-
-  _cupsSetLocale(argv);
-
- /*
-  * Parse command-line arguments...
-  */
-
-  export_all    = 0;
-  http          = NULL;
-  SAMBAUser     = cupsUser();
-  SAMBAPassword = NULL;
-  SAMBAServer   = NULL;
-
-  for (i = 1; i < argc; i ++)
-    if (!strcmp(argv[i], "-E"))
-    {
-#ifdef HAVE_SSL
-      cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
-#else
-      _cupsLangPrintf(stderr,
-                     _("%s: Sorry, no encryption support."),
-                     argv[0]);
-#endif /* HAVE_SSL */
-    }
-    else if (!strcmp(argv[i], "-H"))
-    {
-      i ++;
-      if (i >= argc)
-        usage();
-
-      SAMBAServer = argv[i];
-    }
-    else if (!strcmp(argv[i], "-U"))
-    {
-      char     *sep;                   /* Separator for password */
-
-
-      i ++;
-      if (i >= argc)
-        usage();
-
-      SAMBAUser = argv[i];
-
-      if ((sep = strchr(argv[i], '%')) != NULL)
-      {
-       /*
-        * Nul-terminate the username at the first % and point the
-       * password at the rest...
-       */
-
-        *sep++ = '\0';
-
-        SAMBAPassword = sep;
-      }
-    }
-    else if (!strcmp(argv[i], "-a"))
-      export_all = 1;
-    else if (!strcmp(argv[i], "-h"))
-    {
-      i ++;
-      if (i >= argc)
-        usage();
-
-      cupsSetServer(argv[i]);
-    }
-    else if (!strcmp(argv[i], "-v"))
-      Verbosity = 1;
-    else if (argv[i][0] != '-')
-    {
-      if (!http)
-      {
-       /*
-       * Connect to the server...
-       */
-
-       if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                       cupsEncryption())) == NULL)
-       {
-         _cupsLangPrintf(stderr, _("%s: Unable to connect to server."),
-                         argv[0]);
-         exit(1);
-       }
-      }
-
-      if (SAMBAServer == NULL)
-      {
-       SAMBAServer = cupsServer();
-
-       if (SAMBAServer[0] == '/')      /* Use localhost instead of domain socket */
-         SAMBAServer = "localhost";
-      }
-
-      if ((status = export_dest(http, argv[i])) != 0)
-       return (status);
-    }
-    else
-      usage();
-
- /*
-  * Connect to the server...
-  */
-
-  if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                 cupsEncryption())) == NULL)
-  {
-    _cupsLangPrintf(stderr, _("%s: Unable to connect to server."), argv[0]);
-    exit(1);
-  }
-
- /*
-  * See if the user specified "-a"...
-  */
-
-  if (export_all)
-  {
-   /*
-    * Export all printers...
-    */
-
-    if (SAMBAServer == NULL)
-    {
-      SAMBAServer = cupsServer();
-
-      if (SAMBAServer[0] == '/')       /* Use localhost instead of domain socket */
-       SAMBAServer = "localhost";
-    }
-
-    num_dests = cupsGetDests2(http, &dests);
-
-    for (j = 0, status = 0; j < num_dests; j ++)
-      if (!dests[j].instance)
-      {
-        if ((status = export_dest(http, dests[j].name)) != 0)
-         break;
-      }
-
-    cupsFreeDests(num_dests, dests);
-
-    if (status)
-      return (status);
-  }
-
-  return (0);
-}
-
-
-/*
- * 'export_dest()' - Export a destination to SAMBA.
- */
-
-int                                    /* O - 0 on success, non-zero on error */
-export_dest(http_t     *http,          /* I - Connection to server */
-            const char *dest)          /* I - Destination to export */
-{
-  int          status;                 /* Status of export */
-  char         ppdfile[1024],          /* PPD file for printer drivers */
-               prompt[1024];           /* Password prompt */
-  int          tries;                  /* Number of tries */
-
-
- /*
-  * Get the Windows PPD file for the printer...
-  */
-
-  if (!cupsAdminCreateWindowsPPD(http, dest, ppdfile, sizeof(ppdfile)))
-  {
-    _cupsLangPrintf(stderr,
-                    _("cupsaddsmb: No PPD file for printer \"%s\" - %s"),
-                   dest, cupsLastErrorString());
-    return (1);
-  }
-
- /*
-  * Try to export it...
-  */
-
-  for (status = 0, tries = 0; !status && tries < 3; tries ++)
-  {
-   /*
-    * Get the password, as needed...
-    */
-
-    if (!SAMBAPassword)
-    {
-      snprintf(prompt, sizeof(prompt),
-               _cupsLangString(cupsLangDefault(),
-                              _("Password for %s required to access %s via "
-                                "SAMBA: ")),
-              SAMBAUser, SAMBAServer);
-
-      if ((SAMBAPassword = cupsGetPassword(prompt)) == NULL)
-       break;
-    }
-
-    status = cupsAdminExportSamba(dest, ppdfile, SAMBAServer,
-                                  SAMBAUser, SAMBAPassword,
-                                 Verbosity ? stderr : NULL);
-
-    if (!status && cupsLastError() == IPP_NOT_FOUND)
-      break;
-  }
-
-  unlink(ppdfile);
-
-  return (!status);
-}
-
-
-/*
- * 'usage()' - Show program usage and exit...
- */
-
-void
-usage(void)
-{
-  _cupsLangPuts(stdout, _("Usage: cupsaddsmb [options] printer1 ... printerN"));
-  _cupsLangPuts(stdout, _("       cupsaddsmb [options] -a"));
-  _cupsLangPuts(stdout, "");
-  _cupsLangPuts(stdout, _("Options:"));
-  _cupsLangPuts(stdout, _("  -E                      Encrypt the connection."));
-  _cupsLangPuts(stdout, _("  -H samba-server         Use the named SAMBA "
-                          "server."));
-  _cupsLangPuts(stdout, _("  -U username             Specify username."));
-  _cupsLangPuts(stdout, _("  -a                      Export all printers."));
-  _cupsLangPuts(stdout, _("  -h server[:port]        Specify server address."));
-  _cupsLangPuts(stdout, _("  -v                      Be verbose."));
-
-  exit(1);
-}