Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-unix!husc6!mit-eddie!ll-xn!cit-vax!oberon!sdcrdcf!trwrb!scgvaxd!ashtate!unisol!haral From: haral@unisol.UUCP Newsgroups: comp.unix.wizards Subject: Re: HELP: stop job (csh) su because of tty output Message-ID: <277@unisol.UUCP> Date: Mon, 25-May-87 20:57:06 EDT Article-I.D.: unisol.277 Posted: Mon May 25 20:57:06 1987 Date-Received: Wed, 27-May-87 03:15:17 EDT References: <275@dcc1.UUCP> Reply-To: haral@unisol.UUCP (Haral Tsitsivas) Organization: UniSolutions Associates, Culver City, CA Lines: 30 Keywords: stop jobs, csh, su > douglas@dcc1.UUCP (Douglas B. Jones) writes: > After compiling (instruction in program) the program below, I > execute it with: > %a.out username > %^D> > > > (now in users csh shell) > (I typed in the control-d above and exited back to my shell). > After leaving the shell, I get the message that my a.out program > is stopped due to tty output. I must then do a: > %fg > to get it to continue the program. > ... >Xsprintf(buf,"/bin/su %s",argv[1]); Your problem will go away if you execute the user's shell directly and don't use "su" or other programs that set the first character of the shell to "-" as in "-csh" to signify a login shell. I am not sure why this is true but you will notice the same problem when you set argv[0] to "-anything" as part of the exec system call. I first noticed this on the Mt. Xinu 4.3 release and I guess is part of the standard 4.3 release. I don't think the problem (or feature) existed in 4.2. Note that if you don't call "su" you have to "setuid" and maybe "setgid" (in a sub-process) to get the same effect. --Haral Tsitsivas UniSolutions Associates (213) 641-6739 ...!seismo!scgvaxd!ashtate!unisol!haral