Closed jrmarino closed 4 years ago
FWIW, this is the c_os.c patch I used, and now with the 2 patches, I can build sparforte on DragonFly (and FreeBSD)
--- src/c_os.c.orig 2020-03-28 23:21:57 UTC
+++ src/c_os.c
@@ -16,7 +16,7 @@
#include <stdio.h>
#include <limits.h>
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__)
int group_member(gid_t gid) {
int ngroups, i, ret;
int groups[NGROUPS_MAX];
I just piggy-backed on APPLE fix for the missing group_member function.
I didn't get a chance to test FreeBSD against the last version.
I used the group members function after examining the Bash source code. This will allow SparForte to check for group read/write/execute permissions across all the groups that a person belongs to.
Apparently this was a Linux-specific feature. I didn't notice this while looking at the source code.
Thanks for the patch.
I will release a 2.3.1 version shortly which will include the patches. Thanks.
sparforte can't possibly build on freebsd. This patch fixes one problem:
Another problem is group_member function isn't available on freebsd (c_os.c) but it's used unconditionally in C_is_executable_file. That's a problem that requires opening another issue I think.