Skip to content

Commit e4c6131

Browse files
committed
crypt module (Steve M's)
1 parent 7a325c3 commit e4c6131

4 files changed

Lines changed: 37 additions & 320 deletions

File tree

Modules/Setup.guido

Lines changed: 0 additions & 160 deletions
This file was deleted.

Modules/Setup.irix5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ dbm dbmmodule.o # dbm(3) may require -ldbm or similar
6565
fcntl fcntlmodule.o # fcntl(2) and ioctl(2)
6666
nis nismodule.o # Sun yellow pages -- not everywhere
6767
pwd grp pwdmodule.o # pwd(3) and grp(3)
68+
crypt cryptmodule.o # crypt(3)
6869
select selectmodule.o # select(2); not on ancient System V
6970
socket socketmodule.o # socket(2); not on ancient System V
7071

Modules/Setup.minix

Lines changed: 0 additions & 160 deletions
This file was deleted.

Modules/cryptmodule.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)