openwrt / openwrt/packages

samba4: cannot connect due to permission denied on share_info.tdb

Open
#20,452 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Maintainer: @Gingernut1978
Environment: ARMv5TE, ZyXEL NSA325-Feroceon 88FR131, OpenWrt SNAPSHOT r21997-b5193291bd

Description:
I just installed a fresh snapshot of OpenWrt and I run into a new problem while trying to connect to my smb shares.
The connection is refused and I found this in /var/log/log.rpcd_classic

[2023/02/06 00:26:56,  0] ../../source3/rpc_server/rpc_worker.c:1105(rpc_worker_main)
  rpcd_classic version 4.17.2 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2022
[2023/02/06 00:26:57,  0] ../../source3/lib/sharesec.c:161(share_info_db_init)
  Failed to open share info database /var/lib/samba/share_info.tdb (Permission denied)
[2023/02/06 00:26:57,  0] ../../source3/lib/sharesec.c:161(share_info_db_init)
  Failed to open share info database /var/lib/samba/share_info.tdb (Permission denied)
[2023/02/06 00:26:57,  0] ../../source3/lib/sharesec.c:161(share_info_db_init)
  Failed to open share info database /var/lib/samba/share_info.tdb (Permission denied)
[2023/02/06 00:26:57,  0] ../../source3/lib/sharesec.c:161(share_info_db_init)
  Failed to open share info database /var/lib/samba/share_info.tdb (Permission denied)
[2023/02/06 00:26:57,  0] ../../source3/lib/sharesec.c:161(share_info_db_init)
  Failed to open share info database /var/lib/samba/share_info.tdb (Permission denied)

The permissions on /var/lib/samba/share_info.tdb are set to rw for root only, if I add rw for other users and restart the service I can connect and it works as usual.
If I restart the system the permissions are back to rw for root only, I guess the files in /var/lib/samba/ are re-created at boot.
I'm on samba4-server v4.17.2-2

This was not happening on samba4-server v4.14.12-1, OpenWrt SNAPSHOT r18717-0e32c6baf3.
I preserved the old configuration. I backed up and copied to the new installation the following files:

/etc/config/samba4
/etc/samba/secrets.tdb
/etc/samba/smb.conf.template
/etc/samba/smbpasswd
/etc/avahi/services/smb.service

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing how samba4-server v4.17.2-2 creates or opens /var/lib/samba/share_info.tdb after boot against v4.14.12-1. Check the permissions and startup behavior around that database, using the reported rpcd_classic error and the listed Samba configuration files as context; done means shares connect without manually changing permissions and the permissions persist after restart.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.