The branch, master has been updated via 8a27fde... s3:net: Fix a segfault in "net rpc trustdom list" for overlong domain names from 3f5c077... Remove use of "int ret" when we already have errcode. Jeremy.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 8a27fdea89bc54aa35e363a376836662103c7cb7 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 13 15:56:00 2009 +0200 s3:net: Fix a segfault in "net rpc trustdom list" for overlong domain names That was a complicated way to say "%-20.s"... But that code was from 2002 ... ----------------------------------------------------------------------- Summary of changes: source3/utils/net_rpc.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index afda1a7..0e325b5 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -6012,14 +6012,13 @@ static int rpc_trustdom_list(struct net_context *c, int argc, const char **argv) NTSTATUS nt_status; const char *domain_name = NULL; DOM_SID *queried_dom_sid; - fstring padding; int ascii_dom_name_len; struct policy_handle connect_hnd; union lsa_PolicyInformation *info = NULL; /* trusted domains listing variables */ unsigned int num_domains, enum_ctx = 0; - int i, pad_len, col_len = 20; + int i; struct lsa_DomainList dom_list; fstring pdc_name; @@ -6228,17 +6227,12 @@ static int rpc_trustdom_list(struct net_context *c, int argc, const char **argv) if (ascii_dom_name_len && ascii_dom_name_len < FSTRING_LEN) str[ascii_dom_name_len - 1] = '\0'; - /* calculate padding space for d_printf to look nicer */ - pad_len = col_len - strlen(str); - padding[pad_len] = 0; - do padding[--pad_len] = ' '; while (pad_len); - /* set opt_* variables to remote domain */ strupper_m(str); c->opt_workgroup = talloc_strdup(mem_ctx, str); c->opt_target_workgroup = c->opt_workgroup; - d_printf("%s%s", str, padding); + d_printf("%-20s", str); /* connect to remote domain controller */ nt_status = net_make_ipc_connection(c, -- Samba Shared Repository