Contents of /trunk/nullidentd/patches/nullidentd-1.0-debian3.patch
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 11072 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 11072 byte(s)
-import
1 | --- nullidentd-1.0.orig/Makefile |
2 | +++ nullidentd-1.0/Makefile |
3 | @@ -1,5 +1,9 @@ |
4 | |
5 | -INSTALL=/usr/local/sbin |
6 | +# Edited for Debian GNU/Linux. |
7 | +DESTDIR= |
8 | + |
9 | +INSTALL=$(DESTDIR)/usr/sbin |
10 | + |
11 | |
12 | nullidentd: nullidentd.c version.h |
13 | gcc -O2 -o nullidentd nullidentd.c |
14 | @@ -21,9 +25,10 @@ |
15 | rm -f .version version.h nullidentd |
16 | |
17 | install: nullidentd |
18 | - rm -f $(INSTALL)/nullidentd |
19 | + #rm -f $(INSTALL)/nullidentd |
20 | cp nullidentd $(INSTALL)/nullidentd |
21 | chown root.root $(INSTALL)/nullidentd |
22 | - chmod a-rw $(INSTALL)/nullidentd |
23 | - chmod a+x $(INSTALL)/nullidentd |
24 | + #chmod a-rw $(INSTALL)/nullidentd |
25 | + #chmod a+x $(INSTALL)/nullidentd |
26 | + chmod 0755 $(INSTALL)/nullidentd |
27 | |
28 | --- nullidentd-1.0.orig/nullidentd.c |
29 | +++ nullidentd-1.0/nullidentd.c |
30 | @@ -7,9 +7,11 @@ |
31 | */ |
32 | |
33 | #include <stdio.h> |
34 | +#include <stdlib.h> |
35 | #include <sys/types.h> |
36 | #include <unistd.h> |
37 | #include <signal.h> |
38 | +#include <time.h> |
39 | |
40 | #include "version.h" |
41 | |
42 | @@ -18,6 +20,7 @@ |
43 | #define MAX_RESPONSE 200 |
44 | #define MAX_REQUEST 100 |
45 | #define MAX_USERID 50 |
46 | +#define MAX_RANDOMID 8 |
47 | |
48 | void usage() |
49 | { |
50 | @@ -46,7 +49,6 @@ |
51 | |
52 | int read_request( int fd, char *request, int maxlen ) |
53 | { |
54 | - int retval; |
55 | char c; |
56 | int bytesread = 0; |
57 | |
58 | @@ -76,6 +78,22 @@ |
59 | return 1; |
60 | } |
61 | |
62 | +char *random_userid( void ) |
63 | +{ |
64 | + static char buf[MAX_RANDOMID+1]; |
65 | + size_t i; |
66 | + static const char valid[] = |
67 | + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; |
68 | + |
69 | + for (i = 0 ; i < MAX_RANDOMID ; i++) |
70 | + buf[i] = valid[rand() % (sizeof(valid) - 1)]; |
71 | + |
72 | + buf[i] = '\0'; |
73 | + |
74 | + return buf; |
75 | +} |
76 | + |
77 | + |
78 | void session_timeout( int foo ) |
79 | { |
80 | exit( 0 ); |
81 | @@ -84,12 +102,12 @@ |
82 | int main( int argc, const char *argv[] ) |
83 | { |
84 | const char * userid = "foobar"; |
85 | - char c; |
86 | int infd; |
87 | int outfd; |
88 | int response_len; |
89 | char response[MAX_RESPONSE]; |
90 | char request[MAX_REQUEST]; |
91 | + int gen_random = 0; |
92 | |
93 | if( getgid() == 0 ) { |
94 | fprintf( stderr, "Group id is root, exitting.\n" ); |
95 | @@ -114,6 +132,10 @@ |
96 | } |
97 | } |
98 | |
99 | + if (strcmp(userid, "RANDOM") == 0) { |
100 | + gen_random = 1; |
101 | + } |
102 | + |
103 | infd = fileno( stdin ); |
104 | outfd = fileno( stdout ); |
105 | |
106 | @@ -121,6 +143,8 @@ |
107 | signal( SIGALRM, session_timeout ); |
108 | alarm( SESSION_TIMEOUT ); |
109 | |
110 | + srand(getpid() ^ time(NULL)); |
111 | + |
112 | for( ;; ) { |
113 | /* read the request */ |
114 | if( !read_request( infd, request, MAX_REQUEST ) ) { |
115 | @@ -128,6 +152,10 @@ |
116 | goto done; |
117 | } |
118 | |
119 | + if (gen_random) { |
120 | + userid = random_userid(); |
121 | + } |
122 | + |
123 | /* format the response */ |
124 | response_len = snprintf( response, sizeof( response ), "%.20s : USERID : UNIX : %.20s\r\n", request, userid ); |
125 | |
126 | @@ -140,4 +168,3 @@ |
127 | done: |
128 | return 0; |
129 | } |
130 | - |
131 | --- nullidentd-1.0.orig/debian/dirs |
132 | +++ nullidentd-1.0/debian/dirs |
133 | @@ -0,0 +1 @@ |
134 | +usr/sbin |
135 | --- nullidentd-1.0.orig/debian/docs |
136 | +++ nullidentd-1.0/debian/docs |
137 | @@ -0,0 +1 @@ |
138 | +README |
139 | --- nullidentd-1.0.orig/debian/control |
140 | +++ nullidentd-1.0/debian/control |
141 | @@ -0,0 +1,14 @@ |
142 | +Source: nullidentd |
143 | +Section: net |
144 | +Priority: optional |
145 | +Maintainer: John H. Robinson, IV <jaqque@debian.org> |
146 | +Build-Depends: debhelper |
147 | +Standards-Version: 3.6.1 |
148 | + |
149 | +Package: nullidentd |
150 | +Provides: ident-server |
151 | +Architecture: any |
152 | +Depends: ${shlibs:Depends}, netbase |
153 | +Description: small, fast identd daemon |
154 | + nullidentd is a small, fast and secure identd daemon. It returns a static |
155 | + string for every query. |
156 | --- nullidentd-1.0.orig/debian/nullidentd.8 |
157 | +++ nullidentd-1.0/debian/nullidentd.8 |
158 | @@ -0,0 +1,44 @@ |
159 | +.\" |
160 | +.TH "nullidentd" "8" "January 24, 2001" "" "" |
161 | +.SH "NAME" |
162 | +nullidentd \- a bare minimum identd server |
163 | + |
164 | +.SH "SYNOPSIS" |
165 | +.B nullidentd |
166 | +.RI [uid] |
167 | +.br |
168 | + |
169 | +.SH "DESCRIPTION" |
170 | +This manual page documents briefly the |
171 | +.B nullidentd |
172 | +command. This manual page was written for the Debian GNU/Linux distribution |
173 | +because the original program does not have a manual page. |
174 | +.PP |
175 | +.B Nullidentd |
176 | +is intended to be a bare minimum identd server, suitable for a firewall or IP |
177 | +Masq/NAT gateway. |
178 | + |
179 | +.SH "OPTIONS" |
180 | +.B nullidentd |
181 | +takes only one optional argument, the username to answer with. |
182 | +If this is omitted, |
183 | +.B nullidentd |
184 | +will reply with the username \*(lqfoobar\*(rq. |
185 | +If the username is RANDOM, a random string is generated. |
186 | + |
187 | +.SH "USAGE" |
188 | +.B nullidentd |
189 | +is typically invoked from inetd. The following |
190 | +is a typical inetd.conf example: |
191 | +.br |
192 | +.nh |
193 | +auth stream tcp nowait nobody /usr/sbin/nullidentd nullidentd |
194 | +.hy |
195 | + |
196 | +.SH "AUTHOR" |
197 | +.B |
198 | +nullidentd |
199 | +is written by Brian Young <bayoung@acm.org> |
200 | +.PP |
201 | +This manual page was written by John H. Robinson, IV <jaqque@debian.org>, |
202 | +for the Debian GNU/Linux system (but may be used by others). |
203 | --- nullidentd-1.0.orig/debian/prerm |
204 | +++ nullidentd-1.0/debian/prerm |
205 | @@ -0,0 +1,9 @@ |
206 | +#! /bin/sh |
207 | + |
208 | +set -e |
209 | + |
210 | +if [ "$1" = "remove" ]; then |
211 | + update-inetd --pattern "/usr/sbin/nullidentd" --disable ident |
212 | +fi |
213 | + |
214 | +#DEBHELPER# |
215 | --- nullidentd-1.0.orig/debian/rules |
216 | +++ nullidentd-1.0/debian/rules |
217 | @@ -0,0 +1,77 @@ |
218 | +#!/usr/bin/make -f |
219 | +# Sample debian/rules that uses debhelper. |
220 | +# GNU copyright 1997 to 1999 by Joey Hess. |
221 | + |
222 | +# Uncomment this to turn on verbose mode. |
223 | +#export DH_VERBOSE=1 |
224 | + |
225 | +# This is the debhelper compatability version to use. |
226 | +export DH_COMPAT=1 |
227 | + |
228 | +build: build-stamp |
229 | +build-stamp: |
230 | + dh_testdir |
231 | + |
232 | + |
233 | + # Add here commands to compile the package. |
234 | + $(MAKE) |
235 | + |
236 | + touch build-stamp |
237 | + |
238 | +clean: |
239 | + dh_testdir |
240 | + dh_testroot |
241 | + rm -f build-stamp |
242 | + |
243 | + # Add here commands to clean up after the build process. |
244 | + -$(MAKE) clean |
245 | + |
246 | + dh_clean |
247 | + |
248 | +install: build |
249 | + dh_testdir |
250 | + dh_testroot |
251 | + dh_clean -k |
252 | + dh_installdirs |
253 | + |
254 | + # Add here commands to install the package into debian/tmp. |
255 | + $(MAKE) install DESTDIR=`pwd`/debian/tmp |
256 | + |
257 | + |
258 | +# Build architecture-independent files here. |
259 | +binary-indep: build install |
260 | +# We have nothing to do by default. |
261 | + |
262 | +# Build architecture-dependent files here. |
263 | +binary-arch: build install |
264 | +# dh_testversion |
265 | + dh_testdir |
266 | + dh_testroot |
267 | +# dh_installdebconf |
268 | + dh_installdocs |
269 | + dh_installexamples |
270 | + dh_installmenu |
271 | +# dh_installemacsen |
272 | +# dh_installpam |
273 | +# dh_installinit |
274 | + dh_installcron |
275 | + dh_installmanpages |
276 | + dh_installinfo |
277 | +# dh_undocumented |
278 | + dh_installchangelogs CHANGELOG |
279 | + dh_link |
280 | + dh_strip |
281 | + dh_compress |
282 | + dh_fixperms |
283 | + # You may want to make some executables suid here. |
284 | +# dh_suidregister |
285 | +# dh_makeshlibs |
286 | + dh_installdeb |
287 | +# dh_perl |
288 | + dh_shlibdeps |
289 | + dh_gencontrol |
290 | + dh_md5sums |
291 | + dh_builddeb |
292 | + |
293 | +binary: binary-indep binary-arch |
294 | +.PHONY: build clean binary-indep binary-arch binary install |
295 | --- nullidentd-1.0.orig/debian/changelog |
296 | +++ nullidentd-1.0/debian/changelog |
297 | @@ -0,0 +1,40 @@ |
298 | +nullidentd (1.0-3) unstable; urgency=low |
299 | + |
300 | + * Compiles -Wall -pedantic clean |
301 | + * Random ID's are all eight characters long |
302 | + * Many thanks to Petter Reinholdtsen and Marc Brockschmidt for their NMU's |
303 | + |
304 | + -- John H. Robinson, IV <jaqque@debian.org> Tue, 17 Aug 2004 21:40:18 -0700 |
305 | + |
306 | +nullidentd (1.0-2.2) unstable; urgency=low |
307 | + |
308 | + * Non-maintainer upload. |
309 | + * Add missing dependency on netbase. (Closes: #230641) |
310 | + * Correct email address of upstream author. (Closes: #230644) |
311 | + * Add support for returning random usernames. (Closes: #115204) |
312 | + |
313 | + -- Petter Reinholdtsen <pere@debian.org> Thu, 5 Feb 2004 16:35:16 +0100 |
314 | + |
315 | +nullidentd (1.0-2.1) unstable; urgency=low |
316 | + |
317 | + * Non-maintainer upload. |
318 | + * debian/{postinst,prerm,postrm}: Fixed update-inetd calls to leave user |
319 | + config untouched. (Closes: #206253) |
320 | + * debian/changelog: Removed Emacs user settings at end of file. |
321 | + * debian/copyright: Removed boilerplate "(s)" to make lintian happy. |
322 | + * debian/control: Bumped Standards-Version to 3.6.1 (no changes) |
323 | + |
324 | + -- Marc Brockschmidt <marc@dch-faq.de> Sun, 21 Dec 2003 23:49:31 +0100 |
325 | + |
326 | +nullidentd (1.0-2) unstable; urgency=low |
327 | + |
328 | + * Added Provides: ident-server (closes: Bug#95270) |
329 | + |
330 | + -- John H. Robinson, IV <jaqque@debian.org> Sat, 28 Apr 2001 00:21:58 -0700 |
331 | + |
332 | +nullidentd (1.0-1) unstable; urgency=low |
333 | + |
334 | + * Initial Release. (closes: Bug#83333) |
335 | + * Modified toplevel Makefile to support $(DESTDIR) |
336 | + |
337 | + -- John H. Robinson, IV <jaqque@debian.org> Tue, 16 Jan 2001 20:21:00 -0800 |
338 | --- nullidentd-1.0.orig/debian/postinst |
339 | +++ nullidentd-1.0/debian/postinst |
340 | @@ -0,0 +1,52 @@ |
341 | +#! /bin/sh |
342 | +# postinst script for nullidentd |
343 | +# |
344 | +# see: dh_installdeb(1) |
345 | + |
346 | +set -e |
347 | + |
348 | +# summary of how this script can be called: |
349 | +# * <postinst> `configure' <most-recently-configured-version> |
350 | +# * <old-postinst> `abort-upgrade' <new version> |
351 | +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> |
352 | +# <new-version> |
353 | +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' |
354 | +# <failed-install-package> <version> `removing' |
355 | +# <conflicting-package> <version> |
356 | +# for details, see /usr/doc/packaging-manual/ |
357 | +# |
358 | +# quoting from the policy: |
359 | +# Any necessary prompting should almost always be confined to the |
360 | +# post-installation script, and should be protected with a conditional |
361 | +# so that unnecessary prompting doesn't happen if a package's |
362 | +# installation fails and the `postinst' is called with `abort-upgrade', |
363 | +# `abort-remove' or `abort-deconfigure'. |
364 | + |
365 | +case "$1" in |
366 | + configure) |
367 | + update-inetd --disable ident # don't destroy other's config |
368 | + update-inetd --group INFO --add 'ident\t\tstream\ttcp\tnowait\tnobody\t/usr/sbin/nullidentd\tnullidentd' |
369 | + update-inetd --pattern "/usr/sbin/nullidentd" --enable ident |
370 | + |
371 | + ;; |
372 | + |
373 | + |
374 | + |
375 | + abort-upgrade|abort-remove|abort-deconfigure) |
376 | + |
377 | + ;; |
378 | + |
379 | + *) |
380 | + echo "postinst called with unknown argument \`$1'" >&2 |
381 | + exit 0 |
382 | + ;; |
383 | +esac |
384 | + |
385 | +# dh_installdeb will replace this with shell code automatically |
386 | +# generated by other debhelper scripts. |
387 | + |
388 | +#DEBHELPER# |
389 | + |
390 | +exit 0 |
391 | + |
392 | + |
393 | --- nullidentd-1.0.orig/debian/postrm |
394 | +++ nullidentd-1.0/debian/postrm |
395 | @@ -0,0 +1,28 @@ |
396 | +#! /bin/sh |
397 | +# postrm script for nullidentd |
398 | +# |
399 | +# see: dh_installdeb(1) |
400 | + |
401 | +set -e |
402 | + |
403 | +# summary of how this script can be called: |
404 | +# * <postrm> `remove' |
405 | +# * <postrm> `purge' |
406 | +# * <old-postrm> `upgrade' <new-version> |
407 | +# * <new-postrm> `failed-upgrade' <old-version> |
408 | +# * <new-postrm> `abort-install' |
409 | +# * <new-postrm> `abort-install' <old-version> |
410 | +# * <new-postrm> `abort-upgrade' <old-version> |
411 | +# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version> |
412 | +# for details, see /usr/doc/packaging-manual/ |
413 | + |
414 | +if [ "$1" = "purge" ]; then |
415 | + update-inetd --remove "/usr/sbin/nullidentd" |
416 | +fi |
417 | + |
418 | +# dh_installdeb will replace this with shell code automatically |
419 | +# generated by other debhelper scripts. |
420 | + |
421 | +#DEBHELPER# |
422 | + |
423 | + |
424 | --- nullidentd-1.0.orig/debian/copyright |
425 | +++ nullidentd-1.0/debian/copyright |
426 | @@ -0,0 +1,15 @@ |
427 | +This package was debianized by John H. Robinson IV <jaqque@debian.org> on |
428 | +Tue, 16 Jan 2001 20:21:00 -0800. |
429 | + |
430 | +It was downloaded from http://www.tildeslash.org/nullidentd.html |
431 | + |
432 | +Upstream Author: Brian Young <brian@tildeslash.org> |
433 | + |
434 | +Copyright: |
435 | + |
436 | +Copyright 1999 Brian Young <brian@tildeslash.org> |
437 | + |
438 | +You are free to distribute this software under the terms of |
439 | +the GNU General Public License. |
440 | +On Debian systems, the complete text of the GNU General Public |
441 | +License can be found in /usr/share/common-licenses/GPL file. |