Bug 11566 - net command emits spurious message when run by normal user.
Summary: net command emits spurious message when run by normal user.
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.3.1
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-21 16:03 UTC by Markus Mitsch
Modified: 2021-02-11 14:15 UTC (History)
2 users (show)

See Also:


Attachments
git-am fix for 4.3.next. (1.06 KB, patch)
2015-10-30 18:16 UTC, Jeremy Allison
ddiss: review+
Details
git-am fix for 4.2.next. (1016 bytes, patch)
2015-10-30 18:17 UTC, Jeremy Allison
ddiss: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Mitsch 2015-10-21 16:03:21 UTC
i cant use usershares. "net usershare info" always says "invalid ownership on directory /var/cache/samba/msg.lock"

permissions are:

drwxr-xr-x 2 root root   4096 21. Okt 17:48 msg.lock

im in group sambashare and directory /var/lib/samba/usershare is set up:


drwxrwx--T 2 root sambashare   4096 21. Okt 17:23 usershares

smb.conf:

[global]
        server string = Samba Server
        security = USER
        log file = /var/log/samba/%m.log
        max log size = 50
        dns proxy = No
        usershare allow guests = Yes
        usershare max shares = 100
        usershare owner only = No
        idmap config * : backend = tdb
Comment 1 Jeremy Allison 2015-10-27 23:14:32 UTC
Turns out this is an invalid error message when being invoked from the 'net' command.

The code path that emits this message is source3/utils/net.c:main()

        /*
         * Failing to init the msg_ctx isn't a fatal error. Only root-level
         * things (joining/leaving domains etc.) will be denied.
         */
        c->msg_ctx = messaging_init(c, samba_tevent_context_init(c));

which ends up inside directory_create_or_exist_strict() which is checking /var/cache/samba/msg.lock which is printing the message at debug zero if the uid's don't match.

I think that debug level should be raised, as messaging_init() is often called by non-root code.

The local usershares should still work though.
Comment 2 Jeremy Allison 2015-10-30 18:16:35 UTC
Created attachment 11557 [details]
git-am fix for 4.3.next.

Cherry-picked from master.
Comment 3 Jeremy Allison 2015-10-30 18:17:00 UTC
Created attachment 11558 [details]
git-am fix for 4.2.next.

Back-ported from master.
Comment 4 Jeremy Allison 2015-11-03 22:51:49 UTC
Re-assigning to Karolin for inclusion in 4.3.next, 4.2.next.
Comment 5 Markus Mitsch 2015-11-04 16:32:24 UTC
it may be that usershares by command line still work. but i think that this message prevents creating shares with dolphin file manager from working.

mfg
Comment 6 Jeremy Allison 2015-11-04 16:46:23 UTC
Thanks for the update - the bug fix is scheduled to go into the next release anyway so you should be good to go.
Comment 7 Karolin Seeger 2015-11-06 11:30:40 UTC
(In reply to Jeremy Allison from comment #4)
Pushed to autobuild-v4-[2|3]-test.
Comment 8 Karolin Seeger 2015-11-16 09:17:57 UTC
(In reply to Karolin Seeger from comment #7)
Pushed to both branches.
Closing out bug report.

Thanks!