s3:winbind: Use fstr_sprintf, it is simpler than talloc_asprintf->fstrcpy
authorVolker Lendecke <vl@samba.org>
Sat, 5 Sep 2009 15:14:45 +0000 (17:14 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 5 Sep 2009 15:14:45 +0000 (17:14 +0200)
source3/winbindd/winbindd_pam.c

index 6e67e466dc0fb5439732a62627a3109813ce80da..b87d2a8a9b11ffa071e0378a29ed61567bfffb56 100644 (file)
@@ -1730,20 +1730,17 @@ void winbindd_pam_auth_crap(struct winbindd_cli_state *state)
        }
 
        if (!state->privileged) {
-               char *error_string = NULL;
                DEBUG(2, ("winbindd_pam_auth_crap: non-privileged access "
                          "denied.  !\n"));
                DEBUGADD(2, ("winbindd_pam_auth_crap: Ensure permissions "
                             "on %s are set correctly.\n",
                             get_winbind_priv_pipe_dir()));
                /* send a better message than ACCESS_DENIED */
-               error_string = talloc_asprintf(state->mem_ctx,
-                                              "winbind client not authorized "
-                                              "to use winbindd_pam_auth_crap."
-                                              " Ensure permissions on %s "
-                                              "are set correctly.",
-                                              get_winbind_priv_pipe_dir());
-               fstrcpy(state->response->data.auth.error_string, error_string);
+               fstr_sprintf(state->response->data.auth.error_string,
+                            "winbind client not authorized to use "
+                            "winbindd_pam_auth_crap. Ensure permissions on "
+                            "%s are set correctly.",
+                            get_winbind_priv_pipe_dir());
                result = NT_STATUS_ACCESS_DENIED;
                goto done;
        }