diff options
Diffstat (limited to 'source3/winbindd/wb_fill_pwent.c')
-rw-r--r-- | source3/winbindd/wb_fill_pwent.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/winbindd/wb_fill_pwent.c b/source3/winbindd/wb_fill_pwent.c index 23057384c2..a716245ce8 100644 --- a/source3/winbindd/wb_fill_pwent.c +++ b/source3/winbindd/wb_fill_pwent.c @@ -72,8 +72,7 @@ static void wb_fill_pwent_sid2uid_done(struct tevent_req *subreq) status = wb_sid2uid_recv(subreq, &state->pw->pw_uid); TALLOC_FREE(subreq); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return; } @@ -98,8 +97,7 @@ static void wb_fill_pwent_sid2gid_done(struct tevent_req *subreq) status = wb_sid2gid_recv(subreq, &state->pw->pw_gid); TALLOC_FREE(subreq); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return; } @@ -131,7 +129,9 @@ static void wb_fill_pwent_sid2gid_done(struct tevent_req *subreq) true); } - fstrcpy(state->pw->pw_name, output_username); + strlcpy(state->pw->pw_name, + output_username, + sizeof(state->pw->pw_name)); fstrcpy(state->pw->pw_gecos, state->info->full_name); /* Home directory and shell */ @@ -194,7 +194,7 @@ static bool fillup_pw_field(const char *lp_template, if (!templ) return False; - safe_strcpy(out, templ, sizeof(fstring) - 1); + strlcpy(out, templ, sizeof(fstring)); TALLOC_FREE(templ); return True; |