Commit 253cffef authored by Andrew Price's avatar Andrew Price
Browse files

Remove the dependency on cproto

"There is a limit to the time assigned you, and if you don't use it to
free yourself it will be gone and never return."
                                               -- Marcus Aurelius
parent 56a2f88a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ src/client/mw
src/mw
src/mwserv
src/mwtest
src/nonce.h
src/nonce-def.h
src/server/mwserv
src/utils/del_user
src/utils/fixuser
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ Requires: readline sqlite curl
#Requires(post): systemd-units
#Requires(preun): systemd-units
#Requires(postun): systemd-units
BuildRequires: libtermcap-devel readline-devel glibc-devel sqlite-devel curl-devel openssl-devel jansson-devel postgresql-devel cproto
BuildRequires: libtermcap-devel readline-devel glibc-devel sqlite-devel curl-devel openssl-devel jansson-devel postgresql-devel
URL: http://projects.sucs.org/projects/mw/

%description
+4 −5
Original line number Diff line number Diff line
@@ -12,12 +12,11 @@ build: $(JSOBJ) libmw.a
libmw.a: $(CODE:.c=.o)
	ar rcs libmw.a $^

nonce.c: nonce.h
nonce.c: nonce.h nonce-def.h

nonce.h:
	echo -n "#define NONCE \"" > nonce.h
	dd if=/dev/urandom bs=1 count=8 | base64 | sed -e 's/$$/"/' >> nonce.h
	cproto nonce.c >> nonce.h
nonce-def.h:
	echo -n "#define NONCE \"" > $@
	dd if=/dev/urandom bs=1 count=8 | base64 | sed -e 's/$$/"/' >> $@

install: all
	$(MAKE) -C client $@
+1 −0
Original line number Diff line number Diff line
#include <string.h>
#include "nonce-def.h"
#include "nonce.h"

const char * get_nonce()

src/nonce.h

0 → 100644
+7 −0
Original line number Diff line number Diff line
#ifndef NONCE_H
#define NONCE_H

const char *get_nonce(void);
int match_nonce(const char *test);

#endif /* NONCE_H */