Add support for the new modules system to auth/ (merge from HEAD)
[jra/samba/.git] / source3 / auth / auth_winbind.c
index c6a1727ebeaf90e69c4a4be6c9ac997d56053d5b..e2a292dd01505efca9900f5bb4df28f6ae2b7d13 100644 (file)
@@ -36,8 +36,8 @@ static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct winbindd_response
                if (!prs_init(&ps, len, mem_ctx, UNMARSHALL)) {
                        return NT_STATUS_NO_MEMORY;
                }
-               prs_append_data(&ps, info3_ndr, len);
-               ps.data_offset = 0;
+               prs_copy_data_in(&ps, info3_ndr, len);
+               prs_set_offset(&ps,0);
                if (!net_io_user_info3("", info3, &ps, 1, 3)) {
                        DEBUG(2, ("get_info3_from_ndr: could not parse info3 struct!\n"));
                        return NT_STATUS_UNSUCCESSFUL;
@@ -127,11 +127,15 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
 /* module initialisation */
 NTSTATUS auth_init_winbind(struct auth_context *auth_context, const char *param, auth_methods **auth_method) 
 {
-       if (!make_auth_methods(auth_context, auth_method)) {
+       if (!make_auth_methods(auth_context, auth_method))
                return NT_STATUS_NO_MEMORY;
-       }
 
        (*auth_method)->name = "winbind";
        (*auth_method)->auth = check_winbind_security;
        return NT_STATUS_OK;
 }
+
+int auth_winbind_init(void)
+{
+       return smb_register_auth("winbind", auth_init_winbind, AUTH_INTERFACE_VERSION);
+}