Annotation of 40BSD/cmd/berknet/netlogin.c, revision 1.1.1.1

1.1       root        1: /*
                      2:        netlogin - specify login name and password in environment
                      3: */
                      4: # include "defs.h"
                      5: 
                      6: /* global variables */
                      7: struct userinfo status;
                      8: 
                      9: main(argc,argv)
                     10:        char **argv;
                     11: {
                     12:        char mch, stemp[20], sencpasswd[30];
                     13: # ifdef V6
                     14:        fprintf(stderr,"The netlogin command doesn't work on Version 6 UNIX\n");
                     15:        exit(EX_UNAVAILABLE);
                     16: # endif
                     17:        mch = 0;
                     18:        status.login[0] = 0;
                     19:        status.mpasswd[0] = 0;
                     20:        while(argc > 1 && argv[1][0] == '-'){
                     21:                argc--;
                     22:                argv++;
                     23:                switch(argv[0][1]){
                     24:                case 'm':
                     25:                        harg(stemp,&argc,&argv);
                     26:                        mch = lookup(stemp);
                     27:                        if(mch == 0){
                     28:                                fprintf(stderr,"Bad machine %s\n",stemp);
                     29:                                exit(EX_NOHOST);
                     30:                        }
                     31:                        break;
                     32:                case 'l':
                     33:                        harg(status.login,&argc,&argv);
                     34:                        break;
                     35:                default:
                     36:                        usage();
                     37:                        break;
                     38:                }
                     39:        }
                     40:        if(mch == 0)usage();
                     41:        passwdent();
                     42:        promptlogin(mch);
                     43:        if(strcmp(status.mpasswd,"\"\"") == 0)status.mpasswd[0] = 0;
                     44:        mkpwunclear(status.mpasswd,mch,sencpasswd);
                     45:        printf("%s,%s\n",status.login,sencpasswd);
                     46:        exit(EX_OK);
                     47: }
                     48: usage(){
                     49:        fprintf(stderr,"Usage: netlogin -m mach [-l username]\n");
                     50:        exit(EX_USAGE);
                     51: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.