summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-02-11 15:48:01 +0000
committerJim McDonough <jmcd@samba.org>2002-02-11 15:48:01 +0000
commitad6dfee7413756b7fe76ce1c9440105edd2fe9b2 (patch)
tree0bd51a9420496f7bf385dbd6bc22b09b65b3c9de /source3
parentd2b65dcbff87e7d6e1f56ddffeaeed4cba2b890d (diff)
downloadsamba-ad6dfee7413756b7fe76ce1c9440105edd2fe9b2.tar.gz
samba-ad6dfee7413756b7fe76ce1c9440105edd2fe9b2.tar.xz
samba-ad6dfee7413756b7fe76ce1c9440105edd2fe9b2.zip
Update for new ads modlist structure passing
(This used to be commit 6169b668fe955f298c7323c5d64f6c7b303aaac0)
Diffstat (limited to 'source3')
-rw-r--r--source3/libads/ldap_printer.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c
index d337398158..50f4302201 100644
--- a/source3/libads/ldap_printer.c
+++ b/source3/libads/ldap_printer.c
@@ -57,11 +57,11 @@ ADS_STATUS ads_find_printer_on_server(ADS_STRUCT *ads, void **res,
ADS_STATUS ads_mod_printer_entry(ADS_STRUCT *ads, char *prt_dn,
const ADS_PRINTER_ENTRY *prt)
{
- void **mods;
+ ADS_MODLIST *mods;
ADS_STATUS status;
/* allocate the list */
- mods = ads_init_mods(sizeof(ADS_PRINTER_ENTRY) / sizeof(char *));
+ *mods = ads_init_mods();
/* add the attributes to the list - required ones first */
ads_mod_repl(mods, "printerName", prt->printerName);
@@ -93,10 +93,10 @@ ADS_STATUS ads_mod_printer_entry(ADS_STRUCT *ads, char *prt_dn,
/*... and many others */
/* do the ldap modify */
- status = ads_gen_mod(ads, prt_dn, mods);
+ status = ads_gen_mod(ads, prt_dn, *mods);
/* free mod list, mods, and values */
- ads_free_mods(mods);
+ ads_free_mods(*mods);
return status;
}
@@ -164,7 +164,16 @@ ADS_STATUS ads_add_printer(ADS_STRUCT *ads, const ADS_PRINTER_ENTRY *prt)
}
}
- status = ads_mod_printer_entry(ads, prt_dn, prt);
+ status = ads_search_dn(ads, &res, prt_dn, attrs);
+
+ if (ADS_ERR_OK(status) && ads_count_replies(ads, res)) {
+ /* need to retrieve GUID from results
+ prt->GUID */
+ status = ads_mod_printer_entry(ads, prt_dn, prt);
+ }
+
+ ads_msgfree(ads, res);
+
return status;
}