libndr: Rename policy_handle_empty to ndr_policy_handle_empty.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 18 Mar 2012 16:44:24 +0000 (17:44 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 20 Mar 2012 12:54:07 +0000 (13:54 +0100)
This makes the NDR namespace a bit clearer, in preparation of ABI checking.

librpc/ndr/libndr.h
librpc/ndr/uuid.c
source3/rpc_server/epmapper/srv_epmapper.c
source4/libnet/libnet_domain.c
source4/libnet/prereq_domain.c
source4/rpc_server/handles.c
source4/torture/rpc/epmapper.c
source4/torture/rpc/samr.c

index e68f30369f3cac891bcdb22936b663b6a090c3d9..c0a82b4ad9225c7f9d96935d1ca1a01e4f68692f 100644 (file)
@@ -555,7 +555,7 @@ NDR_SCALAR_PROTO(double, double)
 enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r);
 enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r);
 void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r);
-bool policy_handle_empty(const struct policy_handle *h);
+bool ndr_policy_handle_empty(const struct policy_handle *h);
 bool is_valid_policy_hnd(const struct policy_handle *hnd);
 bool ndr_policy_handle_equal(const struct policy_handle *hnd1,
                         const struct policy_handle *hnd2);
index 9ebccfe29a273429345164918a81021851c417de..f44050587344a95fb82bd329049502098670f853 100644 (file)
@@ -331,14 +331,14 @@ _PUBLIC_ char *NS_GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid)
                               guid->node[4], guid->node[5]);
 }
 
-_PUBLIC_ bool policy_handle_empty(const struct policy_handle *h)
+_PUBLIC_ bool ndr_policy_handle_empty(const struct policy_handle *h)
 {
        return (h->handle_type == 0 && GUID_all_zero(&h->uuid));
 }
 
 _PUBLIC_ bool is_valid_policy_hnd(const struct policy_handle *hnd)
 {
-       return !policy_handle_empty(hnd);
+       return !ndr_policy_handle_empty(hnd);
 }
 
 _PUBLIC_ bool ndr_policy_handle_equal(const struct policy_handle *hnd1,
index cb99bde528bb51b70da792f2810e9e389ab3a230..4fea5887a47ce3b0b44204432fcac09cd3a1e46b 100644 (file)
@@ -537,7 +537,7 @@ error_status_t _epm_Lookup(struct pipes_struct *p,
                  r->in.max_ents));
 
        if (r->in.entry_handle == NULL ||
-           policy_handle_empty(r->in.entry_handle)) {
+           ndr_policy_handle_empty(r->in.entry_handle)) {
                struct GUID *obj;
                char *srv_addr = NULL;
 
@@ -924,7 +924,7 @@ error_status_t _epm_Map(struct pipes_struct *p,
        }
 
        if (r->in.entry_handle == NULL ||
-           policy_handle_empty(r->in.entry_handle)) {
+           ndr_policy_handle_empty(r->in.entry_handle)) {
                struct GUID *obj;
                char *srv_addr = NULL;
 
index b2a88827bd34b124bceded10ae9db99c60b6571d..d2b96958eea0fa3e9b1871ea9aa431d0f8dd6fcb 100644 (file)
@@ -308,7 +308,7 @@ struct composite_context *libnet_DomainOpenSamr_send(struct libnet_context *ctx,
 
        /* libnet context's domain handle is not empty, so check out what
           was opened first, before doing anything */
-       if (!policy_handle_empty(&ctx->samr.handle)) {
+       if (!ndr_policy_handle_empty(&ctx->samr.handle)) {
                if (strequal(ctx->samr.name, io->in.domain_name) &&
                    ctx->samr.access_mask == io->in.access_mask) {
 
index e10e550585c36e34a83a2152a53931d786bb3c8f..039d99d9ef7452e6898ac2893ee4a0454e3297e0 100644 (file)
@@ -45,7 +45,7 @@ bool samr_domain_opened(struct libnet_context *ctx, const char *domain_name,
                 * if it's not been explicitly specified.
                 */
 
-               if (policy_handle_empty(&ctx->samr.handle)) {
+               if (ndr_policy_handle_empty(&ctx->samr.handle)) {
                        domain_open->in.type        = DOMAIN_SAMR;
                        domain_open->in.domain_name = cli_credentials_get_domain(ctx->cred);
                        domain_open->in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -62,7 +62,7 @@ bool samr_domain_opened(struct libnet_context *ctx, const char *domain_name,
                 * opening a new domain otherwise.
                 */
 
-               if (policy_handle_empty(&ctx->samr.handle) ||
+               if (ndr_policy_handle_empty(&ctx->samr.handle) ||
                    !strequal(domain_name, ctx->samr.name)) {
                        domain_open->in.type        = DOMAIN_SAMR;
                        domain_open->in.domain_name = domain_name;
@@ -100,7 +100,7 @@ bool lsa_domain_opened(struct libnet_context *ctx, const char *domain_name,
                 * if it's not been explicitly specified.
                 */
 
-               if (policy_handle_empty(&ctx->lsa.handle)) {
+               if (ndr_policy_handle_empty(&ctx->lsa.handle)) {
                        domain_open->in.type        = DOMAIN_LSA;
                        domain_open->in.domain_name = cli_credentials_get_domain(ctx->cred);
                        domain_open->in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -119,7 +119,7 @@ bool lsa_domain_opened(struct libnet_context *ctx, const char *domain_name,
                 * opening a new domain otherwise.
                 */
 
-               if (policy_handle_empty(&ctx->lsa.handle) ||
+               if (ndr_policy_handle_empty(&ctx->lsa.handle) ||
                    !strequal(domain_name, ctx->lsa.name)) {
                        domain_open->in.type        = DOMAIN_LSA;
                        domain_open->in.domain_name = domain_name;
index e70510c87597cda6545984df3cc6892abfc88d5a..be9f16ce733d3804ce03856f198f3ca6a310e8d7 100644 (file)
@@ -82,7 +82,7 @@ _PUBLIC_ struct dcesrv_handle *dcesrv_handle_fetch(
 
        sid = &context->conn->auth_state.session_info->security_token->sids[PRIMARY_USER_SID_INDEX];
 
-       if (policy_handle_empty(p)) {
+       if (ndr_policy_handle_empty(p)) {
                /* TODO: we should probably return a NULL handle here */
                return dcesrv_handle_new(context, handle_type);
        }
index c0d8c44e0282f66c5099d44485eafa59ae017b19..c605a05f6a0e541efcadd296eff53ba3ca2d0000 100644 (file)
@@ -406,12 +406,12 @@ static bool test_Map_simple(struct torture_context *tctx,
        } while (NT_STATUS_IS_OK(status) &&
                 r.out.result == EPMAPPER_STATUS_OK &&
                 *r.out.num_ents == r.in.max_ents &&
-                !policy_handle_empty(&entry_handle));
+                !ndr_policy_handle_empty(&entry_handle));
 
        torture_assert_ntstatus_ok(tctx, status, "epm_Map_simple failed");
 
        torture_assert(tctx,
-                      policy_handle_empty(&entry_handle),
+                      ndr_policy_handle_empty(&entry_handle),
                       "epm_Map_simple failed - The policy handle should be emtpy.");
 
        return true;
@@ -427,7 +427,7 @@ static bool test_LookupHandleFree(struct torture_context *tctx,
                torture_skip(tctx, "Skip Insert test against Samba4");
        }
 
-       if (policy_handle_empty(entry_handle)) {
+       if (ndr_policy_handle_empty(entry_handle)) {
                torture_comment(tctx,
                                "epm_LookupHandleFree failed - empty policy_handle\n");
                return false;
@@ -504,13 +504,13 @@ static bool test_Lookup_simple(struct torture_context *tctx,
        } while (NT_STATUS_IS_OK(status) &&
                 r.out.result == EPMAPPER_STATUS_OK &&
                 *r.out.num_ents == r.in.max_ents &&
-                !policy_handle_empty(&entry_handle));
+                !ndr_policy_handle_empty(&entry_handle));
 
        torture_assert_ntstatus_ok(tctx, status, "epm_Lookup failed");
        torture_assert(tctx, r.out.result == EPMAPPER_STATUS_NO_MORE_ENTRIES, "epm_Lookup failed");
 
        torture_assert(tctx,
-                      policy_handle_empty(&entry_handle),
+                      ndr_policy_handle_empty(&entry_handle),
                       "epm_Lookup failed - The policy handle should be emtpy.");
 
        return true;
index 6b9079166035c92cb5ecd63fab4810c88a3fe30f..bf1d713eed3b08e70eb50ce7940d31433e79b011 100644 (file)
@@ -4,6 +4,7 @@
 
    Copyright (C) Andrew Tridgell 2003
    Copyright (C) Andrew Bartlett <abartlet@samba.org> 2003
+   Copyright (C) Jelmer Vernooij 2005-2007
    Copyright (C) Guenther Deschner 2008-2010
 
    This program is free software; you can redistribute it and/or modify
@@ -5536,7 +5537,7 @@ static bool test_CreateUser2(struct dcerpc_pipe *p, struct torture_context *tctx
                                ret = false;
                        }
 
-                       if (!policy_handle_empty(&user_handle)) {
+                       if (!ndr_policy_handle_empty(&user_handle)) {
                                torture_comment(tctx, "Testing DeleteUser (createuser2 test)\n");
 
                                d.in.user_handle = &user_handle;
@@ -7483,7 +7484,7 @@ static bool test_ManyObjects(struct dcerpc_pipe *p,
                default:
                        return false;
                }
-               if (!policy_handle_empty(&handles[i])) {
+               if (!ndr_policy_handle_empty(&handles[i])) {
                        num_created++;
                }
        }
@@ -7534,7 +7535,7 @@ static bool test_ManyObjects(struct dcerpc_pipe *p,
 
        for (i=0; i < num_total; i++) {
 
-               if (policy_handle_empty(&handles[i])) {
+               if (ndr_policy_handle_empty(&handles[i])) {
                        continue;
                }
 
@@ -7694,17 +7695,17 @@ static bool test_OpenDomain(struct dcerpc_pipe *p, struct torture_context *tctx,
                break;
        }
 
-       if (!policy_handle_empty(&user_handle) &&
+       if (!ndr_policy_handle_empty(&user_handle) &&
            !test_DeleteUser(b, tctx, &user_handle)) {
                ret = false;
        }
 
-       if (!policy_handle_empty(&alias_handle) &&
+       if (!ndr_policy_handle_empty(&alias_handle) &&
            !test_DeleteAlias(b, tctx, &alias_handle)) {
                ret = false;
        }
 
-       if (!policy_handle_empty(&group_handle) &&
+       if (!ndr_policy_handle_empty(&group_handle) &&
            !test_DeleteDomainGroup(b, tctx, &group_handle)) {
                ret = false;
        }