draios / sysdig

Linux system exploration and troubleshooting tool with first class support for containers
http://www.sysdig.com/
Other
7.68k stars 728 forks source link

implicit declaration of function 'strlcpy'; did you mean 'strscpy'? #2077

Closed jfly closed 3 months ago

jfly commented 3 months ago

It looks like the Linux kernel recently dropped the strlcpy function: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=57f22c8dab6b266ae36b89b073a4a33dea71e762, which is preventing me from building sysdig with errors like this:

/build/source/build/driver/src/ppm_events.c: In function 'val_to_ring':
/build/source/build/driver/src/ppm_events.c:652:36: error: implicit declaration of function 'strlcpy'; did you mean 'strscpy'? [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Werror=implicit-function-declaration8;;]
  652 |                         len = (int)strlcpy(args->buffer + args->arg_data_offset,
      |                                    ^~~~~~~
      |                                    strscpy
SebTM commented 3 months ago

Hey, fyi - I had the same issue and for NixOS we can patch it for certain kernel-versions like this: https://github.com/NixOS/nixpkgs/pull/300630/files#diff-d7c05622bef53ebc52172fc79725acbdcd6663638d515c27f8909e9989bd8756R79

Not nice/optimal but a solution until fixed upstream 🙏🏻

therealbobo commented 3 months ago

Hey @jfly! Thanks for the issue! Please refer to https://github.com/falcosecurity/libs for any driver related issue: we relay on libs for the drivers :)

jfly commented 3 months ago

Ah, ok. Closing in favor of https://github.com/falcosecurity/libs/issues/1740!