file sharing net usershare returns error 255

Bug #1972057 reported by heny
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
MATE Desktop
Fix Released
Unknown
Ubuntu MATE
Invalid
Undecided
Unassigned
caja (Ubuntu)
Invalid
Undecided
Unassigned
Jammy
Invalid
Undecided
Unassigned
Kinetic
Invalid
Undecided
Unassigned
caja-extensions (Ubuntu)
Fix Released
Undecided
Lena Voytek
Jammy
Fix Released
Undecided
Lena Voytek
Kinetic
Fix Released
Undecided
Lena Voytek
samba (Ubuntu)
Invalid
Undecided
Unassigned
Jammy
Invalid
Undecided
Unassigned
Kinetic
Invalid
Undecided
Unassigned

Bug Description

[Impact]

When using caja with caja-share installed, creating a shared folder fails with the result: "'net usershare' returned error 255."

With this feature failing, users running Ubuntu MATE or caja in general are unable to share new folders on the network.

In order to fix this, one argument was changed from -l to --long in the net usershare call for creating a share. This will not affect older versions of net usershare as both --long and -l were previously valid arguments.

[Test Plan]

Using Ubuntu MATE:

# sudo apt install caja-share
# killall caja
# caja

In the caja file browser right click on a folder then select "Sharing Options"
In the File Sharing menu, select "Share this folder" then "Create Share"

Without the fix, it will then reply with "'net usershare' returned error 255"

[Where problems could occur]

net usershare's arguments can change outside of caja-extension's perview, so if --long is removed as -l was this can become an issue again.
If caja's interface fails to create a shared folder, the workaround would be to use the cli interface starting with "net usershare add --long ..."

This change modifies caja's interaction with net usershare, so any regression would be limited to the behavior of caja creating a shared folder.

[Other Info]

The issue was fixed in Kinetic in version 1.26.0-1ubuntu1.

[Original Description]

Installing samba will not solve the problem.
It doesn't work either: sudo chmod 777 /var/lib/samba/usershares
And editing /etc/samba/smb.conf doesn't work either: added the line "usershare owner only = False"

Ubuntumate 22.04

Related branches

heny (heny67)
description: updated
Norbert (nrbrtx)
tags: added: jammy
Revision history for this message
Norbert (nrbrtx) wrote :

Please add exact steps to reproduce and also run

apport-collect 1972057

Norbert (nrbrtx)
Changed in ubuntu-mate:
status: New → Confirmed
Changed in caja (Ubuntu):
status: New → Confirmed
Changed in caja-extensions (Ubuntu):
status: New → Confirmed
Changed in samba (Ubuntu):
status: New → Confirmed
Changed in mate-desktop:
status: Unknown → New
Revision history for this message
Morbius1 (morbius1) wrote :

Some observations:

I can reproduce the original error when I use caja to create a share of my Public folder ( /home/tester/Public ).

The error log at /home/tester/Public/log.net is:

"net usershare add: share name /home/tester/public contains invalid characters (any of %<>*?|/\+=;:",)"

There are two things odd about that error message:

I'm not sharing /home/tester/public. I'm sharing /home/tester/Public

There are no invalid characters with that path.

I should note that if I create the usershare manually in a terminal:

~$ net usershare add Public /home/tester/Public "" Everyone:F guest_ok=y

I get no errors and the share is created successfully:

~$ net usershare info --long
[Public]
path=/home/tester/Public
comment=
usershare_acl=Everyone:F,
guest_ok=y

Revision history for this message
heny (heny67) wrote :

Helló!

In the caja file manager, I select the directory I want to share.
Right mouse button -> sharing settings
Select the Share Folder check box -> Activate the Create Share button
Net usershare 255 error code

Contents of the log.net file:
net usershare: cannot open usershare directory / var / lib / samba / usershares. Error No such file or directory
Please ask your system administrator to enable user sharing.

And the directory you're looking for really doesn't exist.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

A quick grep shows that bin:caja-share from src:caja-extensions needs the same patch[1] as nautilus-share. Note I didn't see the "-l" parameter being used in any of the above comments, though, so it might be something else. But "-l" is definitely no longer accepted in samba 4.15.x.

1. https://git.launchpad.net/ubuntu/+source/nautilus-share/commit/?id=3ef14c2846ae7d1242cf1ea4358165abea0a03c0

Revision history for this message
Norbert (nrbrtx) wrote :

The patch from upstream ( https://github.com/mate-desktop/caja-extensions/pull/108/files ) is now attached.

Please apply it.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "patch from https://github.com/mate-desktop/caja-extensions/pull/108" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in mate-desktop:
status: New → Fix Released
Revision history for this message
yosi_666 (alonso-juste) wrote :

How can we apply the patch in Ubuntu 22.04/Mint 21?

Revision history for this message
Lena Voytek (lvoytek) wrote :

Hello,
I added the caja-extensions patch to Ubuntu 22.04 with a ppa here - https://launchpad.net/~lvoytek/+archive/ubuntu/caja-extensions-fix-samba-share. If you would like to test the fix you can add it to your system with the following commands:

sudo add-apt-repository ppa:lvoytek/caja-extensions-fix-samba-share
sudo apt update
sudo apt upgrade

Let me know if this works and if so I can get an SRU ready to add it to 22.04 by default.

I'll mark the other packages listed in the bug as invalid since the fix is related to caja-extensions.

Changed in caja (Ubuntu):
status: Confirmed → Invalid
Changed in ubuntu-mate:
status: Confirmed → Invalid
Changed in samba (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Xopek Endurance (xopek3of3endurance) wrote :

Lena Voytek (lvoytek), Your patch work perfectly, it helps me to turn on share in Ubuntu Mate 22.04 without error 255, thank You

Revision history for this message
Lena Voytek (lvoytek) wrote :

That's great to hear, I'll get started on adding the fix to 22.04 and beyond

Lena Voytek (lvoytek)
Changed in samba (Ubuntu Jammy):
status: New → Invalid
Changed in caja (Ubuntu Jammy):
status: New → Invalid
Changed in caja-extensions (Ubuntu Kinetic):
status: Confirmed → In Progress
assignee: nobody → Lena Voytek (lvoytek)
Changed in caja-extensions (Ubuntu Jammy):
assignee: nobody → Lena Voytek (lvoytek)
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package caja-extensions - 1.26.0-1ubuntu1

---------------
caja-extensions (1.26.0-1ubuntu1) kinetic; urgency=medium

  * d/p/fix-caja-share-long-param.patch: Fix samba sharing by changing -l
    parameter to --long in arguments (LP: #1972057)

 -- Lena Voytek <email address hidden> Wed, 24 Aug 2022 05:57:06 -0700

Changed in caja-extensions (Ubuntu Kinetic):
status: In Progress → Fix Released
Lena Voytek (lvoytek)
description: updated
Lena Voytek (lvoytek)
description: updated
Lena Voytek (lvoytek)
description: updated
Bryce Harrington (bryce)
Changed in caja-extensions (Ubuntu Jammy):
status: In Progress → Fix Committed
Revision history for this message
yosi_666 (alonso-juste) wrote :

Lena Voytek (lvoytek) , thanks!

Revision history for this message
Robie Basak (racb) wrote :

This is in the SRU review queue for Jammy, so should be In Progress, not Fix Committed (yet).

Changed in caja-extensions (Ubuntu Jammy):
status: Fix Committed → In Progress
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello heny, or anyone else affected,

Accepted caja-extensions into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/caja-extensions/1.26.0-1ubuntu0.22.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in caja-extensions (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Lena Voytek (lvoytek) wrote :

Verified via Ubuntu MATE Jammy VM by running the following after startup:

$ sudo apt update && sudo apt upgrade -y
$ sudo apt install caja-share

Opened Caja
In the caja file browser right clicked on Documents folder then selected "Sharing Options"
In the File Sharing menu, selected "Share this folder" then "Create Share"
The dialog replied with "'net usershare' returned error 255"
Closed Caja

Next I enabled proposed:

$ sudo su
# cat <<EOF >/etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list
# Enable Ubuntu proposed archive
deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe
EOF
# exit
$ sudo apt update && sudo apt upgrade -y

Opened Caja
In the caja file browser right clicked on Documents then selected "Sharing Options"
In the File Sharing menu, selected "Share this folder" then "Create Share"
Dialog closed and share icon showed up successfully

tags: added: verification-done-jammy
removed: verification-needed-jammy
Lena Voytek (lvoytek)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package caja-extensions - 1.26.0-1ubuntu0.22.04.1

---------------
caja-extensions (1.26.0-1ubuntu0.22.04.1) jammy; urgency=medium

  * d/p/fix-caja-share-long-param.patch: Fix samba sharing by changing -l
    parameter to --long in arguments (LP: #1972057)

 -- Lena Voytek <email address hidden> Thu, 25 Aug 2022 07:37:16 -0700

Changed in caja-extensions (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for caja-extensions has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.