FelipeMdeO commented on code in PR #3532:
URL: https://github.com/apache/nuttx-apps/pull/3532#discussion_r3468851322
##########
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[])
Review Comment:
Sorry @xiaoxiang781216, I tried but couldn't apply this request.
That getgroups() is only used by Dropbear's non-multiuser sanity check,
which expects it to fail with ENOSYS to confirm a non-multiuser kernel.
getgrouplist() can't replace it. It's a group-database lookup that always
returns at least the primary group passed in by the caller.
In short, I want to check if the kernel is single user, and getgrouplist
returns other thing.
--
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]