Ensure that only parse_prs.c access internal members of the prs_struct.
[samba.git] / source3 / auth / auth_winbind.c
index 10788721fdebec9893161765909ffbde349748d5..5e1567d3c1975dc3adbe1cdceaa679948e5f1328 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_AUTH
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_AUTH
 
-/* Prototypes from common.h */
-
-NSS_STATUS winbindd_request(int req_type, 
-                           struct winbindd_request *request,
-                           struct winbindd_response *response);
-
-NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct winbindd_response *response, NET_USER_INFO_3 *info3)
+static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct winbindd_response *response, NET_USER_INFO_3 *info3)
 {
        uint8 *info3_ndr;
        size_t len = response->length - sizeof(response);
 {
        uint8 *info3_ndr;
        size_t len = response->length - sizeof(response);
@@ -42,8 +36,8 @@ NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct winbindd_response *respo
                if (!prs_init(&ps, len, mem_ctx, UNMARSHALL)) {
                        return NT_STATUS_NO_MEMORY;
                }
                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;
                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;
@@ -133,9 +127,8 @@ 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) 
 {
 /* 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;
                return NT_STATUS_NO_MEMORY;
-       }
 
        (*auth_method)->name = "winbind";
        (*auth_method)->auth = check_winbind_security;
 
        (*auth_method)->name = "winbind";
        (*auth_method)->auth = check_winbind_security;