summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-07-03 05:08:51 +0000
committerTim Potter <tpot@samba.org>2003-07-03 05:08:51 +0000
commitbaf439cd55d79133e2fca598834e362a81a911a4 (patch)
treedf8a6ebe54775fa945dd6be542379e3055ca96ae /source3/libads
parentd304a61cc70af9bec3f630043f3e7e600352deea (diff)
downloadsamba-baf439cd55d79133e2fca598834e362a81a911a4.tar.gz
samba-baf439cd55d79133e2fca598834e362a81a911a4.tar.bz2
samba-baf439cd55d79133e2fca598834e362a81a911a4.zip
Implemented 'net ads printer search' which searches the directory for
published printers. At the moment we don't search using any parameters but this can be fixed by changing the LDAP search string. Also we should contact the global catalog at SRV _gc._tcp instead of the ldap server we get back from ads_startup(). (This used to be commit 814519c5de7f962623163b732c8589abd355d845)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap_printer.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c
index aa5ac15b5d..b650a5eb38 100644
--- a/source3/libads/ldap_printer.c
+++ b/source3/libads/ldap_printer.c
@@ -53,6 +53,20 @@ ADS_STATUS ads_find_printer_on_server(ADS_STRUCT *ads, void **res,
return status;
}
+ADS_STATUS ads_find_printers(ADS_STRUCT *ads, void **res)
+{
+ char *ldap_expr;
+ const char *attrs[] = { "objectClass", "printerName", "location", "driverName",
+ "serverName", "description", NULL };
+
+ /* For the moment only display all printers */
+
+ ldap_expr = "(&(!(showInAdvancedViewOnly=TRUE))(uncName=*)"
+ "(objectCategory=printQueue))";
+
+ return ads_search(ads, res, ldap_expr, attrs);
+}
+
/*
modify a printer entry in the directory
*/
@@ -338,4 +352,3 @@ BOOL get_local_printer_publishing_data(TALLOC_CTX *mem_ctx,
}
#endif
-