From owner-freebsd-current@FreeBSD.ORG Thu Mar 25 20:49:50 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0DBA116A4CE for ; Thu, 25 Mar 2004 20:49:50 -0800 (PST) Received: from publicd.ub.mng.net (publicd.ub.mng.net [202.179.0.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CBD343D39 for ; Thu, 25 Mar 2004 20:49:49 -0800 (PST) (envelope-from ganbold@micom.mng.net) Received: from [202.179.0.164] (helo=ganbold.micom.mng.net) by publicd.ub.mng.net with asmtp (Exim 4.30; FreeBSD) id 1B6jDA-0002vS-M9 for freebsd-current@freebsd.org; Fri, 26 Mar 2004 12:44:52 +0800 Message-Id: <6.0.3.0.2.20040326125438.029f8390@202.179.0.80> X-Sender: ganbold@micom.mng.net@202.179.0.80 X-Mailer: QUALCOMM Windows Eudora Version 6.0.3.0 Date: Fri, 26 Mar 2004 12:54:49 +0800 To: freebsd-current@freebsd.org From: Ganbold Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Question regarding shell user creation at login time X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 04:49:50 -0000 Hi, I'm using FreeBSD 5.2-CURRENT and I'm trying to write a small C program which in turn calls perl script. Perl script creates user account. I created user called "new" and put new.c and new.pl into its directory. Then I changed shell for user new to point to /home/new/new. The idea is I want to run free shell server. When first time some user logs in as user new it should execute new.pl and ask to enter user name etc. and creates new account. My new.c program is: -------------------------------------------------------------- #include #include int main(void) { char *env[] = { "TERM=vt100", (char *)0 }; execle("/home/new/new.pl","new.pl",(char *)0,env); return 0; } -------------------------------------------------------------- I compile it and make it setuid root: gcc new.c -o new chmod 4750 new chown root:new new -------------------------------------------------------------- # ls -l -r--r----- 1 root new 767 Mar 24 17:43 .cshrc -r--r----- 1 root new 2 Mar 25 15:41 .hushlogin -r--r----- 1 root new 248 Mar 24 17:43 .login -r--r----- 1 root new 158 Mar 24 17:43 .login_conf -r--r----- 1 root new 373 Mar 24 17:43 .mail_aliases -r--r----- 1 root new 331 Mar 24 17:43 .mailrc -r--r----- 1 root new 797 Mar 24 17:43 .profile -r--r----- 1 root new 276 Mar 24 17:43 .rhosts -r--r----- 1 root new 975 Mar 24 17:43 .shrc -rwsr-x--- 1 root new 4549 Mar 25 17:37 new ---------- 1 root wheel 173 Mar 25 17:37 new.c -r-x------ 1 root wheel 15430 Mar 25 15:16 new.pl -rw-r--r-- 1 root wheel 52 Mar 25 16:52 new.sh But when I try to login as user new and when I type password the window just closes. When I run su new from console and after I type password it seems just exits without doing nothing. new.pl works fine without any problem if I run ./new from console. Can somebody give me some hints and advices to help me solve this problem? Is there any other configuration changes I need? Like /etc/login.conf etc? I'm new to this kind of issue and I appreciate if somebody in this list help me. TIA, Ganbold