git: 8a7135132699 - main - net/samba416: Fix startup script in a jail environment

From: Yoshihiro Takahashi <nyan_at_FreeBSD.org>
Date: Sun, 26 May 2024 12:19:26 UTC
The branch main has been updated by nyan:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8a7135132699c731ec53f0f9664d772211eba3b7

commit 8a7135132699c731ec53f0f9664d772211eba3b7
Author:     Yoshihiro Takahashi <nyan@FreeBSD.org>
AuthorDate: 2024-05-26 12:16:36 +0000
Commit:     Yoshihiro Takahashi <nyan@FreeBSD.org>
CommitDate: 2024-05-26 12:16:36 +0000

    net/samba416: Fix startup script in a jail environment
    
    PR:             275343
    Approved by:    maintainer timeout (6 months)
    Approved by:    mikael (samba419 maintainer, ports committer)
---
 net/samba416/Makefile              |  2 +-
 net/samba416/files/samba_server.in | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/net/samba416/Makefile b/net/samba416/Makefile
index a3518fbafe51..d83f339028f6 100644
--- a/net/samba416/Makefile
+++ b/net/samba416/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=			${SAMBA4_BASENAME}416
 PORTVERSION=			${SAMBA4_VERSION}
-PORTREVISION=			4
+PORTREVISION=			5
 CATEGORIES?=			net
 MASTER_SITES=			SAMBA/samba/stable SAMBA/samba/rc
 DISTNAME=			${SAMBA4_DISTNAME}
diff --git a/net/samba416/files/samba_server.in b/net/samba416/files/samba_server.in
index b45811dd9f4d..99c9b64cc78d 100644
--- a/net/samba416/files/samba_server.in
+++ b/net/samba416/files/samba_server.in
@@ -225,10 +225,12 @@ can_mount()
     if ! load_kld $kld; then
         return 1
     fi
-    if [ $(${SYSCTL_N} security.jail.jailed) -eq 0 ] ||
-        [ $(${SYSCTL_N} security.jail.mount_allowed) -eq 1 ] ||
-        [ $(${SYSCTL_N} security.jail.mount_${kld}_allowed) -eq 1 ]; then
-            return 0
+    if [ $(${SYSCTL_N} security.jail.jailed) -eq 0 ]; then
+        return 0
+    fi
+    if [ $(${SYSCTL_N} security.jail.mount_allowed) -eq 1 ] &&
+       [ $(${SYSCTL_N} security.jail.mount_${kld}_allowed) -eq 1 ]; then
+        return 0
     fi
     return 1
 }