Add support for strlcpy()

Too many places in xrdp use strncpy() to copy strings to fixed-length
buffers, when this is not the correct function to use.

This PR makes sure strlcpy() from the BSDs is available as a saner
alternative. This function is available by default on Linux and FreeBSD.
This commit is contained in:
matt335672
2025-03-25 10:37:45 +00:00
parent aac4946558
commit 960ea7ce05
3 changed files with 59 additions and 1 deletions
+1 -1
View File
@@ -238,7 +238,7 @@ AM_COND_IF([DEVEL_DEBUG],
AC_SEARCH_LIBS([setusercontext], [util])
# Define HAVE_XXXXX macros for some system functions
AC_CHECK_FUNCS([setusercontext getgrouplist clearenv])
AC_CHECK_FUNCS([setusercontext getgrouplist clearenv strlcpy])
# The type used by getgrouplist() is the same type used by getgroups()
AC_TYPE_GETGROUPS