xiaoxiang781216 commented on code in PR #3532:
URL: https://github.com/apache/nuttx-apps/pull/3532#discussion_r3464556292
##########
netutils/dropbear/port/nuttx_compat.c:
##########
@@ -0,0 +1,78 @@
+/****************************************************************************
+ * apps/netutils/dropbear/port/nuttx_compat.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "config.h"
+
+#include <sys/types.h>
+#include <errno.h>
+#include <grp.h>
+#include <unistd.h>
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static char g_dropbear_shell[] = "/bin/sh";
+static int g_shell_returned;
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+void dropbear_setusershell(void)
+{
+ g_shell_returned = 0;
+}
+
+FAR char *dropbear_getusershell(void)
+{
+ if (g_shell_returned == 0)
+ {
+ g_shell_returned = 1;
+ return g_dropbear_shell;
+ }
+
+ return NULL;
+}
+
+void dropbear_endusershell(void)
+{
+ g_shell_returned = 0;
+}
+
+int dropbear_getgroups(int size, gid_t list[])
+{
+ (void)size;
+ (void)list;
+
+ errno = ENOSYS;
+ return -1;
+}
+
+int link(FAR const char *path1, FAR const char *path2)
Review Comment:
Ok, since NuttX VFS doesn't support the hard link yet, so it's better to set
errno to ENOSYS at
https://github.com/apache/nuttx/blob/master/fs/vfs/fs_link.c#L63.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]