Bug 135946 - Cannot write to /etc/samba/smb.conf
Summary: Cannot write to /etc/samba/smb.conf
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-samba
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nils Philippsen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC3Blocker
TreeView+ depends on / blocked
 
Reported: 2004-10-15 20:38 UTC by Bob Gustafson
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-20 01:13:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Bob Gustafson 2004-10-15 20:38:14 UTC
Description of problem:

I try to add a share and it says:

  Cannot write to /etc/samba/smb.conf Program will now exit


Version-Release number of selected component (if applicable):

  From 'About box':

  Samba Server Configuration Tool 1.2.20

How reproducible:

  Every time I have tried over the last couple of days.

Steps to Reproduce:
1. Gnome->System Settings->Server Settings->Samba
2. insert root password when asked
3. Add a share - browse to a directory
4. Allow access to everyone (..)
5. Click on OK

6. Read dismal Warning box 'Cannot write to /etc/samba/smb.conf..

Actual results:

  see above

Expected results:

  I should see the appropriate changes written into smb.conf

Additional info:

[root@hoho2 samba]# pwd
/etc/samba
[root@hoho2 samba]# ls -l
total 24
-rw-r--r--  1 root root    20 Oct 13 16:30 lmhosts
-rw-r--r--  1 root root 10836 Oct 14 21:46 smb.conf
-rw-r--r--  1 root root    97 Oct 13 16:30 smbusers
[root@hoho2 samba]#

Comment 1 Nils Philippsen 2004-10-18 09:07:25 UTC
Can you please run system-config-samba from the command line? It
should spit ot a python traceback, please copy it here.

Comment 2 Bob Gustafson 2004-10-18 17:16:03 UTC
[user1@hoho2 ~]$ su
Password:
[root@hoho2 user1]# system-config-samba
Traceback (most recent call last):
  File "/usr/share/system-config-samba/system-config-samba.py", line
41, in ?
    mainWindow.MainWindow(debug_flag)
  File "/usr/share/system-config-samba/mainWindow.py", line 75, in
__init__
    self.samba_data = sambaParser.SambaParser(self)
  File "/usr/share/system-config-samba/sambaParser.py", line 40, in
__init__
    self.parseFile()
  File "/usr/share/system-config-samba/sambaParser.py", line 74, in
parseFile
    token = self.createToken(line)
  File "/usr/share/system-config-samba/sambaParser.py", line 146, in
createToken    token =
sambaToken.SambaToken(sambaToken.SambaToken.SAMBA_TOKEN_KEYVAL, (name,
value), self.parent)
  File "/usr/share/system-config-samba/sambaToken.py", line 36, in
__init__
    raise AttributeError, value
AttributeError: ('readonly', 'yes')
[root@hoho2 user1]#


Comment 3 Nils Philippsen 2004-10-18 17:38:39 UTC
This indicates a wrong option in your /etc/smb.conf. According the the
smb.conf(5) man page it is "read only", not "readonly" -- could you
check your /etc/smb.conf please?

Comment 4 Bob Gustafson 2004-10-18 19:09:39 UTC
# From http://www.poulpetersen.dk/linux/uklinshr.htm
# cdrom setup
[cdrom]
   comment = Samba Server CDROM
   browseable = yes
   writeable = no
   readonly = yes
   printable = no
   public = yes
   only guest = no
   path = /mnt/cdrom


Changing the readonly to 'read only' gives much better results. Before
it was a blank dialog box. Now there are a few lines showing shares,
etc. (Including the cdrom drive..)

Thanks much for the pointer. (maybe smb.conf parse errors should show
in the dialog box?)

Comment 5 Bob Gustafson 2004-10-18 19:10:10 UTC
Works for me

Comment 6 Nils Philippsen 2004-10-19 09:47:21 UTC
Reopening this under a slightly different title ;-).

Comment 7 Bob Gustafson 2004-10-19 16:29:50 UTC
Hmm, I am still getting the dialog box

Cannot write to /etc/samba/smb.conf Program will now exit.

I open a 'preferences' dialog and get the above message when I exit,
no matter whether I change anything or not.

Running from the command line, this is what I get:

[root@hoho2 samba]# system-config-samba
/usr/share/system-config-samba/mainWindow.py:113: DeprecationWarning:
use gtk.UIManager
  item_fac = gtk.ItemFactory(gtk.MenuBar, "<main>", accel_group)
/usr/share/system-config-samba/mainWindow.py:138: DeprecationWarning:
  button = self.toolbar.insert_stock('gtk-add', _("Add a samba
share"), None, self.onNewButtonClicked, None, 0)
/usr/share/system-config-samba/mainWindow.py:143: DeprecationWarning:
  self.properties_button = self.toolbar.insert_stock('gtk-properties',
_("Edit the properties of the selected directory"), None,
self.onPropertiesButtonClicked, None, 1)
/usr/share/system-config-samba/mainWindow.py:148: DeprecationWarning:
  self.delete_button = self.toolbar.insert_stock('gtk-delete',
_("Delete the selected directory"), None, self.onDeleteButtonClicked,
None, 2)
/usr/share/system-config-samba/mainWindow.py:153: DeprecationWarning:
  self.toolbar.insert_stock('gtk-help', _("View help"), None,
self.onHelpClicked, None, 3)
Traceback (most recent call last):
  File "/usr/share/system-config-samba/shareWindow.py", line 537, in
onOkEditButtonClicked
    self.samba_data.writeFile()
  File "/usr/share/system-config-samba/sambaParser.py", line 173, in
writeFile
    raise RuntimeError, (_("Cannot write to %s.  Program will now
exit." % path))
RuntimeError: Cannot write to /etc/samba/smb.conf.  Program will now exit.
[root@hoho2 samba]#


Comment 8 Nils Philippsen 2004-10-19 16:43:32 UTC
Ahh I got the culprit now, changed title back.

Comment 9 Nils Philippsen 2004-10-19 17:13:13 UTC
Should be fixed in 1.2.21-1. Grab them from
http://people.redhat.com/nphilipp/BETA/system-config-samba/ until they
hit the mirrors.

Comment 10 Bob Gustafson 2004-10-20 01:13:13 UTC
Seems to work

I did

rpm -i system..src.rpm
rpm -i system..noarch.rpm
cd /usr/src/redhat/SPECS
rpmbuild -bi system..src.rpm 2>&1 system-config.out

And then added a 'share' and then deleted it. Seemed to work OK.

Thanks much

Works for me

Comment 11 Nils Philippsen 2004-10-20 10:02:30 UTC
You shouldn't have needed to rebuild the source RPM ;-), but anyway
good to hear that it works.


Note You need to log in before you can comment on or make changes to this bug.