Any samba users out there who could test this one?

What you need to do is the following:

git clone https://gitlab.com/xiota/garuda-pkgbuilds.git
git switch pr_samba-support
cd samba-support
makepkg -Si

Then check whether the given configuration succeeds. Thanks! :slight_smile:

1 Like

==> Making package: samba-support 2023.12.07-1 (Fr 08 Dez 2023 23:59:41 CET)
==> Retrieving sources…
→ Found samba-support.smb.conf
→ Found samba-support.sysusers.conf
==> Validating source files with sha256sums…
samba-support.smb.conf … Passed
samba-support.sysusers.conf … Passed
==> Entering fakeroot environment…
==> Creating source package…
→ Adding PKGBUILD…
→ Generating .SRCINFO file…
→ Adding samba-support.smb.conf…
→ Adding samba-support.sysusers.conf…
→ Adding install file (samba-support.install)…
→ Compressing source package…
==> Leaving fakeroot environment.
==> Source package created: samba-support (Fr 08 Dez 2023 23:59:43 CET)

Summary

amba.service - Samba AD Daemon
Loaded: loaded (/usr/lib/systemd/system/samba.service; disabled; preset: disabled)
Active: failed (Result: exit-code) since Sat 2023-12-09 00:11:58 CET; 2min 5s ago
Docs: man:samba(8)
man:samba(7)
man:smb.conf(5)
Process: 61555 ExecStart=/usr/bin/samba --foreground --no-process-group $SAMBAOPTIONS (code=exited, status=1/FAILURE)
Main PID: 61555 (code=exited, status=1/FAILURE)
Status: “daemon failed to start: Samba detected misconfigured ‘server role’ and exited. Check logs for details”
Error: 22 (Invalid argument)
CPU: 74ms

Dez 09 00:11:57 n17 samba[61555]: daemon_status: daemon ‘samba’ : Starting process…
Dez 09 00:11:58 n17 samba[61555]: [2023/12/09 00:11:58.010032, 0] …/…/source4/samba/server.c:863(binary_smbd_main)
Dez 09 00:11:58 n17 samba[61555]: At this time the ‘samba’ binary should only be used for either:
Dez 09 00:11:58 n17 samba[61555]: ‘server role = active directory domain controller’ or the rpc proxy with ‘dcerpc endpoint servers = remote’
Dez 09 00:11:58 n17 samba[61555]: You should start smbd/nmbd/winbindd instead for domain member and standalone file server tasks
Dez 09 00:11:58 n17 samba[61555]: [2023/12/09 00:11:58.010172, 0] …/…/lib/util/become_daemon.c:119(exit_daemon)
Dez 09 00:11:58 n17 samba[61555]: exit_daemon: daemon failed to start: Samba detected misconfigured ‘server role’ and exited. Check logs for details, error code 22
Dez 09 00:11:58 n17 systemd[1]: samba.service: Main process exited, code=exited, status=1/FAILURE
Dez 09 00:11:58 n17 systemd[1]: samba.service: Failed with result ‘exit-code’.
Dez 09 00:11:58 n17 systemd[1]: Failed to start Samba AD Daemon.

smb.conf

[global]
workgroup = WORKGROUP
dns proxy = no
log file = /var/log/samba/%m.log
max log size = 1000
client min protocol = SMB2
server min protocol = SMB2
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = NewUNIXpassword %n\n ReTypenewUNIXpassword* %n\n passwd:allauthenticationtokensupdatedsuccessfully*
pam password change = yes
map to guest = Bad Password
usershare allow guests = yes
name resolve order = lmhosts bcast host wins
security = user
guest account = nobody
usershare path = /var/lib/samba/usershare
usershare max shares = 100
usershare owner only = yes
force create mode = 0070
force directory mode = 0070

[homes]
comment = Home Directories
browseable = no
read only = yes
create mask = 0700
directory mask = 0700
valid users = %S

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no

First step was fine but second got this - im running smb daemon but not running any shares off this PC so not sure if that matters

╰─λ git switch pr_samba-support
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

oops i didnt go into the right directory before running step 2

╰─λ makepkg -Si
==> Making package: samba-support 2023.12.07-1 (Sat 09 Dec 2023 11:23:24)
==> Retrieving sources…
→ Found samba-support.smb.conf
→ Found samba-support.sysusers.conf
==> Validating source files with sha256sums…
samba-support.smb.conf … Passed
samba-support.sysusers.conf … Passed
==> Entering fakeroot environment…
==> Creating source package…
→ Adding PKGBUILD…
→ Generating .SRCINFO file…
→ Adding samba-support.smb.conf…
→ Adding samba-support.sysusers.conf…
→ Adding install file (samba-support.install)…
→ Compressing source package…
==> Leaving fakeroot environment.
==> Source package created: samba-support (Sat 09 Dec 2023 11:23:25)

worked

Thank you! I might have been unclear about the last part, let me clarify it:

What I meant by this is verifying whether the following is executed successfully (and smb stuff still works):

Changes that affect system security:

Uses systemd-sysusers to create sambashare group.
Does not add users to the group on install.
Does not delete the group on uninstall.
Prints messages on install, update, uninstall.
Sets group owner (recursive) of /var/lib/samba/usershares to sambashare on install.
Sets group owner (recursive) of /var/lib/samba/usershares to root on uninstall, if not empty.

General packaging changes:

Change system-config-samba optdep to mx-samba-config (-git).
Move depends inside package function to reduce resource usage during build.
Change /var/lib/samba/usershare to usershares for compatibility with mx-samba-config.

Install and upgrade message:

==> NOTE: The group 'sambashare' has been created,
==>       and is the group owner of the folder:
==>           /var/lib/samba/usershares
==>
==> NOTE: To add users to 'sambashare':
==>           usermod -a -G sambashare [username]


Uninstall message:

==> NOTE: The group 'sambashare' was created on install.
==>       Do not forget to check file ownership
==>       before removing the group with the command:
==>           groupdel sambashare
==>
==> NOTE: The following folder was created on install.
==>           /var/lib/samba/usershares
==>       Do not forget to check content ownership
==>       before removing the folder.