Avoid double call to getenv in chroot
This commit is contained in:
parent
c258d7d0b6
commit
5e9c4d781b
6
chroot.c
6
chroot.c
|
@ -7,10 +7,10 @@ static void usage(void);
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *shell[] = {"/bin/sh", "-i", NULL};
|
char *shell[] = {"/bin/sh", "-i", NULL}, *aux;
|
||||||
|
|
||||||
if(getenv("SHELL"))
|
if(aux = getenv("SHELL"))
|
||||||
shell[0] = getenv("SHELL");
|
shell[0] = aux;
|
||||||
|
|
||||||
if(argc < 2)
|
if(argc < 2)
|
||||||
usage();
|
usage();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user