mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
Fixed ADDPRINTEREX to take a devmode and a security descriptor...
Jeremy.
(This used to be commit 27f65b3aad
)
This commit is contained in:
parent
2452515a16
commit
5b0dca4998
@ -1348,7 +1348,6 @@ typedef struct spool_printer_info_level_2
|
||||
UNISTR2 printprocessor;
|
||||
UNISTR2 datatype;
|
||||
UNISTR2 parameters;
|
||||
SEC_DESC_BUF *secdesc;
|
||||
}
|
||||
SPOOL_PRINTER_INFO_LEVEL_2;
|
||||
|
||||
@ -1490,10 +1489,8 @@ typedef struct spool_q_addprinter
|
||||
UNISTR2 server_name;
|
||||
uint32 level;
|
||||
SPOOL_PRINTER_INFO_LEVEL info;
|
||||
uint32 unk0;
|
||||
uint32 unk1;
|
||||
uint32 unk2;
|
||||
uint32 unk3;
|
||||
DEVMODE_CTR devmode_ctr;
|
||||
SEC_DESC_BUF *secdesc_ctr;
|
||||
uint32 user_level;
|
||||
SPOOL_USER_LEVEL user;
|
||||
}
|
||||
@ -1537,10 +1534,8 @@ typedef struct spool_q_addprinterex
|
||||
UNISTR2 server_name;
|
||||
uint32 level;
|
||||
SPOOL_PRINTER_INFO_LEVEL info;
|
||||
uint32 unk0;
|
||||
uint32 unk1;
|
||||
uint32 unk2;
|
||||
uint32 unk3;
|
||||
DEVMODE_CTR devmode_ctr;
|
||||
SEC_DESC_BUF *secdesc_ctr;
|
||||
uint32 user_switch;
|
||||
SPOOL_USER_CTR user_ctr;
|
||||
}
|
||||
|
@ -778,6 +778,8 @@ BOOL make_spoolss_q_addprinterex(
|
||||
|
||||
if (!ctr) return False;
|
||||
|
||||
ZERO_STRUCTP(q_u);
|
||||
|
||||
q_u->server_name_ptr = (srv_name!=NULL)?1:0;
|
||||
init_unistr2(&q_u->server_name, srv_name, strlen(srv_name));
|
||||
|
||||
@ -797,8 +799,6 @@ BOOL make_spoolss_q_addprinterex(
|
||||
break;
|
||||
}
|
||||
|
||||
q_u->unk0 = q_u->unk1 = q_u->unk2 = q_u->unk3 = 0;
|
||||
|
||||
q_u->user_switch=1;
|
||||
|
||||
q_u->user_ctr.level=1;
|
||||
@ -868,7 +868,6 @@ BOOL make_spoolss_printer_info_2(
|
||||
init_unistr2_from_unistr(&inf->datatype, &info->datatype);
|
||||
init_unistr2_from_unistr(&inf->parameters, &info->parameters);
|
||||
init_unistr2_from_unistr(&inf->datatype, &info->datatype);
|
||||
inf->secdesc = inf->secdesc;
|
||||
|
||||
*spool_info2 = inf;
|
||||
|
||||
@ -4520,6 +4519,8 @@ BOOL spool_io_printer_info_level(char *desc, SPOOL_PRINTER_INFO_LEVEL *il, prs_s
|
||||
|
||||
BOOL spoolss_io_q_addprinterex(char *desc, SPOOL_Q_ADDPRINTEREX *q_u, prs_struct *ps, int depth)
|
||||
{
|
||||
uint32 ptr_sec_desc = 0;
|
||||
|
||||
prs_debug(ps, depth, desc, "spoolss_io_q_addprinterex");
|
||||
depth++;
|
||||
|
||||
@ -4539,25 +4540,32 @@ BOOL spoolss_io_q_addprinterex(char *desc, SPOOL_Q_ADDPRINTEREX *q_u, prs_struct
|
||||
if(!spool_io_printer_info_level("", &q_u->info, ps, depth))
|
||||
return False;
|
||||
|
||||
/* the 4 unknown are all 0 */
|
||||
if (!spoolss_io_devmode_cont(desc, &q_u->devmode_ctr, ps, depth))
|
||||
return False;
|
||||
|
||||
/*
|
||||
* en fait ils sont pas inconnu
|
||||
* par recoupement avec rpcSetPrinter
|
||||
* c'est le devicemode
|
||||
* et le security descriptor.
|
||||
*/
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if(!prs_uint32("unk0", ps, depth, &q_u->unk0))
|
||||
return False;
|
||||
if(!prs_uint32("unk1", ps, depth, &q_u->unk1))
|
||||
return False;
|
||||
if(!prs_uint32("unk2", ps, depth, &q_u->unk2))
|
||||
return False;
|
||||
if(!prs_uint32("unk3", ps, depth, &q_u->unk3))
|
||||
return False;
|
||||
switch (q_u->level) {
|
||||
case 2:
|
||||
ptr_sec_desc = q_u->info.info_2->secdesc_ptr;
|
||||
break;
|
||||
case 3:
|
||||
ptr_sec_desc = q_u->info.info_3->secdesc_ptr;
|
||||
break;
|
||||
}
|
||||
if (ptr_sec_desc) {
|
||||
if (!sec_io_desc_buf(desc, &q_u->secdesc_ctr, ps, depth))
|
||||
return False;
|
||||
} else {
|
||||
uint32 dummy;
|
||||
|
||||
/* Parse a NULL security descriptor. This should really
|
||||
happen inside the sec_io_desc_buf() function. */
|
||||
|
||||
prs_debug(ps, depth, "", "sec_io_desc_buf");
|
||||
if (!prs_uint32("size", ps, depth + 1, &dummy))
|
||||
return False;
|
||||
if (!prs_uint32("ptr", ps, depth + 1, &dummy))
|
||||
return False;
|
||||
}
|
||||
|
||||
if(!prs_uint32("user_switch", ps, depth, &q_u->user_switch))
|
||||
return False;
|
||||
|
@ -5843,7 +5843,7 @@ WERROR _spoolss_enumports( pipes_struct *p, SPOOL_Q_ENUMPORTS *q_u, SPOOL_R_ENUM
|
||||
****************************************************************************/
|
||||
static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_srv_name,
|
||||
const SPOOL_PRINTER_INFO_LEVEL *info,
|
||||
uint32 unk0, uint32 unk1, uint32 unk2, uint32 unk3,
|
||||
DEVICEMODE *devmode, SEC_DESC_BUF *sec_desc_buf,
|
||||
uint32 user_switch, const SPOOL_USER_CTR *user,
|
||||
POLICY_HND *handle)
|
||||
{
|
||||
@ -5939,10 +5939,8 @@ WERROR _spoolss_addprinterex( pipes_struct *p, SPOOL_Q_ADDPRINTEREX *q_u, SPOOL_
|
||||
UNISTR2 *uni_srv_name = &q_u->server_name;
|
||||
uint32 level = q_u->level;
|
||||
SPOOL_PRINTER_INFO_LEVEL *info = &q_u->info;
|
||||
uint32 unk0 = q_u->unk0;
|
||||
uint32 unk1 = q_u->unk1;
|
||||
uint32 unk2 = q_u->unk2;
|
||||
uint32 unk3 = q_u->unk3;
|
||||
DEVICEMODE *devmode = q_u->devmode_ctr.devmode;
|
||||
SEC_DESC_BUF *sdb = q_u->secdesc_ctr;
|
||||
uint32 user_switch = q_u->user_switch;
|
||||
SPOOL_USER_CTR *user = &q_u->user_ctr;
|
||||
POLICY_HND *handle = &r_u->handle;
|
||||
@ -5954,7 +5952,7 @@ WERROR _spoolss_addprinterex( pipes_struct *p, SPOOL_Q_ADDPRINTEREX *q_u, SPOOL_
|
||||
return WERR_UNKNOWN_LEVEL;
|
||||
case 2:
|
||||
return spoolss_addprinterex_level_2(p, uni_srv_name, info,
|
||||
unk0, unk1, unk2, unk3,
|
||||
devmode, sdb,
|
||||
user_switch, user, handle);
|
||||
default:
|
||||
return WERR_UNKNOWN_LEVEL;
|
||||
|
Loading…
Reference in New Issue
Block a user