| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7a325c3 commit e4c6131
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,6 +65,7 @@ dbm dbmmodule.o # dbm(3) may require -ldbm or similar | |||
| 65 | 65 | fcntl fcntlmodule.o # fcntl(2) and ioctl(2) | |
| 66 | 66 | nis nismodule.o # Sun yellow pages -- not everywhere | |
| 67 | 67 | pwd grp pwdmodule.o # pwd(3) and grp(3) | |
| 68 | + crypt cryptmodule.o # crypt(3) | ||
| 68 | 69 | select selectmodule.o # select(2); not on ancient System V | |
| 69 | 70 | socket socketmodule.o # socket(2); not on ancient System V | |
| 70 | 71 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,36 @@ | |||
| 1 | + /* cryptmodule.c - by Steve Majewski | ||
| 2 | + */ | ||
| 3 | + | ||
| 4 | + #include "allobjects.h" | ||
| 5 | + #include "modsupport.h" | ||
| 6 | + | ||
| 7 | + #include <sys/types.h> | ||
| 8 | + | ||
| 9 | + | ||
| 10 | + /* Module crypt */ | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + static object *crypt_crypt(self, args) | ||
| 14 | + object *self, *args; | ||
| 15 | + { | ||
| 16 | + char *word, *salt; | ||
| 17 | + extern char * crypt(); | ||
| 18 | + | ||
| 19 | + struct passwd *p; | ||
| 20 | + if (!getargs(args, "(ss)", &word, &salt)) { | ||
| 21 | + return NULL; | ||
| 22 | + } | ||
| 23 | + return newstringobject( crypt( word, salt ) ); | ||
| 24 | + | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + static struct methodlist crypt_methods[] = { | ||
| 28 | + {"crypt", crypt_crypt}, | ||
| 29 | + {NULL, NULL} /* sentinel */ | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + void | ||
| 33 | + initcrypt() | ||
| 34 | + { | ||
| 35 | + initmodule("crypt", crypt_methods); | ||
| 36 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments