Bug 417 - Variables don't work in include lines
Summary: Variables don't work in include lines
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Config Files (show other bugs)
Version: 3.0.0preX
Hardware: All other
: P2 major
Target Milestone: none
Assignee: Gerald (Jerry) Carter (dead mail address)
QA Contact:
URL:
Keywords:
: 961 (view as bug list)
Depends on:
Blocks: 807 1128
  Show dependency treegraph
 
Reported: 2003-09-08 13:45 UTC by Adam Watkins
Modified: 2005-11-14 09:27 UTC (History)
1 user (show)

See Also:


Attachments
patch for fix %UuGg variable expansion in smb.conf (4.02 KB, patch)
2004-03-19 14:03 UTC, Gerald (Jerry) Carter (dead mail address)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Watkins 2003-09-08 13:45:10 UTC
I use different shares depending on the group of the person connecting.  This 
changes what share can be seen by the users group.  Everything worked fine 
until implementing this.  For instance, I created a group called admins and 
added myself to this group.  I made a file called /etc/samba/smb.conf.admins 
with shares an admin should see.  I added this line to the end of globals 
include=/etc/samba/smb.conf.%G  
After doing this, shares showed up blank.  (I of course restarted samba.)  
After hitting refresh a few times, the shares showed up.  I then went into one 
and it worked ok.  After a bit, the shares dissapeard again and windows 
reported, "The network path was not found."  After hitting F5 a few times, it 
says the server cannot be found now, after hitting refresh a few more times 
the shares are back... for a little bit.

Server OS:  Gentoo Linux 1.4
Samba config:  Samba 3.0.0rc2 Set up as primary domain controler (use to be 
2.2.8a)
Client OS:  Windows XP SP1
Comment 1 Gerald (Jerry) Carter (dead mail address) 2003-09-09 11:15:59 UTC
Briwsing is done as the guest user.  So your 
include line will expand %G to the group of the 
'guest account'.

If you have at least 1 connection to the server as
an authenticated user prior to browsing the include 
line will show up correctly.  There is nothing that 
can be done about this from what I can tell.
Comment 2 Gerald (Jerry) Carter (dead mail address) 2003-09-19 11:45:53 UTC
report via email is that thius worked fine under 2.2.8a
Comment 3 Gerald (Jerry) Carter (dead mail address) 2003-10-03 07:58:33 UTC
More reports from the mailing list:

if i wrote in smb.conf that string - include=/etc/samba/%U.conf this not work
in log this value "file /etc/samba/%U ->  file /etc/samba"
in operator "include" work only one macros %L
other macros - %U %u %G %g not work.
Comment 4 Gerald (Jerry) Carter (dead mail address) 2003-12-12 08:27:59 UTC
reseting target milestone.  3.0.1 has been frozen.  WIll have to 
re-evaluate these.
Comment 5 Charlie Wilder 2004-02-12 08:34:00 UTC
I have been using samba since 2.07, am now using 2.2.8a, and have also noticed
this error in the SAMBA3 base.

smb.conf contains "include=/etc/samba/user.%U", which works in the SAMBA2 base,
but fails to find "/etc/samba/user." in the SAMBA3 base (3.0, 3.0.1, and 3.0.2).

Interestingly, a test share with "comment = u %u U %U  D %D g %g H %H" shows the
right information with "smbclient -L servername -U username".

Also interesting: "include=/etc/samba/server.%L" works in both SAMBA2 and SAMBA3.

I see these results on any of my windows PCs and with smbclient requests.

Based on my testing, this is the only thing keeping me from moving from 2 to 3.
At present the samba server is set to "security=server" with a different (samba)
password server.

I can provide any detail you wish.

Comment 6 Gerald (Jerry) Carter (dead mail address) 2004-03-16 11:52:43 UTC
*** Bug 961 has been marked as a duplicate of this bug. ***
Comment 7 Gerald (Jerry) Carter (dead mail address) 2004-03-18 12:59:26 UTC
Finally tracked this down.  It's kind of widespread 
in that the current_user_info struct seems to have 
fallen into disuse.  I have a working patch but I 
need to make sure that it is a complete patch before
checking it in.
Comment 8 Gerald (Jerry) Carter (dead mail address) 2004-03-19 14:03:33 UTC
Created attachment 448 [details]
patch for fix %UuGg variable expansion in smb.conf 

This patch fixes up the mess with inconsistency surrounding 
the current_user_info global var.  Fixes variables and include files.
Comment 9 Gerald (Jerry) Carter (dead mail address) 2004-03-19 14:08:14 UTC
changes checked into 3.0 and HEAD cvs trees.  SOrry 
for all the hassle on this.
Comment 10 Gerald (Jerry) Carter (dead mail address) 2005-02-07 09:06:14 UTC
originally reported against one of the 3.0.0rc[1-4] releases.
Cleaning up non-production versions.
Comment 11 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:23:44 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 12 Gerald (Jerry) Carter (dead mail address) 2005-11-14 09:27:50 UTC
database cleanup