s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
[kai/samba.git] / source3 / utils / net_rpc_registry.c
index 32c202357bbd9b5d88a05b10907e091c9891fb58..929273dd79e9684b1149cd9f0d027560c917a35d 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
  
 #include "includes.h"
-#include "popt_common.h"
+#include "system/filesys.h"
+#include "rpc_client/rpc_client.h"
 #include "registry.h"
 #include "utils/net.h"
 #include "utils/net_registry_util.h"
 #include "registry/regfio.h"
 #include "../librpc/gen_ndr/ndr_winreg_c.h"
-#include "registry/reg_objects.h"
 #include "../librpc/gen_ndr/ndr_security.h"
 #include "registry/reg_format.h"
 #include "registry/reg_import.h"
 #include <assert.h>
+#include "../libcli/security/display_sec.h"
+#include "../libcli/registry/util_reg.h"
+#include "client.h"
 
 
 /*******************************************************************
@@ -330,8 +333,8 @@ static NTSTATUS registry_enumvalues(TALLOC_CTX *ctx,
                return NT_STATUS_OK;
        }
 
-       if ((!(names = TALLOC_ARRAY(mem_ctx, char *, num_values))) ||
-           (!(values = TALLOC_ARRAY(mem_ctx, struct registry_value *,
+       if ((!(names = talloc_array(mem_ctx, char *, num_values))) ||
+           (!(values = talloc_array(mem_ctx, struct registry_value *,
                                     num_values)))) {
                status = NT_STATUS_NO_MEMORY;
                goto error;
@@ -453,8 +456,8 @@ static NTSTATUS registry_enumvalues2(TALLOC_CTX *ctx,
                return NT_STATUS_OK;
        }
 
-       if ((!(names = TALLOC_ARRAY(mem_ctx, char *, num_values))) ||
-           (!(values = TALLOC_ARRAY(mem_ctx, struct regval_blob *,
+       if ((!(names = talloc_array(mem_ctx, char *, num_values))) ||
+           (!(values = talloc_array(mem_ctx, struct regval_blob *,
                                     num_values)))) {
                status = NT_STATUS_NO_MEMORY;
                goto error;
@@ -1448,7 +1451,7 @@ static NTSTATUS rpc_registry_getsd_internal(struct net_context *c,
                return status;
        }
 
-       sd = TALLOC_ZERO_P(mem_ctx, struct KeySecurityData);
+       sd = talloc_zero(mem_ctx, struct KeySecurityData);
        if (!sd) {
                status = NT_STATUS_NO_MEMORY;
                goto out;
@@ -1782,7 +1785,7 @@ static WERROR import_delete_key(struct import_ctx* ctx,
        WERROR werr;
        NTSTATUS status;
        void* mem_ctx = talloc_new(ctx->mem_ctx);
-       struct winreg_String  keyname;
+       struct winreg_String  keyname = { 0, };
        struct policy_handle  hive;
        struct dcerpc_binding_handle *b = ctx->pipe_hnd->binding_handle;
 
@@ -2100,7 +2103,8 @@ int net_rpc_registry(struct net_context *c, int argc, const char **argv)
                        "export",
                        rpc_registry_export,
                        NET_TRANSPORT_RPC,
-                       N_("net registry export\n"
+                       N_("Export .reg file"),
+                       N_("net rpc registry export\n"
                           "    Export .reg file")
                },
                {NULL, NULL, 0, NULL, NULL}