debian/0000755000000000000000000000000011643100717007166 5ustar debian/control0000644000000000000000000000132011643100611010556 0ustar Source: purity Section: games Priority: optional Maintainer: Debian QA Group Build-Depends: debhelper (>> 7) Standards-Version: 3.9.2 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/purity.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/purity.git Package: purity Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: automated purity testing software For many years now, the purity test, (in various forms) has been widely available on the net. This package provides an automated way of taking the test. . Purity tests are an amusing way to see how much of a nerd or a hacker you are. More tests are available in the purity-off package. debian/dirs0000644000000000000000000000004311643100611010040 0ustar usr/games var/games usr/share/gamesdebian/compat0000644000000000000000000000000211643100611010355 0ustar 7 debian/docs0000644000000000000000000000002411643100611010026 0ustar README README.linux debian/menu0000644000000000000000000000014511643100611010046 0ustar ?package(purity):needs="text" section="Games/Toys" title="purity" command="/usr/games/purity hacker" debian/rules0000755000000000000000000000226611643100611010245 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 CFLAGS := $(shell dpkg-buildflags --get CFLAGS) CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes LDFLAGS += -Wl,-z,defs build-indep: build-arch: build-stamp build-stamp: dh_testdir $(MAKE) CFLAGS='-DLINUX -DSCOREFILE="\"/var/games/purity.scores\"" $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)' \ LIBDIR='/usr/share/games/purity' \ purity cp pt.6 purity.6 touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp purity purity.6 dh_clean binary-indep: binary-arch: build-stamp dh_testdir dh_testroot dh_prep dh_installdirs dh_install dh_installdocs dh_installexamples dh_installmenu dh_installman purity.6 dh_installchangelogs dh_link dh_strip dh_compress dh_fixperms chown root:games debian/purity//usr/games/purity chmod 2755 debian/purity/usr/games/purity dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch build: build-arch build-indep .PHONY: build build-arch build-indep clean binary-indep binary-arch binary debian/postinst0000644000000000000000000000027311643100611010767 0ustar #!/bin/sh set -e #DEBHELPER# if [ ! -f /var/games/purity.scores ] then touch /var/games/purity.scores chmod 660 /var/games/purity.scores chown root:games /var/games/purity.scores; fi debian/watch0000644000000000000000000000016211643100611010207 0ustar # there is only ftp://metalab.unc.edu/pub/Linux/games/amusements/purity.tar.Z # without a version number in it... debian/source/0000755000000000000000000000000011643100611010457 5ustar debian/source/format0000644000000000000000000000001411643100611011665 0ustar 3.0 (quilt) debian/postrm0000644000000000000000000000013211643100611010422 0ustar #!/bin/sh set -e #DEBHELPER# if [ "$1" = "purge" ]; then rm /var/games/purity.scores fi debian/README.Debian0000644000000000000000000000162111643100611011220 0ustar purity for DEBIAN ---------------------- *** NOTICE *** This package used to contain materials which may not be appropriate for minors, and may offend some people. To comply with the aims of debian while still providing a useful piece of software, this package has been released without the sexually explicit purity tests. Should you wish to install sexually explicit purity tests on your system, simply install the package purity-off, maintained by Marco d'Itri . Please be sure if you run a public access system and intend to install sexually explicit material that you are in complience with applicable local laws. To add more purity tests, install them into /usr/share/games/purity. The original distribution from which this package was created is available at ftp://metalab.unc.edu/pub/Linux/games/amusements/purity.tar.Z This package is maintained by Duncan Findlay debian/copyright0000644000000000000000000000076511643100611011122 0ustar This package was debianized by Aaron Howell aaron@kitten.net.au on Mon, 29 Sep 1997 10:30:17 +1000. It is now maintained by Duncan Findlay It was downloaded from: ftp://metalab.unc.edu/pub/Linux/games/amusements/purity.tar.Z Copyright: This program is public domain. Please don't charge for it. If you improve it/fix it/etc, please let me know, so i can keep my version up to date with everyone else's. Eric Lechner lechner@ucscb.ucsc.edu ...!ucbvax!ucscc!ucscb!lechner debian/changelog0000644000000000000000000001036111643100717011041 0ustar purity (1-18) unstable; urgency=low * QA upload (setting Maintainer to QA group) * change to format "3.0 (quilt)" * drop upstream changes easily done in debian/rules instead * modernize debian/rules - use dpkg-buildflags (Closes: 437831) - implement build-arch, build-indep - debhelper compatibility 7 * avoid some compiler warnings * don't change binary's permissions in postinst but in package * Standards-Version to 3.9.2 * fix some minor formating errors and misspellings lintian warns about -- Bernhard R. Link Wed, 05 Oct 2011 18:10:50 +0200 purity (1-17) unstable; urgency=low * Changed fix for overflow to match that of security releases 1-9.1 and 1-14.1 -- Duncan Findlay Thu, 12 Sep 2002 19:46:47 -0400 purity (1-16) unstable; urgency=low * Prevents possible buffer overflow (Closes: #154290) -- Duncan Findlay Sun, 8 Sep 2002 22:41:15 -0400 purity (1-15) unstable; urgency=low * Change of e-mail address -- Duncan Findlay Tue, 14 May 2002 19:02:47 -0400 purity (1-14) unstable; urgency=low * Change of e-mail address -- Duncan Findlay Sat, 24 Nov 2001 16:11:01 -0500 purity (1-13) unstable; urgency=low * fixed segmentation fault when saving high scores (closes: #114340) - thanks to Gergely Nagy for the patch -- Duncan Findlay Wed, 3 Oct 2001 22:12:24 -0400 purity (1-12) unstable; urgency=low * new maintainer (closes: #113109) * fixed stty settings munging (closes: #112827, #112830) - thanks to Alan Shutko for the patch * added build depends (closes: #107311, #111794) * moved /var/lib/games to /var/games (closes: #107643) * (slightly) improved description (closes: #112806) -- Duncan Findlay Thu, 20 Sep 2001 22:54:11 -0400 purity (1-11) unstable; urgency=low * changed package from extra to optional * make directory /var/lib/games if it doesn't exist. (closes #107015) -- Aaron Howell Mon, 30 Jul 2001 07:55:40 +1000 purity (1-10) unstable; urgency=low * Fixed Readme file (closes #48608). * Applied patch from James Morrison to make purity build on SYSV platforms using termios. -- Aaron Howell Sun, 29 Jul 2001 17:15:53 +1000 purity (1-9) unstable; urgency=low * converted to debhelper * changed sunsite.unc.edu to metalab.unc.edu (fixes #33612) * moved tests under /usr/share/games/purity (fixes #44912) -- Aaron Howell Tue, 21 Sep 1999 10:39:15 +1000 purity (1-8) unstable; urgency=low * fixed line length of extended description to conform to policy, fixes #30086 * changed maintainer address to aaron@kitten.net.au -- Aaron Howell Sat, 9 Jan 1999 15:25:59 +1000 purity (1-7) unstable; urgency=low * change maintainer address back to cnl, too many problems with mail to bayside. -- Aaron Howell Sat, 8 Aug 1998 18:44:27 +1000 purity (1-6) unstable; urgency=low * fix source and postinst so scores are logged to /var/lib/games/purity.scores (#18586) -- Aaron Howell Wed, 13 May 1998 10:27:03 +1000 purity (1-5) unstable; urgency=low * s/cnl.com.au/bayside.net.au/g * rebuild to fix md5sums-contains-nonexisting-file error from lintian fixes #19394 -- Aaron Howell Wed, 11 Mar 1998 16:18:27 +1000 purity (1-4) unstable; urgency=low * fix menu entry so purity gets started with a test that is actually included with the package. fixes #16478 -- Aaron Howell Sat, 3 Jan 1998 02:48:31 +1000 purity (1-3) unstable; urgency=low * removed offensive purity tests in accordance with recommendations on debian-devel, see README.debian for more information -- Aaron Howell Sun, 30 Nov 1997 15:19:59 +1000 purity (1-2) unstable; urgency=low * reupload, hopefully this time my public key will be accepted -- Aaron Howell Sat, 18 Oct 1997 23:30:59 +1000 purity (1-1) unstable; urgency=low * Changed termios.h to asm/termios.h so purity will build ok. * Initial Release. -- Aaron Howell Mon, 29 Sep 1997 10:30:17 +1000 debian/patches/0000755000000000000000000000000011643100611010606 5ustar debian/patches/0002-Fixed-two-buffer-overflows.patch0000644000000000000000000000137511643100611017355 0ustar From 35855ccd2de3cf9b6194d73e190290dec50819dd Mon Sep 17 00:00:00 2001 From: Martin Schulze Date: Tue, 10 Sep 2002 20:23:26 +0200 Subject: Fixed two buffer overflows --- pt.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pt.c b/pt.c index 9b4cbf6..8a49204 100644 --- a/pt.c +++ b/pt.c @@ -127,7 +127,7 @@ char *argv[]; case '-' : break; default : - (void) sprintf(path,"%s/%s", + (void) snprintf(path, sizeof(path),"%s/%s", LIBDIR, argv[err]); ch = TRUE; break; @@ -137,7 +137,7 @@ char *argv[]; fp = fopen(path,"r"); if (fp == NULL) { - (void) sprintf(path,"%s",argv[err]); + (void) snprintf(path, sizeof (path),"%s",argv[err]); fp = fopen(path,"r"); } debian/patches/0006-fix-segmentation-fault-when-saving-high-scores.patch0000644000000000000000000000144411643100611023244 0ustar From 7b2c2cbca5dfcf8aaaa2a9a1e53d1ea12ebfd60f Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 3 Oct 2001 18:44:30 +0200 Subject: fix segmentation fault when saving high scores purity segfaults when trying to save the high-score file, this is because it does not check if getlogin() returns NULL, and tries to use it anyway. Bug-Debian: http://bugs.debian.org/114340 --- pt.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/pt.c b/pt.c index 3a0d203..b18acb2 100644 --- a/pt.c +++ b/pt.c @@ -750,7 +750,8 @@ void freemem() fp = fopen (scorepath,"a+"); if (fp != NULL) { #ifdef GETLOGIN - (void) strcpy(login,getlogin()); + char *tmp = getlogin(); + (void) strcpy(login,(tmp) ? tmp : ""); if (*login == '\0') { #endif #ifdef PW debian/patches/0009-fix-spelling-error-in-manpage.patch0000644000000000000000000000156111643100611017762 0ustar From 4fab37fc841d51e73022a0df643bc00d31a8bd66 Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Wed, 5 Oct 2011 18:10:18 +0200 Subject: fix spelling error in manpage lintian says it is preceded and not preceeded... --- pt.6 | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pt.6 b/pt.6 index 8629b0f..8829c68 100644 --- a/pt.6 +++ b/pt.6 @@ -117,10 +117,10 @@ and < conclusion > .PP Plain text blocks are printed out character for character. .PP -Subject headers are preceeded by their subject numbers, starting +Subject headers are preceded by their subject numbers, starting at 1, and then printed as text blocks. .PP -Questions are preceeded by their numbers, and then prompt the +Questions are preceded by their numbers, and then prompt the user to answer the question, keeping track of the user's current score. .PP debian/patches/0003-make-purity-build-on-SYSV-platforms-using-termios.patch0000644000000000000000000000421111643100611023575 0ustar From 376a1532c0b82de1df8b0f7899c4e204eb812ef3 Mon Sep 17 00:00:00 2001 From: James A Morrison Date: Sun, 29 Jul 2001 01:51:53 -0400 Subject: make purity build on SYSV platforms using termios This patch updates purity to use termios on systems which are build with sysv defined. Updating purity to termios allows purity to run on GNU/Linux and GNU/HURD equally well. This patch is needed to compile purity on GNU HURD. Bug-Debian: http://bugs.debian.org/106962 --- pt.c | 24 ++++++++++-------------- 1 files changed, 10 insertions(+), 14 deletions(-) diff --git a/pt.c b/pt.c index 8a49204..a8730f7 100644 --- a/pt.c +++ b/pt.c @@ -20,17 +20,13 @@ #ifdef SYSV #include #include -#ifdef LINUX -# include -#else -# include -#endif +#include /* SYSV now uses termios instead of termio POSIX compliant */ #include #else -#include #include #include -#endif +#endif /*SYSV*/ +#include #include #include #include @@ -659,7 +655,7 @@ void set_mode() #ifndef SYSV struct sgttyb p; #else - struct termio p; + struct termios p; #endif #ifndef SYSV @@ -669,13 +665,13 @@ void set_mode() p.sg_flags &= ~ECHO; (void) ioctl(0,TIOCSETP,&p); #else - (void) ioctl(0,TCGETA,&p); + tcgetattr(0,&p); tty_flags = p.c_lflag; baz = p.c_cc[VMIN]; p.c_lflag &= ~ICANON; p.c_lflag &= ~ECHO; p.c_cc[VMIN] = 1; - (void) ioctl(0,TCSETA,&p); + tcsetattr(0,TCSANOW,&p); #endif } @@ -684,7 +680,7 @@ void clr_mode() #ifndef SYSV struct sgttyb p; #else - struct termio p; + struct termios p; #endif #ifndef SYSV @@ -692,10 +688,10 @@ void clr_mode() p.sg_flags = tty_flags; (void) ioctl(0,TIOCSETP,&p); #else - (void) ioctl(0,TCGETA,&p); + tcgetattr(0,&p); p.c_lflag = tty_flags; p.c_cc[VMIN] = baz; - (void) ioctl(0,TCSETA,&p); + tcsetattr(0,TCSANOW,&p); #endif } @@ -793,7 +789,7 @@ void sizewindow() { struct winsize wsize; - (void) ioctl(0,TIOCGWINSZ,&wsize); + (void) ioctl(0,TIOCSWINSZ,&wsize); cols = wsize.ws_col; rows = wsize.ws_row; debian/patches/0007-move-scorefile-out-of-LIBDIR.patch0000644000000000000000000000132111643100611017301 0ustar From 6ad9592c52e5e43321e4247a36a07aa3bc49496e Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Wed, 5 Oct 2011 17:10:43 +0200 Subject: move scorefile out of LIBDIR instead of hardcoding it like previous patches, allow it to be given via preprocessor flag. --- pt.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/pt.c b/pt.c index b18acb2..d79766e 100644 --- a/pt.c +++ b/pt.c @@ -746,7 +746,11 @@ void freemem() #ifdef LOGFILE if ((no_ans == FALSE) && logme && (ans > 0)) { +# ifdef SCOREFILE + strcpy(scorepath, SCOREFILE); +# else sprintf(scorepath,"%s/%s",LIBDIR,"scores"); +# endif fp = fopen (scorepath,"a+"); if (fp != NULL) { #ifdef GETLOGIN debian/patches/series0000644000000000000000000000060611643100611012025 0ustar 0001-fix-typo-in-README.patch 0002-Fixed-two-buffer-overflows.patch 0003-make-purity-build-on-SYSV-platforms-using-termios.patch 0004-fix-stty-settings-munging.patch 0005-moved-to-FHS-comformant-positions.patch 0006-fix-segmentation-fault-when-saving-high-scores.patch 0007-move-scorefile-out-of-LIBDIR.patch 0008-avoid-some-compiler-warnings.patch 0009-fix-spelling-error-in-manpage.patch debian/patches/0008-avoid-some-compiler-warnings.patch0000644000000000000000000000733311643100611017723 0ustar From 790117346c3dbf1168b132e116272cd6f709ce59 Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Wed, 5 Oct 2011 17:47:13 +0200 Subject: avoid some compiler warnings --- pt.c | 77 +++++++++++++++++++++++++++++++++-------------------------------- 1 files changed, 39 insertions(+), 38 deletions(-) diff --git a/pt.c b/pt.c index d79766e..7649dd2 100644 --- a/pt.c +++ b/pt.c @@ -12,6 +12,7 @@ #ifdef LINUX # define SYSV # include +# include #endif #include "pt.h" @@ -50,49 +51,48 @@ struct quest { struct quest *last; /* pointer to last question */ }; -int question(), - get_response(), - getresp(), - subject(), - print(), - more(); +static int question(void), + get_response(void), + getresp(void), + subject(void), + print(int, int), + more(void), + redraw(void); -void explain(), - quit(), +static void explain(void), + quit(int), #ifdef SIGTSTP - ctrlz(), - ctrlzret(), + ctrlz(int), + ctrlzret(int), #endif - set_mode(), - clr_mode(), - freemem(), - printscore(), - sizewindow(); + set_mode(void), + clr_mode(void), + freemem(void), + printscore(void), + sizewindow(void); #ifndef PW struct passwd *getpw(); #endif -FILE *fp; +static FILE *fp; -struct quest *theq, *nextq, *the_s, *next_s; -int num_ch, num_ln, kill_sub, no_ans, zoom, obfus, fast, derange, rot13; +static struct quest *theq, *nextq, *the_s, *next_s; +static int num_ch, num_ln, kill_sub, no_ans, zoom, obfus, fast, derange, rot13; -short tty_flags; +static short tty_flags; #ifdef SYSV -unsigned char baz; +static unsigned char baz; #endif -unsigned short rows, cols; +static unsigned short rows, cols; -char *testtype; +static char *testtype; #ifdef LOGFILE -int logme; +static int logme; #endif -main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int err, ch; /* var to store error reports */ char path[256], *ch1; @@ -139,15 +139,15 @@ char *argv[]; if (fp == NULL) { #ifndef SYSV - if (ch1 = rindex(argv[0],'/')) ch1++; + if ((ch1 = rindex(argv[0],'/'))) ch1++; #else - if (ch1 = strrchr(argv[0],'/')) ch1++; + if ((ch1 = strrchr(argv[0],'/'))) ch1++; #endif else ch1 = argv[0]; #ifndef SYSV - if (testtype = rindex(path,'/')) testtype++; + if ((testtype = rindex(path,'/'))) testtype++; #else - if (testtype = strrchr(path,'/')) testtype++; + if ((testtype = strrchr(path,'/'))) testtype++; #endif else testtype = path; @@ -159,9 +159,9 @@ char *argv[]; if (testtype == NULL) { #ifndef SYSV - if (testtype = rindex(path,'/')) testtype++; + if ((testtype = rindex(path,'/'))) testtype++; #else - if (testtype = strrchr(path,'/')) testtype++; + if ((testtype = strrchr(path,'/'))) testtype++; #endif else testtype = path; } @@ -300,6 +300,7 @@ char *argv[]; default : break; } + return 0; } int question() @@ -541,9 +542,9 @@ int subject() return (err); } -int print(echo,esc) -int echo; /* if echo then print the text, and give "more" prompts */ -int esc; /* the escape character to end this text block */ +int print(int echo, int esc) + /* if echo then print the text, and give "more" prompts */ + /* the escape character to end this text block */ { int ch; @@ -621,7 +622,7 @@ int more() return (ret); } -void quit () +void quit (int s __attribute__((unused))) { (void) fflush(stdout); (void) signal (SIGINT, SIG_DFL); @@ -633,7 +634,7 @@ void quit () } #ifdef SIGTSTP -void ctrlz () +void ctrlz (int s __attribute__((unused))) { (void) fflush(stdout); fprintf(stdout,"\nyou'll be back, right?\n"); @@ -642,7 +643,7 @@ void ctrlz () (void) kill (getpid(), SIGTSTP); } -void ctrlzret () +void ctrlzret (int s __attribute__((unused))) { fprintf(stdout,"nice to see you came back...\n"); (void) fflush(stdout); debian/patches/0004-fix-stty-settings-munging.patch0000644000000000000000000000105411643100611017277 0ustar From 1c7ff3ea94b093ba56c85fd1a6accb193e797c89 Mon Sep 17 00:00:00 2001 From: Alan Shutko Date: Wed, 19 Sep 2001 14:41:21 -0400 Subject: fix stty settings munging Bug-Debian: http://bugs.debian.org/112827 --- pt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/pt.c b/pt.c index a8730f7..3a0d203 100644 --- a/pt.c +++ b/pt.c @@ -789,7 +789,7 @@ void sizewindow() { struct winsize wsize; - (void) ioctl(0,TIOCSWINSZ,&wsize); + (void) ioctl(0,TIOCGWINSZ,&wsize); cols = wsize.ws_col; rows = wsize.ws_row; debian/patches/0001-fix-typo-in-README.patch0000644000000000000000000000120011643100611015314 0ustar From b98622f73dc97a4b13ebab43dcf941bedff3c38d Mon Sep 17 00:00:00 2001 From: Aaron Howell Date: Sat, 9 Jan 1999 15:25:59 +1000 Subject: fix typo in README --- README | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/README b/README index cc9c116..6cad9bc 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -This is a "purity testing" progam. There have been many +This is a "purity testing" program. There have been many purity tests floating around the net, and this provides a more or less automated way to take the tests, and keep score, without having to always find pencil and paper. debian/patches/0005-moved-to-FHS-comformant-positions.patch0000644000000000000000000000141111643100611020546 0ustar From 736ac4bd4687a25ac25f622cf40368946fc9cb6c Mon Sep 17 00:00:00 2001 From: Duncan Findlay Date: Thu, 20 Sep 2001 22:54:11 -0400 Subject: moved to FHS comformant positions Bug-Debian: http://bugs.debian.org/107643 --- pt.6 | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pt.6 b/pt.6 index 69a5a39..8629b0f 100644 --- a/pt.6 +++ b/pt.6 @@ -145,8 +145,8 @@ and then it would have asked the user for her/his answer. For a generic datafile, use the "sample" datafile for the test. .SH FILES .nf -/usr/games/lib/purity/scores the score logfile -/usr/games/lib/purity/* test data files +/var/games/purity.scores the score logfile +/usr/share/games/purity/* test data files .fi .SH AUTHOR Eric Lechner, lechner@ucscb.ucsc.edu debian/install0000644000000000000000000000006311643100611010547 0ustar purity /usr/games tests/* /usr/share/games/purity/