From fb1f83b05d96fb2e5094c2b35765f62a0fc6c26c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 19 Apr 2006 15:43:48 +0000 Subject: r15137: Refuse to join if our netbios name is longer than 15 chars. I think this is sufficient to fix bug #3659. Volker (This used to be commit 0ef5e4372c45a60d66a902a6dbca58ae98529358) --- source3/utils/net_ads.c | 6 ++++++ source3/utils/net_rpc.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 93d564bea0..11e7ae0282 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -727,6 +727,12 @@ int net_ads_join(int argc, const char **argv) return -1; } + if (strlen(global_myname()) > 15) { + d_printf("Our netbios name can only be 15 chars long, \"%s\"" + " is %d chars long\n", + global_myname(), strlen(global_myname())); + return -1; + } if (argc > 0) { org_unit = argv[0]; diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index e8667cbf7b..0060a39c31 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -395,6 +395,13 @@ int net_rpc_join(int argc, const char **argv) return -1; } + if (strlen(global_myname()) > 15) { + d_printf("Our netbios name can only be 15 chars long, \"%s\"" + " is %d chars long\n", + global_myname(), strlen(global_myname())); + return -1; + } + if ((net_rpc_perform_oldjoin(argc, argv) == 0)) return 0; -- cgit