include = smb.conf.host.%h
Andy Polyakov
appro at fy.chalmers.se
Wed Feb 3 13:37:16 GMT 1999
Hello again!
I've ran into a problem with 2.1.0-prealpha smbd (never tried 2.0.0).
It unlike other accompanying programs, namely nmbd and testparm, fails
to interpret 'include = /blah/blah/blah.%h' directive in smb.conf. I
used to it and find it very handy. What I do (and definitely want to
keep doing) is collect all config files in /same/place, put common
lines in /same/place/smbd.conf and terminate it with 'include =
/same/place/smb.conf.host.%h'. Pretty cool, huh? In either case I
looked into the code and discovered that (unlike other accompanying
programs, see above) myhostname remains uninitialized for first parse
of config file. Following seem to cure the problem (cut-n-paste
courtesy goes to nmbd code):
*** source/smbd/server.c.orig Sat Dec 5 21:19:10 1998
--- source/smbd/server.c Mon Feb 1 18:24:40 1999
***************
*** 446,453 ****
****************************************************************************/
static void init_structs(void )
{
- get_myname(myhostname,NULL);
-
/*
* Set the machine NETBIOS name if not already
* set from the config file.
--- 446,451 ----
***************
*** 635,640 ****
--- 633,644 ----
exit(1);
}
+ if( !get_myname( myhostname, NULL) )
+ {
+ DEBUG( 0, ( "Unable to get my hostname - exiting.\n" ) );
+ return -1;
+ }
+
if (!reload_services(False))
return(-1);
Cheers. Andy.
More information about the samba-ntdom
mailing list