summaryrefslogtreecommitdiffstats
path: root/lib/libskey
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-10-17 15:22:46 +0000
committerache <ache@FreeBSD.org>1996-10-17 15:22:46 +0000
commitc728108ed25838da821f685e038156e966e6b431 (patch)
tree6e2878a0204ed25fc052fdc6a86f02cf8fe98bfa /lib/libskey
parent76fa87e93d6457909de5988f81f282edcfb599d8 (diff)
downloadFreeBSD-src-c728108ed25838da821f685e038156e966e6b431.zip
FreeBSD-src-c728108ed25838da821f685e038156e966e6b431.tar.gz
Prevent namespace pollution cause by this library by splitting to
API and non-API functions and giving _sk_ prefix for all non-API functions. Old names will be available by _SKEY_INTERNAL define it allows not change anything in keyinit & key, only -D_SKEY_INTERNAL required. Staticise some things.
Diffstat (limited to 'lib/libskey')
-rw-r--r--lib/libskey/Makefile2
-rw-r--r--lib/libskey/put.c2
-rw-r--r--lib/libskey/skey.h23
-rw-r--r--lib/libskey/skeylogin.c4
4 files changed, 23 insertions, 8 deletions
diff --git a/lib/libskey/Makefile b/lib/libskey/Makefile
index ebbac7a..b91ab0b 100644
--- a/lib/libskey/Makefile
+++ b/lib/libskey/Makefile
@@ -5,7 +5,7 @@ SRCS= skeyaccess.c put.c skey_crypt.c skey_getpass.c skeylogin.c skeysubr.c
MAN1= skey.1
MAN5= skey.access.5
-CFLAGS+=-DPERMIT_CONSOLE -I${.CURDIR}
+CFLAGS+=-DPERMIT_CONSOLE -D_SKEY_INTERNAL -I${.CURDIR}
beforeinstall:
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/skey.h \
diff --git a/lib/libskey/put.c b/lib/libskey/put.c
index cc7429a..5c9eaea 100644
--- a/lib/libskey/put.c
+++ b/lib/libskey/put.c
@@ -10,7 +10,7 @@ static void insert __P((char *s, int x, int start, int length));
static int wsrch __P((char *w,int low,int high));
/* Dictionary for integer-word translations */
-char Wp[2048][4] = {
+static char Wp[2048][4] = {
"A",
"ABE",
"ACE",
diff --git a/lib/libskey/skey.h b/lib/libskey/skey.h
index 6cf9d95..208d14d 100644
--- a/lib/libskey/skey.h
+++ b/lib/libskey/skey.h
@@ -14,6 +14,7 @@ struct skey {
long recstart; /*needed so reread of buffer is efficient*/
};
+#ifdef _SKEY_INTERNAL
/* Client-side structure for scanning data stream for challenge */
struct mc {
char buf[256];
@@ -21,6 +22,18 @@ struct mc {
int cnt;
};
+#define atob8 _sk_atob8
+#define btoa8 _sk_btoa8
+#define btoe _sk_btoe
+#define etob _sk_etob
+#define f _sk_f
+#define htoi _sk_htoi
+#define keycrunch _sk_keycrunch
+#define put8 _sk_put8
+#define readpass _sk_readpass
+#define rip _sk_rip
+#define sevenbit _sk_sevenbit
+
void f __P((char *x));
int keycrunch __P((char *result,char *seed,char *passwd));
char *btoe __P((char *engout,char *c));
@@ -30,14 +43,16 @@ int btoa8 __P((char *out, char *in));
int htoi __P((char c));
int etob __P((char *out,char *e));
void sevenbit __P((char *s));
+char *readpass __P((char *buf, int n));
void rip __P((char *buf));
-int skeychallenge __P((struct skey *mp,char *name, char *challenge));
-int skeyinfo __P((struct skey *mp, char* name, char *ss));
-int skeylookup __P((struct skey *mp,char *name));
-int skeyverify __P((struct skey *mp,char *response));
+#endif /* _SKEY_INTERNAL */
/* Simplified application programming interface. */
#include <pwd.h>
+int skeylookup __P((struct skey *mp,char *name));
+int skeyverify __P((struct skey *mp,char *response));
+int skeychallenge __P((struct skey *mp,char *name, char *challenge));
+int skeyinfo __P((struct skey *mp, char* name, char *ss));
int skeyaccess __P((char *user, char *port, char *host, char *addr));
char *skey_getpass __P((char *prompt, struct passwd *pwd, int pwok));
char *skey_crypt __P((char *pp, char *salt, struct passwd *pwd, int pwok));
diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c
index d4de744..a90fac1 100644
--- a/lib/libskey/skeylogin.c
+++ b/lib/libskey/skeylogin.c
@@ -22,8 +22,7 @@
#include "skey.h"
#include "pathnames.h"
-char *skipspace();
-int skeylookup __P((struct skey *mp,char *name));
+static char *skipspace();
#define setpriority(x,y,z) /* nothing */
@@ -296,6 +295,7 @@ register char *out,*in;
return 0;
}
+static
char *
skipspace(cp)
register char *cp;
OpenPOWER on IntegriCloud