summaryrefslogtreecommitdiff
path: root/www/wn/files/patch-ab
blob: 1d94f7c826bb18ac9b4b35a62a7ecc73b1cf4b9c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
*** authwn/authwn.c.old	Fri May 24 16:32:44 1996
--- authwn/authwn.c	Thu Aug 29 02:09:41 1996
***************
*** 27,32 ****
--- 27,35 ----
  
  #ifdef DBM_AUTH
  #include <dbm.h>
+ #elif defined(DB_AUTH)
+ #include <fcntl.h>
+ #include <db.h>
  #endif
  
  #include "../config.h"
***************
*** 123,128 ****
--- 126,135 ----
  #ifdef DBM_AUTH
  	datum		content,
  			key;
+ #elif defined(DB_AUTH)
+ 	DBT		content,
+ 			key;
+ 	DB		*db;
  #endif
  
  
***************
*** 168,173 ****
--- 175,193 ----
  			codedpw[content.dsize] = '\0';
  		}
  		dbmclose( pwpath);
+ #elif defined(DB_AUTH)
+ 		key.data = user;
+ 		key.size = strlen(user);
+ 
+ 		db = dbopen(pwpath, O_RDONLY, 0, DB_HASH, NULL);
+ 		if (db == NULL) {
+ 			exit(AUTHERR_NUM5);
+ 		}
+ 		if ((db->get)(db , &key, &content, 0) == 0) {
+ 			strncpy(codedpw, content.data, content.size);
+ 			codedpw[content.size] = '\0';
+ 		}
+ 		(db->close)(db);
  #else
  		exit( AUTHERR_NUM8);
  #endif
*** authwn/Makefile.old	Thu Jul 13 07:17:29 1995
--- authwn/Makefile	Wed Aug 28 19:46:22 1996
***************
*** 4,20 ****
  #You will likely have to change DBMLIB to whatever library contains
  # the DBM functions dbminit(), fetch() and dbmclose() on your system.
  #DBMLIB = -ldbm
! #DBMFLAG =  -DDBM_AUTH
  
! 
! CFLAGS = -I../wn/ -O $(DBMFLAG)
  
  OBJS = authwn.o
  
  all:	authwn
  
  authwn: $(OBJS)
! 	$(CC) $(CFLAGS) -o authwn $(OBJS) $(LIBS) $(DBMLIB)
  
  install:	authwn
  	@echo "Installing authwn in $(BINDIR)"
--- 4,20 ----
  #You will likely have to change DBMLIB to whatever library contains
  # the DBM functions dbminit(), fetch() and dbmclose() on your system.
  #DBMLIB = -ldbm
! DBMFLAG =  -DDB_AUTH
  
! DCFLAGS= -I../wn/ -O
! CFLAGS = $(DCFLAGS) $(DBMFLAG)
  
  OBJS = authwn.o
  
  all:	authwn
  
  authwn: $(OBJS)
! 	$(CC) $(DCFLAGS) -o authwn $(OBJS) $(LIBS) $(DBMLIB)
  
  install:	authwn
  	@echo "Installing authwn in $(BINDIR)"
*** Makefile.old	Wed Aug 28 19:29:10 1996
--- Makefile	Wed Aug 28 19:48:33 1996
***************
*** 64,70 ****
  
  authwn/authwn: config.h
  	@echo "Making authwn"
! 	(cd authwn; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" \
  		BINDIR="$(BINDIR)" )
  
  inst-wn:
--- 64,70 ----
  
  authwn/authwn: config.h
  	@echo "Making authwn"
! 	(cd authwn; $(MAKE) CC="$(CC)" DCFLAGS="$(CFLAGS)" LIBS="$(LIBS)" \
  		BINDIR="$(BINDIR)" )
  
  inst-wn: