91 lines
3.0 KiB
Diff
91 lines
3.0 KiB
Diff
|
diff -ur samba-3.0.0rc3/source/lib/popt_common.c samba-3.0.0rc3-lhh/source/lib/popt_common.c
|
||
|
--- samba-3.0.0rc3/source/lib/popt_common.c 2003-09-10 13:57:00.000000000 -0400
|
||
|
+++ samba-3.0.0rc3-lhh/source/lib/popt_common.c 2003-09-11 13:49:24.000000000 -0400
|
||
|
@@ -87,7 +87,7 @@
|
||
|
|
||
|
case 'n':
|
||
|
if (arg) {
|
||
|
- set_global_myname(arg);
|
||
|
+ set_global_myname_override(arg);
|
||
|
}
|
||
|
break;
|
||
|
|
||
|
diff -ur samba-3.0.0rc3/source/lib/util.c samba-3.0.0rc3-lhh/source/lib/util.c
|
||
|
--- samba-3.0.0rc3/source/lib/util.c 2003-09-08 12:04:35.000000000 -0400
|
||
|
+++ samba-3.0.0rc3-lhh/source/lib/util.c 2003-09-11 13:47:18.000000000 -0400
|
||
|
@@ -84,6 +84,7 @@
|
||
|
***********************************************************************/
|
||
|
|
||
|
static char *smb_myname;
|
||
|
+static char *smb_myname_override;
|
||
|
static char *smb_myworkgroup;
|
||
|
static char *smb_scope;
|
||
|
static int smb_num_netbios_names;
|
||
|
@@ -108,6 +109,27 @@
|
||
|
return smb_myname;
|
||
|
}
|
||
|
|
||
|
+
|
||
|
+/***********************************************************************
|
||
|
+ Allocate and set override for myname. Ensure upper case.
|
||
|
+***********************************************************************/
|
||
|
+
|
||
|
+BOOL set_global_myname_override(const char *myname)
|
||
|
+{
|
||
|
+ SAFE_FREE(smb_myname_override);
|
||
|
+ smb_myname_override = strdup(myname);
|
||
|
+ if (!smb_myname_override)
|
||
|
+ return False;
|
||
|
+ strupper_m(smb_myname_override);
|
||
|
+ return True;
|
||
|
+}
|
||
|
+
|
||
|
+const char *global_myname_override(void)
|
||
|
+{
|
||
|
+ return smb_myname_override;
|
||
|
+}
|
||
|
+
|
||
|
+
|
||
|
/***********************************************************************
|
||
|
Allocate and set myworkgroup. Ensure upper case.
|
||
|
***********************************************************************/
|
||
|
diff -ur samba-3.0.0rc3/source/nmbd/nmbd.c samba-3.0.0rc3-lhh/source/nmbd/nmbd.c
|
||
|
--- samba-3.0.0rc3/source/nmbd/nmbd.c 2003-09-10 13:57:00.000000000 -0400
|
||
|
+++ samba-3.0.0rc3-lhh/source/nmbd/nmbd.c 2003-09-11 14:05:21.000000000 -0400
|
||
|
@@ -608,6 +608,7 @@
|
||
|
{"hosts", 'H', POPT_ARG_STRING, dyn_LMHOSTSFILE, 'H', "Load a netbios hosts file"},
|
||
|
{"port", 'p', POPT_ARG_INT, &global_nmb_port, NMB_PORT, "Listen on the specified port" },
|
||
|
POPT_COMMON_SAMBA
|
||
|
+ POPT_COMMON_CONNECTION
|
||
|
{ NULL }
|
||
|
};
|
||
|
|
||
|
diff -ur samba-3.0.0rc3/source/param/loadparm.c samba-3.0.0rc3-lhh/source/param/loadparm.c
|
||
|
--- samba-3.0.0rc3/source/param/loadparm.c 2003-09-08 12:04:35.000000000 -0400
|
||
|
+++ samba-3.0.0rc3-lhh/source/param/loadparm.c 2003-09-11 14:00:51.000000000 -0400
|
||
|
@@ -1327,7 +1327,10 @@
|
||
|
*/
|
||
|
string_set(&Globals.szPasswdChat, DEFAULT_PASSWD_CHAT);
|
||
|
|
||
|
- set_global_myname(myhostname());
|
||
|
+ if (!global_myname_override())
|
||
|
+ set_global_myname(myhostname());
|
||
|
+ else
|
||
|
+ set_global_myname(global_myname_override());
|
||
|
string_set(&Globals.szNetbiosName,global_myname());
|
||
|
|
||
|
set_global_myworkgroup(WORKGROUP);
|
||
|
@@ -2698,6 +2701,12 @@
|
||
|
BOOL ret;
|
||
|
pstring netbios_name;
|
||
|
|
||
|
+ if (global_myname_override()) {
|
||
|
+ DEBUG(4, ("handle_netbios_name: ignoring netbios name "
|
||
|
+ "parameter"));
|
||
|
+ return True;
|
||
|
+ }
|
||
|
+
|
||
|
pstrcpy(netbios_name, pszParmValue);
|
||
|
|
||
|
standard_sub_basic(current_user_info.smb_name, netbios_name,sizeof(netbios_name));
|