mds/net-print/cups/files/cups-1.3.9-ldap-draft-1.patch

103 lines
3.4 KiB
Diff
Raw Normal View History

Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
Date: 2009-03-13
Initial Package Version: 1.3.9
Origin: me
Upstream Status: unknown
Description: use the oids from the ldap ipp draft
https://datatracker.ietf.org/drafts/draft-ietf-ipp-ldap-printer-schema/
this patch also requres a migration addon schema
http://ftp.disconnected-by-peer.at/mds/printer-cups.schema
diff -Naur cups-1.3.9.orig/scheduler/dirsvc.c cups-1.3.9/scheduler/dirsvc.c
--- cups-1.3.9.orig/scheduler/dirsvc.c 2008-07-18 20:30:23.000000000 +0000
+++ cups-1.3.9/scheduler/dirsvc.c 2009-03-13 20:49:31.160730818 +0000
@@ -104,11 +104,11 @@
#ifdef HAVE_OPENLDAP
static const char * const ldap_attrs[] =/* CUPS LDAP attributes */
{
- "printerDescription",
- "printerLocation",
- "printerMakeAndModel",
- "printerType",
- "printerURI",
+ "printer-info",
+ "printer-location",
+ "printer-make-and-model",
+ "printer-type",
+ "printer-uri",
NULL
};
#endif /* HAVE_OPENLDAP */
@@ -1439,35 +1439,35 @@
*/
if ((value = ldap_get_values(BrowseLDAPHandle, e,
- "printerDescription")) == NULL)
+ "printer-info")) == NULL)
continue;
strlcpy(info, *value, sizeof(info));
ldap_value_free(value);
if ((value = ldap_get_values(BrowseLDAPHandle, e,
- "printerLocation")) == NULL)
+ "printer-location")) == NULL)
continue;
strlcpy(location, *value, sizeof(location));
ldap_value_free(value);
if ((value = ldap_get_values(BrowseLDAPHandle, e,
- "printerMakeAndModel")) == NULL)
+ "printer-make-and-model")) == NULL)
continue;
strlcpy(make_model, *value, sizeof(make_model));
ldap_value_free(value);
if ((value = ldap_get_values(BrowseLDAPHandle, e,
- "printerType")) == NULL)
+ "printer-type")) == NULL)
continue;
type = atoi(*value);
ldap_value_free(value);
if ((value = ldap_get_values(BrowseLDAPHandle, e,
- "printerURI")) == NULL)
+ "printer-uri")) == NULL)
continue;
strlcpy(uri, *value, sizeof(uri));
@@ -3004,7 +3004,7 @@
uri[1] = NULL;
snprintf(filter, sizeof(filter),
- "(&(objectclass=cupsPrinter)(printerURI=%s))", p->uri);
+ "(&(objectclass=cupsPrinter)(printer-uri=%s))", p->uri);
ldap_search_s(BrowseLDAPHandle, BrowseLDAPDN, LDAP_SCOPE_SUBTREE,
filter, (char **)ldap_attrs, 0, &res);
@@ -3013,15 +3013,15 @@
mods[0].mod_type = "cn";
mods[0].mod_values = cn_value;
- mods[1].mod_type = "printerDescription";
+ mods[1].mod_type = "printer-info";
mods[1].mod_values = info;
- mods[2].mod_type = "printerURI";
+ mods[2].mod_type = "printer-uri";
mods[2].mod_values = uri;
- mods[3].mod_type = "printerLocation";
+ mods[3].mod_type = "printer-location";
mods[3].mod_values = location;
- mods[4].mod_type = "printerMakeAndModel";
+ mods[4].mod_type = "printer-make-and-model";
mods[4].mod_values = make_model;
- mods[5].mod_type = "printerType";
+ mods[5].mod_type = "printer-type";
mods[5].mod_values = type;
mods[6].mod_type = "objectClass";
mods[6].mod_values = (char **)objectClass_values;