|
1617
|
1 /* cryptmodule.c - by Steve Majewski
|
|
|
2 */
|
|
|
3
|
|
|
4 #include "allobjects.h"
|
|
|
5
|
|
|
6 #include <sys/types.h>
|
|
|
7
|
|
|
8
|
|
|
9 /* Module crypt */
|
|
|
10
|
|
|
11
|
|
|
12 static object *crypt_crypt(self, args)
|
|
|
13 object *self, *args;
|
|
|
14 {
|
|
|
15 char *word, *salt;
|
|
|
16 extern char * crypt();
|
|
|
17
|
|
|
18 struct passwd *p;
|
|
|
19 if (!getargs(args, "(ss)", &word, &salt)) {
|
|
|
20 return NULL;
|
|
|
21 }
|
|
|
22 return newstringobject( crypt( word, salt ) );
|
|
|
23
|
|
|
24 }
|
|
|
25
|
|
|
26 static struct methodlist crypt_methods[] = {
|
|
|
27 {"crypt", crypt_crypt},
|
|
|
28 {NULL, NULL} /* sentinel */
|
|
|
29 };
|
|
|
30
|
|
|
31 void
|
|
|
32 initcrypt()
|
|
|
33 {
|
|
|
34 initmodule("crypt", crypt_methods);
|
|
|
35 }
|