vfs: check userland buffers before reading them.
[haiku.git] / src / libs / bsd / usershell.c
blob403c5192d17a32329476b49b097721a3180ef791
1 /*
2 * Copyright 2008, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Axel Dörfler, axeld@pinc-software.de
7 */
10 #include <unistd.h>
12 static const char* const kShells[] = {
13 "/bin/sh",
14 "/bin/bash",
15 NULL
17 static int sShellIndex;
20 char *
21 getusershell(void)
23 if (kShells[sShellIndex] == NULL)
24 return NULL;
26 return (char*)kShells[sShellIndex++];
30 void
31 endusershell(void)
33 sShellIndex = 0;
37 void
38 setusershell(void)
40 sShellIndex = 0;