-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LDAP support for Browse #338
Comments
CUPS.org User: mike Reassigned to CUPS 1.2; this won't go into 1.1.x... Thanks! |
CUPS.org User: claus.rosenberger.rocnet is that code included in 1.2cvs? regards claus |
CUPS.org User: mike We are now working on integrating this patch (a long time, I know! :) |
CUPS.org User: olo This would be great if it made to the 1.2 release. Support for storing printers configuration in LDAP directory would make CUPS much more viable for medium and large scale organizations. |
CUPS.org User: mike Fixed in Subversion repository. I updated the code to conform to our coding standards, fixed several memory leaks, and added a call to ldap_modify_s() when the printer definition was just updated, not added. Please open a new STR if you find any problems with the code. Thanks! |
"conf.patch": --- cupsys-1.1.19final-orig/scheduler/conf.c 2003-10-16 16:19:18.000000000 -0400
JobHistory = DEFAULT_HISTORY;
|
"configure.in.patch": --- cupsys-1.1.19final-orig/configure.in 2003-10-16 16:19:18.000000000 -0400 +sinclude(config-scripts/cups-openldap.m4) AC_OUTPUT(Makedefs cups.list cups.sh cups-config conf/cupsd.conf conf/pam.conf) |
"dirsrvc-c.patch": --- cupsys-1.1.19final-orig/scheduler/dirsvc.c 2003-05-12 16:51:53.000000000 -0400
if (!Browsing || !BrowseProtocols)
@@ -1015,6 +1069,14 @@
@@ -1898,6 +1960,185 @@ +#ifdef HAVE_LIBLDAP
+void
+#endif /* HAVE_LIBLDAP */ /*
|
"dirsrvc-h.patch": --- cupsys-1.1.19final-orig/scheduler/dirsvc.h 2003-03-31 11:31:36.000000000 -0500 include <slp.h>#endif /* HAVE_LIBSLP */ +#ifdef HAVE_LIBLDAP /*
@@ -118,6 +121,20 @@ +#ifdef HAVE_LIBLDAP
|
"main.patch": --- cupsys-1.1.19final-orig/scheduler/main.c 2003-05-09 11:11:13.000000000 -0400 +#ifdef HAVE_LIBLDAP
|
Version: 1.2-feature
CUPS.org User: yugami.monochromatic
This patch adds LDAP support to cups Browse functionality.
Apply each of the patches found within, Then edit your cupsd.conf
Added config options are
BrowseProtocol ldap
BrowseLDAPServer (set to a uri like ldapi:/// for local binds or ldap://myserver for remote binds)
BrowseLDAPDN (this is the base dn for searches, and additions dc=arstechnica,dc=com for example)
BrowseLDAPBindDN (who to login to the ldap server as, dn=cupsadmin,dc=arstechnica,dc=com for example)
BrowseLDAPPassword (password for the bind dn) (insecure i know)
Make sure a ou=printers exists under the DN - I'll make this a config option later
your LDAP server must be configured to use the printer.schema found under schemas
add cups-openldap.md4 to your config-scripts under the cups source dir. then rerun autoconf and aclocal and use configre --with-ldap
--- cupsys-1.1.19final-orig/configure.in 2003-10-16 16:19:18.000000000 -0400
+++ cupsys-1.1.19final/configure.in 2003-10-17 08:33:20.000000000 -0400
@@ -48,6 +48,8 @@
sinclude(config-scripts/cups-openssl.m4)
sinclude(config-scripts/cups-pam.m4)
+sinclude(config-scripts/cups-openldap.m4)
+
sinclude(config-scripts/cups-scripting.m4)
AC_OUTPUT(Makedefs cups.list cups.sh cups-config conf/cupsd.conf conf/pam.conf)
--- cupsys-1.1.19final-orig/scheduler/conf.c 2003-10-16 16:19:18.000000000 -0400
+++ cupsys-1.1.19final/scheduler/conf.c 2003-10-17 14:46:26.000000000 -0400
@@ -397,6 +397,11 @@
BrowseTimeout = DEFAULT_TIMEOUT;
Browsing = TRUE;
JobHistory = DEFAULT_HISTORY;
JobFiles = DEFAULT_FILES;
JobAutoPurge = 0;
@@ -918,6 +923,25 @@
value, linenum);
}
#endif /* HAVE_SSL */
+#ifdef HAVE_LIBLDAP
else if (strcasecmp(name, "BrowseAddress") == 0)
{
/
--- cupsys-1.1.19final-orig/configure.in 2003-10-16 16:19:18.000000000 -0400
+++ cupsys-1.1.19final/configure.in 2003-10-17 08:33:20.000000000 -0400
@@ -48,6 +48,8 @@
sinclude(config-scripts/cups-openssl.m4)
sinclude(config-scripts/cups-pam.m4)
+sinclude(config-scripts/cups-openldap.m4)
+
sinclude(config-scripts/cups-scripting.m4)
AC_OUTPUT(Makedefs cups.list cups.sh cups-config conf/cupsd.conf conf/pam.conf)
yugami@killerloop:
/docs/ldap/ldap.ars/cups$ ls/docs/ldap/ldap.ars/cups$ cat conf.patchconfigure.in.patch cups-openldap.m4 dirsrvc-c.patch main.patch
conf.patch CVS dirsrvc-h.patch README
yugami@killerloop:
--- cupsys-1.1.19final-orig/scheduler/conf.c 2003-10-16 16:19:18.000000000 -0400
+++ cupsys-1.1.19final/scheduler/conf.c 2003-10-17 14:46:26.000000000 -0400
@@ -397,6 +397,11 @@
BrowseTimeout = DEFAULT_TIMEOUT;
Browsing = TRUE;
JobHistory = DEFAULT_HISTORY;
JobFiles = DEFAULT_FILES;
JobAutoPurge = 0;
@@ -918,6 +923,25 @@
value, linenum);
}
#endif /* HAVE_SSL */
+#ifdef HAVE_LIBLDAP
else if (strcasecmp(name, "BrowseLDAPServer") == 0)
else if (strcasecmp(name, "BrowseLDAPDN") == 0)
else if (strcasecmp(name, "BrowseLDAPBindDN") == 0)
else if (strcasecmp(name, "BrowseLDAPPassword") == 0)
+#endif /* HAVE_LIBLDAP /
else if (strcasecmp(name, "BrowseAddress") == 0)
{
/
yugami@killerloop:
/docs/ldap/ldap.ars/cups$ ls/docs/ldap/ldap.ars/cups$ cat dirsrvc-c.patchconfigure.in.patch cups-openldap.m4 dirsrvc-c.patch main.patch
conf.patch CVS dirsrvc-h.patch README
yugami@killerloop:
--- cupsys-1.1.19final-orig/scheduler/dirsvc.c 2003-05-12 16:51:53.000000000 -0400
+++ cupsys-1.1.19final/scheduler/dirsvc.c 2003-10-17 22:07:13.000000000 -0400
@@ -707,6 +707,11 @@
{
int val; /* Socket option value /
struct sockaddr_in addr; / Broadcast address */
+#ifdef HAVE_LIBLDAP
+#endif /* HAVE_LIBLDAP */
if (!Browsing || !BrowseProtocols)
@@ -798,6 +803,55 @@
BrowseSLPRefresh = 0;
}
endif /* HAVE_LIBSLP */
+#ifdef HAVE_LIBLDAP
+#endif /* HAVE_LIBLDAP */
}
@@ -1015,6 +1069,14 @@
SLPClose(BrowseSLPHandle);
}
#endif /* HAVE_LIBSLP */
+
+#ifdef HAVE_LIBLDAP
}
@@ -1898,6 +1960,185 @@
}
#endif /* HAVE_LIBSLP */
+#ifdef HAVE_LIBLDAP
+
+static char *CupsAttrs[] = { "printerDescription", "printerURI",
+
+void
+UpdateLDAPBrowse(void)
+{
+}
+
+void
+SendLDAPBrowse(printer_t p) / I - Printer to register */
+{
LDAPMessage res = NULL; / search result token */
rc = ldap_search_s(BrowseLDAPHandle, BrowseLDAPDN, LDAP_SCOPE_SUBTREE, fltr, CupsAttrs, 0, &res);
+}
+
+#endif /* HAVE_LIBLDAP */
/*
--- cupsys-1.1.19final-orig/scheduler/dirsvc.h 2003-03-31 11:31:36.000000000 -0500
+++ cupsys-1.1.19final/scheduler/dirsvc.h 2003-10-17 21:58:30.000000000 -0400
@@ -31,6 +31,9 @@
include <slp.h>
#endif /* HAVE_LIBSLP */+#ifdef HAVE_LIBLDAP
+# include <ldap.h>
+#endif /* HAVE_LIBLDAP */
/*
Browse protocols...
@@ -38,7 +41,7 @@
define BROWSE_CUPS 1 /* CUPS */
define BROWSE_SLP 2 /* SLPv2 */
-#define BROWSE_LDAP 4 /* LDAP (not supported yet) /
+#define BROWSE_LDAP 4 / LDAP */
define BROWSE_ALL 7 /* All protocols */
@@ -118,6 +121,20 @@
/* Next SLP refresh time /
#endif / HAVE_LIBSLP */
+#ifdef HAVE_LIBLDAP
+VAR LDAP* BrowseLDAPHandle VALUE(NULL);
+VAR time_t BrowseLDAPRefresh VALUE(0);
+VAR char *BrowseLDAPServer,
+#endif /* HAVE_LIBLDAP */
/*
@@ -129,6 +146,7 @@
extern void SendBrowseList(void);
extern void SendCUPSBrowse(printer_t *p);
extern void SendSLPBrowse(printer_t *p);
+extern void SendLDAPBrowse(printer_t *p);
extern void StartBrowsing(void);
extern void StartPolling(void);
extern void StopBrowsing(void);
@@ -136,6 +154,7 @@
extern void UpdateCUPSBrowse(void);
extern void UpdatePolling(void);
extern void UpdateSLPBrowse(void);
+extern void UpdateLDAPBrowse(void);
/*
--- cupsys-1.1.19final-orig/scheduler/main.c 2003-05-09 11:11:13.000000000 -0400
+++ cupsys-1.1.19final/scheduler/main.c 2003-10-17 14:41:35.000000000 -0400
@@ -638,6 +638,11 @@
UpdateSLPBrowse();
endif /* HAVE_LIBSLP */
+#ifdef HAVE_LIBLDAP
+
SendBrowseList();
}
The text was updated successfully, but these errors were encountered: