Upgrading to Hardy destroyed my network shares and when I try to recreate them I get this long complicated error message

Bug #214714 reported by Martin Olsson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I just took the plunge and upgraded from Gutsy to the latest pre-release version of Hardy. Overall it fixed a bunch of problems for me and I'm delighted with the new version. I did run into one issue that caused some problems though:

After I had upgraded to Hardy my folder called "music" was no longer shared as a SMB windows network share. This means that my Windows computer (which doesn't have any music stored on it) cannot play any tunes. I immediately tried to fix this by sharing the folder again but when I tried I got this really long strange error message that says I should talk to by system administrator ("yeah right, I wish I could afford one of those actually :-)". The error message I got was:

'net usershare' returned error 255: net usershare add: cannot share path /media/EXTERNAL_______/music as we are restricted to only sharing directories we own.
 Ask the administrator to add the line "usershare owner only = False"
 to the [global] section of the smb.conf to allow this.

The folder I'm trying to share over SMB is located on one of those external USB harddrives and it's formatted as NTFS. That means that when I mount it in Ubuntu all the files are marked as "owned by root". Now, in Gutsy I was able to share these folders just fine.

However, it seems that in Hardy some kind of flag has been activated that prevents me from sharing files that I don't own. Well, clearly it's my files that are stored on this USB harddrive but it seems that the ability to share folders from NTFS drives has been lost in Hardy.

There was no obvious workaround for me to solve this problem, except copying the files to my root partition which is ext2 (this is quite inconvenient though because my music collection doesn't fit on this partition). There was also no checkbox that allowed me to type in my administrator password and override this error message and share the folder anyway.

I've attached a screenshot to this bug, that illustrates the problem I ran into.

Revision history for this message
Martin Olsson (mnemo) wrote :
Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

You have 2 problems.
1/ On upgrade you have lost your gutsy shares. Why ? Have you manually overwrited smb.conf during upgrade ?
2/ The new sharing system use the usershare samba system. A security option is set to not allow users to share folders that they are not owner Bug #214420 -> so you can manually (or use gui like system-config-samba) edit smb.conf to recreate your shares like before (in smb.conf).

Revision history for this message
Martin Olsson (mnemo) wrote :

Thank you Patrice

It's possible that the dist upgrade overwrote my smb.conf (not sure actually) but I was never made aware of the fact that this would cause me to loose all my SMB shares. Maybe a warning text should be added so that users know about this.

I will use your workaround for the second problem.

How can we change the default behavior in order to prevent other users from running into this problem? I think the added security flag is a very good thing that should stay but I still think that this bug has to be fixed somehow. On Windows, the UI interaction workflow is very smooth for the corresponding scenario and I never run into problems where I have to worry about the file system type of the partition on which I want to share files.

For example, when I plugin in my NTFS USB harddrive would it be possible to mount my files so that I am the owner of my own files by default?

Revision history for this message
Steve Langasek (vorlon) wrote :

The current version of the samba package in hardy should preserve all user-defined shares in smb.conf when upgrading, even if you opt to have the upgrade overwrite smb.conf.

So that part of this bug should be fixed.

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 214714] [NEW] Upgrading to Hardy destroyed my network shares and when I try to recreate them I get this long complicated error message
  • unnamed Edit (189 bytes, application/pgp-signature; name="signature.asc")

On Fri, Apr 11, 2008 at 04:42:02AM -0000, Launchpad Bug Tracker wrote:
> Ask the administrator to add the line "usershare owner only = False"
> to the [global] section of the smb.conf to allow this.

Could you try to add the line "usershare owner only = False" to the [global] section of /etc/samba/smb.conf ?

  status incomplete

--
Mathias Gug
Ubuntu Developer http://www.ubuntu.com

Changed in samba:
status: New → Incomplete
Revision history for this message
Richard Theil (richard-theil) wrote : Same problem with updated-from-beta install

I see the same message "'net usershare' returned error 255" on a from-scratch beta-cd installation that has been updated to current as of this writing (Sa 12. Apr 0:00 CEST). No special changes have been made to the stock system in the context of file sharing, the only thing attempted was to enable public sharing of a folder from Nautilus. Nautilus asked to install the services, and did so. Then upon trying to activate the share, the error showed.

I added the "usershare owner only = False" line and issued "/etc/init.d/samba restart". Within Nautilus (but without further reboot) the problem persists. /var/log/samba/log.smbd only confirms the restart done.

Revision history for this message
Richard Theil (richard-theil) wrote : Re: smb.conf change and reboot fix issue

Back after a reboot. This time things work as advertised. A nearby Windows XP machine was successfully able to mount the share.

Revision history for this message
Martin Olsson (mnemo) wrote :

Adding "usershare owner only = False" makes my system usable again. This bug is about getting stuff to work "out of the box" though so that others users don't have to go through the same debugging process I had to go through.

Changed in samba:
status: Incomplete → Confirmed
Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

@mnemo : "Adding "usershare owner only = False" makes my system usable again"

You mean that the shares you specifically mades with nautilus-share are working ?

"usershare owner only = false" is a security problem, I think that we will never put this inb smb.conf.

Changed in samba:
status: Confirmed → Incomplete
Revision history for this message
Martin Olsson (mnemo) wrote :

Clarification, by adding "usershare owner only = False" I'm now able to create new shares again even on my NTFS external harddrive. Of course all my original shares I had on this disk are permanently deleted by the upgrade process.

I understand the security implication and agree that the proper fix is not to add "usershare owner only = False" to smb.conf by default. Ideally, files on NTFS USB external hard drives should be mounted as owned by my user account instead of root:root (this would enable me to create network shares for folders on external USB harddrives with NTFS without resorting to sub-par security).

Changed in samba:
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.