[Gllug] Bash problem

t.clarke tim at seacon.co.uk
Tue Apr 1 14:29:38 UTC 2003


Thanks for the responses regarding my 'bash' problem

I have taken the 'kludge' route around the problem for now as follows:-

1) unlink /bin/sh from /bin/bash
2) create new /bin/sh prog as follows:-



main(argc, argv)
int argc;
char *argv[];
{
close(2);
dup(1);
execv("/bin/bash",argv);
}


Then, when the cobol program or whatever does a system call the fake shell
closes off stderr and re-opens it to same fd as stdout and then execs the
real shell.
Afterthought:
It relies upon stderr always being fd 2  - fair assumption ???
(if not I can always do close(fileno(stderr)) I suppose).



Any potential problems with this approach ?????


Tim

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list