From d1dc42cc732b7ef011a4ed89b0fcda6501ee729a Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 24 Apr 2008 16:07:02 +0000 Subject: [PATCH] "/bin/bash" is a valid shell, too. ftpd doesn't allow anyone to login, who has a shell not returned by getusershell(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25128 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/libs/bsd/usershell.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libs/bsd/usershell.c b/src/libs/bsd/usershell.c index 4eb5dd817b..403c5192d1 100644 --- a/src/libs/bsd/usershell.c +++ b/src/libs/bsd/usershell.c @@ -9,17 +9,21 @@ #include - +static const char* const kShells[] = { + "/bin/sh", + "/bin/bash", + NULL +}; static int sShellIndex; char * getusershell(void) { - if (sShellIndex++ == 0) - return "/bin/sh"; + if (kShells[sShellIndex] == NULL) + return NULL; - return NULL; + return (char*)kShells[sShellIndex++]; }