"Fossies" - the Fresh Open Source Software Archive

Member "delegate9.9.13/subin/dgsetlogin.c" (31 Jan 2010, 1239 Bytes) of package /linux/misc/old/delegate9.9.13.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "dgsetlogin.c" see the Fossies "Dox" file reference documentation.

    1 /*////////////////////////////////////////////////////////////////////////
    2 Copyright (c) 2010 National Institute of Advanced Industrial Science and Technology (AIST)
    3 
    4 Permission to use this material for evaluation, copy this material for
    5 your own use, and distribute the copies via publically accessible on-line
    6 media, without fee, is hereby granted provided that the above copyright
    7 notice and this permission notice appear in all copies.
    8 AIST MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY OF THIS
    9 MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", WITHOUT ANY EXPRESS
   10 OR IMPLIED WARRANTIES.
   11 /////////////////////////////////////////////////////////////////////////
   12 Content-Type:   program/C; charset=US-ASCII
   13 Program:    dgforkpty.c
   14 Author:     Yutaka Sato <ysato@delegate.org>
   15 Description:
   16 History:
   17     100131  created
   18 //////////////////////////////////////////////////////////////////////#*/
   19 #include <stdio.h>
   20 #include <errno.h>
   21 #include "dgxauth.c"
   22 
   23 int main(int ac,char *av[]){
   24     IStr(user,128);
   25     int rcode;
   26 
   27     dgxauth(ac,av);
   28     if( ac < 2 ){
   29         fprintf(stderr,"Usage: dgsetlogin username\n");
   30         return -1;
   31     }
   32     strcpy(user,av[1]);
   33     rcode = setlogin(user);
   34     fprintf(stderr,"--setlogin(%s)=%d, e%d\n",user,rcode,errno);
   35     return rcode;
   36 }