summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-08-29 17:48:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:03:25 -0500
commitc53e760ea52871b476617c6caad64ca88154ff10 (patch)
tree2288cc842147cc7a49621b567bf2f70ec9447a10
parent44707ad2e00a91f459e80efbe8f362b5853b0a62 (diff)
downloadsamba-c53e760ea52871b476617c6caad64ca88154ff10.tar.gz
samba-c53e760ea52871b476617c6caad64ca88154ff10.tar.bz2
samba-c53e760ea52871b476617c6caad64ca88154ff10.zip
r9752: figured out why talloc_steal() is a bad idea for SEC_DESC*
Add a comment so someone else doesn't get bitten by this as well. (This used to be commit 050364ef34b1e69260bd9df9e2140c45263e92f5)
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index ee35b5853f..33eeec91de 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -4171,7 +4171,11 @@ static BOOL construct_printer_info_2(Printer_entry *print_hnd, PRINTER_INFO_2 *p
if ( ntprinter->info_2->secdesc_buf
&& ntprinter->info_2->secdesc_buf->len != 0 )
{
- printer->secdesc = dup_sec_desc( get_talloc_ctx(), ntprinter->info_2->secdesc_buf->sec );
+ /* don't use talloc_steal() here unless you do a deep steal of all
+ the SEC_DESC members */
+
+ printer->secdesc = dup_sec_desc( get_talloc_ctx(),
+ ntprinter->info_2->secdesc_buf->sec );
}
free_a_printer(&ntprinter, 2);
@@ -4205,7 +4209,11 @@ static BOOL construct_printer_info_3(Printer_entry *print_hnd, PRINTER_INFO_3 **
printer->flags = 0x4;
if (ntprinter->info_2->secdesc_buf && ntprinter->info_2->secdesc_buf->len != 0) {
- printer->secdesc = dup_sec_desc( get_talloc_ctx(), ntprinter->info_2->secdesc_buf->sec );
+ /* don't use talloc_steal() here unless you do a deep steal of all
+ the SEC_DESC members */
+
+ printer->secdesc = dup_sec_desc( get_talloc_ctx(),
+ ntprinter->info_2->secdesc_buf->sec );
}
free_a_printer(&ntprinter, 2);