s3:net: use dcerpc_spoolss_X() functions
[samba.git] / source3 / utils / net_rpc_rights.c
index 6b7ca7ec4f83bfd4a787a9d98ca5f1e39bcb19f3..5d962dea31292b2ac851f87bb353451b4f668594 100644 (file)
 #include "utils/net.h"
 #include "../librpc/gen_ndr/cli_lsa.h"
 #include "rpc_client/cli_lsarpc.h"
+#include "rpc_client/init_lsa.h"
+#include "../libcli/security/security.h"
 
 /********************************************************************
 ********************************************************************/
 
 static NTSTATUS sid_to_name(struct rpc_pipe_client *pipe_hnd,
                                TALLOC_CTX *mem_ctx,
-                               DOM_SID *sid,
+                               struct dom_sid *sid,
                                fstring name)
 {
        struct policy_handle pol;
@@ -59,12 +61,12 @@ static NTSTATUS sid_to_name(struct rpc_pipe_client *pipe_hnd,
 
 static NTSTATUS name_to_sid(struct rpc_pipe_client *pipe_hnd,
                            TALLOC_CTX *mem_ctx,
-                           DOM_SID *sid, const char *name)
+                           struct dom_sid *sid, const char *name)
 {
        struct policy_handle pol;
        enum lsa_SidType *sid_types;
        NTSTATUS result;
-       DOM_SID *sids;
+       struct dom_sid *sids;
 
        /* maybe its a raw SID */
        if ( strncmp(name, "S-", 2) == 0 && string_to_sid(sid, name) ) {
@@ -151,7 +153,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,
                                        struct policy_handle *pol,
-                                       DOM_SID *sid,
+                                       struct dom_sid *sid,
                                        const char *right)
 {
        NTSTATUS result;
@@ -186,7 +188,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,
                                        struct policy_handle *pol,
-                                       DOM_SID *sid )
+                                       struct dom_sid *sid )
 {
        NTSTATUS result;
        struct lsa_RightSet rights;
@@ -311,7 +313,7 @@ static NTSTATUS enum_privileges_for_accounts(struct rpc_pipe_client *pipe_hnd,
 ********************************************************************/
 
 static NTSTATUS rpc_rights_list_internal(struct net_context *c,
-                                       const DOM_SID *domain_sid,
+                                       const struct dom_sid *domain_sid,
                                        const char *domain_name,
                                        struct cli_state *cli,
                                        struct rpc_pipe_client *pipe_hnd,
@@ -321,7 +323,7 @@ static NTSTATUS rpc_rights_list_internal(struct net_context *c,
 {
        struct policy_handle pol;
        NTSTATUS result;
-       DOM_SID sid;
+       struct dom_sid sid;
        fstring privname;
        struct lsa_String lsa_name;
        struct lsa_StringLarge *description = NULL;
@@ -436,7 +438,7 @@ done:
 ********************************************************************/
 
 static NTSTATUS rpc_rights_grant_internal(struct net_context *c,
-                                       const DOM_SID *domain_sid,
+                                       const struct dom_sid *domain_sid,
                                        const char *domain_name,
                                        struct cli_state *cli,
                                        struct rpc_pipe_client *pipe_hnd,
@@ -449,7 +451,7 @@ static NTSTATUS rpc_rights_grant_internal(struct net_context *c,
        struct lsa_RightSet rights;
        int i;
 
-       DOM_SID sid;
+       struct dom_sid sid;
 
        if (argc < 2 ) {
                d_printf("%s\n%s",
@@ -508,7 +510,7 @@ static NTSTATUS rpc_rights_grant_internal(struct net_context *c,
 ********************************************************************/
 
 static NTSTATUS rpc_rights_revoke_internal(struct net_context *c,
-                                       const DOM_SID *domain_sid,
+                                       const struct dom_sid *domain_sid,
                                        const char *domain_name,
                                        struct cli_state *cli,
                                        struct rpc_pipe_client *pipe_hnd,
@@ -519,7 +521,7 @@ static NTSTATUS rpc_rights_revoke_internal(struct net_context *c,
        struct policy_handle dom_pol;
        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
        struct lsa_RightSet rights;
-       DOM_SID sid;
+       struct dom_sid sid;
        int i;
 
        if (argc < 2 ) {