diff options
author | Jim McDonough <jmcd@samba.org> | 2002-02-11 15:48:01 +0000 |
---|---|---|
committer | Jim McDonough <jmcd@samba.org> | 2002-02-11 15:48:01 +0000 |
commit | 6169b668fe955f298c7323c5d64f6c7b303aaac0 (patch) | |
tree | 0f720a7a50c98d1c445670db3cd194bd9854f943 | |
parent | 81d76f05d8b886a86eb421d1bd8737ec7d05cbde (diff) | |
download | samba-6169b668fe955f298c7323c5d64f6c7b303aaac0.tar.gz samba-6169b668fe955f298c7323c5d64f6c7b303aaac0.tar.xz samba-6169b668fe955f298c7323c5d64f6c7b303aaac0.zip |
Update for new ads modlist structure passing
-rw-r--r-- | source/libads/ldap_printer.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source/libads/ldap_printer.c b/source/libads/ldap_printer.c index d3373981587..50f43022016 100644 --- a/source/libads/ldap_printer.c +++ b/source/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; } |