Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build failure with freebsd; patch attached #18

Closed
jrmarino opened this issue Apr 11, 2020 · 3 comments
Closed

build failure with freebsd; patch attached #18

jrmarino opened this issue Apr 11, 2020 · 3 comments

Comments

@jrmarino
Copy link

jrmarino commented Apr 11, 2020

sparforte can't possibly build on freebsd. This patch fixes one problem:

--- src/os_bindings/spar_freebsd.ads.orig       2020-03-28 23:21:57 UTC
+++ src/os_bindings/spar_freebsd.ads
@@ -653,7 +653,7 @@ pragma import( C, C_is_includable_file,
 --  True if a file exists, is readable, not world writable and has data
 -- (that is, that it has permissions for an include file)

-function C_is_secure_dir( char * path ) return boolean;
+function C_is_secure_dir( path : string ) return boolean;
 pragma import( C, C_is_secure_dir, "C_is_secure_dir" );
 --  True if a dir exists, is readable, not world writable.

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.

@jrmarino
Copy link
Author

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.

@kburtch
Copy link
Owner

kburtch commented Apr 11, 2020

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.

@kburtch
Copy link
Owner

kburtch commented Apr 11, 2020

I will release a 2.3.1 version shortly which will include the patches. Thanks.

@kburtch kburtch closed this as completed Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants