summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-18 22:49:41 +0100
committerGünther Deschner <gd@samba.org>2009-03-18 23:22:29 +0100
commit531af136f9dd5c6050f78948837294aed02de440 (patch)
treeb204a4e8f3ec5e962fc0544387f31fdb471c0623
parent7d7b1a8dcc338ea037cc02ef1b2dd9e9f6ce0943 (diff)
downloadsamba-531af136f9dd5c6050f78948837294aed02de440.tar.gz
samba-531af136f9dd5c6050f78948837294aed02de440.tar.bz2
samba-531af136f9dd5c6050f78948837294aed02de440.zip
s3: remove POLICY_HND.
Guenther
-rw-r--r--source3/include/libsmb_internal.h2
-rw-r--r--source3/include/nt_printing.h2
-rw-r--r--source3/include/ntdomain.h2
-rw-r--r--source3/include/proto.h20
-rw-r--r--source3/include/rpc_misc.h2
-rw-r--r--source3/lib/netapi/group.c12
-rw-r--r--source3/lib/netapi/user.c4
-rw-r--r--source3/lib/util.c4
-rw-r--r--source3/libads/ldap_printer.c2
-rw-r--r--source3/libnet/libnet_join.c6
-rw-r--r--source3/libsmb/libsmb_xattr.c12
-rw-r--r--source3/libsmb/trusts_util.c2
-rw-r--r--source3/rpc_client/cli_lsarpc.c10
-rw-r--r--source3/rpc_client/cli_reg.c2
-rw-r--r--source3/rpc_client/cli_samr.c2
-rw-r--r--source3/rpc_server/srv_eventlog_nt.c6
-rw-r--r--source3/rpc_server/srv_lsa_hnd.c8
-rw-r--r--source3/rpc_server/srv_samr_nt.c23
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c227
-rw-r--r--source3/rpc_server/srv_svcctl_nt.c4
-rw-r--r--source3/rpc_server/srv_winreg_nt.c6
-rw-r--r--source3/rpcclient/cmd_lsarpc.c48
-rw-r--r--source3/rpcclient/cmd_samr.c56
-rw-r--r--source3/rpcclient/cmd_spoolss.c48
-rw-r--r--source3/rpcclient/cmd_test.c2
-rw-r--r--source3/rpcclient/rpcclient.c2
-rw-r--r--source3/utils/net_rpc.c74
-rw-r--r--source3/utils/net_rpc_audit.c8
-rw-r--r--source3/utils/net_rpc_join.c2
-rw-r--r--source3/utils/net_rpc_printer.c32
-rw-r--r--source3/utils/net_rpc_registry.c6
-rw-r--r--source3/utils/net_rpc_rights.c20
-rw-r--r--source3/utils/net_rpc_service.c22
-rw-r--r--source3/utils/net_rpc_sh_acct.c2
-rw-r--r--source3/utils/net_util.c2
-rw-r--r--source3/utils/netlookup.c2
-rw-r--r--source3/utils/smbcquotas.c2
-rw-r--r--source3/winbindd/winbindd.h4
-rw-r--r--source3/winbindd/winbindd_ads.c2
-rw-r--r--source3/winbindd/winbindd_cm.c6
-rw-r--r--source3/winbindd/winbindd_pam.c6
-rw-r--r--source3/winbindd/winbindd_proto.h4
-rw-r--r--source3/winbindd/winbindd_rpc.c28
43 files changed, 360 insertions, 376 deletions
diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h
index e28c853a1e..0bfcd8fab7 100644
--- a/source3/include/libsmb_internal.h
+++ b/source3/include/libsmb_internal.h
@@ -74,7 +74,7 @@ struct _SMBCSRV {
bool no_pathinfo;
bool no_pathinfo2;
bool no_nt_session;
- POLICY_HND pol;
+ struct policy_handle pol;
SMBCSRV *next, *prev;
diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h
index 2d13197405..7dc60a8f03 100644
--- a/source3/include/nt_printing.h
+++ b/source3/include/nt_printing.h
@@ -440,7 +440,7 @@ typedef struct _Printer{
fstring localmachine;
uint32 printerlocal;
struct spoolss_NotifyOption *option;
- POLICY_HND client_hnd;
+ struct policy_handle client_hnd;
bool client_connected;
uint32 change;
/* are we in a FindNextPrinterChangeNotify() call? */
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index 0b827d385f..c95931b5d0 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -117,7 +117,7 @@ typedef struct _input_data {
struct policy {
struct policy *next, *prev;
- POLICY_HND pol_hnd;
+ struct policy_handle pol_hnd;
void *data_ptr;
};
diff --git a/source3/include/proto.h b/source3/include/proto.h
index c7efc58281..3d87f75c7b 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1209,7 +1209,7 @@ void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned coun
void *talloc_zeronull(const void *context, size_t size, const char *name);
NTSTATUS split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
char **pbase, char **pstream);
-bool is_valid_policy_hnd(const POLICY_HND *hnd);
+bool is_valid_policy_hnd(const struct policy_handle *hnd);
bool policy_hnd_equal(const struct policy_handle *hnd1,
const struct policy_handle *hnd2);
const char *strip_hostname(const char *s);
@@ -5170,13 +5170,13 @@ WERROR regkey_open_internal( TALLOC_CTX *ctx, REGISTRY_KEY **regkey,
NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
bool sec_qos, uint32 des_access,
- POLICY_HND *pol);
+ struct policy_handle *pol);
NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, bool sec_qos,
- uint32 des_access, POLICY_HND *pol);
+ uint32 des_access, struct policy_handle *pol);
NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
- POLICY_HND *pol,
+ struct policy_handle *pol,
int num_sids,
const DOM_SID *sids,
char ***pdomains,
@@ -5184,7 +5184,7 @@ NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli,
enum lsa_SidType **ptypes);
NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
- POLICY_HND *pol, int num_names,
+ struct policy_handle *pol, int num_names,
const char **names,
const char ***dom_names,
int level,
@@ -5398,7 +5398,7 @@ NTSTATUS rpc_transport_sock_init(TALLOC_CTX *mem_ctx, int fd,
NTSTATUS rpccli_winreg_Connect(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
uint32 reg_type, uint32 access_mask,
- POLICY_HND *reg_hnd);
+ struct policy_handle *reg_hnd);
/* The following definitions come from rpc_client/cli_samr.c */
@@ -5431,7 +5431,7 @@ void get_query_dispinfo_params(int loop_count, uint32 *max_entries,
NTSTATUS rpccli_try_samr_connects(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
uint32_t access_mask,
- POLICY_HND *connect_pol);
+ struct policy_handle *connect_pol);
/* The following definitions come from rpc_client/cli_spoolss.c */
@@ -5845,9 +5845,9 @@ NTSTATUS evlog_tdb_entry_to_evt_entry(TALLOC_CTX *mem_ctx,
bool init_pipe_handle_list(pipes_struct *p,
const struct ndr_syntax_id *syntax);
-bool create_policy_hnd(pipes_struct *p, POLICY_HND *hnd, void *data_ptr);
-bool find_policy_by_hnd(pipes_struct *p, POLICY_HND *hnd, void **data_p);
-bool close_policy_hnd(pipes_struct *p, POLICY_HND *hnd);
+bool create_policy_hnd(pipes_struct *p, struct policy_handle *hnd, void *data_ptr);
+bool find_policy_by_hnd(pipes_struct *p, struct policy_handle *hnd, void **data_p);
+bool close_policy_hnd(pipes_struct *p, struct policy_handle *hnd);
void close_policy_by_pipe(pipes_struct *p);
bool pipe_access_check(pipes_struct *p);
diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h
index cdcfb01eff..797e1926db 100644
--- a/source3/include/rpc_misc.h
+++ b/source3/include/rpc_misc.h
@@ -90,8 +90,6 @@ enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_
/**********************************************************************
* RPC policy handle used pretty much everywhere
**********************************************************************/
-
-typedef struct policy_handle POLICY_HND;
#define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\
( IVAL((hnd)->uuid.node,2) == (uint32)sys_getpid() ? "OURS" : \
diff --git a/source3/lib/netapi/group.c b/source3/lib/netapi/group.c
index 617bde2c9a..189902a78e 100644
--- a/source3/lib/netapi/group.c
+++ b/source3/lib/netapi/group.c
@@ -33,7 +33,7 @@ WERROR NetGroupAdd_r(struct libnetapi_ctx *ctx,
struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
- POLICY_HND connect_handle, domain_handle, group_handle;
+ struct policy_handle connect_handle, domain_handle, group_handle;
struct lsa_String lsa_group_name;
struct dom_sid2 *domain_sid = NULL;
uint32_t rid = 0;
@@ -223,7 +223,7 @@ WERROR NetGroupDel_r(struct libnetapi_ctx *ctx,
struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
- POLICY_HND connect_handle, domain_handle, group_handle;
+ struct policy_handle connect_handle, domain_handle, group_handle;
struct lsa_String lsa_group_name;
struct dom_sid2 *domain_sid = NULL;
int i = 0;
@@ -384,7 +384,7 @@ WERROR NetGroupSetInfo_r(struct libnetapi_ctx *ctx,
struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
- POLICY_HND connect_handle, domain_handle, group_handle;
+ struct policy_handle connect_handle, domain_handle, group_handle;
struct lsa_String lsa_group_name;
struct dom_sid2 *domain_sid = NULL;
@@ -624,7 +624,7 @@ WERROR NetGroupGetInfo_r(struct libnetapi_ctx *ctx,
struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
- POLICY_HND connect_handle, domain_handle, group_handle;
+ struct policy_handle connect_handle, domain_handle, group_handle;
struct lsa_String lsa_group_name;
struct dom_sid2 *domain_sid = NULL;
@@ -742,7 +742,7 @@ WERROR NetGroupAddUser_r(struct libnetapi_ctx *ctx,
struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
- POLICY_HND connect_handle, domain_handle, group_handle;
+ struct policy_handle connect_handle, domain_handle, group_handle;
struct lsa_String lsa_group_name, lsa_user_name;
struct dom_sid2 *domain_sid = NULL;
@@ -863,7 +863,7 @@ WERROR NetGroupDelUser_r(struct libnetapi_ctx *ctx,
struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
- POLICY_HND connect_handle, domain_handle, group_handle;
+ struct policy_handle connect_handle, domain_handle, group_handle;
struct lsa_String lsa_group_name, lsa_user_name;
struct dom_sid2 *domain_sid = NULL;
diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c
index 9d7f299f59..8cc65a6e9e 100644
--- a/source3/lib/netapi/user.c
+++ b/source3/lib/netapi/user.c
@@ -352,7 +352,7 @@ WERROR NetUserAdd_r(struct libnetapi_ctx *ctx,
struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
- POLICY_HND connect_handle, domain_handle, user_handle;
+ struct policy_handle connect_handle, domain_handle, user_handle;
struct lsa_String lsa_account_name;
struct dom_sid2 *domain_sid = NULL;
union samr_UserInfo *user_info = NULL;
@@ -496,7 +496,7 @@ WERROR NetUserDel_r(struct libnetapi_ctx *ctx,
struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
- POLICY_HND connect_handle, builtin_handle, domain_handle, user_handle;
+ struct policy_handle connect_handle, builtin_handle, domain_handle, user_handle;
struct lsa_String lsa_account_name;
struct samr_Ids user_rids, name_types;
struct dom_sid2 *domain_sid = NULL;
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 80a807d7e4..75fd82709a 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -3142,9 +3142,9 @@ NTSTATUS split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
return NT_STATUS_OK;
}
-bool is_valid_policy_hnd(const POLICY_HND *hnd)
+bool is_valid_policy_hnd(const struct policy_handle *hnd)
{
- POLICY_HND tmp;
+ struct policy_handle tmp;
ZERO_STRUCT(tmp);
return (memcmp(&tmp, hnd, sizeof(tmp)) != 0);
}
diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c
index e3e8e918f5..9be366dc29 100644
--- a/source3/libads/ldap_printer.c
+++ b/source3/libads/ldap_printer.c
@@ -314,7 +314,7 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli,
struct spoolss_PrinterEnumValues *info;
uint32_t count;
uint32 i;
- POLICY_HND pol;
+ struct policy_handle pol;
if ((asprintf(&printername, "%s\\%s", cli->srv_name_slash, printer) == -1)) {
DEBUG(3, ("Insufficient memory\n"));
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 117178f376..ccfd943a8d 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -680,7 +680,7 @@ static NTSTATUS libnet_join_lookup_dc_rpc(TALLOC_CTX *mem_ctx,
struct cli_state **cli)
{
struct rpc_pipe_client *pipe_hnd = NULL;
- POLICY_HND lsa_pol;
+ struct policy_handle lsa_pol;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
union lsa_PolicyInformation *info = NULL;
@@ -750,7 +750,7 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
struct cli_state *cli)
{
struct rpc_pipe_client *pipe_hnd = NULL;
- POLICY_HND sam_pol, domain_pol, user_pol;
+ struct policy_handle sam_pol, domain_pol, user_pol;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
char *acct_name;
struct lsa_String lsa_acct_name;
@@ -1132,7 +1132,7 @@ static NTSTATUS libnet_join_unjoindomain_rpc(TALLOC_CTX *mem_ctx,
{
struct cli_state *cli = NULL;
struct rpc_pipe_client *pipe_hnd = NULL;
- POLICY_HND sam_pol, domain_pol, user_pol;
+ struct policy_handle sam_pol, domain_pol, user_pol;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
char *acct_name;
uint32_t user_rid;
diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c
index 1ea53eb99a..e4a0a05586 100644
--- a/source3/libsmb/libsmb_xattr.c
+++ b/source3/libsmb/libsmb_xattr.c
@@ -166,7 +166,7 @@ sort_acl(SEC_ACL *the_acl)
/* convert a SID to a string, either numeric or username/group */
static void
convert_sid_to_string(struct cli_state *ipc_cli,
- POLICY_HND *pol,
+ struct policy_handle *pol,
fstring str,
bool numeric,
DOM_SID *sid)
@@ -211,7 +211,7 @@ convert_sid_to_string(struct cli_state *ipc_cli,
/* convert a string to a SID, either numeric or username/group */
static bool
convert_string_to_sid(struct cli_state *ipc_cli,
- POLICY_HND *pol,
+ struct policy_handle *pol,
bool numeric,
DOM_SID *sid,
const char *str)
@@ -255,7 +255,7 @@ done:
/* parse an ACE in the same format as print_ace() */
static bool
parse_ace(struct cli_state *ipc_cli,
- POLICY_HND *pol,
+ struct policy_handle *pol,
SEC_ACE *ace,
bool numeric,
char *str)
@@ -422,7 +422,7 @@ add_ace(SEC_ACL **the_acl,
static SEC_DESC *
sec_desc_parse(TALLOC_CTX *ctx,
struct cli_state *ipc_cli,
- POLICY_HND *pol,
+ struct policy_handle *pol,
bool numeric,
const char *str)
{
@@ -702,7 +702,7 @@ cacl_get(SMBCCTX *context,
TALLOC_CTX *ctx,
SMBCSRV *srv,
struct cli_state *ipc_cli,
- POLICY_HND *pol,
+ struct policy_handle *pol,
char *filename,
char *attr_name,
char *buf,
@@ -1501,7 +1501,7 @@ cacl_set(SMBCCTX *context,
TALLOC_CTX *ctx,
struct cli_state *cli,
struct cli_state *ipc_cli,
- POLICY_HND *pol,
+ struct policy_handle *pol,
const char *filename,
char *the_acl,
int mode,
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index f0595695d2..5b6bc00c57 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -99,7 +99,7 @@ bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain,
char ***domain_names, uint32 *num_domains,
DOM_SID **sids )
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
fstring dc_name;
struct sockaddr_storage dc_ss;
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index 33de986e78..68fd96faa8 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -44,7 +44,7 @@
NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
bool sec_qos, uint32 des_access,
- POLICY_HND *pol)
+ struct policy_handle *pol)
{
struct lsa_ObjectAttribute attr;
struct lsa_QosInfo qos;
@@ -77,7 +77,7 @@ NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, bool sec_qos,
- uint32 des_access, POLICY_HND *pol)
+ uint32 des_access, struct policy_handle *pol)
{
struct lsa_ObjectAttribute attr;
struct lsa_QosInfo qos;
@@ -109,7 +109,7 @@ NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
static NTSTATUS rpccli_lsa_lookup_sids_noalloc(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
- POLICY_HND *pol,
+ struct policy_handle *pol,
int num_sids,
const DOM_SID *sids,
char **domains,
@@ -235,7 +235,7 @@ done:
NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
- POLICY_HND *pol,
+ struct policy_handle *pol,
int num_sids,
const DOM_SID *sids,
char ***pdomains,
@@ -344,7 +344,7 @@ fail:
NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
- POLICY_HND *pol, int num_names,
+ struct policy_handle *pol, int num_names,
const char **names,
const char ***dom_names,
int level,
diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c
index 2ed7119f4b..ec200a24ae 100644
--- a/source3/rpc_client/cli_reg.c
+++ b/source3/rpc_client/cli_reg.c
@@ -27,7 +27,7 @@
NTSTATUS rpccli_winreg_Connect(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
uint32 reg_type, uint32 access_mask,
- POLICY_HND *reg_hnd)
+ struct policy_handle *reg_hnd)
{
ZERO_STRUCTP(reg_hnd);
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index ed42d56a02..86bc041374 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -282,7 +282,7 @@ void get_query_dispinfo_params(int loop_count, uint32 *max_entries,
NTSTATUS rpccli_try_samr_connects(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
uint32_t access_mask,
- POLICY_HND *connect_pol)
+ struct policy_handle *connect_pol)
{
NTSTATUS status;
union samr_ConnectInfo info_in, info_out;
diff --git a/source3/rpc_server/srv_eventlog_nt.c b/source3/rpc_server/srv_eventlog_nt.c
index 2f163a379f..cf07d97fec 100644
--- a/source3/rpc_server/srv_eventlog_nt.c
+++ b/source3/rpc_server/srv_eventlog_nt.c
@@ -50,7 +50,7 @@ static int eventlog_info_destructor(EVENTLOG_INFO *elog)
********************************************************************/
static EVENTLOG_INFO *find_eventlog_info_by_hnd( pipes_struct * p,
- POLICY_HND * handle )
+ struct policy_handle * handle )
{
EVENTLOG_INFO *info;
@@ -174,7 +174,7 @@ static bool get_oldest_entry_hook( EVENTLOG_INFO * info )
/********************************************************************
********************************************************************/
-static NTSTATUS elog_open( pipes_struct * p, const char *logname, POLICY_HND *hnd )
+static NTSTATUS elog_open( pipes_struct * p, const char *logname, struct policy_handle *hnd )
{
EVENTLOG_INFO *elog;
@@ -254,7 +254,7 @@ static NTSTATUS elog_open( pipes_struct * p, const char *logname, POLICY_HND *hn
/********************************************************************
********************************************************************/
-static NTSTATUS elog_close( pipes_struct *p, POLICY_HND *hnd )
+static NTSTATUS elog_close( pipes_struct *p, struct policy_handle *hnd )
{
if ( !( close_policy_hnd( p, hnd ) ) ) {
return NT_STATUS_INVALID_HANDLE;
diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c
index 2779b8aa18..e853bb2047 100644
--- a/source3/rpc_server/srv_lsa_hnd.c
+++ b/source3/rpc_server/srv_lsa_hnd.c
@@ -112,7 +112,7 @@ bool init_pipe_handle_list(pipes_struct *p, const struct ndr_syntax_id *syntax)
data_ptr is TALLOC_FREE()'ed
****************************************************************************/
-bool create_policy_hnd(pipes_struct *p, POLICY_HND *hnd, void *data_ptr)
+bool create_policy_hnd(pipes_struct *p, struct policy_handle *hnd, void *data_ptr)
{
static uint32 pol_hnd_low = 0;
static uint32 pol_hnd_high = 0;
@@ -167,7 +167,7 @@ bool create_policy_hnd(pipes_struct *p, POLICY_HND *hnd, void *data_ptr)
find policy by handle - internal version.
****************************************************************************/
-static struct policy *find_policy_by_hnd_internal(pipes_struct *p, POLICY_HND *hnd, void **data_p)
+static struct policy *find_policy_by_hnd_internal(pipes_struct *p, struct policy_handle *hnd, void **data_p)
{
struct policy *pol;
size_t i;
@@ -197,7 +197,7 @@ static struct policy *find_policy_by_hnd_internal(pipes_struct *p, POLICY_HND *h
find policy by handle
****************************************************************************/
-bool find_policy_by_hnd(pipes_struct *p, POLICY_HND *hnd, void **data_p)
+bool find_policy_by_hnd(pipes_struct *p, struct policy_handle *hnd, void **data_p)
{
return find_policy_by_hnd_internal(p, hnd, data_p) == NULL ? False : True;
}
@@ -206,7 +206,7 @@ bool find_policy_by_hnd(pipes_struct *p, POLICY_HND *hnd, void **data_p)
Close a policy.
****************************************************************************/
-bool close_policy_hnd(pipes_struct *p, POLICY_HND *hnd)
+bool close_policy_hnd(pipes_struct *p, struct policy_handle *hnd)
{
struct policy *pol = find_policy_by_hnd_internal(p, hnd, NULL);
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 1128a856cd..dcbd0963c4 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -719,7 +719,7 @@ NTSTATUS _samr_GetUserPwInfo(pipes_struct *p,
/*******************************************************************
********************************************************************/
-static bool get_lsa_policy_samr_sid( pipes_struct *p, POLICY_HND *pol,
+static bool get_lsa_policy_samr_sid( pipes_struct *p, struct policy_handle *pol,
DOM_SID *sid, uint32 *acc_granted,
DISP_INFO **ppdisp_info)
{
@@ -2122,8 +2122,6 @@ NTSTATUS _samr_OpenUser(pipes_struct *p,
{
struct samu *sampass=NULL;
DOM_SID sid;
- POLICY_HND domain_pol = *r->in.domain_handle;
- POLICY_HND *user_pol = r->out.user_handle;
struct samr_info *info = NULL;
SEC_DESC *psd = NULL;
uint32 acc_granted;
@@ -2135,7 +2133,7 @@ NTSTATUS _samr_OpenUser(pipes_struct *p,
/* find the domain policy handle and get domain SID / access bits in the domain policy. */
- if ( !get_lsa_policy_samr_sid(p, &domain_pol, &sid, &acc_granted, NULL) )
+ if ( !get_lsa_policy_samr_sid(p, r->in.domain_handle, &sid, &acc_granted, NULL) )
return NT_STATUS_INVALID_HANDLE;
nt_status = access_check_samr_function(acc_granted,
@@ -2188,7 +2186,7 @@ NTSTATUS _samr_OpenUser(pipes_struct *p,
info->acc_granted = acc_granted;
/* get a (unique) handle. open a policy on it. */
- if (!create_policy_hnd(p, user_pol, info))
+ if (!create_policy_hnd(p, r->out.user_handle, info))
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
return NT_STATUS_OK;
@@ -3032,9 +3030,7 @@ NTSTATUS _samr_CreateUser2(pipes_struct *p,
{
const char *account = NULL;
DOM_SID sid;
- POLICY_HND dom_pol = *r->in.domain_handle;
uint32_t acb_info = r->in.acct_flags;
- POLICY_HND *user_pol = r->out.user_handle;
struct samr_info *info = NULL;
NTSTATUS nt_status;
uint32 acc_granted;
@@ -3047,7 +3043,7 @@ NTSTATUS _samr_CreateUser2(pipes_struct *p,
DISP_INFO *disp_info = NULL;
/* Get the domain SID stored in the domain policy */
- if (!get_lsa_policy_samr_sid(p, &dom_pol, &sid, &acc_granted,
+ if (!get_lsa_policy_samr_sid(p, r->in.domain_handle, &sid, &acc_granted,
&disp_info))
return NT_STATUS_INVALID_HANDLE;
@@ -3159,7 +3155,7 @@ NTSTATUS _samr_CreateUser2(pipes_struct *p,
info->acc_granted = acc_granted;
/* get a (unique) handle. open a policy on it. */
- if (!create_policy_hnd(p, user_pol, info)) {
+ if (!create_policy_hnd(p, r->out.user_handle, info)) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
@@ -3447,9 +3443,7 @@ NTSTATUS _samr_OpenAlias(pipes_struct *p,
struct samr_OpenAlias *r)
{
DOM_SID sid;
- POLICY_HND domain_pol = *r->in.domain_handle;
uint32 alias_rid = r->in.rid;
- POLICY_HND *alias_pol = r->out.alias_handle;
struct samr_info *info = NULL;
SEC_DESC *psd = NULL;
uint32 acc_granted;
@@ -3460,7 +3454,7 @@ NTSTATUS _samr_OpenAlias(pipes_struct *p,
/* find the domain policy and get the SID / access bits stored in the domain policy */
- if ( !get_lsa_policy_samr_sid(p, &domain_pol, &sid, &acc_granted, NULL) )
+ if ( !get_lsa_policy_samr_sid(p, r->in.domain_handle, &sid, &acc_granted, NULL) )
return NT_STATUS_INVALID_HANDLE;
status = access_check_samr_function(acc_granted,
@@ -3521,7 +3515,7 @@ NTSTATUS _samr_OpenAlias(pipes_struct *p,
info->acc_granted = acc_granted;
/* get a (unique) handle. open a policy on it. */
- if (!create_policy_hnd(p, alias_pol, info))
+ if (!create_policy_hnd(p, r->out.alias_handle, info))
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
return NT_STATUS_OK;
@@ -3996,7 +3990,6 @@ NTSTATUS _samr_SetUserInfo(pipes_struct *p,
NTSTATUS status;
struct samu *pwd = NULL;
DOM_SID sid;
- POLICY_HND *pol = r->in.user_handle;
union samr_UserInfo *info = r->in.info;
uint16_t switch_value = r->in.level;
uint32_t acc_granted;
@@ -4009,7 +4002,7 @@ NTSTATUS _samr_SetUserInfo(pipes_struct *p,
DEBUG(5,("_samr_SetUserInfo: %d\n", __LINE__));
/* find the policy handle. open a policy on it. */
- if (!get_lsa_policy_samr_sid(p, pol, &sid, &acc_granted, &disp_info)) {
+ if (!get_lsa_policy_samr_sid(p, r->in.user_handle, &sid, &acc_granted, &disp_info)) {
return NT_STATUS_INVALID_HANDLE;
}
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index b825cefa39..ab15e5c5f6 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -148,7 +148,7 @@ static int nt_printq_status(int v)
Disconnect from the client
****************************************************************************/
-static void srv_spoolss_replycloseprinter(int snum, POLICY_HND *handle)
+static void srv_spoolss_replycloseprinter(int snum, struct policy_handle *handle)
{
WERROR result;
NTSTATUS status;
@@ -231,7 +231,8 @@ static int printer_entry_destructor(Printer_entry *Printer)
find printer index by handle
****************************************************************************/
-static Printer_entry *find_printer_index_by_hnd(pipes_struct *p, POLICY_HND *hnd)
+static Printer_entry *find_printer_index_by_hnd(pipes_struct *p,
+ struct policy_handle *hnd)
{
Printer_entry *find_printer = NULL;
@@ -247,12 +248,13 @@ static Printer_entry *find_printer_index_by_hnd(pipes_struct *p, POLICY_HND *hnd
Close printer index by handle.
****************************************************************************/
-static bool close_printer_handle(pipes_struct *p, POLICY_HND *hnd)
+static bool close_printer_handle(pipes_struct *p, struct policy_handle *hnd)
{
Printer_entry *Printer = find_printer_index_by_hnd(p, hnd);
if (!Printer) {
- DEBUG(2,("close_printer_handle: Invalid handle (%s:%u:%u)\n", OUR_HANDLE(hnd)));
+ DEBUG(2,("close_printer_handle: Invalid handle (%s:%u:%u)\n",
+ OUR_HANDLE(hnd)));
return False;
}
@@ -325,12 +327,13 @@ WERROR delete_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const char *sh
Delete a printer given a handle.
****************************************************************************/
-static WERROR delete_printer_handle(pipes_struct *p, POLICY_HND *hnd)
+static WERROR delete_printer_handle(pipes_struct *p, struct policy_handle *hnd)
{
Printer_entry *Printer = find_printer_index_by_hnd(p, hnd);
if (!Printer) {
- DEBUG(2,("delete_printer_handle: Invalid handle (%s:%u:%u)\n", OUR_HANDLE(hnd)));
+ DEBUG(2,("delete_printer_handle: Invalid handle (%s:%u:%u)\n",
+ OUR_HANDLE(hnd)));
return WERR_BADFID;
}
@@ -362,13 +365,14 @@ static WERROR delete_printer_handle(pipes_struct *p, POLICY_HND *hnd)
Return the snum of a printer corresponding to an handle.
****************************************************************************/
-static bool get_printer_snum(pipes_struct *p, POLICY_HND *hnd, int *number,
- struct share_params **params)
+static bool get_printer_snum(pipes_struct *p, struct policy_handle *hnd,
+ int *number, struct share_params **params)
{
Printer_entry *Printer = find_printer_index_by_hnd(p, hnd);
if (!Printer) {
- DEBUG(2,("get_printer_snum: Invalid handle (%s:%u:%u)\n", OUR_HANDLE(hnd)));
+ DEBUG(2,("get_printer_snum: Invalid handle (%s:%u:%u)\n",
+ OUR_HANDLE(hnd)));
return False;
}
@@ -551,7 +555,8 @@ static bool set_printer_hnd_name(Printer_entry *Printer, char *handlename)
Find first available printer slot. creates a printer handle for you.
****************************************************************************/
-static bool open_printer_hnd(pipes_struct *p, POLICY_HND *hnd, char *name, uint32 access_granted)
+static bool open_printer_hnd(pipes_struct *p, struct policy_handle *hnd,
+ char *name, uint32_t access_granted)
{
Printer_entry *new_printer;
@@ -1539,7 +1544,6 @@ bool convert_devicemode(const char *printername,
WERROR _spoolss_OpenPrinterEx(pipes_struct *p,
struct spoolss_OpenPrinterEx *r)
{
- POLICY_HND *handle = r->out.handle;
char *name = CONST_DISCARD(char *, r->in.printername);
int snum;
Printer_entry *Printer=NULL;
@@ -1553,16 +1557,16 @@ WERROR _spoolss_OpenPrinterEx(pipes_struct *p,
DEBUGADD(3,("checking name: %s\n",name));
- if (!open_printer_hnd(p, handle, name, 0)) {
+ if (!open_printer_hnd(p, r->out.handle, name, 0)) {
ZERO_STRUCTP(r->out.handle);
return WERR_INVALID_PARAM;
}
- Printer=find_printer_index_by_hnd(p, handle);
+ Printer = find_printer_index_by_hnd(p, r->out.handle);
if ( !Printer ) {
DEBUG(0,("_spoolss_OpenPrinterEx: logic error. Can't find printer "
"handle we created for printer %s\n", name ));
- close_printer_handle(p,handle);
+ close_printer_handle(p, r->out.handle);
ZERO_STRUCTP(r->out.handle);
return WERR_INVALID_PARAM;
}
@@ -1613,7 +1617,7 @@ WERROR _spoolss_OpenPrinterEx(pipes_struct *p,
if (r->in.access_mask &
~(SERVER_ACCESS_ADMINISTER | SERVER_ACCESS_ENUMERATE)) {
DEBUG(3, ("access DENIED for non-printserver bits\n"));
- close_printer_handle(p, handle);
+ close_printer_handle(p, r->out.handle);
ZERO_STRUCTP(r->out.handle);
return WERR_ACCESS_DENIED;
}
@@ -1625,7 +1629,7 @@ WERROR _spoolss_OpenPrinterEx(pipes_struct *p,
SE_PRIV se_printop = SE_PRINT_OPERATOR;
if (!lp_ms_add_printer_wizard()) {
- close_printer_handle(p, handle);
+ close_printer_handle(p, r->out.handle);
ZERO_STRUCTP(r->out.handle);
return WERR_ACCESS_DENIED;
}
@@ -1641,7 +1645,7 @@ WERROR _spoolss_OpenPrinterEx(pipes_struct *p,
NULL, NULL,
p->server_info->ptok,
lp_printer_admin(snum))) {
- close_printer_handle(p, handle);
+ close_printer_handle(p, r->out.handle);
ZERO_STRUCTP(r->out.handle);
return WERR_ACCESS_DENIED;
}
@@ -1663,8 +1667,8 @@ WERROR _spoolss_OpenPrinterEx(pipes_struct *p,
/* NT doesn't let us connect to a printer if the connecting user
doesn't have print permission. */
- if (!get_printer_snum(p, handle, &snum, NULL)) {
- close_printer_handle(p, handle);
+ if (!get_printer_snum(p, r->out.handle, &snum, NULL)) {
+ close_printer_handle(p, r->out.handle);
ZERO_STRUCTP(r->out.handle);
return WERR_BADFID;
}
@@ -1700,14 +1704,14 @@ WERROR _spoolss_OpenPrinterEx(pipes_struct *p,
!print_access_check(p->server_info, snum,
r->in.access_mask)) {
DEBUG(3, ("access DENIED for printer open\n"));
- close_printer_handle(p, handle);
+ close_printer_handle(p, r->out.handle);
ZERO_STRUCTP(r->out.handle);
return WERR_ACCESS_DENIED;
}
if ((r->in.access_mask & SPECIFIC_RIGHTS_MASK)& ~(PRINTER_ACCESS_ADMINISTER|PRINTER_ACCESS_USE)) {
DEBUG(3, ("access DENIED for printer open - unknown bits\n"));
- close_printer_handle(p, handle);
+ close_printer_handle(p, r->out.handle);
ZERO_STRUCTP(r->out.handle);
return WERR_ACCESS_DENIED;
}
@@ -1999,9 +2003,10 @@ static bool convert_printer_driver_info(const struct spoolss_AddDriverInfoCtr *r
* _spoolss_enddocprinter_internal.
********************************************************************/
-static WERROR _spoolss_enddocprinter_internal(pipes_struct *p, POLICY_HND *handle)
+static WERROR _spoolss_enddocprinter_internal(pipes_struct *p,
+ struct policy_handle *handle)
{
- Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
int snum;
if (!Printer) {
@@ -2026,14 +2031,12 @@ static WERROR _spoolss_enddocprinter_internal(pipes_struct *p, POLICY_HND *handl
WERROR _spoolss_ClosePrinter(pipes_struct *p,
struct spoolss_ClosePrinter *r)
{
- POLICY_HND *handle = r->in.handle;
-
- Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
if (Printer && Printer->document_started)
- _spoolss_enddocprinter_internal(p, handle); /* print job was not closed */
+ _spoolss_enddocprinter_internal(p, r->in.handle); /* print job was not closed */
- if (!close_printer_handle(p, handle))
+ if (!close_printer_handle(p, r->in.handle))
return WERR_BADFID;
/* clear the returned printer handle. Observed behavior
@@ -2053,14 +2056,13 @@ WERROR _spoolss_ClosePrinter(pipes_struct *p,
WERROR _spoolss_DeletePrinter(pipes_struct *p,
struct spoolss_DeletePrinter *r)
{
- POLICY_HND *handle = r->in.handle;
- Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
WERROR result;
if (Printer && Printer->document_started)
- _spoolss_enddocprinter_internal(p, handle); /* print job was not closed */
+ _spoolss_enddocprinter_internal(p, r->in.handle); /* print job was not closed */
- result = delete_printer_handle(p, handle);
+ result = delete_printer_handle(p, r->in.handle);
update_c_setprinter(False);
@@ -2652,7 +2654,8 @@ static bool spoolss_connect_to_client(struct rpc_pipe_client **pp_pipe,
static bool srv_spoolss_replyopenprinter(int snum, const char *printer,
uint32 localprinter, uint32 type,
- POLICY_HND *handle, struct sockaddr_storage *client_ss)
+ struct policy_handle *handle,
+ struct sockaddr_storage *client_ss)
{
WERROR result;
NTSTATUS status;
@@ -2766,18 +2769,18 @@ static struct spoolss_NotifyOption *dup_spoolss_NotifyOption(TALLOC_CTX *mem_ctx
WERROR _spoolss_RemoteFindFirstPrinterChangeNotifyEx(pipes_struct *p,
struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r)
{
- POLICY_HND *handle = r->in.handle;
int snum = -1;
struct spoolss_NotifyOption *option = r->in.notify_options;
struct sockaddr_storage client_ss;
/* store the notify value in the printer struct */
- Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
if (!Printer) {
DEBUG(2,("_spoolss_RemoteFindFirstPrinterChangeNotifyEx: "
- "Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+ "Invalid handle (%s:%u:%u).\n",
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
@@ -2795,7 +2798,7 @@ WERROR _spoolss_RemoteFindFirstPrinterChangeNotifyEx(pipes_struct *p,
if ( Printer->printer_type == SPLHND_SERVER)
snum = -1;
else if ( (Printer->printer_type == SPLHND_PRINTER) &&
- !get_printer_snum(p, handle, &snum, NULL) )
+ !get_printer_snum(p, r->in.handle, &snum, NULL) )
return WERR_BADFID;
if (!interpret_string_addr(&client_ss, p->client_address,
@@ -3550,12 +3553,13 @@ static bool construct_notify_jobs_info(print_queue_struct *queue,
*
********************************************************************/
-static WERROR printserver_notify_info(pipes_struct *p, POLICY_HND *hnd,
+static WERROR printserver_notify_info(pipes_struct *p,
+ struct policy_handle *hnd,
struct spoolss_NotifyInfo *info,
TALLOC_CTX *mem_ctx)
{
int snum;
- Printer_entry *Printer=find_printer_index_by_hnd(p, hnd);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, hnd);
int n_services=lp_numservices();
int i;
struct spoolss_NotifyOption *option;
@@ -3616,11 +3620,12 @@ static WERROR printserver_notify_info(pipes_struct *p, POLICY_HND *hnd,
*
********************************************************************/
-static WERROR printer_notify_info(pipes_struct *p, POLICY_HND *hnd, struct spoolss_NotifyInfo *info,
+static WERROR printer_notify_info(pipes_struct *p, struct policy_handle *hnd,
+ struct spoolss_NotifyInfo *info,
TALLOC_CTX *mem_ctx)
{
int snum;
- Printer_entry *Printer=find_printer_index_by_hnd(p, hnd);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, hnd);
int i;
uint32 id;
struct spoolss_NotifyOption *option;
@@ -3709,10 +3714,9 @@ static WERROR printer_notify_info(pipes_struct *p, POLICY_HND *hnd, struct spool
WERROR _spoolss_RouterRefreshPrinterChangeNotify(pipes_struct *p,
struct spoolss_RouterRefreshPrinterChangeNotify *r)
{
- POLICY_HND *handle = r->in.handle;
struct spoolss_NotifyInfo *info;
- Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
WERROR result = WERR_BADFID;
/* we always have a spoolss_NotifyInfo struct */
@@ -3726,7 +3730,8 @@ WERROR _spoolss_RouterRefreshPrinterChangeNotify(pipes_struct *p,
if (!Printer) {
DEBUG(2,("_spoolss_RouterRefreshPrinterChangeNotify: "
- "Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+ "Invalid handle (%s:%u:%u).\n",
+ OUR_HANDLE(r->in.handle)));
goto done;
}
@@ -3755,11 +3760,13 @@ WERROR _spoolss_RouterRefreshPrinterChangeNotify(pipes_struct *p,
switch (Printer->printer_type) {
case SPLHND_SERVER:
- result = printserver_notify_info(p, handle, info, p->mem_ctx);
+ result = printserver_notify_info(p, r->in.handle,
+ info, p->mem_ctx);
break;
case SPLHND_PRINTER:
- result = printer_notify_info(p, handle, info, p->mem_ctx);
+ result = printer_notify_info(p, r->in.handle,
+ info, p->mem_ctx);
break;
}
@@ -5063,7 +5070,7 @@ WERROR _spoolss_GetPrinterDriver2(pipes_struct *p,
DEBUG(4,("_spoolss_GetPrinterDriver2\n"));
- if (!(printer = find_printer_index_by_hnd( p, r->in.handle))) {
+ if (!(printer = find_printer_index_by_hnd(p, r->in.handle))) {
DEBUG(0,("_spoolss_GetPrinterDriver2: invalid printer handle!\n"));
return WERR_INVALID_PRINTER_NAME;
}
@@ -5142,9 +5149,7 @@ WERROR _spoolss_GetPrinterDriver2(pipes_struct *p,
WERROR _spoolss_StartPagePrinter(pipes_struct *p,
struct spoolss_StartPagePrinter *r)
{
- POLICY_HND *handle = r->in.handle;
-
- Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
if (!Printer) {
DEBUG(3,("_spoolss_StartPagePrinter: "
@@ -5163,18 +5168,17 @@ WERROR _spoolss_StartPagePrinter(pipes_struct *p,
WERROR _spoolss_EndPagePrinter(pipes_struct *p,
struct spoolss_EndPagePrinter *r)
{
- POLICY_HND *handle = r->in.handle;
int snum;
- Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
if (!Printer) {
DEBUG(2,("_spoolss_EndPagePrinter: Invalid handle (%s:%u:%u).\n",
- OUR_HANDLE(handle)));
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
- if (!get_printer_snum(p, handle, &snum, NULL))
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
Printer->page_started=False;
@@ -5190,15 +5194,15 @@ WERROR _spoolss_EndPagePrinter(pipes_struct *p,
WERROR _spoolss_StartDocPrinter(pipes_struct *p,
struct spoolss_StartDocPrinter *r)
{
- POLICY_HND *handle = r->in.handle;
uint32_t *jobid = r->out.job_id;
struct spoolss_DocumentInfo1 *info_1;
int snum;
- Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
if (!Printer) {
DEBUG(2,("_spoolss_StartDocPrinter: "
- "Invalid handle (%s:%u:%u)\n", OUR_HANDLE(handle)));
+ "Invalid handle (%s:%u:%u)\n",
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
@@ -5224,7 +5228,7 @@ WERROR _spoolss_StartDocPrinter(pipes_struct *p,
}
/* get the share number of the printer */
- if (!get_printer_snum(p, handle, &snum, NULL)) {
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL)) {
return WERR_BADFID;
}
@@ -5252,9 +5256,7 @@ WERROR _spoolss_StartDocPrinter(pipes_struct *p,
WERROR _spoolss_EndDocPrinter(pipes_struct *p,
struct spoolss_EndDocPrinter *r)
{
- POLICY_HND *handle = r->in.handle;
-
- return _spoolss_enddocprinter_internal(p, handle);
+ return _spoolss_enddocprinter_internal(p, r->in.handle);
}
/****************************************************************
@@ -5264,21 +5266,20 @@ WERROR _spoolss_EndDocPrinter(pipes_struct *p,
WERROR _spoolss_WritePrinter(pipes_struct *p,
struct spoolss_WritePrinter *r)
{
- POLICY_HND *handle = r->in.handle;
uint32 buffer_size = r->in._data_size;
uint8 *buffer = r->in.data.data;
uint32 *buffer_written = &r->in._data_size;
int snum;
- Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
if (!Printer) {
DEBUG(2,("_spoolss_WritePrinter: Invalid handle (%s:%u:%u)\n",
- OUR_HANDLE(handle)));
+ OUR_HANDLE(r->in.handle)));
*r->out.num_written = r->in._data_size;
return WERR_BADFID;
}
- if (!get_printer_snum(p, handle, &snum, NULL))
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
(*buffer_written) = (uint32)print_job_write(snum, Printer->jobid, (const char *)buffer,
@@ -5302,7 +5303,7 @@ WERROR _spoolss_WritePrinter(pipes_struct *p,
*
********************************************************************/
-static WERROR control_printer(POLICY_HND *handle, uint32 command,
+static WERROR control_printer(struct policy_handle *handle, uint32_t command,
pipes_struct *p)
{
int snum;
@@ -5310,7 +5311,8 @@ static WERROR control_printer(POLICY_HND *handle, uint32 command,
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
if (!Printer) {
- DEBUG(2,("control_printer: Invalid handle (%s:%u:%u)\n", OUR_HANDLE(handle)));
+ DEBUG(2,("control_printer: Invalid handle (%s:%u:%u)\n",
+ OUR_HANDLE(handle)));
return WERR_BADFID;
}
@@ -5351,18 +5353,17 @@ static WERROR control_printer(POLICY_HND *handle, uint32 command,
WERROR _spoolss_AbortPrinter(pipes_struct *p,
struct spoolss_AbortPrinter *r)
{
- POLICY_HND *handle = r->in.handle;
- Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
int snum;
WERROR errcode = WERR_OK;
if (!Printer) {
DEBUG(2,("_spoolss_AbortPrinter: Invalid handle (%s:%u:%u)\n",
- OUR_HANDLE(handle)));
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
- if (!get_printer_snum(p, handle, &snum, NULL))
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
print_job_delete(p->server_info, snum, Printer->jobid, &errcode );
@@ -5375,7 +5376,7 @@ WERROR _spoolss_AbortPrinter(pipes_struct *p,
* when updating a printer description
********************************************************************/
-static WERROR update_printer_sec(POLICY_HND *handle,
+static WERROR update_printer_sec(struct policy_handle *handle,
pipes_struct *p, SEC_DESC_BUF *secdesc_ctr)
{
SEC_DESC_BUF *new_secdesc_ctr = NULL, *old_secdesc_ctr = NULL;
@@ -5661,7 +5662,7 @@ bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEV
* when updating a printer description.
********************************************************************/
-static WERROR update_printer(pipes_struct *p, POLICY_HND *handle,
+static WERROR update_printer(pipes_struct *p, struct policy_handle *handle,
struct spoolss_SetPrinterInfoCtr *info_ctr,
struct spoolss_DeviceMode *devmode)
{
@@ -5854,7 +5855,8 @@ done:
/****************************************************************************
****************************************************************************/
-static WERROR publish_or_unpublish_printer(pipes_struct *p, POLICY_HND *handle,
+static WERROR publish_or_unpublish_printer(pipes_struct *p,
+ struct policy_handle *handle,
struct spoolss_SetPrinterInfo7 *info7)
{
#ifdef HAVE_ADS
@@ -5890,36 +5892,35 @@ static WERROR publish_or_unpublish_printer(pipes_struct *p, POLICY_HND *handle,
WERROR _spoolss_SetPrinter(pipes_struct *p,
struct spoolss_SetPrinter *r)
{
- POLICY_HND *handle = r->in.handle;
WERROR result;
- Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
if (!Printer) {
DEBUG(2,("_spoolss_SetPrinter: Invalid handle (%s:%u:%u)\n",
- OUR_HANDLE(handle)));
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
/* check the level */
switch (r->in.info_ctr->level) {
case 0:
- return control_printer(handle, r->in.command, p);
+ return control_printer(r->in.handle, r->in.command, p);
case 2:
- result = update_printer(p, handle,
+ result = update_printer(p, r->in.handle,
r->in.info_ctr,
r->in.devmode_ctr->devmode);
if (!W_ERROR_IS_OK(result))
return result;
if (r->in.secdesc_ctr->sd)
- result = update_printer_sec(handle, p,
+ result = update_printer_sec(r->in.handle, p,
r->in.secdesc_ctr);
return result;
case 3:
- return update_printer_sec(handle, p,
+ return update_printer_sec(r->in.handle, p,
r->in.secdesc_ctr);
case 7:
- return publish_or_unpublish_printer(p, handle,
+ return publish_or_unpublish_printer(p, r->in.handle,
r->in.info_ctr->info.info7);
default:
return WERR_UNKNOWN_LEVEL;
@@ -5933,12 +5934,11 @@ WERROR _spoolss_SetPrinter(pipes_struct *p,
WERROR _spoolss_FindClosePrinterNotify(pipes_struct *p,
struct spoolss_FindClosePrinterNotify *r)
{
- POLICY_HND *handle = r->in.handle;
- Printer_entry *Printer= find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
if (!Printer) {
DEBUG(2,("_spoolss_FindClosePrinterNotify: "
- "Invalid handle (%s:%u:%u)\n", OUR_HANDLE(handle)));
+ "Invalid handle (%s:%u:%u)\n", OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
@@ -5948,7 +5948,7 @@ WERROR _spoolss_FindClosePrinterNotify(pipes_struct *p,
if ( Printer->printer_type == SPLHND_SERVER)
snum = -1;
else if ( (Printer->printer_type == SPLHND_PRINTER) &&
- !get_printer_snum(p, handle, &snum, NULL) )
+ !get_printer_snum(p, r->in.handle, &snum, NULL) )
return WERR_BADFID;
srv_spoolss_replycloseprinter(snum, &Printer->notify.client_hnd);
@@ -6275,14 +6275,13 @@ WERROR _spoolss_ScheduleJob(pipes_struct *p,
WERROR _spoolss_SetJob(pipes_struct *p,
struct spoolss_SetJob *r)
{
- POLICY_HND *handle = r->in.handle;
uint32 jobid = r->in.job_id;
uint32 command = r->in.command;
int snum;
WERROR errcode = WERR_BADFUNC;
- if (!get_printer_snum(p, handle, &snum, NULL)) {
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL)) {
return WERR_BADFID;
}
@@ -7103,7 +7102,7 @@ static WERROR spoolss_addprinterex_level_2(pipes_struct *p,
struct spoolss_DeviceMode *devmode,
struct security_descriptor *sec_desc,
struct spoolss_UserLevelCtr *user_ctr,
- POLICY_HND *handle)
+ struct policy_handle *handle)
{
NT_PRINTER_INFO_LEVEL *printer = NULL;
fstring name;
@@ -7803,8 +7802,7 @@ done:
WERROR _spoolss_ResetPrinter(pipes_struct *p,
struct spoolss_ResetPrinter *r)
{
- POLICY_HND *handle = r->in.handle;
- Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
int snum;
DEBUG(5,("_spoolss_ResetPrinter\n"));
@@ -7817,11 +7815,11 @@ WERROR _spoolss_ResetPrinter(pipes_struct *p,
if (!Printer) {
DEBUG(2,("_spoolss_ResetPrinter: Invalid handle (%s:%u:%u).\n",
- OUR_HANDLE(handle)));
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
- if (!get_printer_snum(p,handle, &snum, NULL))
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
@@ -7836,21 +7834,20 @@ WERROR _spoolss_ResetPrinter(pipes_struct *p,
WERROR _spoolss_DeletePrinterData(pipes_struct *p,
struct spoolss_DeletePrinterData *r)
{
- POLICY_HND *handle = r->in.handle;
NT_PRINTER_INFO_LEVEL *printer = NULL;
int snum=0;
WERROR status = WERR_OK;
- Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
DEBUG(5,("_spoolss_DeletePrinterData\n"));
if (!Printer) {
DEBUG(2,("_spoolss_DeletePrinterData: Invalid handle (%s:%u:%u).\n",
- OUR_HANDLE(handle)));
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
- if (!get_printer_snum(p, handle, &snum, NULL))
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
if (Printer->access_granted != PRINTER_ACCESS_ADMINISTER) {
@@ -7886,7 +7883,6 @@ WERROR _spoolss_DeletePrinterData(pipes_struct *p,
WERROR _spoolss_AddForm(pipes_struct *p,
struct spoolss_AddForm *r)
{
- POLICY_HND *handle = r->in.handle;
struct spoolss_AddFormInfo1 *form = r->in.info.info1;
nt_forms_struct tmpForm;
int snum;
@@ -7895,13 +7891,13 @@ WERROR _spoolss_AddForm(pipes_struct *p,
int count=0;
nt_forms_struct *list=NULL;
- Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
DEBUG(5,("_spoolss_AddForm\n"));
if (!Printer) {
DEBUG(2,("_spoolss_AddForm: Invalid handle (%s:%u:%u).\n",
- OUR_HANDLE(handle)));
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
@@ -7910,7 +7906,7 @@ WERROR _spoolss_AddForm(pipes_struct *p,
if ( Printer->printer_type == SPLHND_PRINTER )
{
- if (!get_printer_snum(p,handle, &snum, NULL))
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
status = get_a_printer(Printer, &printer, 2, lp_const_servicename(snum));
@@ -7962,12 +7958,11 @@ done:
WERROR _spoolss_DeleteForm(pipes_struct *p,
struct spoolss_DeleteForm *r)
{
- POLICY_HND *handle = r->in.handle;
const char *form_name = r->in.form_name;
nt_forms_struct tmpForm;
int count=0;
nt_forms_struct *list=NULL;
- Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
int snum;
WERROR status = WERR_OK;
NT_PRINTER_INFO_LEVEL *printer = NULL;
@@ -7976,7 +7971,7 @@ WERROR _spoolss_DeleteForm(pipes_struct *p,
if (!Printer) {
DEBUG(2,("_spoolss_DeleteForm: Invalid handle (%s:%u:%u).\n",
- OUR_HANDLE(handle)));
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
@@ -7984,7 +7979,7 @@ WERROR _spoolss_DeleteForm(pipes_struct *p,
if ( Printer->printer_type == SPLHND_PRINTER )
{
- if (!get_printer_snum(p,handle, &snum, NULL))
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
status = get_a_printer(Printer, &printer, 2, lp_const_servicename(snum));
@@ -8032,7 +8027,6 @@ done:
WERROR _spoolss_SetForm(pipes_struct *p,
struct spoolss_SetForm *r)
{
- POLICY_HND *handle = r->in.handle;
struct spoolss_AddFormInfo1 *form = r->in.info.info1;
nt_forms_struct tmpForm;
int snum;
@@ -8041,13 +8035,13 @@ WERROR _spoolss_SetForm(pipes_struct *p,
int count=0;
nt_forms_struct *list=NULL;
- Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
DEBUG(5,("_spoolss_SetForm\n"));
if (!Printer) {
DEBUG(2,("_spoolss_SetForm: Invalid handle (%s:%u:%u).\n",
- OUR_HANDLE(handle)));
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
@@ -8055,7 +8049,7 @@ WERROR _spoolss_SetForm(pipes_struct *p,
if ( Printer->printer_type == SPLHND_PRINTER )
{
- if (!get_printer_snum(p,handle, &snum, NULL))
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
status = get_a_printer(Printer, &printer, 2, lp_const_servicename(snum));
@@ -8807,21 +8801,21 @@ WERROR _spoolss_SetPrinterDataEx(pipes_struct *p,
WERROR _spoolss_DeletePrinterDataEx(pipes_struct *p,
struct spoolss_DeletePrinterDataEx *r)
{
- POLICY_HND *handle = r->in.handle;
NT_PRINTER_INFO_LEVEL *printer = NULL;
int snum=0;
WERROR status = WERR_OK;
- Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
DEBUG(5,("_spoolss_DeletePrinterDataEx\n"));
if (!Printer) {
DEBUG(2,("_spoolss_DeletePrinterDataEx: "
- "Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+ "Invalid handle (%s:%u:%u).\n",
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
- if (!get_printer_snum(p, handle, &snum, NULL))
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
if (Printer->access_granted != PRINTER_ACCESS_ADMINISTER) {
@@ -8939,8 +8933,7 @@ WERROR _spoolss_EnumPrinterKey(pipes_struct *p,
WERROR _spoolss_DeletePrinterKey(pipes_struct *p,
struct spoolss_DeletePrinterKey *r)
{
- POLICY_HND *handle = r->in.handle;
- Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
+ Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
NT_PRINTER_INFO_LEVEL *printer = NULL;
int snum=0;
WERROR status;
@@ -8949,7 +8942,7 @@ WERROR _spoolss_DeletePrinterKey(pipes_struct *p,
if (!Printer) {
DEBUG(2,("_spoolss_DeletePrinterKey: Invalid handle (%s:%u:%u).\n",
- OUR_HANDLE(handle)));
+ OUR_HANDLE(r->in.handle)));
return WERR_BADFID;
}
@@ -8958,7 +8951,7 @@ WERROR _spoolss_DeletePrinterKey(pipes_struct *p,
if ( !r->in.key_name )
return WERR_INVALID_PARAM;
- if (!get_printer_snum(p, handle, &snum, NULL))
+ if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
if (Printer->access_granted != PRINTER_ACCESS_ADMINISTER) {
diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c
index b90a189f7e..3ca85aa755 100644
--- a/source3/rpc_server/srv_svcctl_nt.c
+++ b/source3/rpc_server/srv_svcctl_nt.c
@@ -170,7 +170,7 @@ static SEC_DESC* construct_scm_sd( TALLOC_CTX *ctx )
Find a registry key handle and return a SERVICE_INFO
*****************************************************************/
-static SERVICE_INFO *find_service_info_by_hnd(pipes_struct *p, POLICY_HND *hnd)
+static SERVICE_INFO *find_service_info_by_hnd(pipes_struct *p, struct policy_handle *hnd)
{
SERVICE_INFO *service_info = NULL;
@@ -185,7 +185,7 @@ static SERVICE_INFO *find_service_info_by_hnd(pipes_struct *p, POLICY_HND *hnd)
/******************************************************************
*****************************************************************/
-static WERROR create_open_service_handle( pipes_struct *p, POLICY_HND *handle, uint32 type,
+static WERROR create_open_service_handle( pipes_struct *p, struct policy_handle *handle, uint32 type,
const char *service, uint32 access_granted )
{
SERVICE_INFO *info = NULL;
diff --git a/source3/rpc_server/srv_winreg_nt.c b/source3/rpc_server/srv_winreg_nt.c
index 8092601202..3de9f0e623 100644
--- a/source3/rpc_server/srv_winreg_nt.c
+++ b/source3/rpc_server/srv_winreg_nt.c
@@ -30,7 +30,7 @@
*****************************************************************/
static struct registry_key *find_regkey_by_hnd(pipes_struct *p,
- POLICY_HND *hnd)
+ struct policy_handle *hnd)
{
struct registry_key *regkey = NULL;
@@ -50,7 +50,7 @@ static struct registry_key *find_regkey_by_hnd(pipes_struct *p,
HK[LM|U]\<key>\<key>\...
*******************************************************************/
-static WERROR open_registry_key( pipes_struct *p, POLICY_HND *hnd,
+static WERROR open_registry_key( pipes_struct *p, struct policy_handle *hnd,
struct registry_key *parent,
const char *subkeyname,
uint32 access_desired )
@@ -83,7 +83,7 @@ static WERROR open_registry_key( pipes_struct *p, POLICY_HND *hnd,
Note that P should be valid & hnd should already have space
*******************************************************************/
-static bool close_registry_key(pipes_struct *p, POLICY_HND *hnd)
+static bool close_registry_key(pipes_struct *p, struct policy_handle *hnd)
{
struct registry_key *regkey = find_regkey_by_hnd(p, hnd);
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c
index 6424f1b3af..722a0a3832 100644
--- a/source3/rpcclient/cmd_lsarpc.c
+++ b/source3/rpcclient/cmd_lsarpc.c
@@ -29,7 +29,7 @@ static NTSTATUS name_to_sid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
DOM_SID *sid, const char *name)
{
- POLICY_HND pol;
+ struct policy_handle pol;
enum lsa_SidType *sid_types;
NTSTATUS result;
DOM_SID *sids;
@@ -149,7 +149,7 @@ static NTSTATUS cmd_lsa_query_info_policy(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
union lsa_PolicyInformation *info = NULL;
@@ -207,7 +207,7 @@ static NTSTATUS cmd_lsa_lookup_names(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
DOM_SID *sids;
enum lsa_SidType *types;
@@ -255,7 +255,7 @@ static NTSTATUS cmd_lsa_lookup_names_level(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
DOM_SID *sids;
enum lsa_SidType *types;
@@ -305,7 +305,7 @@ static NTSTATUS cmd_lsa_lookup_names_level(struct rpc_pipe_client *cli,
static NTSTATUS cmd_lsa_lookup_sids(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
DOM_SID *sids;
char **domains;
@@ -374,7 +374,7 @@ static NTSTATUS cmd_lsa_enum_trust_dom(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_DomainList domain_list;
@@ -439,7 +439,7 @@ static NTSTATUS cmd_lsa_enum_privilege(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_PrivArray priv_array;
@@ -496,7 +496,7 @@ static NTSTATUS cmd_lsa_get_dispname(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint16 lang_id=0;
@@ -544,7 +544,7 @@ static NTSTATUS cmd_lsa_enum_sids(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 enum_context=0;
@@ -600,8 +600,8 @@ static NTSTATUS cmd_lsa_create_account(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND dom_pol;
- POLICY_HND user_pol;
+ struct policy_handle dom_pol;
+ struct policy_handle user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 des_access = 0x000f000f;
@@ -647,8 +647,8 @@ static NTSTATUS cmd_lsa_enum_privsaccounts(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND dom_pol;
- POLICY_HND user_pol;
+ struct policy_handle dom_pol;
+ struct policy_handle user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 access_desired = 0x000f000f;
DOM_SID sid;
@@ -710,7 +710,7 @@ static NTSTATUS cmd_lsa_enum_acct_rights(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
DOM_SID sid;
struct lsa_RightSet rights;
@@ -760,7 +760,7 @@ static NTSTATUS cmd_lsa_add_acct_rights(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_RightSet rights;
DOM_SID sid;
@@ -813,7 +813,7 @@ static NTSTATUS cmd_lsa_remove_acct_rights(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_RightSet rights;
DOM_SID sid;
@@ -868,7 +868,7 @@ static NTSTATUS cmd_lsa_lookup_priv_value(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_LUID luid;
struct lsa_String name;
@@ -910,7 +910,7 @@ static NTSTATUS cmd_lsa_query_secobj(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
SEC_DESC_BUF *sdb;
uint32 sec_info = DACL_SECURITY_INFORMATION;
@@ -996,7 +996,7 @@ static NTSTATUS cmd_lsa_query_trustdominfobysid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
DOM_SID dom_sid;
uint32 access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
@@ -1045,7 +1045,7 @@ static NTSTATUS cmd_lsa_query_trustdominfobyname(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
union lsa_TrustedDomainInfo *info = NULL;
@@ -1093,7 +1093,7 @@ static NTSTATUS cmd_lsa_query_trustdominfo(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol, trustdom_pol;
+ struct policy_handle pol, trustdom_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
union lsa_TrustedDomainInfo *info = NULL;
@@ -1152,7 +1152,7 @@ static NTSTATUS cmd_lsa_get_username(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
const char *servername = cli->desthost;
struct lsa_String *account_name = NULL;
@@ -1194,7 +1194,7 @@ static NTSTATUS cmd_lsa_add_priv(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND dom_pol, user_pol;
+ struct policy_handle dom_pol, user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_PrivilegeSet privs;
struct lsa_LUIDAttribute *set = NULL;
@@ -1278,7 +1278,7 @@ static NTSTATUS cmd_lsa_del_priv(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND dom_pol, user_pol;
+ struct policy_handle dom_pol, user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_PrivilegeSet privs;
struct lsa_LUIDAttribute *set = NULL;
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 936c2081f3..428984db13 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -299,7 +299,7 @@ static NTSTATUS cmd_samr_query_user(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol, user_pol;
+ struct policy_handle connect_pol, domain_pol, user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 info_level = 21;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -487,7 +487,7 @@ static NTSTATUS cmd_samr_query_group(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol, group_pol;
+ struct policy_handle connect_pol, domain_pol, group_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
enum samr_GroupInfoEnum info_level = GROUPINFOALL;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -555,7 +555,7 @@ static NTSTATUS cmd_samr_query_usergroups(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol,
+ struct policy_handle connect_pol,
domain_pol,
user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -624,7 +624,7 @@ static NTSTATUS cmd_samr_query_useraliases(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
DOM_SID *sids;
size_t num_sids;
@@ -709,7 +709,7 @@ static NTSTATUS cmd_samr_query_groupmem(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol, group_pol;
+ struct policy_handle connect_pol, domain_pol, group_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 group_rid;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -783,7 +783,7 @@ static NTSTATUS cmd_samr_enum_dom_users(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 start_idx, size, num_dom_users, i;
struct samr_SamArray *dom_users = NULL;
@@ -862,7 +862,7 @@ static NTSTATUS cmd_samr_enum_dom_groups(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 start_idx, size, num_dom_groups, i;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -935,7 +935,7 @@ static NTSTATUS cmd_samr_enum_als_groups(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 start_idx, size, num_als_groups, i;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -1008,7 +1008,7 @@ static NTSTATUS cmd_samr_enum_domains(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol;
+ struct policy_handle connect_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 start_idx, size, num_entries, i;
uint32 access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -1071,7 +1071,7 @@ static NTSTATUS cmd_samr_query_aliasmem(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol, alias_pol;
+ struct policy_handle connect_pol, domain_pol, alias_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 alias_rid, i;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -1144,7 +1144,7 @@ static NTSTATUS cmd_samr_query_aliasinfo(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol, alias_pol;
+ struct policy_handle connect_pol, domain_pol, alias_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32_t alias_rid;
uint32_t access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -1239,7 +1239,7 @@ static NTSTATUS cmd_samr_delete_alias(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol, alias_pol;
+ struct policy_handle connect_pol, domain_pol, alias_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 alias_rid;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -1320,7 +1320,7 @@ static NTSTATUS cmd_samr_query_dispinfo_internal(struct rpc_pipe_client *cli,
int argc, const char **argv,
uint32_t opcode)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 start_idx=0, max_entries=250, max_size = 0xffff, num_entries = 0, i;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -1512,7 +1512,7 @@ static NTSTATUS cmd_samr_query_dominfo(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 switch_level = 2;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -1615,7 +1615,7 @@ static NTSTATUS cmd_samr_create_dom_user(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol, user_pol;
+ struct policy_handle connect_pol, domain_pol, user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_String acct_name;
uint32 acb_info;
@@ -1693,7 +1693,7 @@ static NTSTATUS cmd_samr_create_dom_group(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol, group_pol;
+ struct policy_handle connect_pol, domain_pol, group_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_String grp_name;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -1759,7 +1759,7 @@ static NTSTATUS cmd_samr_create_dom_alias(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol, alias_pol;
+ struct policy_handle connect_pol, domain_pol, alias_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_String alias_name;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -1827,7 +1827,7 @@ static NTSTATUS cmd_samr_lookup_names(struct rpc_pipe_client *cli,
int argc, const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
uint32 num_names;
struct samr_Ids rids, name_types;
int i;
@@ -1902,7 +1902,7 @@ static NTSTATUS cmd_samr_lookup_rids(struct rpc_pipe_client *cli,
int argc, const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
uint32_t num_rids, *rids;
struct lsa_Strings names;
struct samr_Ids types;
@@ -1977,7 +1977,7 @@ static NTSTATUS cmd_samr_delete_dom_group(struct rpc_pipe_client *cli,
int argc, const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- POLICY_HND connect_pol, domain_pol, group_pol;
+ struct policy_handle connect_pol, domain_pol, group_pol;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
if ((argc < 2) || (argc > 3)) {
@@ -2058,7 +2058,7 @@ static NTSTATUS cmd_samr_delete_dom_user(struct rpc_pipe_client *cli,
int argc, const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- POLICY_HND connect_pol, domain_pol, user_pol;
+ struct policy_handle connect_pol, domain_pol, user_pol;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
if ((argc < 2) || (argc > 3)) {
@@ -2140,7 +2140,7 @@ static NTSTATUS cmd_samr_query_sec_obj(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol, user_pol, *pol;
+ struct policy_handle connect_pol, domain_pol, user_pol, *pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 sec_info = DACL_SECURITY_INFORMATION;
uint32 user_rid = 0;
@@ -2230,7 +2230,7 @@ static NTSTATUS cmd_samr_get_usrdom_pwinfo(struct rpc_pipe_client *cli,
int argc, const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- POLICY_HND connect_pol, domain_pol, user_pol;
+ struct policy_handle connect_pol, domain_pol, user_pol;
struct samr_PwInfo info;
uint32_t rid;
@@ -2316,7 +2316,7 @@ static NTSTATUS cmd_samr_lookup_domain(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
fstring sid_string;
@@ -2369,7 +2369,7 @@ static NTSTATUS cmd_samr_chgpasswd(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol, user_pol;
+ struct policy_handle connect_pol, domain_pol, user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
const char *user, *oldpass, *newpass;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -2461,7 +2461,7 @@ static NTSTATUS cmd_samr_chgpasswd2(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
const char *user, *oldpass, *newpass;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -2518,7 +2518,7 @@ static NTSTATUS cmd_samr_chgpasswd3(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
const char *user, *oldpass, *newpass;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -2604,7 +2604,7 @@ static NTSTATUS cmd_samr_setuserinfo_int(struct rpc_pipe_client *cli,
int argc, const char **argv,
int opcode)
{
- POLICY_HND connect_pol, domain_pol, user_pol;
+ struct policy_handle connect_pol, domain_pol, user_pol;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
const char *user, *param;
uint32_t access_mask = MAXIMUM_ALLOWED_ACCESS;
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index dd2a360298..cd04462426 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -105,7 +105,7 @@ static WERROR cmd_spoolss_open_printer_ex(struct rpc_pipe_client *cli,
int argc, const char **argv)
{
WERROR werror;
- POLICY_HND hnd;
+ struct policy_handle hnd;
if (argc != 2) {
printf("Usage: %s <printername>\n", argv[0]);
@@ -414,7 +414,7 @@ static WERROR cmd_spoolss_setprinter(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
WERROR result;
NTSTATUS status;
uint32 info_level = 2;
@@ -490,7 +490,7 @@ static WERROR cmd_spoolss_setprintername(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
WERROR result;
NTSTATUS status;
uint32 info_level = 2;
@@ -566,7 +566,7 @@ static WERROR cmd_spoolss_getprinter(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
WERROR result;
uint32_t level = 1;
const char *printername;
@@ -751,7 +751,7 @@ static WERROR cmd_spoolss_getprinterdata(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
WERROR result;
fstring printername;
const char *valuename;
@@ -811,7 +811,7 @@ static WERROR cmd_spoolss_getprinterdataex(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
WERROR result;
NTSTATUS status;
fstring printername;
@@ -971,7 +971,7 @@ static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
WERROR werror;
uint32_t level = 3;
const char *printername;
@@ -1464,7 +1464,7 @@ static WERROR cmd_spoolss_setdriver(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
WERROR result;
NTSTATUS status;
uint32 level = 2;
@@ -1713,7 +1713,7 @@ static WERROR cmd_spoolss_getprintprocdir(struct rpc_pipe_client *cli,
static WERROR cmd_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND handle;
+ struct policy_handle handle;
WERROR werror;
NTSTATUS status;
const char *printername;
@@ -1803,7 +1803,7 @@ static WERROR cmd_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
static WERROR cmd_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND handle;
+ struct policy_handle handle;
WERROR werror;
NTSTATUS status;
const char *printername;
@@ -1917,7 +1917,7 @@ static void display_form_info2(struct spoolss_FormInfo2 *r)
static WERROR cmd_spoolss_getform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
- POLICY_HND handle;
+ struct policy_handle handle;
WERROR werror;
NTSTATUS status;
const char *printername;
@@ -2001,7 +2001,7 @@ static WERROR cmd_spoolss_deleteform(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND handle;
+ struct policy_handle handle;
WERROR werror;
NTSTATUS status;
const char *printername;
@@ -2048,7 +2048,7 @@ static WERROR cmd_spoolss_enum_forms(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- POLICY_HND handle;
+ struct policy_handle handle;
WERROR werror;
const char *printername;
uint32 num_forms, level = 1, i;
@@ -2118,7 +2118,7 @@ static WERROR cmd_spoolss_setprinterdata(struct rpc_pipe_client *cli,
WERROR result;
NTSTATUS status;
const char *printername;
- POLICY_HND pol;
+ struct policy_handle pol;
union spoolss_PrinterInfo info;
enum winreg_Type type;
union spoolss_PrinterData data;
@@ -2309,7 +2309,7 @@ static WERROR cmd_spoolss_enum_jobs(struct rpc_pipe_client *cli,
WERROR result;
uint32_t level = 1, count, i;
const char *printername;
- POLICY_HND hnd;
+ struct policy_handle hnd;
union spoolss_JobInfo *info;
if (argc < 2 || argc > 3) {
@@ -2456,7 +2456,7 @@ static WERROR cmd_spoolss_enum_data(struct rpc_pipe_client *cli,
NTSTATUS status;
uint32_t i = 0;
const char *printername;
- POLICY_HND hnd;
+ struct policy_handle hnd;
uint32_t value_offered = 0;
const char *value_name = NULL;
uint32_t value_needed;
@@ -2546,7 +2546,7 @@ static WERROR cmd_spoolss_enum_data_ex( struct rpc_pipe_client *cli,
WERROR result;
uint32 i;
const char *printername;
- POLICY_HND hnd;
+ struct policy_handle hnd;
uint32_t count;
struct spoolss_PrinterEnumValues *info;
@@ -2603,7 +2603,7 @@ static WERROR cmd_spoolss_enum_printerkey(struct rpc_pipe_client *cli,
WERROR result;
const char *printername;
const char *keyname = NULL;
- POLICY_HND hnd;
+ struct policy_handle hnd;
const char **key_buffer = NULL;
int i;
@@ -2664,7 +2664,7 @@ static WERROR cmd_spoolss_rffpcnex(struct rpc_pipe_client *cli,
{
const char *printername;
const char *clientname;
- POLICY_HND hnd;
+ struct policy_handle hnd;
WERROR result;
NTSTATUS status;
struct spoolss_NotifyOption option;
@@ -2748,8 +2748,8 @@ done:
/****************************************************************************
****************************************************************************/
-static bool compare_printer( struct rpc_pipe_client *cli1, POLICY_HND *hnd1,
- struct rpc_pipe_client *cli2, POLICY_HND *hnd2 )
+static bool compare_printer( struct rpc_pipe_client *cli1, struct policy_handle *hnd1,
+ struct rpc_pipe_client *cli2, struct policy_handle *hnd2 )
{
union spoolss_PrinterInfo info1, info2;
WERROR werror;
@@ -2789,8 +2789,8 @@ static bool compare_printer( struct rpc_pipe_client *cli1, POLICY_HND *hnd1,
/****************************************************************************
****************************************************************************/
-static bool compare_printer_secdesc( struct rpc_pipe_client *cli1, POLICY_HND *hnd1,
- struct rpc_pipe_client *cli2, POLICY_HND *hnd2 )
+static bool compare_printer_secdesc( struct rpc_pipe_client *cli1, struct policy_handle *hnd1,
+ struct rpc_pipe_client *cli2, struct policy_handle *hnd2 )
{
union spoolss_PrinterInfo info1, info2;
WERROR werror;
@@ -2864,7 +2864,7 @@ static WERROR cmd_spoolss_printercmp(struct rpc_pipe_client *cli,
char *printername_path = NULL;
struct cli_state *cli_server2 = NULL;
struct rpc_pipe_client *cli2 = NULL;
- POLICY_HND hPrinter1, hPrinter2;
+ struct policy_handle hPrinter1, hPrinter2;
NTSTATUS nt_status;
WERROR werror;
diff --git a/source3/rpcclient/cmd_test.c b/source3/rpcclient/cmd_test.c
index 0f1d4221ca..b7be038539 100644
--- a/source3/rpcclient/cmd_test.c
+++ b/source3/rpcclient/cmd_test.c
@@ -26,7 +26,7 @@ static NTSTATUS cmd_testme(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
{
struct rpc_pipe_client *lsa_pipe = NULL, *samr_pipe = NULL;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
- POLICY_HND pol;
+ struct policy_handle pol;
d_printf("testme\n");
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index ea572eefd0..a202dcc5f3 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -133,7 +133,7 @@ static char *next_command (char **cmdstr)
static void fetch_machine_sid(struct cli_state *cli)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_OK;
static bool got_domain_sid;
TALLOC_CTX *mem_ctx;
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 42756f660e..d83fb44aba 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -55,7 +55,7 @@ NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
const char **domain_name)
{
struct rpc_pipe_client *lsa_pipe;
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_OK;
union lsa_PolicyInformation *info = NULL;
@@ -470,7 +470,7 @@ NTSTATUS rpc_info_internals(struct net_context *c,
int argc,
const char **argv)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
union samr_DomainInfo *info = NULL;
fstring sid_str;
@@ -989,10 +989,10 @@ static NTSTATUS rpc_sh_handle_user(struct net_context *c,
TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
- POLICY_HND *user_hnd,
+ struct policy_handle *user_hnd,
int argc, const char **argv))
{
- POLICY_HND connect_pol, domain_pol, user_pol;
+ struct policy_handle connect_pol, domain_pol, user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
DOM_SID sid;
uint32 rid;
@@ -1073,7 +1073,7 @@ static NTSTATUS rpc_sh_user_show_internals(struct net_context *c,
TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
- POLICY_HND *user_hnd,
+ struct policy_handle *user_hnd,
int argc, const char **argv)
{
NTSTATUS result;
@@ -1124,7 +1124,7 @@ static NTSTATUS rpc_sh_user_str_edit_internals(struct net_context *c,
TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
- POLICY_HND *user_hnd,
+ struct policy_handle *user_hnd,
int argc, const char **argv)
{
NTSTATUS result;
@@ -1209,7 +1209,7 @@ static NTSTATUS rpc_sh_user_flag_edit_internals(struct net_context *c,
TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
- POLICY_HND *user_hnd,
+ struct policy_handle *user_hnd,
int argc, const char **argv)
{
NTSTATUS result;
@@ -1386,7 +1386,7 @@ static NTSTATUS rpc_group_delete_internals(struct net_context *c,
int argc,
const char **argv)
{
- POLICY_HND connect_pol, domain_pol, group_pol, user_pol;
+ struct policy_handle connect_pol, domain_pol, group_pol, user_pol;
bool group_is_primary = false;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32_t group_rid;
@@ -1658,7 +1658,7 @@ static NTSTATUS get_sid_from_name(struct cli_state *cli,
DOM_SID *sids = NULL;
enum lsa_SidType *types = NULL;
struct rpc_pipe_client *pipe_hnd;
- POLICY_HND lsa_pol;
+ struct policy_handle lsa_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
result = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
@@ -1710,10 +1710,10 @@ static NTSTATUS rpc_add_groupmem(struct rpc_pipe_client *pipe_hnd,
const DOM_SID *group_sid,
const char *member)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result;
uint32 group_rid;
- POLICY_HND group_pol;
+ struct policy_handle group_pol;
struct samr_Ids rids, rid_types;
struct lsa_String lsa_acct_name;
@@ -1784,10 +1784,10 @@ static NTSTATUS rpc_add_aliasmem(struct rpc_pipe_client *pipe_hnd,
const DOM_SID *alias_sid,
const char *member)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result;
uint32 alias_rid;
- POLICY_HND alias_pol;
+ struct policy_handle alias_pol;
DOM_SID member_sid;
enum lsa_SidType member_type;
@@ -1918,10 +1918,10 @@ static NTSTATUS rpc_del_groupmem(struct net_context *c,
const DOM_SID *group_sid,
const char *member)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result;
uint32 group_rid;
- POLICY_HND group_pol;
+ struct policy_handle group_pol;
struct samr_Ids rids, rid_types;
struct lsa_String lsa_acct_name;
@@ -1986,10 +1986,10 @@ static NTSTATUS rpc_del_aliasmem(struct rpc_pipe_client *pipe_hnd,
const DOM_SID *alias_sid,
const char *member)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result;
uint32 alias_rid;
- POLICY_HND alias_pol;
+ struct policy_handle alias_pol;
DOM_SID member_sid;
enum lsa_SidType member_type;
@@ -2136,7 +2136,7 @@ static NTSTATUS rpc_group_list_internals(struct net_context *c,
int argc,
const char **argv)
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 start_idx=0, max_entries=250, num_entries, i, loop_count = 0;
struct samr_SamArray *groups = NULL;
@@ -2259,7 +2259,7 @@ static NTSTATUS rpc_group_list_internals(struct net_context *c,
if (c->opt_long_list_entries) {
- POLICY_HND alias_pol;
+ struct policy_handle alias_pol;
union samr_AliasInfo *info = NULL;
if ((NT_STATUS_IS_OK(rpccli_samr_OpenAlias(pipe_hnd, mem_ctx,
@@ -2318,7 +2318,7 @@ static NTSTATUS rpc_group_list_internals(struct net_context *c,
if (c->opt_long_list_entries) {
- POLICY_HND alias_pol;
+ struct policy_handle alias_pol;
union samr_AliasInfo *info = NULL;
if ((NT_STATUS_IS_OK(rpccli_samr_OpenAlias(pipe_hnd, mem_ctx,
@@ -2362,11 +2362,11 @@ static NTSTATUS rpc_list_group_members(struct net_context *c,
TALLOC_CTX *mem_ctx,
const char *domain_name,
const DOM_SID *domain_sid,
- POLICY_HND *domain_pol,
+ struct policy_handle *domain_pol,
uint32 rid)
{
NTSTATUS result;
- POLICY_HND group_pol;
+ struct policy_handle group_pol;
uint32 num_members, *group_rids;
int i;
struct samr_RidTypeArray *rids = NULL;
@@ -2437,12 +2437,12 @@ static NTSTATUS rpc_list_group_members(struct net_context *c,
static NTSTATUS rpc_list_alias_members(struct net_context *c,
struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *domain_pol,
+ struct policy_handle *domain_pol,
uint32 rid)
{
NTSTATUS result;
struct rpc_pipe_client *lsa_pipe;
- POLICY_HND alias_pol, lsa_pol;
+ struct policy_handle alias_pol, lsa_pol;
uint32 num_members;
DOM_SID *alias_sids;
char **domains;
@@ -2545,7 +2545,7 @@ static NTSTATUS rpc_group_members_internals(struct net_context *c,
const char **argv)
{
NTSTATUS result;
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
struct samr_Ids rids, rid_types;
struct lsa_String lsa_acct_name;
@@ -3752,13 +3752,13 @@ static void push_alias(TALLOC_CTX *mem_ctx, struct full_alias *alias)
static NTSTATUS rpc_fetch_domain_aliases(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *connect_pol,
+ struct policy_handle *connect_pol,
const DOM_SID *domain_sid)
{
uint32 start_idx, max_entries, num_entries, i;
struct samr_SamArray *groups = NULL;
NTSTATUS result;
- POLICY_HND domain_pol;
+ struct policy_handle domain_pol;
/* Get domain policy handle */
@@ -3782,7 +3782,7 @@ static NTSTATUS rpc_fetch_domain_aliases(struct rpc_pipe_client *pipe_hnd,
&num_entries);
for (i = 0; i < num_entries; i++) {
- POLICY_HND alias_pol;
+ struct policy_handle alias_pol;
struct full_alias alias;
struct lsa_SidArray sid_array;
int j;
@@ -3847,7 +3847,7 @@ static NTSTATUS rpc_aliaslist_dump(struct net_context *c,
{
int i;
NTSTATUS result;
- POLICY_HND lsa_pol;
+ struct policy_handle lsa_pol;
result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED,
@@ -3912,7 +3912,7 @@ static NTSTATUS rpc_aliaslist_internals(struct net_context *c,
const char **argv)
{
NTSTATUS result;
- POLICY_HND connect_pol;
+ struct policy_handle connect_pol;
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
pipe_hnd->desthost,
@@ -5149,7 +5149,7 @@ static NTSTATUS rpc_trustdom_add_internals(struct net_context *c,
int argc,
const char **argv)
{
- POLICY_HND connect_pol, domain_pol, user_pol;
+ struct policy_handle connect_pol, domain_pol, user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
char *acct_name;
struct lsa_String lsa_acct_name;
@@ -5306,7 +5306,7 @@ static NTSTATUS rpc_trustdom_del_internals(struct net_context *c,
int argc,
const char **argv)
{
- POLICY_HND connect_pol, domain_pol, user_pol;
+ struct policy_handle connect_pol, domain_pol, user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
char *acct_name;
DOM_SID trust_acct_sid;
@@ -5495,7 +5495,7 @@ static int rpc_trustdom_establish(struct net_context *c, int argc,
struct cli_state *cli = NULL;
struct sockaddr_storage server_ss;
struct rpc_pipe_client *pipe_hnd = NULL;
- POLICY_HND connect_hnd;
+ struct policy_handle connect_hnd;
TALLOC_CTX *mem_ctx;
NTSTATUS nt_status;
DOM_SID *domain_sid;
@@ -5731,7 +5731,7 @@ static void print_trusted_domain(DOM_SID *dom_sid, const char *trusted_dom_name)
static NTSTATUS vampire_trusted_domain(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *pol,
+ struct policy_handle *pol,
DOM_SID dom_sid,
const char *trusted_dom_name)
{
@@ -5797,7 +5797,7 @@ static int rpc_trustdom_vampire(struct net_context *c, int argc,
NTSTATUS nt_status;
const char *domain_name = NULL;
DOM_SID *queried_dom_sid;
- POLICY_HND connect_hnd;
+ struct policy_handle connect_hnd;
union lsa_PolicyInformation *info = NULL;
/* trusted domains listing variables */
@@ -5950,7 +5950,7 @@ static int rpc_trustdom_list(struct net_context *c, int argc, const char **argv)
DOM_SID *queried_dom_sid;
fstring padding;
int ascii_dom_name_len;
- POLICY_HND connect_hnd;
+ struct policy_handle connect_hnd;
union lsa_PolicyInformation *info = NULL;
/* trusted domains listing variables */
@@ -5960,7 +5960,7 @@ static int rpc_trustdom_list(struct net_context *c, int argc, const char **argv)
fstring pdc_name;
/* trusting domains listing variables */
- POLICY_HND domain_hnd;
+ struct policy_handle domain_hnd;
struct samr_SamArray *trusts = NULL;
if (c->display_usage) {
diff --git a/source3/utils/net_rpc_audit.c b/source3/utils/net_rpc_audit.c
index dc4c796c17..aa7fc7c394 100644
--- a/source3/utils/net_rpc_audit.c
+++ b/source3/utils/net_rpc_audit.c
@@ -70,7 +70,7 @@ static NTSTATUS rpc_audit_get_internal(struct net_context *c,
int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
union lsa_PolicyInformation *info = NULL;
int i;
@@ -138,7 +138,7 @@ static NTSTATUS rpc_audit_set_internal(struct net_context *c,
int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
union lsa_PolicyInformation *info = NULL;
uint32_t audit_policy, audit_category;
@@ -224,7 +224,7 @@ static NTSTATUS rpc_audit_enable_internal_ext(struct rpc_pipe_client *pipe_hnd,
const char **argv,
bool enable)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
union lsa_PolicyInformation *info = NULL;
@@ -308,7 +308,7 @@ static NTSTATUS rpc_audit_list_internal(struct net_context *c,
int argc,
const char **argv)
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
union lsa_PolicyInformation *info = NULL;
int i;
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index 1c45d0c515..7f3515ce75 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -141,7 +141,7 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv)
/* rpc variables */
- POLICY_HND lsa_pol, sam_pol, domain_pol, user_pol;
+ struct policy_handle lsa_pol, sam_pol, domain_pol, user_pol;
DOM_SID *domain_sid;
uint32 user_rid;
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index 8684e4ce74..b25c897770 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -683,7 +683,7 @@ static bool net_spoolss_open_printer_ex(struct rpc_pipe_client *pipe_hnd,
const char *printername,
uint32 access_required,
const char *username,
- POLICY_HND *hnd)
+ struct policy_handle *hnd)
{
WERROR result;
fstring printername2;
@@ -722,7 +722,7 @@ static bool net_spoolss_open_printer_ex(struct rpc_pipe_client *pipe_hnd,
static bool net_spoolss_getprinter(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd,
+ struct policy_handle *hnd,
uint32 level,
union spoolss_PrinterInfo *info)
{
@@ -744,7 +744,7 @@ static bool net_spoolss_getprinter(struct rpc_pipe_client *pipe_hnd,
static bool net_spoolss_setprinter(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd,
+ struct policy_handle *hnd,
uint32 level,
union spoolss_PrinterInfo *info)
{
@@ -844,7 +844,7 @@ static bool net_spoolss_setprinterdata(struct rpc_pipe_client *pipe_hnd,
static bool net_spoolss_enumprinterkey(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd,
+ struct policy_handle *hnd,
const char *keyname,
const char ***keylist)
{
@@ -864,7 +864,7 @@ static bool net_spoolss_enumprinterkey(struct rpc_pipe_client *pipe_hnd,
static bool net_spoolss_enumprinterdataex(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
uint32 offered,
- POLICY_HND *hnd,
+ struct policy_handle *hnd,
const char *keyname,
uint32_t *count,
struct spoolss_PrinterEnumValues **info)
@@ -890,7 +890,7 @@ static bool net_spoolss_enumprinterdataex(struct rpc_pipe_client *pipe_hnd,
static bool net_spoolss_setprinterdataex(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd,
+ struct policy_handle *hnd,
const char *keyname,
REGISTRY_VALUE *value)
{
@@ -917,7 +917,7 @@ static bool net_spoolss_setprinterdataex(struct rpc_pipe_client *pipe_hnd,
static bool net_spoolss_enumforms(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd,
+ struct policy_handle *hnd,
int level,
uint32_t *num_forms,
union spoolss_FormInfo **forms)
@@ -965,7 +965,7 @@ static bool net_spoolss_enumprinterdrivers (struct rpc_pipe_client *pipe_hnd,
static bool net_spoolss_getprinterdriver(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd, uint32 level,
+ struct policy_handle *hnd, uint32 level,
const char *env, int version,
union spoolss_DriverInfo *info)
{
@@ -1051,7 +1051,7 @@ static bool get_printer_info(struct rpc_pipe_client *pipe_hnd,
uint32 *num_printers,
union spoolss_PrinterInfo **info_p)
{
- POLICY_HND hnd;
+ struct policy_handle hnd;
/* no arguments given, enumerate all printers */
if (argc == 0) {
@@ -1236,7 +1236,7 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_
struct spoolss_SetPrinterInfoCtr info_ctr;
struct spoolss_DevmodeContainer devmode_ctr;
struct sec_desc_buf secdesc_ctr;
- POLICY_HND hnd;
+ struct policy_handle hnd;
WERROR result;
const char *action_str;
@@ -1378,7 +1378,7 @@ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c,
const char *printername, *sharename;
union spoolss_PrinterInfo *info_enum;
union spoolss_PrinterInfo info;
- POLICY_HND hnd;
+ struct policy_handle hnd;
int state;
if (!get_printer_info(pipe_hnd, mem_ctx, 2, argc, argv, &num_printers, &info_enum))
@@ -1470,7 +1470,7 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
uint32 level = 2;
const char *printername, *sharename;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
- POLICY_HND hnd_src, hnd_dst;
+ struct policy_handle hnd_src, hnd_dst;
union spoolss_PrinterInfo *info_enum;
struct cli_state *cli_dst = NULL;
union spoolss_PrinterInfo info_src, info_dst;
@@ -1616,7 +1616,7 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
uint32 level = 1;
const char *printername, *sharename;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
- POLICY_HND hnd_src, hnd_dst;
+ struct policy_handle hnd_src, hnd_dst;
union spoolss_PrinterInfo *info_enum;
union spoolss_PrinterInfo info_dst;
uint32_t num_forms;
@@ -1778,7 +1778,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
bool got_src_driver_share = false;
bool got_dst_driver_share = false;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
- POLICY_HND hnd_src, hnd_dst;
+ struct policy_handle hnd_src, hnd_dst;
union spoolss_DriverInfo drv_info_src;
union spoolss_PrinterInfo *info_enum;
union spoolss_PrinterInfo info_dst;
@@ -1988,7 +1988,7 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
union spoolss_PrinterInfo info_dst, info_src;
union spoolss_PrinterInfo *info_enum;
struct cli_state *cli_dst = NULL;
- POLICY_HND hnd_dst, hnd_src;
+ struct policy_handle hnd_dst, hnd_src;
const char *printername, *sharename;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
struct spoolss_SetPrinterInfoCtr info_ctr;
@@ -2144,7 +2144,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
uint32 level = 2;
const char *printername, *sharename;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
- POLICY_HND hnd_src, hnd_dst;
+ struct policy_handle hnd_src, hnd_dst;
union spoolss_PrinterInfo *info_enum;
union spoolss_PrinterInfo info_dst_publish;
union spoolss_PrinterInfo info_dst;
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index 00c827928e..60274728f3 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -767,7 +767,7 @@ static NTSTATUS rpc_registry_enumerate_internal(struct net_context *c,
int argc,
const char **argv )
{
- POLICY_HND pol_hive, pol_key;
+ struct policy_handle pol_hive, pol_key;
NTSTATUS status;
uint32 num_subkeys = 0;
uint32 num_values = 0;
@@ -843,7 +843,7 @@ static NTSTATUS rpc_registry_save_internal(struct net_context *c,
const char **argv )
{
WERROR result = WERR_GENERAL_FAILURE;
- POLICY_HND pol_hive, pol_key;
+ struct policy_handle pol_hive, pol_key;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
struct winreg_String filename;
@@ -1139,7 +1139,7 @@ static NTSTATUS rpc_registry_getsd_internal(struct net_context *c,
int argc,
const char **argv)
{
- POLICY_HND pol_hive, pol_key;
+ struct policy_handle pol_hive, pol_key;
NTSTATUS status;
enum ndr_err_code ndr_err;
struct KeySecurityData *sd = NULL;
diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c
index ddcfff3685..10166b6d2b 100644
--- a/source3/utils/net_rpc_rights.c
+++ b/source3/utils/net_rpc_rights.c
@@ -28,7 +28,7 @@ static NTSTATUS sid_to_name(struct rpc_pipe_client *pipe_hnd,
DOM_SID *sid,
fstring name)
{
- POLICY_HND pol;
+ struct policy_handle pol;
enum lsa_SidType *sid_types = NULL;
NTSTATUS result;
char **domains = NULL, **names = NULL;
@@ -59,7 +59,7 @@ static NTSTATUS name_to_sid(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
DOM_SID *sid, const char *name)
{
- POLICY_HND pol;
+ struct policy_handle pol;
enum lsa_SidType *sid_types;
NTSTATUS result;
DOM_SID *sids;
@@ -90,7 +90,7 @@ static NTSTATUS name_to_sid(struct rpc_pipe_client *pipe_hnd,
static NTSTATUS enum_privileges(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *ctx,
- POLICY_HND *pol )
+ struct policy_handle *pol )
{
NTSTATUS result;
uint32 enum_context = 0;
@@ -148,7 +148,7 @@ static NTSTATUS enum_privileges(struct rpc_pipe_client *pipe_hnd,
static NTSTATUS check_privilege_for_user(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *ctx,
- POLICY_HND *pol,
+ struct policy_handle *pol,
DOM_SID *sid,
const char *right)
{
@@ -183,7 +183,7 @@ static NTSTATUS check_privilege_for_user(struct rpc_pipe_client *pipe_hnd,
static NTSTATUS enum_privileges_for_user(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *ctx,
- POLICY_HND *pol,
+ struct policy_handle *pol,
DOM_SID *sid )
{
NTSTATUS result;
@@ -214,7 +214,7 @@ static NTSTATUS enum_privileges_for_user(struct rpc_pipe_client *pipe_hnd,
static NTSTATUS enum_accounts_for_privilege(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *ctx,
- POLICY_HND *pol,
+ struct policy_handle *pol,
const char *privilege)
{
NTSTATUS result;
@@ -265,7 +265,7 @@ static NTSTATUS enum_accounts_for_privilege(struct rpc_pipe_client *pipe_hnd,
static NTSTATUS enum_privileges_for_accounts(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *ctx,
- POLICY_HND *pol)
+ struct policy_handle *pol)
{
NTSTATUS result;
uint32 enum_context=0;
@@ -317,7 +317,7 @@ static NTSTATUS rpc_rights_list_internal(struct net_context *c,
int argc,
const char **argv )
{
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result;
DOM_SID sid;
fstring privname;
@@ -436,7 +436,7 @@ static NTSTATUS rpc_rights_grant_internal(struct net_context *c,
int argc,
const char **argv )
{
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_RightSet rights;
int i;
@@ -506,7 +506,7 @@ static NTSTATUS rpc_rights_revoke_internal(struct net_context *c,
int argc,
const char **argv )
{
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct lsa_RightSet rights;
DOM_SID sid;
diff --git a/source3/utils/net_rpc_service.c b/source3/utils/net_rpc_service.c
index 236414222c..bcb1a00dab 100644
--- a/source3/utils/net_rpc_service.c
+++ b/source3/utils/net_rpc_service.c
@@ -61,11 +61,11 @@ const char *svc_status_string( uint32 state )
static WERROR query_service_state(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *hSCM,
+ struct policy_handle *hSCM,
const char *service,
uint32 *state )
{
- POLICY_HND hService;
+ struct policy_handle hService;
struct SERVICE_STATUS service_status;
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
@@ -102,7 +102,7 @@ static WERROR query_service_state(struct rpc_pipe_client *pipe_hnd,
static WERROR watch_service_state(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *hSCM,
+ struct policy_handle *hSCM,
const char *service,
uint32 watch_state,
uint32 *final_state )
@@ -137,12 +137,12 @@ static WERROR watch_service_state(struct rpc_pipe_client *pipe_hnd,
static WERROR control_service(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
- POLICY_HND *hSCM,
+ struct policy_handle *hSCM,
const char *service,
uint32 control,
uint32 watch_state )
{
- POLICY_HND hService;
+ struct policy_handle hService;
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
struct SERVICE_STATUS service_status;
@@ -199,7 +199,7 @@ static NTSTATUS rpc_service_list_internal(struct net_context *c,
int argc,
const char **argv )
{
- POLICY_HND hSCM;
+ struct policy_handle hSCM;
struct ENUM_SERVICE_STATUSW *services = NULL;
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
@@ -309,7 +309,7 @@ static NTSTATUS rpc_service_status_internal(struct net_context *c,
int argc,
const char **argv )
{
- POLICY_HND hSCM, hService;
+ struct policy_handle hSCM, hService;
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
struct SERVICE_STATUS service_status;
@@ -433,7 +433,7 @@ static NTSTATUS rpc_service_stop_internal(struct net_context *c,
int argc,
const char **argv )
{
- POLICY_HND hSCM;
+ struct policy_handle hSCM;
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
fstring servicename;
@@ -477,7 +477,7 @@ static NTSTATUS rpc_service_pause_internal(struct net_context *c,
int argc,
const char **argv )
{
- POLICY_HND hSCM;
+ struct policy_handle hSCM;
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
fstring servicename;
@@ -521,7 +521,7 @@ static NTSTATUS rpc_service_resume_internal(struct net_context *c,
int argc,
const char **argv )
{
- POLICY_HND hSCM;
+ struct policy_handle hSCM;
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
fstring servicename;
@@ -565,7 +565,7 @@ static NTSTATUS rpc_service_start_internal(struct net_context *c,
int argc,
const char **argv )
{
- POLICY_HND hSCM, hService;
+ struct policy_handle hSCM, hService;
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
uint32 state = 0;
diff --git a/source3/utils/net_rpc_sh_acct.c b/source3/utils/net_rpc_sh_acct.c
index 977e1e2a0a..af0b426bbc 100644
--- a/source3/utils/net_rpc_sh_acct.c
+++ b/source3/utils/net_rpc_sh_acct.c
@@ -38,7 +38,7 @@ static NTSTATUS rpc_sh_acct_do(struct net_context *c,
struct samr_DomInfo12 *i12,
int argc, const char **argv))
{
- POLICY_HND connect_pol, domain_pol;
+ struct policy_handle connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
union samr_DomainInfo *info1 = NULL;
union samr_DomainInfo *info3 = NULL;
diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c
index 7fbfdbab44..c6b6ee9e80 100644
--- a/source3/utils/net_util.c
+++ b/source3/utils/net_util.c
@@ -29,7 +29,7 @@ NTSTATUS net_rpc_lookup_name(struct net_context *c,
enum lsa_SidType *ret_type)
{
struct rpc_pipe_client *lsa_pipe;
- POLICY_HND pol;
+ struct policy_handle pol;
NTSTATUS result = NT_STATUS_OK;
const char **dom_names;
DOM_SID *sids;
diff --git a/source3/utils/netlookup.c b/source3/utils/netlookup.c
index 14f2dddebc..dd0efa4142 100644
--- a/source3/utils/netlookup.c
+++ b/source3/utils/netlookup.c
@@ -31,7 +31,7 @@ struct con_struct {
NTSTATUS err;
struct cli_state *cli;
struct rpc_pipe_client *lsapipe;
- POLICY_HND pol;
+ struct policy_handle pol;
};
static struct con_struct *cs;
diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c
index bc21dd8ad9..78260acf76 100644
--- a/source3/utils/smbcquotas.c
+++ b/source3/utils/smbcquotas.c
@@ -35,7 +35,7 @@ enum exit_values {EXIT_OK, EXIT_FAILED, EXIT_PARSE_ERROR};
static struct cli_state *cli_ipc;
static struct rpc_pipe_client *global_pipe_hnd;
-static POLICY_HND pol;
+static struct policy_handle pol;
static bool got_policy_hnd;
static struct user_auth_info *smbcquotas_auth_info;
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index 5ebbb72cf5..f3733dc131 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -119,10 +119,10 @@ struct winbindd_cm_conn {
struct cli_state *cli;
struct rpc_pipe_client *samr_pipe;
- POLICY_HND sam_connect_handle, sam_domain_handle;
+ struct policy_handle sam_connect_handle, sam_domain_handle;
struct rpc_pipe_client *lsa_pipe;
- POLICY_HND lsa_policy;
+ struct policy_handle lsa_policy;
struct rpc_pipe_client *netlogon_pipe;
};
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index a508682e5e..a76faa7a25 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -978,7 +978,7 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
size_t num_members = 0;
ads_control args;
struct rpc_pipe_client *cli;
- POLICY_HND lsa_policy;
+ struct policy_handle lsa_policy;
DOM_SID *sid_mem_nocache = NULL;
char **names_nocache = NULL;
enum lsa_SidType *name_types_nocache = NULL;
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index d595f80b49..ed0a33a5f2 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1773,7 +1773,7 @@ static void set_dc_type_and_flags_connect( struct winbindd_domain *domain )
WERROR werr;
TALLOC_CTX *mem_ctx = NULL;
struct rpc_pipe_client *cli = NULL;
- POLICY_HND pol;
+ struct policy_handle pol;
union dssetup_DsRoleInfo info;
union lsa_PolicyInformation *lsa_info = NULL;
@@ -1990,7 +1990,7 @@ static bool cm_get_schannel_dcinfo(struct winbindd_domain *domain,
}
NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
- struct rpc_pipe_client **cli, POLICY_HND *sam_handle)
+ struct rpc_pipe_client **cli, struct policy_handle *sam_handle)
{
struct winbindd_cm_conn *conn;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -2156,7 +2156,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
}
NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
- struct rpc_pipe_client **cli, POLICY_HND *lsa_policy)
+ struct rpc_pipe_client **cli, struct policy_handle *lsa_policy)
{
struct winbindd_cm_conn *conn;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 597d48aad0..15d1b7e2bf 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -1396,7 +1396,7 @@ NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain,
NT_STATUS_IS_OK(result) && (my_info3->base.acct_flags == 0)) {
struct rpc_pipe_client *samr_pipe;
- POLICY_HND samr_domain_handle, user_pol;
+ struct policy_handle samr_domain_handle, user_pol;
union samr_UserInfo *info = NULL;
NTSTATUS status_tmp;
uint32 acct_flags;
@@ -2066,7 +2066,7 @@ enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact
{
char *oldpass;
char *newpass = NULL;
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
struct rpc_pipe_client *cli;
bool got_info = false;
struct samr_DomInfo1 *info = NULL;
@@ -2394,7 +2394,7 @@ enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domai
DATA_BLOB new_lm_password;
DATA_BLOB old_lm_hash_enc;
fstring domain,user;
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
struct winbindd_domain *contact_domain = domainSt;
struct rpc_pipe_client *cli;
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index 9a3651220e..384395f896 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -208,9 +208,9 @@ void invalidate_cm_connection(struct winbindd_cm_conn *conn);
void close_conns_after_fork(void);
NTSTATUS init_dc_connection(struct winbindd_domain *domain);
NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
- struct rpc_pipe_client **cli, POLICY_HND *sam_handle);
+ struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
- struct rpc_pipe_client **cli, POLICY_HND *lsa_policy);
+ struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
struct rpc_pipe_client **cli);
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index 2c0222e7c5..5edb0d98b0 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -38,7 +38,7 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain,
WINBIND_USERINFO **info)
{
NTSTATUS result;
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
unsigned int i, start_idx;
uint32 loop_count;
struct rpc_pipe_client *cli;
@@ -130,7 +130,7 @@ static NTSTATUS enum_dom_groups(struct winbindd_domain *domain,
uint32 *num_entries,
struct acct_info **info)
{
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
NTSTATUS status;
uint32 start = 0;
struct rpc_pipe_client *cli;
@@ -201,7 +201,7 @@ static NTSTATUS enum_local_groups(struct winbindd_domain *domain,
uint32 *num_entries,
struct acct_info **info)
{
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
NTSTATUS result;
struct rpc_pipe_client *cli;
@@ -278,7 +278,7 @@ static NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain,
enum lsa_SidType *types = NULL;
char *full_name = NULL;
struct rpc_pipe_client *cli;
- POLICY_HND lsa_policy;
+ struct policy_handle lsa_policy;
NTSTATUS name_map_status = NT_STATUS_UNSUCCESSFUL;
char *mapped_name = NULL;
@@ -343,7 +343,7 @@ static NTSTATUS msrpc_sid_to_name(struct winbindd_domain *domain,
enum lsa_SidType *types = NULL;
NTSTATUS result;
struct rpc_pipe_client *cli;
- POLICY_HND lsa_policy;
+ struct policy_handle lsa_policy;
NTSTATUS name_map_status = NT_STATUS_UNSUCCESSFUL;
char *mapped_name = NULL;
@@ -396,7 +396,7 @@ static NTSTATUS msrpc_rids_to_names(struct winbindd_domain *domain,
char **domains;
NTSTATUS result;
struct rpc_pipe_client *cli;
- POLICY_HND lsa_policy;
+ struct policy_handle lsa_policy;
DOM_SID *sids;
size_t i;
char **ret_names;
@@ -461,7 +461,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
WINBIND_USERINFO *user_info)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- POLICY_HND dom_pol, user_pol;
+ struct policy_handle dom_pol, user_pol;
union samr_UserInfo *info = NULL;
uint32 user_rid;
struct netr_SamInfo3 *user;
@@ -564,7 +564,7 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
uint32 *num_groups, DOM_SID **user_grpsids)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- POLICY_HND dom_pol, user_pol;
+ struct policy_handle dom_pol, user_pol;
uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
struct samr_RidWithAttributeArray *rid_array = NULL;
unsigned int i;
@@ -645,7 +645,7 @@ static NTSTATUS msrpc_lookup_useraliases(struct winbindd_domain *domain,
uint32 **alias_rids)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
uint32 num_query_sids = 0;
int i;
struct rpc_pipe_client *cli;
@@ -745,7 +745,7 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 i, total_names = 0;
- POLICY_HND dom_pol, group_pol;
+ struct policy_handle dom_pol, group_pol;
uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
uint32 *rid_mem = NULL;
uint32 group_rid;
@@ -953,7 +953,7 @@ static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32 *seq)
TALLOC_CTX *mem_ctx;
union samr_DomainInfo *info = NULL;
NTSTATUS result;
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
bool got_seq_num = False;
struct rpc_pipe_client *cli;
@@ -1054,7 +1054,7 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain,
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 enum_ctx = 0;
struct rpc_pipe_client *cli;
- POLICY_HND lsa_policy;
+ struct policy_handle lsa_policy;
DEBUG(3,("rpc: trusted_domains\n"));
@@ -1112,7 +1112,7 @@ static NTSTATUS msrpc_lockout_policy(struct winbindd_domain *domain,
{
NTSTATUS result;
struct rpc_pipe_client *cli;
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
union samr_DomainInfo *info = NULL;
DEBUG(10,("rpc: fetch lockout policy for %s\n", domain->name));
@@ -1153,7 +1153,7 @@ static NTSTATUS msrpc_password_policy(struct winbindd_domain *domain,
{
NTSTATUS result;
struct rpc_pipe_client *cli;
- POLICY_HND dom_pol;
+ struct policy_handle dom_pol;
union samr_DomainInfo *info = NULL;
DEBUG(10,("rpc: fetch password policy for %s\n", domain->name));