source: rtems/cpukit/telnetd/genpw.c @ 2aa8014

4.104.11
Last change on this file since 2aa8014 was 8ad6681b, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 25, 2007 at 5:14:01 PM

2007-09-25 Joel Sherrill <joel.sherrill@…>

  • telnetd/README, telnetd/pty.c, telnetd/pty.h, telnetd/telnetd.c, telnetd/telnetd.h: telnetd rewrite.
  • telnetd/check_passwd.c, telnetd/des.c, telnetd/genpw.c: New files.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1#include <crypt.h>
2#include <stdio.h>
3#include <unistd.h>
4
5/*
6 * Authorship
7 * ----------
8 * This software was created by
9 *     Till Straumann <strauman@slac.stanford.edu>, 2003-2007
10 *         Stanford Linear Accelerator Center, Stanford University.
11 *
12 * Acknowledgement of sponsorship
13 * ------------------------------
14 * This software was produced by
15 *     the Stanford Linear Accelerator Center, Stanford University,
16 *         under Contract DE-AC03-76SFO0515 with the Department of Energy.
17 *
18 * Government disclaimer of liability
19 * ----------------------------------
20 * Neither the United States nor the United States Department of Energy,
21 * nor any of their employees, makes any warranty, express or implied, or
22 * assumes any legal liability or responsibility for the accuracy,
23 * completeness, or usefulness of any data, apparatus, product, or process
24 * disclosed, or represents that its use would not infringe privately owned
25 * rights.
26 *
27 * Stanford disclaimer of liability
28 * --------------------------------
29 * Stanford University makes no representations or warranties, express or
30 * implied, nor assumes any liability for the use of this software.
31 *
32 * Stanford disclaimer of copyright
33 * --------------------------------
34 * Stanford University, owner of the copyright, hereby disclaims its
35 * copyright and all other rights in this software.  Hence, anyone may
36 * freely use it for any purpose without restriction. 
37 *
38 * Maintenance of notices
39 * ----------------------
40 * In the interest of clarity regarding the origin and status of this
41 * SLAC software, this and all the preceding Stanford University notices
42 * are to remain affixed to any copy or derivative of this software made
43 * or distributed by the recipient and are to be affixed to any copy of
44 * software made or distributed by the recipient that contains a copy or
45 * derivative of this software.
46 *
47 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
48 */ 
49static void
50usage(char *nm)
51{
52  fprintf(stderr,"Usage: %s [-h] [-s salt] cleartext_password\n", nm);
53}
54
55int
56main(int argc, char **argv)
57{
58int ch;
59char *salt="td";
60  while ( (ch=getopt(argc, argv, "hs:")) >=0 ) {
61    switch (ch) {
62      default:  fprintf(stderr,"Unknown Option '%c'\n",ch);
63      case 'h': usage(argv[0]);
64      return 0;
65      case 's': salt=optarg;
66      break;
67    }
68  }
69  if ( optind >= argc ) {
70    usage(argv[0]);
71    return 1;
72  }
73  printf("#define TELNETD_DEFAULT_PASSWD \"%s\"\n",crypt(argv[optind],salt));
74}
Note: See TracBrowser for help on using the repository browser.