Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed caja-share not working under Arch Linux #108

Merged
merged 1 commit into from May 17, 2022

Conversation

Knucklesfan
Copy link
Contributor

Found a very minor syntax error with the share feature in Caja which prevented me from being able to start samba shares under Arch Linux. Literally changed one line and fixed the problem.

Very minor syntax error with the samba command.
@lukefromdc lukefromdc requested a review from a team January 9, 2022 07:18
@lukefromdc
Copy link
Member

Can someone who has a Windows machine to test Samba sharing test this? I don't know how to use Samba and do not have any Windows boxes at all.

@rbuj
Copy link
Contributor

rbuj commented Jan 9, 2022

There is no syntax error, as both selectors are still supported, using samba 4.14.11 on Fedora 34.

[robert@fedora ~]$ net help usershare
Usage:
net usershare add
    Add/modify user defined share
net usershare delete
    Delete user defined share
net usershare info
    Display information about a user defined share
net usershare list
    List user defined shares
[robert@fedora ~]$ net help usershare add
net usershare add [-l|--long] <sharename> <path> [<comment>] [<acl>] [<guest_ok=[y|n]>]
	Adds the specified share name for this user.
	<sharename> is the new share name.
	<path> is the path on the filesystem to export.
	<comment> is the optional comment for the new share.
	<acl> is an optional share acl in the format "DOMAIN\name:X,DOMAIN\name:X,...."
	<guest_ok=y> if present sets "guest ok = yes" on this usershare.
		"X" represents a permission and can be any one of the characters f, r or d
		where "f" means full control, "r" means read-only, "d" means deny access.
		name may be a domain user or group. For local users use the local server name instead of "DOMAIN"
		The default acl is "Everyone:r" which allows everyone read-only access.
	Add -l or --long to print the info on the newly added share.
[robert@fedora caja-extensions]$ rpm -qf /usr/bin/net
samba-common-tools-4.14.11-0.fc34.x86_64
[robert@fedora caja-extensions]$ rpm -qi samba-common-tools
Name        : samba-common-tools
Epoch       : 2
Version     : 4.14.11
Release     : 0.fc34
Architecture: x86_64
Install Date: dissabte, 1 de gener de 2022, 10:02:52
Group       : Unspecified
Size        : 1266206
License     : GPLv3+ and LGPLv3+
Signature   : RSA/SHA256, dijous, 16 de desembre de 2021, 09:59:28, Key ID 1161ae6945719a39
Source RPM  : samba-4.14.11-0.fc34.src.rpm
Build Date  : dijous, 16 de desembre de 2021, 01:18:50
Build Host  : buildhw-x86-11.iad2.fedoraproject.org
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : https://www.samba.org
Bug URL     : https://bugz.fedoraproject.org/samba
Summary     : Tools for Samba servers and clients
Description :
The samba-common-tools package contains tools for Samba servers and
SMB/CIFS clients.

@rbuj
Copy link
Contributor

rbuj commented Jan 9, 2022

Upstream syntax:

		"net usershare add [-l|--long] <sharename> <path> [<comment>] [<acl>] [<guest_ok=[y|n]>]\n"

https://github.com/samba-team/samba/blob/master/source3/utils/net_usershare.c#L73

@Knucklesfan
Copy link
Contributor Author

Apologies for the delayed response, using Samba Version 4.15.3, Caja version 1.26.0 and package caja-extensions-commons yields this result without the above modification.
error
I used only packages from the official arch repository, no 3rd party packages from the AUR were used.
Although the two mean effectively the same thing and can both be used together, this appears to be an issue for both caja-share and nautilus-share, although nobody has made an issue or PR for that either. For the time being, this can easily be fixed with a one line code modification.

@vkareh
Copy link
Member

vkareh commented Mar 22, 2022

I can't for the life of me figure out how to run the net usershare, and I'm not interesting in samba shares myself, but this change looks benign and improves compatibility. Also, I prefer explicit flags when needed in source code.

@rbuj if the command allows both -l and --long, then there's no reason to block this PR. Code compiles and runs well for me anyway. LGTM

Copy link
Contributor

@rbuj rbuj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rbuj rbuj merged commit 8f18ddd into mate-desktop:master May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants