From bbba0b7f939e59a82b509905f369a89f5d6b5bcf Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Sat, 29 Aug 2020 18:25:56 +0000 Subject: [PATCH] FreeBSD: Define crgetzoneid appropriately The previous ZFS implementation on FreeBSD had ifdefs to use jailed() instead of crgetzoneid() in dsl_dir.c, however we can simply provide an appropriate definition of crgetzoneid for the same effect. Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #10851 --- include/os/freebsd/spl/sys/cred.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/os/freebsd/spl/sys/cred.h b/include/os/freebsd/spl/sys/cred.h index e32910e0ef..86f79011d6 100644 --- a/include/os/freebsd/spl/sys/cred.h +++ b/include/os/freebsd/spl/sys/cred.h @@ -93,7 +93,7 @@ extern cred_t *zone_kcred(void); extern gid_t crgetrgid(const cred_t *); extern gid_t crgetsgid(const cred_t *); -#define crgetzoneid(x) (0) +#define crgetzoneid(cr) ((cr)->cr_prison->pr_id) extern projid_t crgetprojid(const cred_t *); extern cred_t *crgetmapped(const cred_t *);