pax_global_header 0000666 0000000 0000000 00000000064 11366314324 0014515 g ustar 00root root 0000000 0000000 52 comment=23561a12d98fda90f0b41077f3078f01bdf41735
bidentd-1.1.4/ 0000775 0000000 0000000 00000000000 11366314324 0013131 5 ustar 00root root 0000000 0000000 bidentd-1.1.4/COPYING 0000664 0000000 0000000 00000043076 11366314324 0014176 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C) 19yy
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
bidentd-1.1.4/ChangeLog 0000664 0000000 0000000 00000006145 11366314324 0014711 0 ustar 00root root 0000000 0000000 Tue 2010-04-29 09:17 Joel Yliluoma
* Version 1.1.4
- Integrated Thibaut Varčne's patch fixing a forwarding-looping bug.
Tue 2009-10-20 10:05 Joel Yliluoma
* Version 1.1.3
- Integrated Wesley W.Terpstra's patch fixing compilation.
Wed 2009-03-18 11:20 Joel Yliluoma
* Version 1.1.2.1
- A maintenance update that does change functionality.
Mon 2007-04-02 19:38 Joel Yliluoma
* Version 1.1.2
- Fixed a reported compilation error on GCC 4.3.
Sat 2005-05-13 13:35 Joel Yliluoma
* Version 1.1.1
- Removed the rfc file from archive to make the life easier
for the Debian politics.
Mon 2005-03-14 21:15 Joel Yliluoma
* Version 1.1.0
- Integrated Wesley W. Terpstra's patch for kernel 2.6-support.
- Integrated Wesley W. Terpstra's patch for root privilege
separation.
Thu 2003-02-13 15:06 Joel Yliluoma
* Version 1.0.10
- Fixed minor masquerading bugs: ^M and space were
cumulated in the reply for each masquerading chain.
- Fixed syslog: ^M was superfluously added to every message.
Tue 2002-05-14 19:33 Joel Yliluoma
* Version 1.0.9.1
- Updated the document generating mechanism.
Sun 2002-05-01 18:59 Joel Yliluoma
* Version 1.0.9
- Applied Wesley W. Terpstra's patch for kernel 2.4-support.
- Updated the documentation about Debian support.
Sun 2001-10-04 22:50 Joel Yliluoma
* Version 1.0.8
- Updated the documentation.
Sun 2001-07-14 18:27 Joel Yliluoma
* Version 1.0.7
- Some minor changes to get this to compile with gcc-3.0.
Sun 2000-11-01 23:35 Joel Yliluoma
* Version 1.0.6
- Updated the documentation.
Sun 2000-10-28 12:53 Joel Yliluoma
* Version 1.0.5
- Changed ll_normal to ll_verbose somewhere in main.cc
Mon 2000-10-23 23:37 Joel Yliluoma
* Version 1.0.4
- Applied gaia's patch
- Rewrote argv handling
- Updated the manual page
Mon 2000-10-23 23:00 Antti-Juhani Kaijanaho
* Unreleased patch
- Added logging support.
- Fixed identd recommendation (nowait, not wait)
Wed 2000-10-18 20:43 Joel Yliluoma
* Version 1.0.3
- Renamed the package to bidentd, for
convenience. It was identd previously.
Wed 2000-10-18 14:33 Joel Yliluoma
* Version 1.0.2
- Reindented the sourcecode.
Wed 2000-10-18 02:56 Joel Yliluoma
* Version 1.0.1
- Whoap. I accidentally installed it
as inetd and wiped my inetd out.
- This version should be working, and supports
masquerading. It works even through chains
of masquerades - multiple masquerades. Fetching
recursively the identd from remote hosts. :)
Thu 2000-10-17 18:38 Joel Yliluoma
* Version 1.0.0
- Initial version
- Does actually nothing.
bidentd-1.1.4/Makefile 0000664 0000000 0000000 00000002145 11366314324 0014573 0 ustar 00root root 0000000 0000000 VERSION = 1.1.4
CPP=gcc
CPPFLAGS += -DVERSION="\"$(VERSION)\""
CXXFLAGS += -O2 -fomit-frame-pointer -pipe \
-Wall -W -pedantic -Wundef \
-Wcast-qual -Wcast-align -Wwrite-strings \
-Wredundant-decls -Winline
LDFLAGS +=
BINDIR=/usr/local/sbin
MANDIR=/usr/local/man/man8
INSTALL=install
PROG=bidentd
OBJS=main.o
ARCHDIR=archives/
ARCHNAME=${PROG}-$(VERSION)
ARCHFILES=main.cc ChangeLog COPYING sizes.h \
bidentd.8 progdesc.php
INSTALLPROGS=$(PROG)
DEPFUN_INSTALL=bin
$(PROG): $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $^
install: install${DEPFUN_INSTALL}
install -c -s -m 644 ${PROG}.8 ${MANDIR}/${PROG}.8
@echo Done.
@echo Now ensure that ${PROG} starts automatically from inetd.
deinstall: uninstall
uninstall: uninstall${DEPFUN_INSTALL}
startup: install
@echo You must manually make inetd spawn ${PROG}.
@echo Try adding this line to /etc/inetd.conf:
@echo auth stream tcp nowait nobody ${BINDIR}/$PROG $PROG
update: uninstall${DEPFUN_INSTALL} start
- killall -1 inetd
@echo Updated.
clean:
rm -f $(PROG) $(OBJS)
distclean: clean
rm -f core *~ .depend
realclean: distclean
include depfun.mak
bidentd-1.1.4/README.html 0000664 0000000 0000000 00000022451 11366314324 0014760 0 ustar 00root root 0000000 0000000
Bisqwit's identd
Bisqwit's identd
0. Contents
This is the documentation of bidentd-1.1.4.
1. Purpose
ident daemon for unix systems, implementing rfc1413 defined behaviour.
There is also a Debian package available, coordinated by Wesley W. Terpstra.
The package for your architechture can be downloaded from any official Debian mirror.
2. Why another identd daemon?
Because there is no other (wasn't in 2000 at least)
which worked correctly over multiple NATs.
The program works like an ident daemon is supposed to work.
It allows people to query who's connecting in which port.
Masquerading is supported, and works recursively.
Works only under Linux, due to the use of /proc filesystem.
My typical case (why I made this):
- Alpha has the internet connection. It has an ip in internet.
- Beta is masqueraded by Alpha.
- Gamma is masqueraded by Beta.
- Somebody in Gamma starts irc, and the irc server (in internet)
gets the username of the user in Gamma, correctly.
All computers in the identd masquerading chain must be
running bidentd, except the end part, which can be using
any identd daemon, as long as that one does not care about
the source ip address.
3. Notes
Version 1.0.8 and prior worked only on the 2.2 -series of the Linux kernel,
but 1.0.9 supports 2.4 too.
Since 1.1.0, kernel family 2.6 is supported too.
4. Version history
Tue 2010-04-29 09:17 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.1.4
- Integrated Thibaut Varčne's patch fixing a forwarding-looping bug.
Tue 2009-10-20 10:05 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.1.3
- Integrated Wesley W.Terpstra's patch fixing compilation.
Wed 2009-03-18 11:20 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.1.2.1
- A maintenance update that does change functionality.
Mon 2007-04-02 19:38 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.1.2
- Fixed a reported compilation error on GCC 4.3.
Sat 2005-05-13 13:35 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.1.1
- Removed the rfc file from archive to make the life easier
for the Debian politics.
Mon 2005-03-14 21:15 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.1.0
- Integrated Wesley W. Terpstra's patch for kernel 2.6-support.
- Integrated Wesley W. Terpstra's patch for root privilege
separation.
Thu 2003-02-13 15:06 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.10
- Fixed minor masquerading bugs: ^M and space were
cumulated in the reply for each masquerading chain.
- Fixed syslog: ^M was superfluously added to every message.
Tue 2002-05-14 19:33 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.9.1
- Updated the document generating mechanism.
Sun 2002-05-01 18:59 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.9
- Applied Wesley W. Terpstra's patch for kernel 2.4-support.
- Updated the documentation about Debian support.
Sun 2001-10-04 22:50 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.8
- Updated the documentation.
Sun 2001-07-14 18:27 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.7
- Some minor changes to get this to compile with gcc-3.0.
Sun 2000-11-01 23:35 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.6
- Updated the documentation.
Sun 2000-10-28 12:53 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.5
- Changed ll_normal to ll_verbose somewhere in main.cc
Mon 2000-10-23 23:37 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.4
- Applied gaia's patch
- Rewrote argv handling
- Updated the manual page
Mon 2000-10-23 23:00 Antti-Juhani Kaijanaho <gaia@iki.fi>
* Unreleased patch
- Added logging support.
- Fixed identd recommendation (nowait, not wait)
Wed 2000-10-18 20:43 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.3
- Renamed the package to bidentd, for
convenience. It was identd previously.
Wed 2000-10-18 14:33 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.2
- Reindented the sourcecode.
Wed 2000-10-18 02:56 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.1
- Whoap. I accidentally installed it
as inetd and wiped my inetd out.
- This version should be working, and supports
masquerading. It works even through chains
of masquerades - multiple masquerades. Fetching
recursively the identd from remote hosts. :)
Thu 2000-10-17 18:38 Joel Yliluoma <joel.yliluoma@iki.fi>
* Version 1.0.0
- Initial version
- Does actually nothing.
5. Copying
6. Requirements
GNU make is probably required.
7. Installation
make install (as root)
make startup (Follow the instructions)
8. Uninstallation
make uninstall
Edit /etc/inetd.conf
9. Updating from possible previous version
10. Compilation only.
11. Downloading
The official home page of bidentd
is at
http://iki.fi/bisqwit/source/bidentd.html.
Check there for new versions.
Additionally, the most recent source code (bleeding edge) for bidentd can also be downloaded by cloning the Git repository by:
Generated from
progdesc.php (last updated: Thu, 29 Apr 2010 17:33:56 +0300)
with docmaker.php (last updated: Thu, 29 Apr 2010 17:33:56 +0300)
at Thu, 29 Apr 2010 17:33:56 +0300
bidentd-1.1.4/bidentd.8 0000664 0000000 0000000 00000003504 11366314324 0014635 0 ustar 00root root 0000000 0000000 .TH BIDENTD 8 2002-05-01 "" ""
\" Written by Antti-Juhani Kaijanaho. You may treat this file as if
\" it were in the public domain.
\" Updated 2003-02-13 by Joel Yliluoma
.SH NAME
bidentd \- Bisqwit's TCP/IP Identification Protocol daemon
.SH SYNOPSIS
.B bidentd
[ -qq | -q | -v | -vv | -vvv ]
.SH DESCRIPTION
.B "Bisqwit's identd"
is a daemon for the intenet Identification Protocol described by RFC 1413.
It supports recursive IP masquerade, where a machine has
Internet access through a masquerading machine which itself has
Internet access through another masquerading machine, and so on.
The program requires no setup (no config files required).
It is designed to be run from the Internet superserver (inetd).
.PP
.B bidentd
requires no command-line arguments, but some are supported though.
Explained below.
.SH OPTIONS
The following options control the amount of information that is dumped
to the system log. Options may be specified separately or in group:
-qq equals -q -q.
.PP
.IP -qq
Output nothing to the log.
.IP -q
Output only fatal errors to the log.
.IP "(no option)"
If no option is specified, the log includes one line for every reponse
sent in addition to any fatal errors.
.IP -v
Be a little more verbose than when no option is specified.
.IP -vv
Output everything that -v outputs and additional debug information.
.IP -vvv
Output a lot of debug information in addition to everything that -v
outputs.
.SH FILES
.IP "/proc/net/tcp"
This file is required by bidentd operation
.IP "/proc/net/ip_masquerade"
If masquerade support is desired, this file is needed.
.IP "/proc/net/ip_conntrack"
This file will be used for masquerading connection
tracking if the kernel is from 2.4-series.
.SH AUTHOR
.B "Bisqwit's identd"
was written by Joel Yliluoma . Some enhancements
and this manual page were added by Antti-Juhani Kaijanaho.
bidentd-1.1.4/depfun.mak 0000664 0000000 0000000 00000016655 11366314324 0015121 0 ustar 00root root 0000000 0000000 # This is Bisqwit's generic depfun.mak, included from Makefile.
# The same file is used in many different projects.
#
# depfun.mak version 1.6.1
#
# Required vars:
#
# ${CPP} - C preprocessor name, usually "gcc"
# ${CPPFLAGS} - preprocessor flags (including defs)
#
# ${ARCHFILES} - All file names to include in archive
# .depend, depfun.mak and Makefile are
# automatically included.
# ${ARCHNAME} - Name of program. Example: testprog-0.0.1
#
# Optional vars:
#
# ${ARCHDIR} - Directory for the archives.
# Must end with '/'.
# ${INSTALLPROGS} - Programs to be installed (space delimited)
# ${BINDIR} - Directory for installed programs (without /)
# Example: /usr/local/bin
# ${INSTALL} - Installer program, example: install
# ${DEPDIRS} - Optional dependency dirs to account in .depend
#
# ${EXTRA_ARCHFILES} - More files to include in archive,
# but without dependency checking
# Note: This requires perl. FIXME change it to sed
.depend: ${ARCHFILES}
@echo "Checking dependencies..."
@rm -f $@.tmp
@for dir in "" ${DEPDIRS}; \
do n="`pwd`";\
if [ ! -z "$$dir" ]; then cd "$$dir"; fi; \
for s in *.c *.cc *.cpp; \
do if echo "$$s"|grep -vq '^\*';\
then \
cd "$$n";\
${CPP} ${CPPFLAGS} -MM -MG "$$dir""$$s" |\
perl -pe "s|^([^ ])|$$dir\\1|" \
> $@."$$s";\
fi&done; \
cd "$$n"; \
done; wait
@touch $@.dummy
@cat $@.* >$@
@cp -f $@ $@.tmp
@sed 's/\.o:/.lo:/' <$@.tmp >>$@
@rm -f $@.*
depend dep: .depend
-include .depend
git_release: ${ARCHFILES} ;
# Create the release commit
git commit --allow-empty -a -m 'Release version ${VERSION} (dev)' # commit in dev brach
git rev-parse HEAD > .git/PUSHED_HEAD
git checkout release || git checkout -b release
#
# Set the cache & index to exact copy of the original branch
#
git rm -fr --cached '*' &> /dev/null
git checkout PUSHED_HEAD .
#
# Limit the index to those files we publish
#
git rm -fr --cached '*' &> /dev/null
git add -f --ignore-errors ${ARCHFILES} ${EXTRA_ARCHFILES} depfun.mak Makefile
@if [ -f docmaker.php ]; then php -q docmaker.php ${ARCHNAME} > README.html; git add docmaker.php README.html; fi
@if [ -f makediff.php ]; then git add makediff.php; fi
#
# Create a merge commit
#
cp .git/PUSHED_HEAD .git/MERGE_HEAD
git commit -m 'Release version ${VERSION}' # commit in release
#
# Create the archive
#
@- mkdir ${ARCHDIR} 2>/dev/null
git archive --format=tar --prefix=${ARCHNAME}/ HEAD > ${ARCHDIR}${ARCHNAME}.tar
# Return to the original branch
git checkout -f $$(cd .git/refs/heads;grep -l `cat ../../PUSHED_HEAD` * || echo PUSHED_HEAD)
git update-server-info
@make arch_finish_pak
@make omabin_link${DEPFUN_OMABIN}
git_test_release: ${ARCHFILES}
# Create the testing commit
git commit --allow-empty -a -m 'Test release ${VERSION} (dev)' # commit in dev branch
git rev-parse HEAD > .git/PUSHED_HEAD
git checkout release || git checkout -b release
#
# Backup the HEAD in release branch
#
git rev-parse release > .git/RELEASE_HEAD
#
# Set the cache & index to exact copy of the original branch
#
git rm -fr --cached '*' &> /dev/null
git checkout PUSHED_HEAD .
#
# Limit the index to those files we publish
#
git rm -fr --cached '*' &> /dev/null
git add -f --ignore-errors ${ARCHFILES} ${EXTRA_ARCHFILES} depfun.mak Makefile
@if [ -f docmaker.php ]; then php -q docmaker.php ${ARCHNAME} > README.html; git add docmaker.php README.html; fi
@if [ -f makediff.php ]; then git add makediff.php; fi
#
# Create a merge commit
#
cp .git/PUSHED_HEAD .git/MERGE_HEAD
git commit -m 'Test release' # commit in release
#
# Create the testing directory
#
rm -rf test_release
git archive --format=tar --prefix=test_release/ HEAD | tar xvf - | sed 's/^/ /'
#
# Reset the release branch to its previous state
#
git reset --hard RELEASE_HEAD
# Return to the original branch
git checkout -f $$(cd .git/refs/heads;grep -l `cat ../../PUSHED_HEAD` * || echo PUSHED_HEAD)
git update-server-info
git gc --quiet
@echo
@echo ----------------------------------------------------------------------
@echo 'Would-be release extracted to test_release/ -- go ahead and try it.'
@echo ----------------------------------------------------------------------
@echo
UNUSED_archpak: ${ARCHFILES} ;
@if [ "${ARCHNAME}" = "" ]; then echo ARCHNAME not set\!;false;fi
- mkdir ${ARCHNAME} ${ARCHDIR} 2>/dev/null
cp --parents -lfr ${ARCHFILES} ${EXTRA_ARCHFILES} depfun.mak Makefile ${ARCHNAME}/ 2>&1 >/dev/null | while read line;do cp --parents -fr "`echo "$$line"|sed 's/.*${ARCHNAME}\///;s/'\''.*//'`" ${ARCHNAME}/; done
- if [ -f docmaker.php ]; then php -q docmaker.php ${ARCHNAME} >README.html; ln -f docmaker.php README.html ${ARCHNAME}/;fi
if [ -f makediff.php ]; then ln -f makediff.php ${ARCHNAME}/; fi
#- rm -f ${ARCHDIR}${ARCHNAME}.zip
#- zip -9rq ${ARCHDIR}${ARCHNAME}.zip ${ARCHNAME}/
#- rar a ${ARCHDIR}${ARCHNAME}.rar -mm -m5 -r -s -inul ${ARCHNAME}/
#tar cf ${ARCHDIR}${ARCHNAME}.tar ${ARCHNAME}/
#
find ${ARCHNAME}/ -type d > .paktmp.txt
find ${ARCHNAME}/ -not -type d | rev | sort | rev >> .paktmp.txt
#find ${ARCHNAME}/|/ftp/backup/bsort >.paktmp.txt
tar -c --no-recursion -f ${ARCHDIR}${ARCHNAME}.tar -T.paktmp.txt
rm -rf .paktmp.txt ${ARCHNAME}
@make arch_finish_pak
arch_finish_pak:
- if [ "${NOBZIP2ARCHIVES}" = "" ]; then bzip2 -9 >${ARCHDIR}${ARCHNAME}.tar.bz2 < ${ARCHDIR}${ARCHNAME}.tar; fi
if [ "${NOGZIPARCHIVES}" = "" ]; then gzip -f9 ${ARCHDIR}${ARCHNAME}.tar; fi
rm -f ${ARCHDIR}${ARCHNAME}.tar
# Makes the packages of various types...
UNUSED_pak: archpak ;
if [ -f makediff.php ]; then php -q makediff.php ${ARCHNAME} ${ARCHDIR} 1; fi
omabin_link${DEPFUN_OMABIN}:
- @rm -f /WWW/src/arch/${ARCHNAME}.tar.{bz2,gz}
- ln -f ${ARCHDIR}${ARCHNAME}.tar.{bz2,gz} /WWW/src/arch/
if [ -f progdesc.php ]; then cp -p --remove-destination progdesc.php /WWW/src/.desc-$(subst /,,$(dir $(subst -,/,$(ARCHNAME)))).php 2>/dev/null || cp -fp progdesc.php /WWW/src/.desc-$(subst /,,$(dir $(subst -,/,$(ARCHNAME)))).php; fi
# This is Bisqwit's method to install the packages to web-server...
UNUSED_omabin${DEPFUN_OMABIN}: archpak
if [ -f makediff.php ]; then php -q makediff.php ${ARCHNAME} ${ARCHDIR}; fi
#- @rm -f /WWW/src/arch/${ARCHNAME}.{zip,rar,tar.{bz2,gz}}
#- ln -f ${ARCHDIR}${ARCHNAME}.{zip,rar,tar.{bz2,gz}} /WWW/src/arch/
@make omabin_link${DEPFUN_OMABIN}
install${DEPFUN_INSTALL}: ${INSTALLPROGS}
- if [ ! "${BINDIR}" = "" ]; then mkdir --parents $(BINDIR) 2>/dev/null; mkdir $(BINDIR) 2>/dev/null; \
for s in ${INSTALLPROGS} ""; do if [ ! "$$s" = "" ]; then \
${INSTALL} -c -s -o bin -g bin -m 755 "$$s" ${BINDIR}/"$$s";fi;\
done; \
fi; \
if [ ! "${MANDIR}" = "" ]; then mkdir --parents $(MANDIR) 2>/dev/null; mkdir $(MANDIR) 2>/dev/null; \
for s in ${INSTALLMANS} ""; do if [ ! "$$s" = "" ]; then \
${INSTALL} -m 644 "$$s" ${MANDIR}/man"`echo "$$s"|sed 's/.*\.//'`"/"$$s";fi;\
done; \
fi
uninstall${DEPFUN_INSTALL} deinstall${DEPFUN_INSTALL}:
for s in ${INSTALLPROGS}; do rm -f ${BINDIR}/"$$s";done
- for s in ${INSTALLLIBS}; do rm -f ${LIBDIR}/"$$s";done
for s in ${INSTALLMANS} ""; do if [ ! "$$s" = "" ]; then \
rm -f ${MANDIR}/man"`echo "$$s"|sed 's/.*\.//'`"/"$$s";fi;\
done; \
.PHONY: pak dep depend archpak omabin \
install${DEPFUN_INSTALL} \
deinstall${DEPFUN_INSTALL} \
uninstall${DEPFUN_INSTALL}
bidentd-1.1.4/docmaker.php 0000664 0000000 0000000 00000007650 11366314324 0015437 0 ustar 00root root 0000000 0000000
=htmlspecialchars($title)?>
=htmlspecialchars($title)?>
0. Contents
This is the documentation of =htmlspecialchars($archivename)?>.
$url = 'http://iki.fi/bisqwit/source/'.rawurlencode($progname).'.html';
$k = '
The official home page of '.htmlspecialchars($progname).'
is at '.htmlspecialchars($url).'.
Check there for new versions.
';
if(isset($git))
{
$k .=
''.
'Additionally, the most recent source code (bleeding edge) for '.htmlspecialchars($progname).
' can also be downloaded by cloning the Git repository'.
' by:
';
}
$text['download:99999. Downloading'] = $k;
include $docformatfn;
$st1 = stat($docmodulefn);
$st2 = stat('docmaker.php');
?>
Generated from
=$docmodulefn?> (last updated: =date('r', $st1[9])?>)
with docmaker.php (last updated: =date('r', $st2[9])?>)
at =date('r')?>
if($outset)
{
$s = ob_get_contents();
ob_end_clean();
if(file_exists('/usr/local/bin/htmlrecode'))
{
/* Try to ensure browser interpretes japanese characters correctly */
passthru('echo '.shellfix($s).
'|/usr/local/bin/htmlrecode -Iiso-8859-1 -O'.$outset.' 2>/dev/null');
}
else
print $s;
}
bidentd-1.1.4/main.cc 0000664 0000000 0000000 00000020245 11366314324 0014367 0 ustar 00root root 0000000 0000000 #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
/* This client does not care about the remote host name,
* because a local port can not be reserved twice at the same time.
*/
using namespace std;
#include "sizes.h"
#ifdef __GNUC__
# define FORMAT(p,a,b) __attribute__((format(p,a,b)))
#else
# define FORMAT(p,a,b) /* none */
#endif
static unsigned localport=0;
static unsigned remoteport=0;
static FILE *ipm, *ipc, *tcp;
static string RespType;
static string AddInfo;
enum loglevel_t { ll_none=0, ll_quiet, ll_normal, ll_verbose, ll_debug, ll_verbosedebug };
static int ll2sysloglevel[] = { LOG_CRIT, LOG_ERR, LOG_NOTICE, LOG_DEBUG, LOG_DEBUG, LOG_DEBUG };
static int loglevel = ll_normal;
static void msyslog(enum loglevel_t ll, const char *msg, ...) FORMAT(printf, 2, 3);
static void msyslog(enum loglevel_t ll, const char *msg, ...)
{
char buf[2048];
va_list ap;
if (loglevel < ll) return;
va_start(ap, msg);
vsnprintf(buf, sizeof(buf), msg, ap);
va_end(ap);
syslog(ll2sysloglevel[ll], "%s", buf);
}
static int lgetchar()
{
char c;
int rv = EOF;
if(read(0, &c, 1) > 0)rv = c;
//int rv = getchar();
if (isprint(rv))
msyslog(ll_verbosedebug, "read char %i (%c)", rv, rv);
else
msyslog(ll_verbosedebug, "read char %i", rv);
return rv;
}
static int Done(int code=0)
{
msyslog(ll_normal, "%u, %u : %s : %s\n", localport, remoteport, RespType.c_str(), AddInfo.c_str());
printf("%u, %u : %s : %s\r\n", localport, remoteport, RespType.c_str(), AddInfo.c_str());
if(code)
{
closelog();
exit(code);
}
return code;
}
static int Error(const char *ErrorType = "INVALID-PORT")
{
int code = -1;
RespType = "ERROR";
if(!ErrorType)
{
ErrorType = "UNKNOWN-ERROR";
code = errno;
}
AddInfo = ErrorType;
return Done(code);
}
static DWORD byteswap(DWORD n)
{
return ((n&0xFF) << 24)
| ((n&0xFF00) << 8)
| ((n&0xFF0000) >> 8)
| ((n&0xFF000000) >> 24);
}
static int Forward(DWORD host, int lport, int rport)
{
in_addr addr = { byteswap(host) };
msyslog(ll_debug, "(forward) host = %s, lport = %i, rport = %i",
inet_ntoa(addr), lport, rport);
int sock = socket(AF_INET, SOCK_STREAM, 0);
if(sock < 0)
{
if (loglevel >= ll_normal) msyslog(ll_quiet, "cannot bind socket");
Error(NULL);
}
struct sockaddr_in madr;
memset(&madr, 0, sizeof madr);
madr.sin_port = htons(113);
madr.sin_family = AF_INET;
madr.sin_addr.s_addr = byteswap(host);
if(connect(sock, (struct sockaddr *)&madr, sizeof madr) < 0)
{
if (loglevel >= ll_normal) msyslog(ll_quiet, "cannot connect");
Error(NULL);
}
char Buf[256];
sprintf(Buf, "%d,%d\r\n", rport, lport);
msyslog(ll_verbose, "Forwarding to host %s the following request: %s\n",
inet_ntoa(addr), Buf);
write(sock, Buf, strlen(Buf));
char c;
while(read(sock, &c, 1)==1 && c!=':') { }
for(RespType=""; read(sock, &c, 1)==1 && c != ':'; )if(RespType.size() || c!=' ')if(c != ' ')RespType += c;
for(AddInfo=""; read(sock, &c, 1)==1 && c != '\n'; )if(AddInfo.size() || c!=' ')if(c != '\r')AddInfo += c;
return close(sock) ? errno : 0;
}
static int Resolve(void)
{
FILE *fp;
char Buf[256];
if((fp = tcp) != NULL)
{
while(fgets(Buf, 255, fp))
{
unsigned l, r, uid, state;
sscanf(Buf, "%*u: %*X:%X %*X:%X %X %*X:%*X %*X:%*X %*X %u", &l, &r, &state, &uid);
msyslog(ll_debug, " (tcp parse) l = %u, r = %u, state = %u, uid = %u", l, r, state, uid);
// This was a bad guess:
// if(state != IPPROTO_TCP)continue;
if(l==localport && r==remoteport)
{
const struct passwd *p = getpwuid(uid);
RespType = "USERID";
AddInfo = "UNIX : ";
if(p)
AddInfo += p->pw_name;
else
{
sprintf(Buf, "%u", uid);
AddInfo += Buf;
}
return 0;
}
}
fclose(fp);
}
if((fp = ipm) != NULL)
{
while(fgets(Buf, 255, fp))
{
unsigned l, r, masqport;
DWORD masqhost;
char proto[5];
sscanf(Buf, "%s %X:%X %*X:%X %X", proto, &masqhost, &l, &r, &masqport);
in_addr masqaddr = { byteswap(masqhost) };
msyslog(ll_debug, " (masq parse) proto = %s, masqhost = %s, l = %u, r = %u, masqport = %u",
proto, inet_ntoa(masqaddr), l, r, masqport);
if(strcmp(proto, "TCP"))continue;
if(r == remoteport && masqport == localport)
return Forward(masqhost, r, l);
}
fclose(fp);
}
/* 2.4.-kernel support by Wesley W. Terpstra */
if((fp = ipc) != NULL)
{
while(fgets(Buf, 255, fp))
{
unsigned l, r, masqport;
char proto[20];
char masqhosts[20];
char* a = strstr(Buf, "src=");
if(!a)continue;
char* b = strstr(a+1, "src=");
if(!b)continue;
sscanf(Buf, "%19s %*d %*d", proto);
sscanf(a, "src=%19s %*s sport=%u %*s",
masqhosts, &l);
sscanf(b, "%*s %*s sport=%u dport=%u",
&r, &masqport);
msyslog(ll_debug, " (conntrack parse) proto = %s, masqhost = %s, l = %u, r = %u, masqport = %u\n",
proto, masqhosts, l, r, masqport);
DWORD masqhost = inet_addr(masqhosts);
if(strcmp(proto, "tcp"))continue;
if(r == remoteport && masqport == localport)
return Forward(byteswap(masqhost), r, l);
}
fclose(fp);
}
return Error("NO-USER");
}
int main(int argc, const char *const *argv)
{
const char *const a0 = *argv;
int help=0, error=0;
/* Support for modern 2.4 and 2.6 kernels (root-only proc): */
/* use root priveledges to open protected files */
ipm = fopen("/proc/net/ip_masquerade", "rt");
ipc = fopen("/proc/net/ip_conntrack", "rt");
tcp = fopen("/proc/net/tcp", "rt");
/* drop priveledges */
setregid(65534, 65534); /* nogroup */
setreuid(65534, 65534); /* nobody */
loglevel = ll_normal;
while(--argc > 0)
{
const char *s = *++argv;
if(*s == '-')
while(*++s)
switch(*s)
{
case 'q': if(loglevel > ll_none)--loglevel; break;
case 'v': if(loglevel < ll_verbosedebug)++loglevel; break;
case 'h':
case '?': ++help; break;
default: ++error; break;
}
else if(!strcmp(s, "--help"))
++help;
else
++error;
}
if(error || help)
{
fprintf(stderr,
"Bisqwit's identd version "VERSION"\n"
"Copyright (C) 1992,2005 Bisqwit (http://iki.fi/bisqwit/)\n"
"\n"
"To be spawned from inetd. Usage:\n"
" %s \n"
" -q Quieter (-qq=max)\n"
" -v Verboser (-vvv=max)\n"
"\n"
"Read the installation instructions from INSTALL.\n\n", a0);
return -error;
}
openlog(a0, LOG_PID, LOG_DAEMON);
int l, r, c;
for(l=0; isdigit(c = lgetchar()); )l = l*10 + (c-'0');
msyslog(ll_debug, "(request parsing) l= %i", l);
while(c == ' ')c = lgetchar();
if(c != ',') { msyslog(ll_debug, "missing comma in request"); Error(); }
for(r=0; isdigit(c = lgetchar()) || c==' '; )if(c!=' ')r = r*10 + (c-'0');
msyslog(ll_debug, "(request parsing) r= %i", r);
while(c == '\r')c = lgetchar();
if(c != '\n' && c != EOF) { msyslog(ll_debug, "message did not end at \\n"); Error(); }
remoteport = r;
localport = l;
int rv = Done(Resolve());
closelog();
return rv;
}
bidentd-1.1.4/makediff.php 0000664 0000000 0000000 00000026170 11366314324 0015416 0 ustar 00root root 0000000 0000000 = 2)
{
$oldest=''; $oldesttime=999999999;
foreach($openfiles as $fn => $puh)
{
$keep = 0;
foreach($keeplist as $keepfn) if($fn == $keepfn) { $keep=1; break; }
if($keep) continue;
if($puh['time'] < $oldesttime) { $oldesttime = $puh['time']; $oldest = $fn; }
}
if($oldest)
{
Close($oldest);
}
}
$pick = '';
foreach($files as $fn)
if(ereg('\.tar\.gz$', $fn))
{
$pick = $fn;
break;
}
if(!$pick)
{
reset($files);
list($dummy, $pick) = each($files);
}
GoTmp();
@mkdir($subtmpdir, 0700);
chdir($subtmpdir);
if(ereg('\.tar\.gz$', $pick))
{
print "\ttar xfz ../".shellfix($pick)."\n";
exec('tar xfz ../../'.shellfix($pick));
}
else
{
print "\tbzip2 -d < ../".shellfix($pick)."| tar xf -\n";
exec('bzip2 -d < ../../'.shellfix($pick).'| tar xf -');
}
$thisdir = exec('echo *');
exec('mv * ../');
chdir('..');
global $timeind;
$openfiles[$pick] = array('dir' => $thisdir, 'time' => ++$timeind);
return $thisdir;
}
function Close($fn)
{
global $openfiles;
global $archtmpdir;
$puh = $openfiles[$fn];
if(!$puh) return;
$prefix = IsInTmp() ? '' : $archtmpdir.'/';
$cmd = 'rm -rf '.shellfix($prefix.$puh['dir']);
print "\t$cmd\n";
exec($cmd);
unset($openfiles[$fn]);
}
function CloseAll()
{
global $openfiles;
global $archtmpdir;
UnGoTmp();
$openfiles = Array();
$cmd = 'rm -rf '.shellfix($archtmpdir);
print "\t$cmd\n";
exec($cmd);
}
function MakeDiff($dir1, $dir2, $patchname)
{
GoTmp();
#print "## Building $patchname from $dir1 and $dir2\n";
#passthru('ls -al');
/*
Before doing the diff, we should do the following:
- Remove all symlinks
- Remove all duplicate hardlinks
*/
/* Gather up inode numbers. */
$data1 = FindInodes($dir1);
$data2 = FindInodes($dir2);
$era1 = Array();
$era2 = Array();
foreach($data1['if'] as $ino => $fils)
{
if(count($fils) > 1)
{
$bestcommoncount = 0;
$bestcommon = $fn;
$group2 = array();
foreach($fils as $fn)
{
$ino2 = $data2['fi'][$fn];
if(!isset($ino2))continue;
$fils2 = $data2['if'][$ino2];
$common = array_intersect($fils, $fils2);
if(count($common) > $bestcommoncount)
{
$bestcommoncount = count($common);
$bestcommon = $fn;
$group2 = $fils2;
}
}
$common = array_intersect($fils, $group2);
// Leave one file so that diff works
reset($common);
list($dummy, $fn) = each($common);
unset($common[$dummy]);
foreach($common as $fn)
{
$era1[] = $fn;
$era2[] = $fn;
}
}
}
if(count($era1))
{
chdir($dir1); print "\tcd $dir1\n";
$cmd = 'rm -f';
foreach($era1 as $fn)$cmd .= ' '.shellfix($fn);
print "\t$cmd\n";
exec($cmd);
chdir('..'); print "\tcd ..\n";
}
if(count($era2))
{
chdir($dir2); print "\tcd $dir2\n";
$cmd = 'rm -f';
foreach($era1 as $fn)$cmd .= ' '.shellfix($fn);
print "\t$cmd\n";
exec($cmd);
chdir('..'); print "\tcd ..\n";
}
$cmd = 'LC_ALL=C LANG=C diff -NaHudr '.shellfix($dir1) . ' ' . shellfix($dir2).' > '.shellfix($patchname);
print "\t$cmd\n";
exec($cmd);
}
function FindInodes($directory)
{
for($try = 0; $try < 10; $try++)
{
$fp = @opendir($directory);
if($fp) break;
print "OPENDIR $directory failed (cwd=".getcwd()."), retrying\n";
sleep(1);
}
if($try == 10)
{
print "OPENDIR $directory failed (cwd=".getcwd().")!\n";
exit;
}
$inofil = array();
$filino = array();
while(($fn = readdir($fp)))
{
if($fn=='.' || $fn=='..')continue;
if($directory != '.')
$fn = $directory.'/'.$fn;
$st = stat($fn);
$ino = $st[0].':'.$st[1];
$inofil[$ino][] = $fn;
$filino[$fn] = $ino;
if(is_dir($fn))
{
$sub = FindInodes($fn);
$filino = $filino + $sub['fi'];
foreach($sub['if'] as $ino => $fil)
{
$tgt = &$inofil[$ino];
if(is_array($tgt))
$tgt = array_merge($tgt, $fil);
else
$tgt = $fil;
}
unset($tgt);
}
}
closedir($fp);
return array('if' => $inofil, 'fi' => $filino);
}
function MakePatch($progname, $v1, $v2, $paks1, $paks2)
{
// print "Make patch for $progname $v1 - $v2\n";
// Available packages for prog1: print_r($paks1);
// Available packages for prog2: print_r($paks2);
$v1 = ereg_replace('(-----)*$', '', $v1);
$v2 = ereg_replace('(-----)*$', '', $v2);
$v1string = ereg_replace('\.$', '', preg_replace('|(.....)|e', '(str_replace("-","","$1"))."."', $v1));
$v2string = ereg_replace('\.$', '', preg_replace('|(.....)|e', '(str_replace("-","","$1"))."."', $v2));
$files1 = Array();
foreach($paks1 as $ext)
$files1[] = $progname . '-' . $v1string . '.' . $ext;
$files2 = Array();
foreach($paks2 as $ext)
$files2[] = $progname . '-' . $v2string . '.' . $ext;
$keeplist = array_merge($files1, $files2);
$dir1 = Open($files1, $keeplist);
$dir2 = Open($files2, $keeplist);
$patchname = "patch-$progname-$v1string-$v2string";
MakeDiff($dir1, $dir2, $patchname);
GoTmp();
$cmd = "gzip -9 ".shellfix($patchname);
print "\t$cmd\n";
exec($cmd);
$cmd = "gzip -d < ".shellfix($patchname). ".gz | bzip2 -9 > ".shellfix($patchname).".bz2";
print "\t$cmd\n";
exec($cmd);
$cmd = "mv -f ".shellfix($patchname).".{gz,bz2} ../";
print "\t$cmd\n";
exec($cmd);
UnGoTmp();
$cmd = "touch -r".shellfix($files2[0])." ".shellfix($patchname).".{gz,bz2}";
print "\t$cmd\n";
exec($cmd);
$cmd = "chown --reference ".shellfix($files2[0])." ".shellfix($patchname).".{gz,bz2}";
print "\t$cmd\n";
exec($cmd);
global $argv;
if(!$argv[3])
{
$cmd = 'ln -f '.shellfix($patchname).'.{gz,bz2} /WWW/src/arch/';
print "\t$cmd\n";
exec($cmd);
}
}
$progs = array();
$fp = opendir('.');
$f = array();
while(($fn = readdir($fp)))
{
if(ereg('\.sh\.(gz|bz2)$', $fn))continue;
if(ereg('^patch-.*-[0-9].*-[0-9].*\...*', $fn))
{
preg_match(
'/^patch-(.*(?:-opt)?)-([0-9][0-9.a-z-]*)-([0-9][0-9.a-z-]*)\.([a-z0-9]+)$/', $fn, $tab);
// tab[0] = fn
// tab[1] = progname
// tab[2] = old version
// tab[3] = new version
// tab[4] = compression type (gz, bz2)
$progname = $tab[1];
$version1 = calcversion($tab[2]);
$version2 = calcversion($tab[3]);
$archtype = $tab[4];
# print "patch prog {$tab[1]} vers1 {$tab[2]} vers2 {$tab[3]} comp {$tab[4]}\n";
$progs[$progname]['p'][$version1][$version2][$archtype] = $archtype;
}
else
{
preg_match('/(.*(?:-opt)?)-((?!-opt)[0-9][0-9.a-z-]*)\.(tar\.[a-z0-9]+|zip|rar)$/', $fn, $tab);
// tab[0] = fn
// tab[1] = progname
// tab[2] = version
// tab[3] = archive type (tar.gz, tar.bz2, zip, rar)
#print "$fn:\n";
#print_r($tab);
$progname = $tab[1];
$version = calcversion($tab[2]);
$archtype = $tab[3];
if($archtype != 'zip' && $archtype != 'rar')
{
# print "prog {$tab[1]} vers {$tab[2]} comp {$tab[3]}\n";
$progs[$progname]['v'][$version][$archtype] = $archtype;
}
}
}
closedir($fp);
$argv[1] = preg_replace('@^[^-]*(?:-opt)?-([0-9])@', '\1', $argv[1]);
$wantversion = strlen($argv[1]) ? calcversion($argv[1]) : '';
foreach($progs as $progname => $data)
{
$versions = $data['v'];
ksort($versions);
$wantpatches = Array();
$verstabs = Array();
for($c=1; $c<=6; $c++)
{
foreach($versions as $version => $paks)
{
$k = substr($version, 0, $c*5);
$verstabs[$c][$k] = $k;
}
asort($verstabs[$c]);
}
$lastversio = '';
foreach($versions as $version => $paks)
{
if($lastversio)
{
$did = Array($lastversio => 1);
$wantpatches[$lastversio][$version] = 1;
for($c=1; $c<=5; ++$c)
{
$prev = '';
$k = substr($version, 0, $c*5);
$test = str_pad($k, 5*6, '-');
if($test != $version
&& isset($versions[$test])) continue;
foreach($verstabs[$c] as $k2)
{
if($k2 == $k)break;
$prev = $k2;
}
if($prev)
{
$prev = str_pad($prev, 5*6, '-');
if(isset($versions[$prev]) && !$did[$prev])
{
$did[$prev] = 1;
// Extra
$wantpatches[$prev][$version] = 1;
}
}
}
}
$lastversio = $version;
}
foreach($wantpatches as $version1 => $v2tab)
{
foreach($v2tab as $version2 => $dummy)
{
if(strlen($wantversion))
{
if($version2 != $wantversion)
{
continue;
}
}
else if(isset($progs[$progname]['p'][$version1][$version2]))
{
continue;
}
MakePatch($progname, $version1, $version2,
$versions[$version1],
$versions[$version2]);
}
}
}
print_r($thisdir);
CloseAll();
UnGoTmp();
bidentd-1.1.4/progdesc.php 0000664 0000000 0000000 00000005065 11366314324 0015456 0 ustar 00root root 0000000 0000000 "
ident daemon for unix systems, implementing rfc1413 defined behaviour.
There is also a Debian package available, coordinated by Wesley W. Terpstra.
The package for your architechture can be downloaded from any official Debian mirror.
", '1. Why another identd daemon?' => "
Because there is no other (wasn't in 2000 at least)
which worked correctly over multiple NATs.
The program works like an ident daemon is supposed to work.
It allows people to query who's connecting in which port.
Masquerading is supported, and works recursively.
Works only under Linux, due to the use of /proc filesystem.
My typical case (why I made this):
- Alpha has the internet connection. It has an ip in internet.
- Beta is masqueraded by Alpha.
- Gamma is masqueraded by Beta.
- Somebody in Gamma starts irc, and the irc server (in internet)
gets the username of the user in Gamma, correctly.
All computers in the identd masquerading chain must be
running bidentd, except the end part, which can be using
any identd daemon, as long as that one does not care about
the source ip address.
", '1. Notes' => "
Version 1.0.8 and prior worked only on the 2.2 -series of the Linux kernel,
but 1.0.9 supports 2.4 too.
Since 1.1.0, kernel family 2.6 is supported too.
", '1. Version history' => "
".htmlspecialchars($k)."
", '1. Copying' => "
bidentd has been written by
Joel Yliluoma,
and is distributed under the terms of the
General Public License (GPL).
", '1. Requirements' => "
GNU make is probably required.
", '1. Installation' => "
make install (as root)
make startup (Follow the instructions)
", '1. Uninstallation' => "
make uninstall
Edit /etc/inetd.conf
", '1. Updating from possible previous version' => "
make update
", '1. Compilation only.' => "
make
");
include '/WWW/progdesc.php';
bidentd-1.1.4/sizes.h 0000664 0000000 0000000 00000002040 11366314324 0014433 0 ustar 00root root 0000000 0000000 #ifndef bisq_sizes_h
#define bisq_sizes_h
/*
* This is Bisqwit's generic sizes.h.
* The same file is used in many different projects.
*
* sizes.h version 1.1.1
*/
#ifdef DJGPP
typedef unsigned char uint8_t;
typedef unsigned char uint_fast8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef unsigned int uint_fast16_t;
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed long int32_t;
#else
#include
#endif
/*
* Copyright (C) 1992,2000 Bisqwit (http://iki.fi/bisqwit/)
* No warranty. You are free to modify this source, and to
* distribute modified sources, as long as you keep the
* existing copyright messages intact and as long as you
* remember to add your own copyright markings.
*
* This text may only apply to this file (sizes.h).
*/
typedef uint8_t BYTE;
typedef uint_fast8_t fBYTE;
typedef uint16_t WORD;
typedef uint_fast16_t fWORD;
typedef uint32_t DWORD;
typedef int8_t SBYTE;
typedef int16_t SWORD;
typedef int32_t SDWORD;
#endif