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: }
Defined functions
main
defined in line
9;
never used
usage
defined in line
48; used 2 times
Defined variables
status
defined in line
7; used 7 times