Question regarding shell user creation at login time

From: Ganbold (ganbold_at_micom.mng.net)
Date: 03/25/04

  • Next message: Fred Clift: "Re: Diagnosing unrecognized hardware"
    Date: Thu, 25 Mar 2004 18:19:54 +0800
    To: freebsd-hackers@freebsd.org
    
    

    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 <stdio.h>
    #include <unistd.h>

    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

    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Fred Clift: "Re: Diagnosing unrecognized hardware"

    Relevant Pages

    • Question regarding shell user creation at login time
      ... Perl script creates user account. ... But when I try to login as user new and when I type password the window ... When I run su new from console and after I type password it seems just ...
      (freebsd-current)
    • Re: tsmmc.msc and process failure on logoff
      ... TS Team Blogs: ... as soon as anyone logs on to a console session on the ... You can check the user account as follows: ...
      (microsoft.public.windows.terminal_services)
    • RE: blank ISA console
      ... The console is back! ... > user account, delete the profile and then logon by using that problematic ... > If the issue still exists, we may perform the following steps to repair ISA: ... > Microsoft CSS Online Newsgroup Support ...
      (microsoft.public.windows.server.sbs)
    • Re: WHY can NOT open files in the aspx Page under IIS6?
      ... Yes, you CAN change the user account ASP.NET uses, but you'd be more secure ... This posting is provided "AS IS" with no warranties, and confers no rights. ... > I can open the file in CONSOLE application.but can NOT in ASP.Net. ... >>>I can open file in the CONSOLE process ...
      (microsoft.public.inetserver.iis.security)
    • Trash and linkage?
      ... I am building a Perl script and work on it at home and at work. ... I use Kate for the source and open a separate console to test with. ... So what happened is that I sent to trash a subdirectory that my console ... in the same place that the console window is looking at. ...
      (comp.os.linux.misc)