diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-01-17 06:15:18 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-01-17 06:15:18 +0000 |
commit | 96c795cea7518b50a40caba34e656f056a832589 (patch) | |
tree | a75d467bddd17c322b932734549db27cf1cf56fa /source3/rpc_parse/parse_spoolss.c | |
parent | ec879eacc263043409b584797d1e8c39258ba125 (diff) | |
download | samba-96c795cea7518b50a40caba34e656f056a832589.tar.gz samba-96c795cea7518b50a40caba34e656f056a832589.tar.bz2 samba-96c795cea7518b50a40caba34e656f056a832589.zip |
reverted this patch till I sort out the craziness with UNIHDR
(This used to be commit e3d00fa47d38cd214f5e350e1d6b30d90ed8a52c)
Diffstat (limited to 'source3/rpc_parse/parse_spoolss.c')
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 70 |
1 files changed, 37 insertions, 33 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index b3fbb655ca..cb3b2efd9d 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -916,12 +916,12 @@ BOOL make_spoolss_q_open_printer_ex(SPOOL_Q_OPEN_PRINTER_EX *q_u, { DEBUG(5,("make_spoolss_q_open_printer_ex\n")); q_u->printername_ptr = (printername!=NULL)?1:0; - init_unistr2(&q_u->printername, printername); + init_unistr2(&q_u->printername, printername, strlen(printername)+1); q_u->printer_default.datatype_ptr = 0; /* q_u->printer_default.datatype_ptr = (datatype!=NULL)?1:0; - init_unistr2(&q_u->printer_default.datatype, datatype); + init_unistr2(&q_u->printer_default.datatype, datatype, strlen(datatype)); */ q_u->printer_default.devmode_cont.size=0; q_u->printer_default.devmode_cont.devmode_ptr=0; @@ -937,8 +937,8 @@ BOOL make_spoolss_q_open_printer_ex(SPOOL_Q_OPEN_PRINTER_EX *q_u, q_u->user_ctr.user1.major=2; q_u->user_ctr.user1.minor=0; q_u->user_ctr.user1.processor=0; - init_unistr2(&q_u->user_ctr.user1.client_name, clientname); - init_unistr2(&q_u->user_ctr.user1.user_name, user_name); + init_unistr2(&q_u->user_ctr.user1.client_name, clientname, strlen(clientname)+1); + init_unistr2(&q_u->user_ctr.user1.user_name, user_name, strlen(user_name)+1); return True; } @@ -963,7 +963,7 @@ BOOL make_spoolss_q_addprinterex( ZERO_STRUCTP(q_u); q_u->server_name_ptr = (srv_name!=NULL)?1:0; - init_unistr2(&q_u->server_name, srv_name); + init_unistr2(&q_u->server_name, srv_name, strlen(srv_name)); q_u->level = level; @@ -991,8 +991,8 @@ BOOL make_spoolss_q_addprinterex( q_u->user_ctr.user1.major=2; q_u->user_ctr.user1.minor=0; q_u->user_ctr.user1.processor=0; - init_unistr2(&q_u->user_ctr.user1.client_name, clientname); - init_unistr2(&q_u->user_ctr.user1.user_name, user_name); + init_unistr2(&q_u->user_ctr.user1.client_name, clientname, strlen(clientname)+1); + init_unistr2(&q_u->user_ctr.user1.user_name, user_name, strlen(user_name)+1); q_u->user_ctr.user1.size=q_u->user_ctr.user1.user_name.uni_str_len + q_u->user_ctr.user1.client_name.uni_str_len + 2; @@ -1187,9 +1187,9 @@ BOOL make_spoolss_q_deleteprinterdriver( /* these must be NULL terminated or else NT4 will complain about invalid parameters --jerry */ - init_unistr2(&q_u->server, server); - init_unistr2(&q_u->arch, arch); - init_unistr2(&q_u->driver, driver); + init_unistr2(&q_u->server, server, strlen(server)+1); + init_unistr2(&q_u->arch, arch, strlen(arch)+1); + init_unistr2(&q_u->driver, driver, strlen(driver)+1); return True; @@ -1209,7 +1209,7 @@ BOOL make_spoolss_q_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u, DEBUG(5,("make_spoolss_q_getprinterdata\n")); q_u->handle = *handle; - init_unistr2(&q_u->valuename, valuename); + init_unistr2(&q_u->valuename, valuename, strlen(valuename) + 1); q_u->size = size; return True; @@ -1228,8 +1228,8 @@ BOOL make_spoolss_q_getprinterdataex(SPOOL_Q_GETPRINTERDATAEX *q_u, DEBUG(5,("make_spoolss_q_getprinterdataex\n")); q_u->handle = *handle; - init_unistr2(&q_u->valuename, valuename); - init_unistr2(&q_u->keyname, keyname); + init_unistr2(&q_u->valuename, valuename, strlen(valuename) + 1); + init_unistr2(&q_u->keyname, keyname, strlen(keyname) + 1); q_u->size = size; return True; @@ -5373,7 +5373,7 @@ BOOL make_spoolss_q_addprinterdriver(TALLOC_CTX *mem_ctx, DEBUG(5,("make_spoolss_q_addprinterdriver\n")); q_u->server_name_ptr = (srv_name!=NULL)?1:0; - init_unistr2(&q_u->server_name, srv_name); + init_unistr2(&q_u->server_name, srv_name, strlen(srv_name)+1); q_u->level = level; @@ -6161,7 +6161,7 @@ BOOL make_spoolss_q_enumprinterdataex(SPOOL_Q_ENUMPRINTERDATAEX *q_u, uint32 size) { memcpy(&q_u->handle, hnd, sizeof(q_u->handle)); - init_unistr2(&q_u->key, key); + init_unistr2(&q_u->key, key, strlen(key)+1); q_u->size = size; return True; @@ -6174,7 +6174,7 @@ BOOL make_spoolss_q_setprinterdata(SPOOL_Q_SETPRINTERDATA *q_u, const POLICY_HND { memcpy(&q_u->handle, hnd, sizeof(q_u->handle)); q_u->type = data_type; - init_unistr2(&q_u->value, value); + init_unistr2(&q_u->value, value, strlen(value)+1); q_u->max_len = q_u->real_len = data_size; q_u->data = data; @@ -6190,8 +6190,8 @@ BOOL make_spoolss_q_setprinterdataex(SPOOL_Q_SETPRINTERDATAEX *q_u, const POLICY { memcpy(&q_u->handle, hnd, sizeof(q_u->handle)); q_u->type = data_type; - init_unistr2(&q_u->value, value); - init_unistr2(&q_u->key, key); + init_unistr2(&q_u->value, value, strlen(value)+1); + init_unistr2(&q_u->key, key, strlen(key)+1); q_u->max_len = q_u->real_len = data_size; q_u->data = data; @@ -6588,7 +6588,7 @@ BOOL make_spoolss_q_replyopenprinter(SPOOL_Q_REPLYOPENPRINTER *q_u, if (q_u == NULL) return False; - init_unistr2(&q_u->string, string); + init_unistr2(&q_u->string, string, strlen(string)+1); q_u->printer=printer; q_u->type=type; @@ -7091,7 +7091,7 @@ BOOL make_spoolss_q_enumprinterkey(SPOOL_Q_ENUMPRINTERKEY *q_u, DEBUG(5,("make_spoolss_q_enumprinterkey\n")); memcpy(&q_u->handle, hnd, sizeof(q_u->handle)); - init_unistr2(&q_u->key, key); + init_unistr2(&q_u->key, key, strlen(key)+1); q_u->size = size; return True; @@ -7160,7 +7160,7 @@ BOOL make_spoolss_q_deleteprinterkey(SPOOL_Q_DELETEPRINTERKEY *q_u, DEBUG(5,("make_spoolss_q_deleteprinterkey\n")); memcpy(&q_u->handle, hnd, sizeof(q_u->handle)); - init_unistr2(&q_u->keyname, keyname); + init_unistr2(&q_u->keyname, keyname, strlen(keyname)+1); return True; } @@ -7382,8 +7382,8 @@ BOOL make_spoolss_q_getprintprocessordirectory(SPOOL_Q_GETPRINTPROCESSORDIRECTOR { DEBUG(5,("make_spoolss_q_getprintprocessordirectory\n")); - init_unistr2(&q_u->name, name); - init_unistr2(&q_u->environment, environment); + init_unistr2(&q_u->name, name, strlen(name)+1); + init_unistr2(&q_u->environment, environment, strlen(environment)+1); q_u->level = level; @@ -7509,7 +7509,7 @@ BOOL make_spoolss_q_setform(SPOOL_Q_SETFORM *q_u, POLICY_HND *handle, q_u->level = level; q_u->level2 = level; memcpy(&q_u->form, form, sizeof(FORM)); - init_unistr2(&q_u->name, form_name); + init_unistr2(&q_u->name, form_name, strlen(form_name) + 1); return True; } @@ -7521,7 +7521,7 @@ BOOL make_spoolss_q_setform(SPOOL_Q_SETFORM *q_u, POLICY_HND *handle, BOOL make_spoolss_q_deleteform(SPOOL_Q_DELETEFORM *q_u, POLICY_HND *handle, char *form) { memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - init_unistr2(&q_u->name, form); + init_unistr2(&q_u->name, form, strlen(form) + 1); return True; } @@ -7535,7 +7535,7 @@ BOOL make_spoolss_q_getform(SPOOL_Q_GETFORM *q_u, POLICY_HND *handle, { memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); q_u->level = level; - init_unistr2(&q_u->formname, formname); + init_unistr2(&q_u->formname, formname, strlen(formname) + 1); q_u->buffer=buffer; q_u->offered=offered; @@ -7642,13 +7642,16 @@ BOOL make_spoolss_q_startdocprinter(SPOOL_Q_STARTDOCPRINTER *q_u, ctr->docinfo.doc_info_1.p_datatype = datatype ? 1 : 0; if (docname) - init_unistr2(&ctr->docinfo.doc_info_1.docname, docname); + init_unistr2(&ctr->docinfo.doc_info_1.docname, docname, + strlen(docname) + 1); if (outputfile) - init_unistr2(&ctr->docinfo.doc_info_1.outputfile, outputfile); + init_unistr2(&ctr->docinfo.doc_info_1.outputfile, outputfile, + strlen(outputfile) + 1); if (datatype) - init_unistr2(&ctr->docinfo.doc_info_1.datatype, datatype); + init_unistr2(&ctr->docinfo.doc_info_1.datatype, datatype, + strlen(datatype) + 1); break; case 2: @@ -7697,7 +7700,7 @@ BOOL make_spoolss_q_deleteprinterdata(SPOOL_Q_DELETEPRINTERDATA *q_u, POLICY_HND *handle, char *valuename) { memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - init_unistr2(&q_u->valuename, valuename); + init_unistr2(&q_u->valuename, valuename, strlen(valuename) + 1); return True; } @@ -7711,8 +7714,8 @@ BOOL make_spoolss_q_deleteprinterdataex(SPOOL_Q_DELETEPRINTERDATAEX *q_u, char *value) { memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - init_unistr2(&q_u->valuename, value); - init_unistr2(&q_u->keyname, key); + init_unistr2(&q_u->valuename, value, strlen(value) + 1); + init_unistr2(&q_u->keyname, key, strlen(key) + 1); return True; } @@ -7732,7 +7735,8 @@ BOOL make_spoolss_q_rffpcnex(SPOOL_Q_RFFPCNEX *q_u, POLICY_HND *handle, q_u->localmachine_ptr = 1; - init_unistr2(&q_u->localmachine, localmachine); + init_unistr2(&q_u->localmachine, localmachine, + strlen(localmachine) + 1); q_u->printerlocal = printerlocal; |