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

make suidinstall fails on Alpine Linux #538

Open
gresskar opened this issue Sep 29, 2024 · 1 comment
Open

make suidinstall fails on Alpine Linux #538

gresskar opened this issue Sep 29, 2024 · 1 comment

Comments

@gresskar
Copy link

System information

OS Name: Alpine Linux edge
OS Version: 3.21.0_alpha20240923
Kernel: Linux host 6.6.52-0-lts # 1-Alpine SMP PREEMPT_DYNAMIC 2024-09-19 07:41:43 x86_64 Linux
CPU: 12th Gen Intel(R) Core(TM) i5-1235U
Clang version 18.1.8

Error information

Compilation went fine, but when running doas make suidinstall I got the errors:

capture_antsdr_droneid.c:256:25: error: call to undeclared function 'gethostbyname'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  256 |     if ((connect_host = gethostbyname(localdrone->host)) == NULL) {
      |                         ^
capture_antsdr_droneid.c:256:25: note: did you mean 'gethostname'?
/usr/include/unistd.h:124:5: note: 'gethostname' declared here
  124 | int gethostname(char *, size_t);
      |     ^
capture_antsdr_droneid.c:256:23: error: incompatible integer to pointer conversion assigning to 'struct hostent *' from 'int' [-Wint-conversion]
  256 |     if ((connect_host = gethostbyname(localdrone->host)) == NULL) {
      |                       ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
capture_antsdr_droneid.c:263:42: error: incomplete definition of type 'struct hostent'
  263 |     client_sock.sin_family = connect_host->h_addrtype;
      |                              ~~~~~~~~~~~~^
capture_antsdr_droneid.c:185:12: note: forward declaration of 'struct hostent'
  185 |     struct hostent *connect_host;
      |            ^
capture_antsdr_droneid.c:264:65: error: incomplete definition of type 'struct hostent'
  264 |     memcpy((char *) &(client_sock.sin_addr.s_addr), connect_host->h_addr_list[0],
      |                                                     ~~~~~~~~~~~~^
capture_antsdr_droneid.c:185:12: note: forward declaration of 'struct hostent'
  185 |     struct hostent *connect_host;
      |            ^
capture_antsdr_droneid.c:265:25: error: incomplete definition of type 'struct hostent'
  265 |             connect_host->h_length);
      |             ~~~~~~~~~~~~^
capture_antsdr_droneid.c:185:12: note: forward declaration of 'struct hostent'
  185 |     struct hostent *connect_host;
      |            ^
5 errors generated.
make[2]: *** [Makefile:19: capture_antsdr_droneid.c.o] Error 1
make[2]: Leaving directory '/home/user/.build/kismet/capture_antsdr_droneid'
make[1]: *** [Makefile:433: capture_antsdr_droneid/kismet_cap_antsdr_droneid] Error 2
make[1]: Leaving directory '/home/user/.build/kismet'
make: *** [Makefile:680: suidinstall] Error 2

How to fix

Simply append #include <netdb.h> to the capture_antsdr_droneid/capture_antsdr_droneid.c file

@gresskar
Copy link
Author

The same thing happens on Arch Linux as well

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

1 participant