From: Marius S. <li...@sc...> - 2025-04-27 18:57:09
|
This morning my FreeBSD Poudriere build system updated SSHGuard to version 2.5.0. When I attempted to update the MacPorts Portfile (I’m the maintainer), I got the following build error: ../common/sandbox.c:43:9: error: call to undeclared function 'setresgid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 43 | if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1) { | ^ ../common/sandbox.c:43:9: note: did you mean 'setregid'? /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/unistd.h:593:6: note: 'setregid' declared here 593 | int setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid); | ^ ../common/sandbox.c:46:9: error: call to undeclared function 'setresuid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 46 | if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1) { | ^ 2 errors generated. make[2]: *** [sandbox.o] Error 1 There is no “setresgid" function in macOS. It should be defined in <unistd.h>, but doesn’t appear there. It appears to be a GNU/Linux function (which FreeBSD also implements). Marius -- Marius Schamschula |
From: Kevin Z. <kev...@gm...> - 2025-04-28 18:54:26
|
Thanks for the report, Marius. Could you check that the latest version in Git (or any revision after 90df5477) fixes the issue for you? Regards, Kevin |
From: Alexei A. <ale...@gm...> - 2025-04-28 23:07:41
|
hi guys, piggy backing on this thread (also posted my build error), getting this on OmniOS - just tried with git latest, the error is slightly different from what I got using 2.5.0 tarball. -- Best regards, Aleksey Anisimov root@test:~/sshguard# make Making all in src make[1]: Entering directory '/root/sshguard/src' Making all in blocker make[2]: Entering directory '/root/sshguard/src/blocker' CC sandbox.o ../common/sandbox.c: In function 'init_log': ../common/sandbox.c:14:18: warning: implicit declaration of function 'getenv' [-Wimplicit-function-declaration] 14 | int debug = (getenv("SSHGUARD_DEBUG") != NULL); | ^~~~~~ ../common/sandbox.c:6:1: note: 'getenv' is defined in header '<stdlib.h>'; did you forget to '#include <stdlib.h>'? 5 | #include "sandbox.h" +++ |+#include <stdlib.h> 6 | ../common/sandbox.c:14:43: warning: comparison between pointer and integer 14 | int debug = (getenv("SSHGUARD_DEBUG") != NULL); | ^~ ../common/sandbox.c:19:18: error: 'LOG_PERROR' undeclared (first use in this function); did you mean 'LOG_ERR'? 19 | flags |= LOG_PERROR; | ^~~~~~~~~~ | LOG_ERR ../common/sandbox.c:19:18: note: each undeclared identifier is reported only once for each function it appears in ../common/sandbox.c: In function 'droproot': ../common/sandbox.c:36:9: warning: implicit declaration of function 'initgroups'; did you mean 'setgroups'? [-Wimplicit-function-declaration] 36 | if (initgroups(user, pw->pw_gid) == -1) { | ^~~~~~~~~~ | setgroups ../common/sandbox.c:39:9: warning: implicit declaration of function 'setresgid'; did you mean 'setregid'? [-Wimplicit-function-declaration] 39 | if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1) { | ^~~~~~~~~ | setregid ../common/sandbox.c:42:9: warning: implicit declaration of function 'setresuid'; did you mean 'setreuid'? [-Wimplicit-function-declaration] 42 | if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1) { | ^~~~~~~~~ | setreuid ../common/sandbox.c: In function 'sandbox_init': ../common/sandbox.c:48:18: warning: initialization of 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 48 | char *user = getenv("SSHGUARD_USER"); | ^~~~~~ make[2]: *** [Makefile:408: sandbox.o] Error 1 make[2]: Leaving directory '/root/sshguard/src/blocker' make[1]: *** [Makefile:430: all-recursive] Error 1 make[1]: Leaving directory '/root/sshguard/src' make: *** [Makefile:481: all-recursive] Error 1 root@test:~/sshguard# On Tue, 29 Apr 2025 at 04:55, Kevin Zheng <kev...@gm...> wrote: > Thanks for the report, Marius. > > Could you check that the latest version in Git (or any revision after > 90df5477) fixes the issue for you? > > Regards, > Kevin > > > _______________________________________________ > sshguard-users mailing list > ssh...@li... > https://lists.sourceforge.net/lists/listinfo/sshguard-users > |
From: Kevin Z. <kev...@gm...> - 2025-04-28 23:41:29
|
Hi Alexei, Thanks for the report. It sounds like OmniOS requires different header files for the syslog functions. Could you check (via man pages) what header files are required for getenv() and the syslog stuff? Does OmniOS have setresgid? The version in Git now has setresgid detection via configure, can you double check that you're using the right version? Also not sure why it's complaining about missing stdlib.h, when that is clearly included at the top of that file... I don't run OmniOS, but if you're able to figure out what changes are necessary and send me a patch, I can incorporate that into the next release. Regards, Kevin |
From: Alexei A. <ale...@gm...> - 2025-05-02 12:05:12
|
Hi Kevin and thanks ! so I managed to compile it by adding this ifdef to the sandbox.c (see below). However now make install is also failing - because I think in OmniOS this is all in /opt/local/ instead root@test:~/sshguard# make install Making install in src make[1]: Entering directory '/root/sshguard/src' Making install in blocker make[2]: Entering directory '/root/sshguard/src/blocker' make[3]: Entering directory '/root/sshguard/src/blocker' mkdir -p '/usr/local/libexec' mkdir: /usr/local: cannot create intermediate directory [No such file or directory] make[3]: *** [Makefile:325: install-libexecPROGRAMS] Error 1 make[3]: Leaving directory '/root/sshguard/src/blocker' make[2]: *** [Makefile:546: install-am] Error 2 make[2]: Leaving directory '/root/sshguard/src/blocker' make[1]: *** [Makefile:430: install-recursive] Error 1 make[1]: Leaving directory '/root/sshguard/src' make: *** [Makefile:481: install-recursive] Error 1 -- Best regards, Aleksey Anisimov root@test:~/sshguard# diff src/common/sandbox.c src/common/sandbox.c.orig 23,25c23 < #ifdef LOG_PERROR < flags |= LOG_PERROR; < #endif --- > flags |= LOG_PERROR; On Tue, 29 Apr 2025 at 09:41, Kevin Zheng <kev...@gm...> wrote: > Hi Alexei, > > Thanks for the report. > > It sounds like OmniOS requires different header files for the syslog > functions. Could you check (via man pages) what header files are > required for getenv() and the syslog stuff? > > Does OmniOS have setresgid? The version in Git now has setresgid > detection via configure, can you double check that you're using the > right version? > > Also not sure why it's complaining about missing stdlib.h, when that is > clearly included at the top of that file... > > I don't run OmniOS, but if you're able to figure out what changes are > necessary and send me a patch, I can incorporate that into the next > release. > > Regards, > Kevin > |