source: rtems/cpukit/telnetd/genpw.c @ 94e04b5

5
Last change on this file since 94e04b5 was ddeb7730, checked in by Joel Sherrill <joel.sherrill@…>, on 03/27/10 at 15:08:04

2010-03-27 Joel Sherrill <joel.sherrill@…>

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