summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-11-09 15:07:49 -0800
committerJeremy Allison <jra@samba.org>2010-11-10 01:14:17 +0000
commitf0dcc90f726e1232a4e0b74a03784281ea9a7cdc (patch)
treef05f122e49e766b6267feb65dc1dc738d4fbd70f /source3/printing
parent3878fa4c435140bd2e3c59f8bdb932fe19e4c13a (diff)
downloadsamba-f0dcc90f726e1232a4e0b74a03784281ea9a7cdc.tar.gz
samba-f0dcc90f726e1232a4e0b74a03784281ea9a7cdc.tar.bz2
samba-f0dcc90f726e1232a4e0b74a03784281ea9a7cdc.zip
Fix bug 7781 - Samba transforms ShareName to lowercase (sharename) when adding new share via MMC
Change the find_service() interface to not depend on fstring, and create a useable talloc-based interface. Jeremy.
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 84de565159..8462c859d2 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -587,7 +587,7 @@ static uint32 get_correct_cversion(struct pipes_struct *p,
connection_struct *conn = NULL;
NTSTATUS status;
char *oldcwd;
- fstring printdollar;
+ char *printdollar = NULL;
int printdollar_snum;
*perr = WERR_INVALID_PARAM;
@@ -606,9 +606,11 @@ static uint32 get_correct_cversion(struct pipes_struct *p,
return 3;
}
- fstrcpy(printdollar, "print$");
-
- printdollar_snum = find_service(printdollar);
+ printdollar_snum = find_service(talloc_tos(), "print$", &printdollar);
+ if (!printdollar) {
+ *perr = WERR_NOMEM;
+ return -1;
+ }
if (printdollar_snum == -1) {
*perr = WERR_NO_SUCH_SHARE;
return -1;
@@ -946,7 +948,7 @@ WERROR move_driver_to_download_area(struct pipes_struct *p,
TALLOC_CTX *ctx = talloc_tos();
int ver = 0;
char *oldcwd;
- fstring printdollar;
+ char *printdollar = NULL;
int printdollar_snum;
*perr = WERR_OK;
@@ -969,9 +971,11 @@ WERROR move_driver_to_download_area(struct pipes_struct *p,
return WERR_UNKNOWN_PRINTER_DRIVER;
}
- fstrcpy(printdollar, "print$");
-
- printdollar_snum = find_service(printdollar);
+ printdollar_snum = find_service(ctx, "print$", &printdollar);
+ if (!printdollar) {
+ *perr = WERR_NOMEM;
+ return WERR_NOMEM;
+ }
if (printdollar_snum == -1) {
*perr = WERR_NO_SUCH_SHARE;
return WERR_NO_SUCH_SHARE;
@@ -1885,7 +1889,7 @@ bool delete_driver_files(const struct auth_serversupplied_info *server_info,
connection_struct *conn;
NTSTATUS nt_status;
char *oldcwd;
- fstring printdollar;
+ char *printdollar = NULL;
int printdollar_snum;
bool ret = false;
@@ -1896,9 +1900,10 @@ bool delete_driver_files(const struct auth_serversupplied_info *server_info,
DEBUG(6,("delete_driver_files: deleting driver [%s] - version [%d]\n",
r->driver_name, r->version));
- fstrcpy(printdollar, "print$");
-
- printdollar_snum = find_service(printdollar);
+ printdollar_snum = find_service(talloc_tos(), "print$", &printdollar);
+ if (!printdollar) {
+ return false;
+ }
if (printdollar_snum == -1) {
return false;
}