Bug 1133 - system-wide config should be merged with user-wide config
Summary: system-wide config should be merged with user-wide config
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 3.0.0
Hardware: Other other
: P5 normal
Target Milestone: none
Assignee: Derrell Lipman
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-27 03:26 UTC by Bastien Nocera
Modified: 2005-08-24 10:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bastien Nocera 2004-02-27 03:26:56 UTC
If a user-wide smb.conf file is available, the system-wide smb.conf is ignored.

The user-wide smb.conf should only override options in the system-wide smb.conf,
and the system-wide smb.conf still be used.
Comment 1 Gerald (Jerry) Carter (dead mail address) 2004-03-01 09:24:30 UTC
I don't understand your report.  Please provide more details.
Dropping priority until there is sufficient information to work 
on this.
Comment 2 Bastien Nocera 2004-03-01 09:58:05 UTC
If you have a ~/.smb/smb.conf, /etc/samba/smb.conf is completely ignored.
The user's smb.conf should only be used to override parameters from the
system-wide configuration.

For example:
- system-wide contains the codepage to be used
- if an empty ~/.smb/smb.conf file exists, the compiled-in default codepage is
used, instead of the system-wide one
Comment 3 Andreas Hasenack (mail address dead) 2004-06-11 16:23:48 UTC
This has an interesting collateral effect. At least the gnome network viewer,
which shows all smb machines on the local LAN, relies on this "bug". It creates
an emtpy ~/.smb/smb.conf file, otherwise network browsing could perhaps not work.

I'll try to explain what happened here.
Scenario:
- client machine not running samba but with samba installed and
/etc/samba/smb.conf using workgroup=MYGROUP
- server machine, *misconfigured*, also in the MYGROUP group, with samba running
(perhaps just nmbd (I don't have shell access there), that's the problem, but
read on)
- lots of other smb machines in other groups, all working perfectly and
configured correctly

"dirfd = smbc_opendir( "smb://" );" on the client machine would always return -1
in this scenario. Once, however, I changed the workgroup of the client machine
to something else other than MYGROUP, then smbc_opendir (and kio-smb from KDE
also) would work. The issue is that the misbehaving server machine in the
MYGROUP group somehow caused the browsing of all the other groups to fail.

We saw this when we inspected gnome's code for their network browsing tool. They
simply create an emtpy ~/.smb/smb.conf file first. With this, they effectively
use a blank workgroup setting and this error doesn't happen (but many others
could be introduced, like what was reported in this ticket).

BTW, I used samba-3.0.4 on the client. The servers are mixed (some 2.2.x, some 3.x).
Comment 4 Andreas Hasenack (mail address dead) 2004-06-11 16:36:09 UTC
Is there a way to set a blank workgroup through libsmbclient? Or only via the
configuration file? I guess all these "network neighbourhood" type programs use
this trick.
Comment 5 Andreas Hasenack (mail address dead) 2004-06-14 14:38:35 UTC
As a reference, here is the corresponding gnome ticket:
http://bugzilla.gnome.org/show_bug.cgi?id=135580

It was asked that they remove this behaviour, at least until the option merge is
implemented.
Comment 6 Derrell Lipman 2005-03-31 13:32:34 UTC
Added configuration file ~/.smb/smb.conf.append which is read after the global
configuration file, allowing modifying some global parameter settings.

~/.smb/smb.conf.append is read ONLY if the global configuration file was found
and read.

The meaning of ~/.smb/smb.conf remains, for backward compatibility, that if it
is found, it is read, but the global configuration file is not read.  By
implication, this means that ~/.smb/smb.conf.append is not used if
~/.smb/smb.conf is used.
Comment 7 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:15:48 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.