Merge branch 'master' of ssh://git.samba.org/data/git/abartlet/samba into extended...
[abartlet/samba.git/.git] / source3 / librpc / gen_ndr / srv_netlogon.c
index 9546b2551b05f6446908b2ed700f1b6d5a9516c5..8cb461e94ddd1e32148fb60fc4ebb7ad476fb2ce 100644 (file)
@@ -871,6 +871,7 @@ static bool api_netr_AccountSync(pipes_struct *p)
 
        ZERO_STRUCT(r->out);
        r->out.return_authenticator = r->in.return_authenticator;
+       r->out.recordid = r->in.recordid;
        r->out.buffer = talloc_zero(r, struct netr_AccountBuffer);
        if (r->out.buffer == NULL) {
                talloc_free(r);
@@ -895,7 +896,6 @@ static bool api_netr_AccountSync(pipes_struct *p)
                return false;
        }
 
-       r->out.recordid = r->in.recordid;
        r->out.result = _netr_AccountSync(p, r);
 
        if (p->rng_fault_state) {
@@ -1290,13 +1290,13 @@ static bool api_netr_ServerAuthenticate2(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
+       r->out.negotiate_flags = r->in.negotiate_flags;
        r->out.return_credentials = talloc_zero(r, struct netr_Credential);
        if (r->out.return_credentials == NULL) {
                talloc_free(r);
                return false;
        }
 
-       r->out.negotiate_flags = r->in.negotiate_flags;
        r->out.result = _netr_ServerAuthenticate2(p, r);
 
        if (p->rng_fault_state) {
@@ -2146,13 +2146,13 @@ static bool api_netr_ServerAuthenticate3(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
+       r->out.negotiate_flags = r->in.negotiate_flags;
        r->out.return_credentials = talloc_zero(r, struct netr_Credential);
        if (r->out.return_credentials == NULL) {
                talloc_free(r);
                return false;
        }
 
-       r->out.negotiate_flags = r->in.negotiate_flags;
        r->out.rid = talloc_zero(r, uint32_t);
        if (r->out.rid == NULL) {
                talloc_free(r);
@@ -3186,6 +3186,7 @@ static bool api_netr_LogonSamLogonEx(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
+       r->out.flags = r->in.flags;
        r->out.validation = talloc_zero(r, union netr_Validation);
        if (r->out.validation == NULL) {
                talloc_free(r);
@@ -3198,7 +3199,6 @@ static bool api_netr_LogonSamLogonEx(pipes_struct *p)
                return false;
        }
 
-       r->out.flags = r->in.flags;
        r->out.result = _netr_LogonSamLogonEx(p, r);
 
        if (p->rng_fault_state) {
@@ -3685,6 +3685,7 @@ static bool api_netr_LogonSamLogonWithFlags(pipes_struct *p)
 
        ZERO_STRUCT(r->out);
        r->out.return_authenticator = r->in.return_authenticator;
+       r->out.flags = r->in.flags;
        r->out.validation = talloc_zero(r, union netr_Validation);
        if (r->out.validation == NULL) {
                talloc_free(r);
@@ -3697,7 +3698,6 @@ static bool api_netr_LogonSamLogonWithFlags(pipes_struct *p)
                return false;
        }
 
-       r->out.flags = r->in.flags;
        r->out.result = _netr_LogonSamLogonWithFlags(p, r);
 
        if (p->rng_fault_state) {
@@ -3733,18 +3733,18 @@ static bool api_netr_LogonSamLogonWithFlags(pipes_struct *p)
        return true;
 }
 
-static bool api_netr_NETRSERVERGETTRUSTINFO(pipes_struct *p)
+static bool api_netr_ServerGetTrustInfo(pipes_struct *p)
 {
        const struct ndr_interface_call *call;
        struct ndr_pull *pull;
        struct ndr_push *push;
        enum ndr_err_code ndr_err;
        DATA_BLOB blob;
-       struct netr_NETRSERVERGETTRUSTINFO *r;
+       struct netr_ServerGetTrustInfo *r;
 
-       call = &ndr_table_netlogon.calls[NDR_NETR_NETRSERVERGETTRUSTINFO];
+       call = &ndr_table_netlogon.calls[NDR_NETR_SERVERGETTRUSTINFO];
 
-       r = talloc(talloc_tos(), struct netr_NETRSERVERGETTRUSTINFO);
+       r = talloc(talloc_tos(), struct netr_ServerGetTrustInfo);
        if (r == NULL) {
                return false;
        }
@@ -3768,10 +3768,35 @@ static bool api_netr_NETRSERVERGETTRUSTINFO(pipes_struct *p)
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_NETRSERVERGETTRUSTINFO, r);
+               NDR_PRINT_IN_DEBUG(netr_ServerGetTrustInfo, r);
+       }
+
+       ZERO_STRUCT(r->out);
+       r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
+       if (r->out.return_authenticator == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.new_owf_password = talloc_zero(r, struct samr_Password);
+       if (r->out.new_owf_password == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.old_owf_password = talloc_zero(r, struct samr_Password);
+       if (r->out.old_owf_password == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.trust_info = talloc_zero(r, struct netr_TrustInfo *);
+       if (r->out.trust_info == NULL) {
+               talloc_free(r);
+               return false;
        }
 
-       r->out.result = _netr_NETRSERVERGETTRUSTINFO(p, r);
+       r->out.result = _netr_ServerGetTrustInfo(p, r);
 
        if (p->rng_fault_state) {
                talloc_free(r);
@@ -3780,7 +3805,7 @@ static bool api_netr_NETRSERVERGETTRUSTINFO(pipes_struct *p)
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_NETRSERVERGETTRUSTINFO, r);
+               NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo, r);
        }
 
        push = ndr_push_init_ctx(r, NULL);
@@ -3856,7 +3881,7 @@ static struct api_struct api_netlogon_cmds[] =
        {"NETR_DSRGETFORESTTRUSTINFORMATION", NDR_NETR_DSRGETFORESTTRUSTINFORMATION, api_netr_DsRGetForestTrustInformation},
        {"NETR_GETFORESTTRUSTINFORMATION", NDR_NETR_GETFORESTTRUSTINFORMATION, api_netr_GetForestTrustInformation},
        {"NETR_LOGONSAMLOGONWITHFLAGS", NDR_NETR_LOGONSAMLOGONWITHFLAGS, api_netr_LogonSamLogonWithFlags},
-       {"NETR_NETRSERVERGETTRUSTINFO", NDR_NETR_NETRSERVERGETTRUSTINFO, api_netr_NETRSERVERGETTRUSTINFO},
+       {"NETR_SERVERGETTRUSTINFO", NDR_NETR_SERVERGETTRUSTINFO, api_netr_ServerGetTrustInfo},
 };
 
 void netlogon_get_pipe_fns(struct api_struct **fns, int *n_fns)