Hi,
I'd like to port libnetconf2 over to QNX. Below I've summarized the issues in no particular order.
Let me know if you want more details for any of these issues. Aside from issue 2, I can submit patches for the rest. If you do want patches, how would you want them divided?
fd_set and friends are defined in #include <sys/select.h> on QNX. The relevant file is session_client.c.
asprintf, vasprintf and strndup are used in io.c, messages_server.c, session.c and session_client.c but are not available on QNX. Would it be possible to provide a compat.c similar to this commit in libyang?
#include <sys/syscall.h> is not available on QNX. It's used in session_client.c. Would it be possible to put it in a #ifdef __linux__ wrapper, as the only time it's called is in a section of code also delimited by #ifdef __linux__?
- In
session_server.c, nc_accept_unix relies on SO_PEERCRED. I think it would be possible to provide an alternate implementation that would cover the BSDs and as a result QNX (networking stack is NetBSD) and perhaps MAC (due to Darwin). getpeereid could be used to get the euid which in turn could be used for the rest of nc_accept_unix. See here for details and here for QNX documentation. What are your thoughts on this?
- QNX links against
-llogin instead of -lcrypt for the crypt() function. See target_link_libraries(netconf2 "-L${LIBSSH_LIBRARY_DIR}" -lssh -lcrypt) in CMakeLists.txt.
- In
session_server_ssh.c, QNX doesn't provide #include <crypt.h>. It does however provide #include <shadow.h>.
- In
session_server_ssh.c, getspnam_r is used in auth_password_get_pwd_hash. getspnam_r is defined differently for QNX compared to linux. In QNX it returns what would otherwise be obtained from the fifth parameter. Here's the doc.
Hi,
I'd like to port libnetconf2 over to QNX. Below I've summarized the issues in no particular order.
Let me know if you want more details for any of these issues. Aside from issue 2, I can submit patches for the rest. If you do want patches, how would you want them divided?
fd_setand friends are defined in#include <sys/select.h>on QNX. The relevant file issession_client.c.asprintf,vasprintfandstrndupare used inio.c,messages_server.c,session.candsession_client.cbut are not available on QNX. Would it be possible to provide acompat.csimilar to this commit in libyang?#include <sys/syscall.h>is not available on QNX. It's used insession_client.c. Would it be possible to put it in a#ifdef __linux__wrapper, as the only time it's called is in a section of code also delimited by#ifdef __linux__?session_server.c,nc_accept_unixrelies onSO_PEERCRED. I think it would be possible to provide an alternate implementation that would cover the BSDs and as a result QNX (networking stack is NetBSD) and perhaps MAC (due to Darwin).getpeereidcould be used to get theeuidwhich in turn could be used for the rest ofnc_accept_unix. See here for details and here for QNX documentation. What are your thoughts on this?-llogininstead of-lcryptfor thecrypt()function. Seetarget_link_libraries(netconf2 "-L${LIBSSH_LIBRARY_DIR}" -lssh -lcrypt)inCMakeLists.txt.session_server_ssh.c, QNX doesn't provide#include <crypt.h>. It does however provide#include <shadow.h>.session_server_ssh.c,getspnam_ris used inauth_password_get_pwd_hash.getspnam_ris defined differently for QNX compared to linux. In QNX it returns what would otherwise be obtained from the fifth parameter. Here's the doc.