Bug 2816 - virtual servers using netbios alias and include not working
Summary: virtual servers using netbios alias and include not working
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.10
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-22 22:41 UTC by Tim Harvey
Modified: 2005-08-24 10:26 UTC (History)
0 users

See Also:


Attachments
log file (32.98 KB, text/plain)
2005-06-22 22:58 UTC, Tim Harvey
no flags Details
log file (31.61 KB, text/plain)
2005-06-22 22:58 UTC, Tim Harvey
no flags Details
log file (50.94 KB, text/plain)
2005-06-22 22:58 UTC, Tim Harvey
no flags Details
log file (13.54 KB, text/plain)
2005-06-22 23:00 UTC, Tim Harvey
no flags Details
smbd.log (13.54 KB, text/plain)
2005-06-22 23:00 UTC, Tim Harvey
no flags Details
nmbd.log (50.98 KB, text/plain)
2005-06-22 23:01 UTC, Tim Harvey
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Harvey 2005-06-22 22:41:10 UTC
when using 'virtual servers' implemented with 'netbios name', 'netbios alias'
the %L parameter in the include is not being resolved correctly.

For example, with the following config files:

/etc/samba/smb.conf:
#Global parameters
[global]
workgroup = mshome
netbios name = nas2
netbios aliases = server1 server2
security = share
server string = Samba Server %L
log file = /var/log/samba/%L.%m.log
log level = 10
max log size = 50
preferred master = yes
include = /etc/samba/%L.conf

/etc/samba/nas2.conf
[data]
comment = data 
browseable = yes
path = /data
force user = nobody
force group = nobody
read only = No
guest ok = Yes

/etc/samba/server1.conf
[Video]
comment = Video files 
browseable = yes
path = /data/Video
force user = nobody
force group = nobody
read only = No
guest ok = Yes

/etc/samba/server2.conf                            
[Music]
comment = Music files 
browseable = yes
path = /data/Audio/Music
force user = nobody
force group = nobody
read only = No
guest ok = Yes

starting smb and using:
smbclient -L server2 -U%

the 'data' share is listed, not the 'music' share.  

A log file /var/log/samba/server2.nas2.log is created indicating the netbios
alias has been used.
Comment 1 Tim Harvey 2005-06-22 22:58:27 UTC
Created attachment 1284 [details]
log file
Comment 2 Tim Harvey 2005-06-22 22:58:42 UTC
Created attachment 1285 [details]
log file
Comment 3 Tim Harvey 2005-06-22 22:58:57 UTC
Created attachment 1286 [details]
log file
Comment 4 Tim Harvey 2005-06-22 23:00:35 UTC
Created attachment 1287 [details]
log file
Comment 5 Tim Harvey 2005-06-22 23:00:53 UTC
Created attachment 1288 [details]
smbd.log
Comment 6 Tim Harvey 2005-06-22 23:01:28 UTC
Created attachment 1289 [details]
nmbd.log
Comment 7 Tim Harvey 2005-06-22 23:02:52 UTC
Additional steps to reproduce issue:

using the provided config files, starting smb and attempting a connect fails:

$ smbclient //server2/Music
Password: 
Domain=[MSHOME] OS=[Unix] Server=[Samba 3.0.10-1.fc2]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

the logs from this session were attached for reference.
Comment 8 Tim Harvey 2005-06-28 07:07:10 UTC
Adding the global configuration item 'smb ports = 139' solves this issue.  

The default value for the ports that are listened on for SMB traffic.  Win2K and
later send on 445 which bypasses any netbios operations (such as the session
request that contains the netbios called name which is used for %L).

You could also achieve similar virtual host functionality by using a multi-homed
server (even virtual interfaces) and the %i variable in smb.conf
Comment 9 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:26:00 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.