git: 9e9e06725ba1 - main - net/samba419: Fix startup script in a jail environment

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

URL: https://cgit.FreeBSD.org/ports/commit/?id=9e9e06725ba1e9475da8f6e02ae81b32044dee88

commit 9e9e06725ba1e9475da8f6e02ae81b32044dee88
Author:     Yoshihiro Takahashi <nyan@FreeBSD.org>
AuthorDate: 2024-05-26 12:17:36 +0000
Commit:     Yoshihiro Takahashi <nyan@FreeBSD.org>
CommitDate: 2024-05-26 12:17:36 +0000

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

diff --git a/net/samba419/Makefile b/net/samba419/Makefile
index 66f012b8065e..8bdb0ed8ae1f 100644
--- a/net/samba419/Makefile
+++ b/net/samba419/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=			${SAMBA4_BASENAME}419
 PORTVERSION=			${SAMBA4_VERSION}
+PORTREVISION=			1
 CATEGORIES?=			net
 MASTER_SITES=			SAMBA/samba/stable SAMBA/samba/rc
 DISTNAME=			${SAMBA4_DISTNAME}
diff --git a/net/samba419/files/samba_server.in b/net/samba419/files/samba_server.in
index b45811dd9f4d..99c9b64cc78d 100644
--- a/net/samba419/files/samba_server.in
+++ b/net/samba419/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
 }