]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/adminutil.c
Merge changes from CUPS 1.4svn-r8606.
[thirdparty/cups.git] / cups / adminutil.c
index dc62951adbaf6090ecfde1f7de0bce1215fad1cd..e2c5ea827dbe49154805a3e5ea9003c194157386 100644 (file)
@@ -4,7 +4,7 @@
  *   Administration utility API definitions for the Common UNIX Printing
  *   System (CUPS).
  *
- *   Copyright 2007-2008 by Apple Inc.
+ *   Copyright 2007-2009 by Apple Inc.
  *   Copyright 2001-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -75,6 +75,8 @@ static void           write_option(cups_file_t *dstfp, int order,
 
 /*
  * 'cupsAdminCreateWindowsPPD()' - Create the Windows PPD file for a printer.
+ *
+ * @since CUPS 1.2/Mac OS X 10.5@
  */
 
 char *                                 /* O - PPD file or NULL */
@@ -401,6 +403,8 @@ cupsAdminCreateWindowsPPD(
 
 /*
  * 'cupsAdminExportSamba()' - Export a printer to Samba.
+ *
+ * @since CUPS 1.2/Mac OS X 10.5@
  */
 
 int                                    /* O - 1 on success, 0 on failure */
@@ -850,7 +854,7 @@ cupsAdminExportSamba(
  * The returned settings should be freed with cupsFreeOptions() when
  * you are done with them.
  *
- * @since CUPS 1.3@
+ * @since CUPS 1.3/Mac OS X 10.5@
  */
 
 int                                    /* O - 1 on success, 0 on failure */
@@ -945,6 +949,8 @@ _cupsAdminGetServerSettings(
        return (0);
       }
     }
+
+    http = cg->http;
   }
 
   if (!http || !num_settings || !settings)
@@ -1129,7 +1135,13 @@ _cupsAdminGetServerSettings(
         else if (!strcasecmp(value, "all"))
          remote_any = 1;
       }
-      else if (line[0] != '<' && !in_location && !in_policy)
+      else if (line[0] != '<' && !in_location && !in_policy &&
+              strcasecmp(line, "Allow") &&
+               strcasecmp(line, "AuthType") &&
+              strcasecmp(line, "Deny") &&
+              strcasecmp(line, "Order") &&
+              strcasecmp(line, "Require") &&
+              strcasecmp(line, "Satisfy"))
         cg->cupsd_num_settings = cupsAddOption(line, value,
                                               cg->cupsd_num_settings,
                                               &(cg->cupsd_settings));
@@ -1193,7 +1205,7 @@ _cupsAdminGetServerSettings(
 /*
  * 'cupsAdminSetServerSettings()' - Set settings on the server.
  *
- * @since CUPS 1.3@
+ * @since CUPS 1.3/Mac OS X 10.5@
  */
 
 int                                    /* O - 1 on success, 0 on failure */
@@ -1639,7 +1651,7 @@ _cupsAdminSetServerSettings(
                             "  <Limit Cancel-Job>\n"
                             "    Order deny,allow\n"
                             "    Require user @OWNER "
-                            CUPS_DEFAULT_PRINTADMIN_AUTH "\n"
+                            CUPS_DEFAULT_PRINTOPERATOR_AUTH "\n"
                             "  </Limit>\n");
       }
 
@@ -1786,7 +1798,7 @@ _cupsAdminSetServerSettings(
                           "  <Limit Cancel-Job>\n"
                           "    Order deny,allow\n"
                           "    Require user @OWNER "
-                          CUPS_DEFAULT_PRINTADMIN_AUTH "\n"
+                          CUPS_DEFAULT_PRINTOPERATOR_AUTH "\n"
                           "  </Limit>\n");
 
       in_cancel_job = 0;
@@ -1794,8 +1806,7 @@ _cupsAdminSetServerSettings(
     else if ((((in_admin_location || in_conf_location || in_root_location) &&
                remote_admin >= 0) ||
               (in_root_location && share_printers >= 0)) &&
-             (((!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny")) &&
-              !strcasecmp(value, "@LOCAL")) ||
+             (!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny") ||
              !strcasecmp(line, "Order")))
       continue;
     else if (in_cancel_job == 2)
@@ -2012,7 +2023,7 @@ _cupsAdminSetServerSettings(
                         "  <Limit Cancel-Job>\n"
                         "    Order deny,allow\n"
                         "    Require user @OWNER "
-                        CUPS_DEFAULT_PRINTADMIN_AUTH "\n"
+                        CUPS_DEFAULT_PRINTOPERATOR_AUTH "\n"
                         "  </Limit>\n");
 
     cupsFilePuts(temp, "  <Limit All>\n"
@@ -2199,7 +2210,7 @@ do_samba_command(const char *command,     /* I - Command to run */
   if (logfile)
     _cupsLangPuts(logfile, "\n");
 
-  DEBUG_printf(("status=%d\n", status));
+  DEBUG_printf(("9do_samba_command: status=%d", status));
 
   if (WIFEXITED(status))
     return (WEXITSTATUS(status));