smb.conf file issues

427 views
Skip to first unread message

Tom Schmidt

unread,
Mar 14, 2012, 11:13:19 PM3/14/12
to Alt-F
I have been trying to get Alt-F to work for me with my DNS-323.
However, I have found that the /etc/samba/smb.conf file keeps getting
its "hosts allow" line altered on every reboot by a sed command in
the /etc/init.d/rcS startup script. It changes my entry from:

hosts allow = 127. 192.168.1.0/24

to

hosts allow = 127. 192.168.1.0/

It looses the netmask, as the sed command in the rcS script is using
the undefined $subnet variable instead of the correct $netmask
variable. I tried to edit rcS with this change, but it reverts on
reboot.

How do we get this fixed? As a workaround, I made my smb.conf entry
have a third IP entry, which the sed command does not modify:

hosts allow = 127. 192.168.1.0/ 127. 192.168.1.0/24


Also, the documentation does not tell users how to port their /etc/
samba/smb.conf file from their original DNS-323 DLink firmware to the
Alt-F configuration. Novice UNIX users will have a hard time trying
to figure out what needs done.

Joao Cardoso

unread,
Mar 15, 2012, 11:20:26 AM3/15/12
to al...@googlegroups.com


On Thursday, March 15, 2012 3:13:19 AM UTC, Tom Schmidt wrote:
I have been trying to get Alt-F to work for me with my DNS-323.
However, I have found that the /etc/samba/smb.conf file keeps getting
its "hosts allow" line altered on every reboot by a sed command in
the /etc/init.d/rcS startup script.  It changes my entry from:

   hosts allow = 127. 192.168.1.0/24

to

   hosts allow = 127. 192.168.1.0/

It looses the netmask, as the sed command in the rcS script is using
the undefined $subnet variable instead of the correct $netmask
variable.

You are using "reloaded", using the Alt-F fun_plug script to boot it, right? 
 
 I tried to edit rcS with this change, but it reverts on
reboot.

Yes, rcS is stored on flash-memory.
If you want to override it, read the HowToFixOrCustomizeFirmware wiki entry.

How do we get this fixed?  As a workaround, I made my smb.conf entry
have a third IP entry, which the sed command does not modify:

   hosts allow = 127. 192.168.1.0/ 127. 192.168.1.0/24

This issue was already covered in the "Help! Newb screwed it all up!" thread and on  Issue 81: Network settings in "reloaded" mode. It was already fixed in SVN.

There are two possibilities:

1-Go to Setup->Host (not "hosts") in the DNS and hit the "Submit" button (without 
changing anything) after each reboot

2-Edit fun_plug and comment the "KIP=yes" line near the top (setting it to 'no' will not work)

The first one has been confirmed to work, but not the second, do you mind trying it and reporting back?

Also, the documentation does not tell users how to port their /etc/
samba/smb.conf file from their original DNS-323 DLink firmware to the
Alt-F configuration.

There are several things to change, the best is to start afresh from the beginning.

What I (or you) could do is to write a how-to wiki on how to make existing data available. There are two possibilities: 
-either using Samba Setup to make the existing shares available (does not cover ftp, etc)
-move the data to the user's home directory or the Public directories
and change folder/files permissions by using the Folders Browse page

 Novice UNIX users will have a hard time trying
to figure out what needs done.

The original goal was to provide a friendly enough web-gui (and help pages) for the intermediate user, so command line editing should not be necessary.
I think that for new deployments users should have no problems (would they follow the "First Login Tour", which most don't), but porting existing data is much more complex, as each case is different. Do you have a specific proposal?

Thanks,
Joao

Tom Schmidt

unread,
Mar 15, 2012, 10:55:00 PM3/15/12
to Alt-F
Replies inline below.

On Mar 15, 9:20 am, Joao Cardoso <whoami.jc...@gmail.com> wrote:
> On Thursday, March 15, 2012 3:13:19 AM UTC, Tom Schmidt wrote:
>
> > I have been trying to get Alt-F to work for me with my DNS-323.
> > However, I have found that the /etc/samba/smb.conf file keeps getting
> > its "hosts allow" line altered on every reboot by a sed command in
> > the /etc/init.d/rcS startup script.  It changes my entry from:
>
> >    hosts allow = 127. 192.168.1.0/24
>
> > to
>
> >    hosts allow = 127. 192.168.1.0/
>
> > It looses the netmask, as the sed command in the rcS script is using
> > the undefined $subnet variable instead of the correct $netmask
> > variable.
>
> You are using "reloaded", using the Alt-F fun_plug script to boot it,
> right?

Yes, I am using the reloaded Alt-F fun_plug downloaded from here with
the 0.1RC2 release

>
> >  I tried to edit rcS with this change, but it reverts on
> > reboot.
>
> Yes, rcS is stored on flash-memory.
> If you want to override it, read the HowToFixOrCustomizeFirmware wiki entry.
>
> How do we get this fixed?  As a workaround, I made my smb.conf entry
>
> > have a third IP entry, which the sed command does not modify:
>
> >    hosts allow = 127. 192.168.1.0/ 127. 192.168.1.0/24
>
> This issue was already covered in the "Help! Newb screwed it all up!"
> thread and on  Issue 81: Network settings in "reloaded" mode. It was
> already fixed in SVN.

I downloaded the updated rcS from SVN and installed it and added it to
the saved files in the loadsave_settings script. I rebooted, and the
rcS script was the new one from SVN, yet my smb.conf file was still
editted such that the netmask field was empty for the hosts allow
line. So I am continuing to use the third entry of 192.168.1.0/24 on
the "hosts allow" line in smb.conf. I don't see what it isn't putting
the 255.255.255.0 value in for the netmask, as it does do that for the
httpd.conf file just above it.

>
> There are two possibilities:
>
> 1-Go to Setup->Host (not "hosts") in the DNS and hit the "Submit" button
> (without
> changing anything) after each reboot
>
> 2-Edit fun_plug and comment the "KIP=yes" line near the top (setting it to
> 'no' will not work)
>
> The first one has been confirmed to work, but not the second, do you mind
> trying it and reporting back?

I have not tried this yet

>
> Also, the documentation does not tell users how to port their /etc/
>
> > samba/smb.conf file from their original DNS-323 DLink firmware to the
> > Alt-F configuration.
>
> There are several things to change, the best is to start afresh from the
> beginning.
>
> What I (or you) could do is to write a how-to wiki on how to make existing
> data available. There are two possibilities:
> -either using Samba Setup to make the existing shares available (does not
> cover ftp, etc)
> -move the data to the user's home directory or the Public directories
> and change folder/files permissions by using the Folders Browse page
>
>  Novice UNIX users will have a hard time trying
>
> > to figure out what needs done.
>
> The original goal was to provide a friendly enough web-gui (and help pages)
> for the intermediate user, so command line editing should not be necessary.
> I think that for new deployments users should have no problems (would they
> follow the "First Login Tour", which most don't), but porting existing
> data is much more complex, as each case is different. Do you have a
> specific proposal?

I don't have a good proposal, as yes, the customization of every
smb.conf out there can be different. It would be possible to write a
conversion script that converts the old smb.conf file to the new
format, including updating smbpasswd, passwd, shadow, group, and other
files.

>
> Thanks,
> Joao

Thank you! I would like to help improve Alt-F, as I have worked with
*NIX for 20+ years on a daily basis as a system administrator, but I
don't know how much time I could devote to it. I see a lot of
potential here! I have not flashed it to my DNS-323 yet, nor added
back in bittorrent and mediatomb or other media streamers, that's
next.

Tom

Joao Cardoso

unread,
Mar 16, 2012, 12:32:23 AM3/16/12
to al...@googlegroups.com


On Fri, Mar 16, 2012 at 2:55 AM, Tom Schmidt <musta...@gmail.com> wrote:
...
> >  I tried to edit rcS with this change, but it reverts on
> > reboot.
>
> Yes, rcS is stored on flash-memory.
> If you want to override it, read the HowToFixOrCustomizeFirmware wiki entry.
...
This issue was already covered in the "Help! Newb screwed it all up!"
> thread and on  Issue 81: Network settings in "reloaded" mode. It was
> already fixed in SVN.

I downloaded the updated rcS from SVN and installed it and added it to
the saved files in the loadsave_settings script.

This will not work, as settings are loaded by rcS itself, which is running, and (the running copy) will not be overridden by the one loaded from flash.

As a matter of fact my suggestion above, HowToFixOrCustomizeFirmware, will also not work, as it relies on hot-plugging that is also deployed by rcS.

So, rcS can't be changed.
 
 I rebooted, and the
rcS script was the new one from SVN,

You are now watching the flash-loaded rcS, not the one that was running.
You have to rely on one of the two methods outlined bellow.

> There are two possibilities:
>
> 1-Go to Setup->Host (not "hosts") in the DNS and hit the "Submit" button
> (without
> changing anything) after each reboot
>
> 2-Edit fun_plug and comment the "KIP=yes" line near the top (setting it to
> 'no' will not work)
...


I don't have a good proposal, as yes, the customization of every
smb.conf out there can be different.  It would be possible to write a
conversion script that converts the old smb.conf file to the new
format, including updating smbpasswd, passwd, shadow, group, and other
files.

Converting users/groups can be done, although the gids/uids are certainly different.
I think that passwords can't be preserved.
Home directories has to be converted, as Alt-F has the idiosyncrasy of using the users full name and storing them in a filesystem under a Users directory. Then all users files ownership has to be changed. I don't like the idea of changing users data...
For smb.conf, I think the best would be to parse the vendor's one for shares and create  shares with the same name and path in the new smb.conf. smb; smbpassword can be copied verbatim, I think.

Yes, it can be done, but it is not a priority for me -- I prefer to have the user do the transition, after all it's his/her data.

But having some documentation on the recommended way to do the transition (essentially creating users/groups and moving or renaming directories and changing files permissions) would be good thing to have. Or at least explain Alt-F's directory hierarchy.

Joao

Joao Cardoso

unread,
Mar 18, 2012, 1:35:12 PM3/18/12
to al...@googlegroups.com

...

Converting users/groups can be done, although the gids/uids are certainly different.
I think that passwords can't be preserved.
Home directories has to be converted, as Alt-F has the idiosyncrasy of using the users full name and storing them in a filesystem under a Users directory. Then all users files ownership has to be changed. I don't like the idea of changing users data...
For smb.conf, I think the best would be to parse the vendor's one for shares and create  shares with the same name and path in the new smb.conf. smb; smbpassword can be copied verbatim, I think.

Yes, it can be done, but it is not a priority for me -- I prefer to have the user do the transition, after all it's his/her data.

You also said:

  I would like to help improve Alt-F, as I have worked with 
  *NIX for 20+ years on a daily basis as a system administrator, but I 
  don't know how much time I could devote to it.  I see a lot of 
  potential here!
 
And I forgot to ask you if you could try to write the porting script :-)

As this is volunteer work, there are no deadlines, it will be ready when it is ready.

you also said:
   I have not flashed it to my DNS-323 yet, nor added 
   back in bittorrent and mediatomb or other media streamers, that's 
   next. 

You are in a privileged situation, as you still have the vendor's settings and file hierarchy, which I don't. I don't even remember if users home directories are or not used.
In any case, the script should only be available (enabled) if the user has flashed Alt-F.

Reply all
Reply to author
Forward
0 new messages