work/ 0000755 0000000 0000000 00000000000 14141560754 006735 5 ustar work/.gitignore 0000644 0000000 0000000 00000000637 14141560754 010733 0 ustar *.o
*~
*.new
debian/*.substvars
debian/*.debhelper.log
debian/files
debian/debhelper-build-stamp
debian/.debhelper
debian/userv-utils
debian/userv-ucgi
debian/userv-dyndns
debian/userv-git-daemon
debian/userv-groupmanage
debian/userv-ipif
dist_tmp
userv-utils-*.tar.gz
build
git-daemon/git-upload-pack
git-daemon/inetd.conf
git-daemon/git-daemon
git-daemon/git-service
git-daemon/sedscript
git-daemon/logrotate
work/COPYING 0000644 0000000 0000000 00000104513 14141560754 007774 0 ustar GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
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
state 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)
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 3 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, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
.
work/Makefile 0000644 0000000 0000000 00000002341 14141560754 010375 0 ustar # Copyright 1996-2013 Ian Jackson
# Copyright 1998 David Damerell
# Copyright 1999,2003
# Chancellor Masters and Scholars of the University of Cambridge
# Copyright 2010 Tony Finch
#
# This 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
all:
@echo >&2 'See README. This is not a unified package.'
SUBDIRS_DISTCLEAN= www-cgi ipif git-daemon
distclean:
find . \( -name '*~' -o -name '#*#' -o -name '*.o' -o -name core \
-o -name dist_tmp -o -name userv-utils-\*.tar.gz \
-o -name '.#*' \) \
-print0 | xargs -0r rm -rf --
for f in $(SUBDIRS_DISTCLEAN); do make -C $$f distclean; done
work/README 0000644 0000000 0000000 00000006373 14141560754 007626 0 ustar This is userv-utils. It is a collection of utilities, scripts and example
configuration files that serve both as examples for how to use userv, and in
some cases, hopefully as useful programs and services.
Please see each individual directory for any details, installation
instructions, documentation, invididual copyright statements, and anything
else, that is available.
If you do not know what userv is, see its WWW page at
http://www.chiark.greenend.org.uk/~ian/userv/. For now at least, the
userv mailing lists should be used to discuss these and other
userv-using programs.
Please send bug reports and suggestions to
ijackson@chiark.greenend.org.uk, or to the userv-discuss mailing
list if you are subscribed to it.
Here is a quick summary of the currently available utilities
Directory Status Description (UC=`users can ...')
--------------- ----- ------------------------------------------------
groupmanage Y Y A UC create groups, add/remove members, &c
ipif Y Y A UC create IP interfaces/VPNs (Linux-specific)
www-cgi Y Y A UC provide CGIs which run as themselves
misc/mailq* Y S S UC list mail queue even if sendmail forbids
misc/ndc-reload Y S S UC reload named after editing own zone files
misc/checkpass* Y Y S UC check own password; some can check any passwd
git-daemon Y Y Y UC safely publish git repositories on port 9418
newsrc-lg X B X Acquire list of subscribed groups from .newsrcs
dyndns Y Y Y UC edit simple DNS entries for certian domains
Key to the Status:
First letter is completeness:
Y Complete.
P Partially complete, some glue or modification needed.
X Incomplete. Much extra stuff is required.
Second letter is general status:
Y Released; hopefully of production quality.
B Beta. Not fully released, but hopefully useful with care.
A Alpha. Probably buggy. Not well tested or widely used.
X Example/experimental - for documentation purposes only,
not recommended for use.
S Too small for this question to be relevant.
Third letter is documentation:
Y Full installation and use instructions included.
A Documentation is believed largely adequate, but a bit rough.
P Partial documentation or hints. Good sysadmins should cope.
X No documentation. Good luck !
S Too small to need any significant documentation.
userv-utils are
Copyright 1996-2013,2016 Ian Jackson
Copyright 1998 David Damerell
Copyright 1999,2003
Chancellor Masters and Scholars of the University of Cambridge
Copyright 2010 Tony Finch
Copyright 2013,2016 Mark Wooding
All the utilities here are 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
Local variables:
mode: text
fill-column: 77
End:
work/changelog 0000644 0000000 0000000 00000016541 14141560754 010616 0 ustar userv-utils (0.6.1) unstable; urgency=medium
* Collect into userv-utils all the services which don't involve creating
users, etc. Move the services.d files to services-available, and move
the service-specific configurations into their enabled locations where
appropriate.
* Move the upstream changelog into ./changelog, to make room for
a Debian-specific upstream changelog.
* ipif: Provide ipif-access aka ipif/service-wrap, new access control
wrapper program for service with a new better syntax.
[Ian Jackson; fixes from Mark Wooding]
* ipif: Fix some option-handling bugs.
* ipif: Tidy up some compiler warnings. [Mark Wooding]
-- Ian Jackson Wed, 04 Aug 2021 22:48:27 +0100
userv-utils (0.6.0~~iwj3) unstable; urgency=low
* Correct binary package dependencies by referencing substvars in
debian/control.
* Add dependency on debhelper.
* No longer mention SLIP and udptunnel in the userv-ipif Description.
* Americanise spelling of /usr/share/common-licences to ...-licenses.
* Add debhelper token to postinst scripts.
* Change default user for git-daemon to userv-git and
default user for dyndns to userv-dyndns.
* Improve adduser calls:
- no longer guard with calls to id, as adduser --quiet is idempotent
- pass --shell /bin/false and --no-create-home
* Bump Standards-Version to 3.7.0.0.
* Fix typo in userv-cgi long description.
* Provide various documentation for userv-cgi in /usr/share.
* Remove obsolete and broken dist target in root Makefile.
* Add quirkafleeg to git-daemon/Makefile to placate emacs makefile mode.
* www-cgi: Overhaul of env var handling (thanks to Mark Wooding).
* Make deprecated things not built by default by Makefile (and remove
code in debian/rules for achieving this).
-- Ian Jackson Fri, 14 Apr 2017 15:58:46 +0100
userv-utils (0.6.0~~iwj2) unstable; urgency=low
* Use dh(1). WIP.
-- Ian Jackson Sun, 08 Dec 2013 13:38:23 +0000
userv-utils (0.6.0~~iwj1) unstable; urgency=low
* WIP
* www-cgi: Promise better status for this utility.
* mailq: Clarify set of relevant files in README.
* dyndns: Docuument existence in README.
* REAMDE, copyright: Correct locations for GPL, and contact info.
* Update to GPLv3+; update copyright notices everywhere.
* ipif: Update docs to reflect fact that we are now using tun/tap.
* ipif: Deprecate udptunnel.
* ipif: Provide head comment of service.c as a txt docs.
-- Ian Jackson Wed, 04 Dec 2013 23:01:37 +0000
userv-utils (0.5.0) unstable; urgency=low
* checkpasswd-*: new service
* www-cgi: whitelist some more HTTP headers.
* ipif: Improve documentation comment.
* ipif: Some portability improvements.
* Remove .cvsignore files.
* Pass -g to linker, by default.
* www-cgi: clean target removes *.o.
-- Ian Jackson Sun, 27 Jan 2013 16:34:29 +0000
userv-utils (0.4.2) unstable; urgency=low
ipif bugfix:
* Fix failure which occurs when input data starts to back up:
service.c:866: copydata: Assertion `r < sizeof(input_buf)' failed.
-- Ian Jackson Sun, 15 Jan 2012 01:00:00 +0000
userv-utils (0.4.1) unstable; urgency=low
ipif bugfixes:
* Ignore empty packets (ie consecutive END bytes), as tun rejects
them with EINVAL.
* Tolerate ENOMEM from tun.
-- Ian Jackson Sat, 14 Jan 2012 15:46:53 +0000
userv-utils (0.4) unstable; urgency=low
ipif:
* Now uses tun, not slip. All modern Linux kernels have tun support,
and we weren't portable to non-Linux anyway. slattach has sometimes
been implicated in kernel problems. Interfaces are now called
"userv%d" (ie, userv0, userv1, etc.). Only "slip" is now supported.
-- Ian Jackson Sat, 14 Jan 2012 15:24:57 +0000
userv-utils (0.4~beta1) unstable; urgency=low
git-daemon:
* New userv-git-daemon service.
package admin:
* Now in git.
* Fixed up some portability problems.
-- Ian Jackson Sat, 22 May 2010 19:50:57 +0100
userv-utils (0.3) unstable; urgency=medium
dyndns:
* New dyndns service.
ucgi:
* add HTTP_REFERER.
* Fix path in www-cgi userv service default configuration.
ipif/udptunnel:
* Use slip, not cslip (!)
* service MAXEXROUTES increased from 5 to 50.
* Set default max clock skew to 45/45, not 10/30.
* Allow config file to override default clock skew and lag.
* Report nonzero death of m4 better.
* Add a few missing #include's of .
* Minor fixes to INSTALL.
groupmanage:
* new name-regexp feature.
* admin-group is understood in config file but currently ignored.
* file locations configurable.
* groupmanage: do not claim that root doesn't exist.
* groupmanage: configurable group name length limit.
(Thanks to reports and patches from Ben Harris at Cambridge University.)
Packaging changes:
* Debianisation.
* New Makefiles in various directories; still not wonderful.
* Removed some common stuff from */Makefile to settings.make.
* Copyright notices updated.
* Moved changelog to debian/changelog.
-- Ian Jackson Tue, 6 Jun 2006 22:02:17 +0100
userv-utils (0.2.3) unstable; urgency=low
* udptunnel-reconf can write a known_hosts file for you.
-- Ian Jackson Mon, 11 Feb 2002 21:46:48 +0000
userv-utils (0.2.2) unstable; urgency=low
* udptunnel-reconf default script pauses for 10s between restarts.
* udptunnel-reconf inittab entries default to having Sat, 15 Dec 2001 17:55:06 +0000
userv-utils (0.2.1) unstable; urgency=low
* New udptunnel-reconf program for generating invoke scripts, inittab
entries, and the like, for a multi-host VPN.
* service.c (userv ipif) /32 prefixes work properly now.
* `make distclean' works in ipif, www-cgi and top level.
-- Ian Jackson Mon, 11 Dec 2000 02:45:58 +0000
userv-utils (0.2.0) unstable; urgency=low
Improvements to ipif (tunnelling/VPN facility):
* INSTALL instructions much improved and README created.
* Patch to slattach included.
* Documentation comments improved.
-- Ian Jackson Mon, 18 Sep 2000 01:31:01 +0100
userv-utils (0.1.90) unstable; urgency=low
* ipif/INSTALL instructions, such as they are, included.
* ipif service now supports `=' character in addrs in ipif-networks, for
local endpoint only.
-- Ian Jackson Wed, 21 Jun 2000 23:48:10 +0100
userv-utils (0.1.9) unstable; urgency=low
* Completely revamped udptunnel (in ipif) - now does encryption.
-- Ian Jackson Sun, 18 Jun 2000 14:41:36 +0100
userv-utils (0.1) experimental; urgency=low
* Initial release.
-- Ian Jackson Tue, 9 Nov 1999 23:24:58 +0000
# Local variables:
# mode: debian-changelog
# End:
work/debian/ 0000755 0000000 0000000 00000000000 14141560754 010157 5 ustar work/debian/changelog 0000644 0000000 0000000 00000000710 14141560754 012027 0 ustar userv-utils (0.6.1-2) unstable; urgency=medium
* Source-only upload for testing migration.
* Add Lintian override for malformed-debian-changelog-version.
-- Sean Whitton Sat, 06 Nov 2021 13:13:32 -0700
userv-utils (0.6.1-1) unstable; urgency=medium
* Initial release (Closes: #991906).
-- Sean Whitton Wed, 04 Aug 2021 15:32:01 -0700
# Local variables:
# mode: debian-changelog
# End:
work/debian/control 0000644 0000000 0000000 00000004500 14141560754 011561 0 ustar Source: userv-utils
Section: admin
Priority: optional
Maintainer: Sean Whitton
Uploaders: Ian Jackson
Build-Depends: debhelper-compat (= 12), rename
Standards-Version: 4.5.1
Rules-Requires-Root: binary-targets
Homepage: https://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv-utils.git;a=summary
Vcs-Git: https://git.spwhitton.name/userv-utils/
Vcs-Browser: https://git.spwhitton.name/userv-utils/
Package: userv-utils
Architecture: any
Depends: userv, ${shlibs:Depends}, ${misc:Depends}
Recommends: ${perl:Depends}
Description: privsep utilities collection
Several small userv services, which allow certain system configuration
actions to be delegated. In each case the service is disabled unless
enabled by symlink /etc/userv/services.d/* -> ../services-available/*.
.
ipif - allow non-root users to create network interfaces
ucgi - run CGI programs in providing user's account
mailq - allow users to view the mail queue
ndc-reload - allow certain users to reload the nameserver
checkpasswd-* - allow users to run a UNIX password check
groupmanage - allow users to create and manage a few groups each
Package: userv-dyndns
Architecture: all
Depends: userv, chiark-utils-bin, adduser, ${perl:Depends}, ${misc:Depends}
Recommends: bind
Description: dynamic DNS for shell account users
userv-dyndns is a userv service which allows non-root users to
modify individual DNS records in specified zones in a controlled way.
.
Typically, this can be used to provide a `dyndns.org'-like service
which is modifiable by shell account users.
.
The default configuration creates the infrastructure (including a
service user) but does not allow any users to modify the DNS.
Package: userv-git-daemon
Architecture: all
Depends: userv, git-core, adduser, ${perl:Depends}, ${misc:Depends}
Description: per-user git daemon service
userv-git-daemon allows users to publish git repositories which will
be published via the git protocol on 9418. This is a bit like
git-daemon except that the actual reading of each user's repositories
is done as that user.
.
The default configuration does nothing: you must (a) manually copy
the line from /usr/share/doc/examples/userv-git-daemon.inetd into
/etc/inetd.conf and (b) specifically list hostnames and target
directories in /etc/userv/git-urlmap.
work/debian/copyright 0000644 0000000 0000000 00000003267 14141560754 012122 0 ustar This package contains a number of small utilities and programs for use
with the `userv' security boundary tool, obtained from
.
This package, containing the moderately portable sources and Debian
packaging information, and the resulting Debian binary packages, was
put together by Ian Jackson and Sean Whitton. For both upstream and
Debian packaging questions, please contact
userv-discuss@chiark.greenend.org.uk.
userv and userv-utils are all free software; you can redistribute them
and/or modify them under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
These programs are distributed in the hope that they 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 with
your Debian GNU/Linux system, in /usr/share/common-licenses/GPL.
If not, see .
The utilities and programs under the git-daemon/ subdirectory are
dedicated to the public domain by means of the CC0 1.0 public domain
dedication; see /usr/share/common-licenses/CC0-1.0 on Debian systems.
userv-utils are
Copyright 1996-2013,2016 Ian Jackson
Copyright 1998 David Damerell
Copyright 1999,2003
Chancellor Masters and Scholars of the University of Cambridge
Copyright 2010 Tony Finch
Copyright 2013,2016 Mark Wooding
work/debian/rules 0000755 0000000 0000000 00000006135 14141560754 011244 0 ustar #!/usr/bin/make -f
# Copyright 1996-2013,2016 Ian Jackson
# Copyright 1998 David Damerell
# Copyright 1999,2003
# Chancellor Masters and Scholars of the University of Cambridge
# Copyright 2010 Tony Finch
#
# This 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
subdirs_build= ipif ucgi git-daemon
subdirs_nobuild=dyndns groupmanage misc
package= userv-utils
packages_indep= userv-dyndns userv-groupmanage userv-utils userv-git-daemon
packages_arch= userv-ipif userv-cgi
packages= $(packages_indep) $(packages_arch)
SHELL=/bin/bash
cwd= $(shell pwd)
d= $(cwd)/debian
%:
dh $@
override_dh_auto_configure:
override_dh_auto_build:
$(checkdir)
set -e; for s in $(subdirs_build); do \
$(MAKE) -C $$s all; \
done
touch build
override_dh_auto_install:
$(checkdir)
-
set -e; for p in $(packages); do rm -rf $d/$$p; done
-
set -e; for s in $(subdirs_build) $(subdirs_nobuild); do \
t=$d/userv-$$s; \
rm -rf $$t; \
$(MAKE) -C $$s install install-docs install-examples \
prefix=$$t/usr \
etcdir=$$t/etc \
vardir=$$t/var \
gituser=root \
; \
done
-
mv debian/userv-misc debian/userv-utils
-
mv $d/userv-ipif/usr/share/doc/userv-ipif/{service.c.txt,ipif.txt}
-
set -e; cd debian/userv-ucgi/usr/share/doc/userv-ucgi; \
rename 's/^/ucgi-/' *
-
set -e; cd debian/userv-groupmanage/usr/share/doc; \
mv groupmanage userv-groupmanage; \
rm userv-groupmanage/INSTALL
-
set -e; for p in userv-ipif userv-ucgi userv-groupmanage; do \
(cd debian/$$p/usr/share/doc; \
mv $$p userv-utils); \
cp -al debian/$$p/. debian/userv-utils/.; \
done
-
perl -pe 's{/usr/local/}{/usr/}' ucgi/www-cgi \
>debian/userv-utils/etc/userv/services.d/www-cgi
-
rename 's/\.example$$//' $d/userv-ipif/etc/userv/vpn/*.example \
$d/userv-dyndns/etc/userv/dyndns-service-users.example \
$d/userv-utils/etc/groupmanage.conf.example
rename 's/\.distrib$$//' $d/*/etc/userv/services.d/*.distrib
-
mv $d/userv-utils/usr/bin/mailq $d/userv-utils/usr/bin/mailq.userv
-
set -e; cd $d/userv-utils/etc/userv; \
mkdir services-available; \
mv services.d/* services-available/
override_dh_install:
override_dh_auto_clean:
$(checkdir)
rm -f build
set -e; for s in $(subdirs_build); do \
$(MAKE) -C $$s -i distclean || \
$(MAKE) -C $$s -f Makefile.in distclean; \
done
rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars*
define checkdir
test -f ipif/service.c
endef
# Below here is fairly generic really
checkroot:
$(checkdir)
test root = "`whoami`"
work/debian/source/ 0000755 0000000 0000000 00000000000 14141560754 011457 5 ustar work/debian/source/lintian-overrides 0000644 0000000 0000000 00000000043 14141560754 015035 0 ustar malformed-debian-changelog-version
work/debian/userv-dyndns.postinst 0000755 0000000 0000000 00000002207 14141560754 014431 0 ustar #!/bin/sh
set -e
# Copyright 1996-2013 Ian Jackson
# Copyright 1998 David Damerell
# Copyright 1999,2003
# Chancellor Masters and Scholars of the University of Cambridge
# Copyright 2010 Tony Finch
#
# This 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
#DEBHELPER#
user="$(sed -n '/^[a-z]/{p;q;}' /etc/userv/dyndns-service-users)"
if [ "$user" ]; then
adduser --system --force-badname --quiet --group \
--gecos 'userv dyndns' \
--home /etc/userv --no-create-home --shell /bin/false $user
fi
work/debian/userv-git-daemon.postinst 0000755 0000000 0000000 00000002364 14141560754 015162 0 ustar #!/bin/sh
set -e
# Copyright 1996-2013 Ian Jackson
# Copyright 1998 David Damerell
# Copyright 1999,2003
# Chancellor Masters and Scholars of the University of Cambridge
# Copyright 2010 Tony Finch
#
# This file is part of userv-git-daemon, part of userv-utils
#
# This 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
GITDUSER=_userv-git
defaults=/etc/default/userv-git-daemon
if test -f $defaults; then . $defaults; fi
#DEBHELPER#
if [ "$GITDUSER" ]; then
adduser --system --force-badname --quiet --group \
--gecos 'userv git daemon' \
--home /etc/userv --no-create-home --shell /bin/false $GITDUSER
fi
work/dyndns/ 0000755 0000000 0000000 00000000000 14141560754 010234 5 ustar work/dyndns/INSTALL 0000644 0000000 0000000 00000003426 14141560754 011272 0 ustar # To install the dyndns service:
#
# 1. Install the scripts and configuration:
#
mkdir -p /usr/local/lib/userv/dyndns /var/lib/userv/dyndns/tmp
cp install-script /usr/local/lib/userv/dyndns/install
cp service update /usr/local/lib/userv/dyndns
cp dyndns /etc/userv/services.d/dyndns.distrib
cp dyndns-domains /etc/userv/dyndns-domains.example
# Rename the .distrib and .example, or edit them to be how you
# want, or merge your changes.
#
# Create the service user `usdyndns'.
#
# 2. For each zone, create
# /var/lib/userv/zone,/
# and put in it the file
# Manual containing the $TTL, SOA, zone cut NS RRset,
# RP, and other fixed RRsets.
# and edit
# /etc/userv/dyndns-domains appropriately.
# and then create an RR and check that it has made the zone,
# before adding the new file
# Zone
# to your nameserver configuration.
# Copyright 1996-2013 Ian Jackson
# Copyright 1998 David Damerell
# Copyright 1999,2003
# Chancellor Masters and Scholars of the University of Cambridge
# Copyright 2010 Tony Finch
#
# This 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
work/dyndns/Makefile 0000644 0000000 0000000 00000002227 14141560754 011677 0 ustar # Makefile
# installation runes for userv-dyndns
# Copyright (C) 2003 Ian Jackson
#
# This 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
include ../settings.make
install:
mkdir -p $(shareuserv)/dyndns $(varlibuserv)/dyndns/tmp
cp service update $(shareuserv)/dyndns
cp install-script $(shareuserv)/dyndns/install
install-examples:
mkdir -p $(services)
cp dyndns $(services)/dyndns.distrib
cp dyndns-domains $(etcuserv)/dyndns-domains.example
echo _userv-dyndns >$(etcuserv)/dyndns-service-users.example
install-docs:
mkdir -p $(docdir)/userv-dyndns
cp INSTALL $(docdir)/userv-dyndns
work/dyndns/dyndns 0000644 0000000 0000000 00000000321 14141560754 011452 0 ustar if ( grep calling-user-shell /etc/shells
& grep service-user /etc/userv/dyndns-service-users
)
reset
no-set-environment
no-suppress-args
no-disconnect-hup
execute /usr/share/userv/dyndns/service
fi
work/dyndns/dyndns-domains 0000644 0000000 0000000 00000002603 14141560754 013107 0 ustar # Syntax is list of directives.
# include Read at this point
# eof
# Settings directives, apply to succeeding subdomain lines.
# zone This is for stuff in
# rrs ... Allow addition/removal of (only) these RR types
# ratelimit
# Limit rate of changes. Up to one per
# will always be allowed, and never updates more than
# apart. is compared
# with events in roughly last
# ttlrange
# Actual directive:
# subdomain
ratelimit 30 300 3600
zone dynamic.greenend.org.uk
ttlrange 30 86400
rrs A
subdomain anjou rich-avn
subdomain badgers sion-net
subdomain bellevue theom
subdomain burrow vcla-brw
subdomain confusion matt-cnf
subdomain dorothee jdamery
subdomain ecstacy dunc-xtc
subdomain firestorm davi-mul
subdomain gallery jayl-dns
subdomain nosreme ceme-gal
subdomain heresy cjwa-vpn
subdomain lemoncurd bjha-dd
subdomain lilac dame-lil
subdomain nijinsky jmatthew
subdomain relativity ijackson
subdomain riva cjwatson
subdomain sinister Mgend
subdomain slappy chri-cat
subdomain stardust sgtatham
subdomain thistles rcooksey
subdomain titus owen-dns
subdomain milton stev-pub
rrs A CNAME
subdomain gin dh219
subdomain aibs dh219
rrs A MX CNAME
subdomain test ijackson
eof
work/dyndns/install-script 0000755 0000000 0000000 00000002436 14141560754 013137 0 ustar #!/bin/bash
# Copyright 1996-2013 Ian Jackson
# Copyright 1998 David Damerell
# Copyright 1999,2003
# Chancellor Masters and Scholars of the University of Cambridge
# Copyright 2010 Tony Finch
#
# This 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
set -e
zone=$1
test -d ../zone,$zone
ah="`
adnshost +Do +Dt -Cf -t soa $zone. || \
(test $? == 6 && echo . . 1 0 0 0 0)
`"
re='.* \([0-9][0-9]*\) [0-9][0-9]* [0-9][0-9]* [0-9][0-9]* [0-9][0-9]*$'
serial="`expr 1 + match \"$ah\" \"$re\"`"
sed Zone.new
cat [_0-9a-z]*,data >>Zone.new
mv Zone.new Zone
echo "serial $serial"
userv root ndc-reload
work/dyndns/service 0000755 0000000 0000000 00000014026 14141560754 011625 0 ustar #!/usr/bin/perl
# usage: (cat RRs; echo .) | userv dyndns
# Not all zone file formats are accepted:
# - All RRs must have owners specified.
# - All RRs must have TTLs specified.
# - The owner must be specified as a sub-subdomain, relative
# to ., and so must not have a trailing `.';
# where the owner is to be ., `@' must be used.
# Copyright 1996-2013 Ian Jackson
# Copyright 1998 David Damerell
# Copyright 1999,2003
# Chancellor Masters and Scholars of the University of Cambridge
# Copyright 2010 Tony Finch
#
# This 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
use POSIX;
BEGIN {
$vardir= "/var/lib/userv/dyndns";
$defconf= "/etc/userv/dyndns-domains";
$libdir= "/usr/share/userv/dyndns";
}
END {
remove "$vardir/tmp/$$" or $! == ENOENT or
warn "cannot remove tempfile:$!\n";
}
use FileHandle;
use IO::File;
use Socket;
use Socket6;
@ARGV==2 or die "need and arguments\n";
($zone,$subdomain) = @ARGV;
domainsyntax("command line",$zone);
domainsyntax("command line",$subdomain) unless $subdomain eq '@';
@userv_groups= split m/ /, $ENV{'USERV_GROUP'};
@rates= (1,1,1000);
$ttlmin= 0;
$ttlmax= 86400;
sub readconf ($) {
my ($cf,$fh) = @_;
$fh= new FileHandle;
$fh->open("< $cf") or die "$cf: $!\n";
for (;;) {
$!=0; $_= <$fh>;
length or die "$cf:".($? ? "read:$?" : "eof")."\n";
s/^\s+//; chomp; s/\s+$//;
last if m/^eof$/;
next if m/^\#/ or !m/\S/;
if (m/^zone\s+(\S+)$/) {
$thiszone= $1 eq $zone;
} elsif (m/^ratelimit\s+(\d+)\s+(\d+)\s+(\d+)$/) {
@rates= ($1,$2,$3);
} elsif (m/^ttlrange\s+(\d+)\s+(\d+)$/) {
($ttlmin,$ttlmax) = ($1,$2);
} elsif (m/^rrs\s+([A-Za-z0-9 \t]+)$/) {
$rrt_list= $1;
undef %rrt_allowed;
grep { y/a-z/A-Z/; $rrt_allowed{$_}= 1; } split m/\s+/, $1;
} elsif (m/^include\s+(\S.*)$/) {
return if readconf($1);
} elsif (m/^subdomain\s+(\S+)\s+(\S+)$/) {
next unless $thiszone;
next unless $1 eq $subdomain;
next unless grep { $_ eq $2 } @userv_groups;
return 1;
} else {
die "$cf:$.: config error\n";
}
}
close $fh or die "$cf: close: $!\n";
return 0;
}
readconf "$defconf"
or die "permission denied\n";
chdir "$vardir" or die "chdir dyndns:$!\n";
open T,">tmp/$$" or die "create temp file: $!\n";
for (;;) {
$?=0; $_= ;
die "input:$.:".($? ? "$?" : "eof") unless length;
chomp;
last if m/^\.$/;
s/^(\S+)\s+(\d+)\s+([A-Za-z][0-9A-Za-z]*)\s+//
or die "input:$.:bogus line\n";
($owner,$ttl,$type)= ($1,$2,$3);
if ($owner eq '@') {
$write_owner= $subdomain;
} else {
domainsyntax("input:$.",$owner) unless $owner eq '@';
$write_owner= $subdomain eq '@' ? $owner : "$owner.$subdomain";
}
length "$write_owner.$zone." < 255
or die "input:$.:$owner:resulting domain name too long\n";
$ttl += 0;
if ($ttl < $ttlmin) {
warn "input:$.:$owner:capping ttl $ttl at lower bound $ttlmin\n";
$ttl=$ttlmin;
}
if ($ttl > $ttlmax) {
warn "input:$.:$owner:capping ttl $ttl at upper bound $ttlmax\n";
$ttl=$ttlmax;
}
$type =~ y/a-z/A-Z/;
die "input:$.:$owner:rr type not permitted:$type\n"
unless $rrt_allowed{$type};
if (exists $rrset_ttl{$owner,$type}) {
die "input:$.:$owner:$type:RRset has varying TTLs\n"
unless $rrset_ttl{$owner,$type} == $ttl;
} else {
$rrset_ttl{$owner,$type}= $ttl;
}
die "input:$.:$owner:CNAME and other records, or multiple CNAMEs\n"
if $type eq 'CNAME'
? exists $owner_types{$owner}
: exists $owner_types{$owner}->{'CNAME'};
if ($type eq 'A') {
defined($addr= inet_aton $_) or
die "input:$.:$owner:invalid IP address\n";
$data= inet_ntoa($addr);
} elsif ($type eq 'AAAA') {
defined($addr= inet_pton(AF_INET6, $_)) or
die "input:$.:$owner:invalid IPv6 address\n";
$data = inet_ntop(AF_INET6, $addr);
} elsif ($type eq 'CNAME') {
$data= domainsyntax_rel("input:$.:$owner:canonical name",$_).".";
} elsif ($type eq 'MX') {
m/^(\d+)\s+(\S+)$/ or die "input:$.:$owner:invalid MX syntax\n";
($pref,$target) = ($1,$2);
$pref += 0;
die "input:$.:$owner:invalid MX preference\n"
if $pref<0 || $pref>65535;
$target= domainsyntax_rel("input:$.:$owner:mail exchanger",$target);
$data= "$pref $target.";
} else {
die "input:$.:$owner:unsupported RR type:$type\n";
}
$owner_types{$owner}->{$type}= 1;
print T "$write_owner $ttl $type $data\n"
or die "write data to temp file:$!\n";
}
close T or die "close RR data include:$!\n";
open STDIN, "< tmp/$$" or die "reopen RR data include:$!\n";
remove "tmp/$$" or die "close RR data include:$!\n";
chdir "zone,$zone" or die "chdir:$zone:$!\n";
exec "with-lock-ex","-w","Lock",
"$libdir/update", $zone, $subdomain, @rates;
die "execute update program:$!\n";
sub domainsyntax ($$) {
my ($w,$d) = @_;
return if eval {
die "bad char:\`$&'\n" if $d =~ m/[^-.0-9a-z]/;
$d= ".$d.";
die "label starts with hyphen\n" if $d =~ m/\.\-/;
die "label ends with hyphen\n" if $d =~ m/\-\./;
die "empty label or dot at start or end\n" if $d =~ m/\.\./;
die "label too long\n" if $d =~ m/\..{64,}\./;
die "domain name too long\n" if length $d > 255;
1;
};
die "$w:invalid domain name:\`$d':$@";
}
sub domainsyntax_rel ($$) {
my ($w,$d,$r) = @_;
unless ($d =~ s/\.$//) {
$d .= '.' unless $d =~ s/^\@$//;
$d .= ($subdomain eq '@' ? "$zone" : "$subdomain.$zone");
}
domainsyntax($w,$d);
return $d;
}
work/dyndns/update 0000755 0000000 0000000 00000003633 14141560754 011451 0 ustar #!/bin/bash
# Copyright 1996-2013 Ian Jackson
# Copyright 1998 David Damerell
# Copyright 1999,2003
# Chancellor Masters and Scholars of the University of Cambridge
# Copyright 2010 Tony Finch
#
# This 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
set -e
zone="$1"
subdomain="$2"
interval_min="$3"
interval_avg="$4"
interval_mem="$5"
now=`date +%s`
charge=0
case $subdomain in
'@') files=_ ;;
*) files=$subdomain ;;
esac
if test -f $files,timings && read lastup charge <$files,timings
then
if [ $now -lt $[ $lastup + $interval_min ] ]; then
echo "wait $[ $lastup + $interval_min - $now ]"
echo >&2 "must wait at least $interval_min between updates"
exit 75
fi
charge=$[ $charge + $interval_avg - ($now - $lastup) ]
if [ $charge -gt $interval_mem ]; then
echo "wait $[ $charge - $interval_mem ]"
echo >&2 "must wait on average $interval_avg between updates"
exit 75
fi
if [ $charge -lt 0 ]; then charge=0; fi
fi
sort >$files,new
if test -f $files,data
then
set +e
diff >/dev/null $files,data $files,new
diff=$?
set -e
if [ $diff = 0 ]; then echo 'unchanged'; exit 0; fi
if [ $diff != 1 ]; then exit 1; fi
fi
echo $now $charge >$files,timings.new
mv -f $files,timings.new $files,timings
mv $files,new $files,data
exec /usr/share/userv/dyndns/install $zone
work/finger/ 0000755 0000000 0000000 00000000000 14141560754 010207 5 ustar work/finger/.gitignore 0000644 0000000 0000000 00000000117 14141560754 012176 0 ustar config
services
finger-finger
finger-notmyself
finger-getprefs
finger-setprefs
work/git-daemon/ 0000755 0000000 0000000 00000000000 14141560754 010761 5 ustar work/git-daemon/Makefile 0000644 0000000 0000000 00000003113 14141560754 012417 0 ustar # Makefile for userv-git-daemon
#
# This was written by Tony Finch and subsequently
# heavily modified by Ian Jackson
# You may do anything with it, at your own risk.
# http://creativecommons.org/publicdomain/zero/1.0/
include ../settings.make
gituser= userv-git
varloggit= $(varlog)/git
TARGETS= git-upload-pack inetd.conf git-daemon git-service logrotate
SUBSTVARS= libuserv etcuserv varloggit gituser
CONFIGS= $(services)/git-upload-pack \
$(etcuserv)/git-urlmap \
$(etcdir)/logrotate.d/userv-git-daemon
all: $(TARGETS)
sedscript: Makefile read-urlmap
echo >$@.new '$(foreach f, $(SUBSTVARS), s,@$f@,$($f),g; )'
echo >>$@.new '/@@READ_URLMAP@@/c\'
@#'
perl >>$@.new -pe 's/\\/\\\\/g; s/$$/\\/' $@.new; \
if test -x $<; then chmod +x $@.new; fi; \
mv -f $@.new $@
install: all
mkdir -p $(libuserv) $(etcuserv) $(services) \
$(etcdir)/logrotate.d
install -d -o $(gituser) -g adm $(varloggit)
cp git-daemon git-service $(libuserv)
cp git-upload-pack $(services)/git-upload-pack:new
cp git-urlmap $(etcuserv)/git-urlmap:new
cp logrotate $(etcdir)/logrotate.d/userv-git-daemon:new
set -e; for f in $(CONFIGS); do \
if test -f $$f; then continue; fi; \
mv $$f:new $$f; \
done
mkdocdir:
mkdir -p $(docdir)/userv-git-daemon
install-docs: mkdocdir
cp README $(docdir)/userv-git-daemon/README
install-examples: all mkdocdir
cp inetd.conf $(docdir)/userv-git-daemon/inetd.conf
distclean clean:
rm -f $(TARGETS) *~
# end
work/git-daemon/README 0000644 0000000 0000000 00000004616 14141560754 011650 0 ustar userv-git-daemon is a replacement for the standard git daemon,
which provides anonymous remote access to git repositories.
It uses userv to invoke the service requested by the client, and users
can configure it to map git:// URLs to repositories and enable and
disable services as they see fit, without intervention from the system
administrator.
To install:
-----------
Adjust the paths in ../settings.make as necessary.
userv-git-daemon uses $(libuserv), $(etcuserv), and $(services).
Type make install.
Create a "userv-git" user that will run the outer part of the git-daemon.
Ensure your /etc/services contains a line like "git 9418/tcp".
Insert the inetd.conf fragment into your /etc/inetd.conf
and tell inetd to reload.
As a test user, create a 'public-git' directory, and copy a bare git
repository into it, e.g.
git clone --bare git://dotat.at/unifdef.git public-git/unifdef.git
This repository should now be visible:
git ls-remote git://localhost/~test/unifdef.git
Operation:
----------
The userv-git-daemon is invoked by inetd which also tells it where to
find its global git-urlmap config.
The git-daemon parses the request from the network and uses the global
git-urlmap config to determine which user will run the requested
service. It invokes userv for the request to be performed. The most
common service is git-upload-pack, which is confusingly named: it
uploads from the repository to the network; other services supported
by git are git-upload-archive and git-receive-pack.
The git-daemon will pass any service beginning git- to userv. The
userv configuration determines which services may be requested. This
package includes example git-upload-pack service configurations.
The service configuration uses the git-service script to run the
service. It passes the global and per-user git-urlmap configs to the
git-service script to determine where in the filesyetem the requested
repository is. Later urlmap entries override the choices made by
earlier ones.
If a repository is located, the git-service script runs the requested
service, which is simply the git program with the same name.
Configuration:
--------------
See "git-urlmap" for syntax description and an example.
----------------------------------------------
This was written by Tony Finch and subsequently
heavily modified by Ian Jackson
http://creativecommons.org/publicdomain/zero/1.0/
work/git-daemon/git-daemon.in 0000755 0000000 0000000 00000004563 14141560754 013350 0 ustar #!/usr/bin/perl
#
# A git daemon with an added userv security boundary.
#
# This was written by Tony Finch and subsequently
# heavily modified by Ian Jackson
# http://creativecommons.org/publicdomain/zero/1.0/
use strict;
use warnings;
use POSIX;
use Socket;
use Sys::Syslog;
BEGIN {
if ($ARGV[0] =~ s/^-L//) {
my $logfile= shift @ARGV;
open STDERR, ">> $logfile" or die $!;
}
}
sub ntoa {
my $sockaddr = shift;
return ('(local)') unless defined $sockaddr;
my ($port,$addr) = sockaddr_in $sockaddr;
$addr = inet_ntoa $addr;
return ("[$addr]:$port",$addr,$port);
}
our ($client,$client_addr,$client_port) = ntoa getpeername STDIN;
our ($server,$server_addr,$server_port) = ntoa getsockname STDIN;
our ($service,$specpath,$spechost);
printf STDERR "%s [$$] %s %s\n",
strftime("%Y-%m-%d %H:%M:%S %Z", localtime), $server, $client;
openlog 'userv-git-daemon', 'pid', 'daemon';
sub fail { syslog 'err', "$client @_"; exit }
$SIG{ALRM} = sub { fail "timeout" };
alarm 30;
sub xread {
my $length = shift;
my $buffer = "";
while ($length > length $buffer) {
my $ret = sysread STDIN, $buffer, $length, length $buffer;
fail "Expected $length bytes, got ".length $buffer
if defined $ret and $ret == 0;
fail "read: $!" if not defined $ret and $! != EINTR and $! != EAGAIN;
}
return $buffer;
}
my $hex_len = xread 4;
fail "Bad hex in packet length" unless $hex_len =~ m|^[0-9a-fA-F]{4}$|;
my $line = xread -4 + hex $hex_len;
unless (($service,$specpath,$spechost) = $line =~
m|^(git-[a-z-]+) /*([!-~]+)\0host=([!-~]+)\0$|) {
$line =~ s|[^ -~]+| |g;
fail "Could not parse \"$line\""
}
@@READ_URLMAP@@
fail "No global mapping for $uri" unless defined $serve_user;
my ($hn,$ha,$at,$naddrs,@addrs) = gethostbyname $spechost;
fail "hostname/address mismatch ($spechost $server_addr)" unless grep {
$server_addr eq inet_ntoa $_
} @addrs;
our @opts;
push @opts, "-D$_=${$::{$_}}"
for qw(service specpath spechost
client client_addr client_port
server server_addr server_port);
fail "no user $serve_user" unless getpwnam($serve_user);
syslog 'notice', "$client $service $uri $serve_user";
my @cmd = ('userv', '-t300', @opts, $serve_user, $service);
no warnings; # suppress errors to stderr
exec @cmd or fail "exec userv: $!";
# end
work/git-daemon/git-service.in 0000755 0000000 0000000 00000002461 14141560754 013540 0 ustar #!/usr/bin/perl
#
# userv-git-daemon service script
#
# This was written by Tony Finch and subsequently
# heavily modified by Ian Jackson
# http://creativecommons.org/publicdomain/zero/1.0/
use strict;
use warnings;
use POSIX;
use Sys::Syslog;
our ($client,$service,$specpath,$spechost,@opts);
${$::{$_}} = $ENV{"USERV_U_$_"}
for qw(service specpath spechost client);
openlog "userv-$service:$ENV{USER}", 'pid', 'daemon';
sub fail { syslog 'err', "$client @_"; exit }
@@READ_URLMAP@@
fail "No user $ENV{USER} mapping for $uri" unless defined $serve_user;
$serve_dir = "$ENV{HOME}/$serve_dir" unless $serve_dir =~ m|^/|;
if (length $serve_repo) {
my $inspect= $serve_repo;
$inspect =~ s,^/,,;
fail "Bad subdirectory $serve_repo" unless $inspect =~ m/$repo_regexp/o;
fail "bad config - repo-regexp does not capture" unless defined $1;
$serve_repo= "/$1";
}
my $dir = $serve_dir.$serve_repo;
my $path = $check_export ? "$dir/git-daemon-export-ok" : $dir;
fail "$! $path" unless -e $path;
syslog 'notice', "$client $uri $dir";
@opts = qw( --strict )
if @opts == 0 and $service eq 'git-upload-pack';
my @cmd = ($service =~ m|^(git)-(.*)$|, @opts, $dir);
no warnings; # suppress errors to stderr
exec @cmd or fail "exec $service: $!";
# end
work/git-daemon/git-upload-pack.in 0000644 0000000 0000000 00000000705 14141560754 014274 0 ustar # userv configuration for git-daemon git-upload-pack service
#
# This was written by Tony Finch
# You may do anything with it, at your own risk.
# http://creativecommons.org/publicdomain/zero/1.0/
if ( grep service-user-shell /etc/shells
& glob service git-upload-pack
& glob calling-user @gituser@
)
reset
errors-to-syslog daemon error
execute @libuserv@/git-service @etcuserv@/git-urlmap .userv/git-urlmap
fi
# end
work/git-daemon/git-urlmap 0000644 0000000 0000000 00000002536 14141560754 012773 0 ustar # Each line is one of:
#
# single-user [/] []
# matching requests will be handled by
# and unless overridden by handled by
# serving subdirectories of
#
# multi-user [/]
# matching requests are only those those next
# path element starts with ~. The
# request will be handled by and unless
# overridden by will be handled by
# serving subdirectories of
# ( must be a relative path)
#
# repo-regexp
# For per-user service. Subrepos must match this
# regexp, which must contain a single matching
# group which is the filesystem pathname inside
# the . The default is:
# repo-regexp ^(w[-+._0-9A-Za-z]*/?\.git)$
#
# [no-]require-git-daemon-export-ok
# For per-user service. Default is no-.
#
# Last match, or last setting, wins.
# s may start with ~
# here is an example, taken from chiark:
#
# single-user dotat.at fanf dotat-git
# single-user git.chiark.greenend.org.uk webmaster /u2/git-repos
#
# multi-user cabal.greenend.org.uk cabal-git
# multi-user git.chiark.greenend.org.uk public-git
work/git-daemon/inetd.conf.in 0000644 0000000 0000000 00000000262 14141560754 013340 0 ustar # Example inetd.conf line for the userv git daemon.
git stream tcp nowait @gituser@ /usr/sbin/tcpd @libuserv@/git-daemon -L@varloggit@/userv-git-daemon.log @etcuserv@/git-urlmap
work/git-daemon/logrotate.in 0000644 0000000 0000000 00000000120 14141560754 013302 0 ustar @varloggit@/userv-git-daemon.log {
rotate 7
daily
missingok
delaycompress
}
work/git-daemon/read-urlmap 0000644 0000000 0000000 00000004746 14141560754 013130 0 ustar # -*- perl -*-
# uses:
# $specpath whole path from caller, minus any leading /s
# $spechost host from caller
#
# sets:
#
# always:
# $uri
#
# if match found for this host and path:
# $serve_user username, or undef if no match (then other serve_* invalid)
# $serve_dir directory as specified in config
# $serve_repo subpath under $serve_dir _including_ leading /
#
# for use by user's service program
# $repo_regexp
# $require_exportok
sub remain_path ($) {
# return value matches {( / [^/]+ )+}x
my ($vsubpath) = @_;
syslog 'debug', sprintf "DEBUG remain_path %s $specpath",
(defined $vsubpath ? $vsubpath : '');
return "/$specpath" if !defined $vsubpath;
return "" if $vsubpath eq $specpath;
return substr($specpath,length($vsubpath))
if substr($specpath,0,length($vsubpath)+1) eq "$vsubpath/";
return undef;
}
fail "no config ??" unless @ARGV;
fail "no specpath ??" unless length $specpath;
our $uri = "git://$spechost/$specpath";
our $repo_regexp= '^(\\w[-+._0-9A-Za-z]*/?\.git)$'; # stupid emacs ';
our $check_export= 0;
our ($serve_user, $serve_dir, $serve_repo);
sub fexists ($) {
my ($f) = @_;
if (stat $f) {
-f _ or fail "bad config $_ - not a file";
return 1;
} else {
$!==&ENOENT or fail "bad config $_ - could not stat: $!";
return 0;
}
}
@ARGV = grep { fexists($_) } @ARGV;
while (<>) {
s/^\s*//;
s/\s+$//;
next unless m/\S/;
next if m/^\#/;
if (m{^ single-user \s+ (\S+?) (/\S*)? \s+ (\S+) (?: \s+ (\S+) )? $ }x) {
my ($h,$v,$u,$d) = ($1,$2,$3,$4);
next unless $h eq $spechost;
$serve_repo= remain_path($v);
next unless defined $serve_repo;
$serve_user= $u;
$serve_dir= $d;
syslog 'debug', "DEBUG $ARGV:$. match".
" $serve_user $serve_dir $serve_repo";
} elsif (m{^ multi-user \s+ (\S+?) (/\S*)? \s+ (\S+) $ }x) {
my ($h,$v,$d) = ($1,$2,$3);
next unless $1 eq $spechost;
$serve_repo= remain_path($v);
next unless defined $serve_repo;
syslog 'debug', "DEBUG $ARGV:$. perhaps $serve_repo";
next unless $serve_repo =~ s{ ^/\~( [a-z][-+_0-9a-z]* )/ }{/}xi;
$serve_user= $1;
$serve_dir= $d;
syslog 'debug', "DEBUG $ARGV:$. match".
" $serve_user $serve_dir $serve_repo";
} elsif (m{^ repo-regexp \s+ (\S.*) $ }x) {
$repo_regexp= $1;
} elsif (m{^ (no-)?require-git-daemon-export-ok $ }x) {
$check_export= !defined $1;
} else {
fail "config syntax error at $ARGV:$.";
}
}
# end
work/groupmanage/ 0000755 0000000 0000000 00000000000 14141560754 011242 5 ustar work/groupmanage/INSTALL 0000644 0000000 0000000 00000003212 14141560754 012271 0 ustar groupmanage - installation instructions
'groupmanage' is /usr/local/bin/groupmanage - NOT setuid root
-rwxr-xr-x 1 root root /usr/local/bin/groupmanage
'groupmanage.conf' is /etc/groupmanage.conf - edit to taste
-rw-rw-r-- 1 root root /etc/groupmanage.conf
'services' is (typically) /etc/userv/services.d/groupmanage
-rw-rw-r-- 1 root root /etc/userv/services.d/groupmanage
Edit /etc/userv/system.default to add a line
include-lookup service /etc/userv/services.d
if you don't have one already.
groupmanage depends on /etc/environment setting up a sensible PATH.
/etc/grouplist must exist. We suggest inserting the comment
# Syntax:
# group:description:manager:maint-users:home
There must be no blank lines in /etc/grouplist.
groupmanage is part of userv-utils, which are
Copyright 1996-2013 Ian Jackson
Copyright 1998 David Damerell
Copyright 1999,2003
Chancellor Masters and Scholars of the University of Cambridge
Copyright 2010 Tony Finch
All the utilities here are 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
work/groupmanage/Makefile 0000644 0000000 0000000 00000002404 14141560754 012702 0 ustar # Makefile
# installation runes for groupmanage
# Copyright 1996-2013 Ian Jackson
# Copyright 1998 David Damerell
# Copyright 1999,2003
# Chancellor Masters and Scholars of the University of Cambridge
# Copyright 2010 Tony Finch
#
# This 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
include ../settings.make
install:
mkdir -p $(bindir)
cp groupmanage $(bindir)/.
install-examples:
mkdir -p $(etcdir) $(services)
cp groupmanage.conf $(etcdir)/groupmanage.conf.example
cp services $(services)/groupmanage.distrib
install-docs:
mkdir -p $(docdir)/groupmanage
cp INSTALL groupmanage.text $(docdir)/groupmanage/.
work/groupmanage/groupmanage 0000755 0000000 0000000 00000026552 14141560754 013507 0 ustar #!/usr/bin/perl
#
# Copyright 1996-2013 Ian Jackson
# Copyright 1998 David Damerell
# Copyright 1999,2003
# Chancellor Masters and Scholars of the University of Cambridge
# Copyright 2010 Tony Finch
#
# This 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 3 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 userv-utils; if not, see http://www.gnu.org/licenses/.
sub usage {
&unlock;
&p_out;
print(< [--info]
groupmanage [ ...]
groupmanage --create [ ...]
actions:
--clear
--add ...
--remove ...
--manager-clear
--manager-add ...
--manager-remove ...
--title
--owner [root only]
groupmanage is Copyright. It is free software, released under the GNU
GPL v2 or later. There is NO WARRANTY. See the GPL for details.
END
exit(1);
}
@ARGV || &usage('too few arguments');
if ($>) {
exec 'userv','root','groupmanage',@ARGV;
&quit("unable to execute userv to gain root privilege: $!");
}
chdir("/etc") || die "groupmanage: chdir /etc: $!\n";
$groupname= shift(@ARGV);
$groupname =~ y/\n//d;
$groupname =~ m/^\w[-0-9A-Za-z]*$/ ||
&quit("first argument is invalid - must be group name");
@ARGV || push(@ARGV,'--info');
$callinguser= exists $ENV{'USERV_UID'} ? $ENV{'USERV_UID'} : $<;
%opt= ('user-create','0',
'user-create-minunameu','5',
'user-create-min','10000',
'user-create-max','19999',
'user-create-nameintitle','0',
'user-create-maxperu','5',
'group-file','group',
'gtmp-file','gtmp',
'grouplist-file','grouplist',
'name-regexp','',
'name-maxlen','8',
'admin-group','',
'finish-command','');
%ovalid= ('user-create','boolean',
'user-create-minunameu','number',
'user-create-min','number',
'user-create-max','number',
'user-create-nameintitle','boolean',
'user-create-maxperu','number',
'group-file','string',
'gtmp-file','string',
'grouplist-file','string',
'name-regexp','string',
'name-maxlen','number',
'admin-group','string',
'finish-command','string');
sub ov_boolean {
$cov= $_ eq 'yes' ? 1 :
$_ eq 'no' ? 0 :
&quit("groupmanage.conf:$.: bad boolean value");
}
sub ov_number {
m/^[0-9]{1,10}$/ || &quit("groupmanage.conf:$.: bad numerical value");
}
sub ov_string {
}
open(GMC,"groupmanage.conf") || &quit("read groupmanage.conf: $!");
while () {
next if m/^\#/ || !m/\S/;
s/\s*\n$//;
s/^\s*([-0-9a-z]+)\s*// || &quit("groupmanage.conf:$.: bad option format");
$co= $1;
defined($opt{$co}) || &quit("groupmanage.conf:$.: unknown option $co");
$cov= $_;
$ovf= 'ov_'.$ovalid{$co};
&$ovf;
$opt{$co}= $cov;
}
close(GMC);
if ($ARGV[0] eq '--info') {
@ARGV == 1 || &usage('no arguments allowed after --info');
&p_out;
&load;
&checkexists;
&display;
&p_out;
exit(0);
}
sub naming {
$callinguser || return;
&p_out;
if ($opt{'user-create-minunameu'}) {
print(STDERR <-
You must quote at least $opt{'user-create-minunameu'} chars of your username $createby
(or all of it if it is shorter).
END
}
if ($opt{'name-regexp'}) {
print(STDERR <= $opt{'user-create-minunameu'} &&
substr($createby,0,length($upart)) eq $upart)
|| &naming;
} else {
$groupname =~ m/${opt{'name-regexp'}}/ || &naming;
}
$create= 1;
shift(@ARGV);
}
&lock;
&load;
if ($create) {
$bythisowner < $opt{'user-create-maxperu'} ||
&quit("you already have $bythisowner group(s)");
$groupfileix==-1 || &quit("group already exists, cannot create it");
$grouplistix==-1 || &quit("group is already in grouplist, cannot create it");
for ($gid= $opt{'user-create-min'};
$gid < $opt{'user-create-max'} && defined(getgrgid($gid));
$gid++) { }
$gid <= $opt{'user-create-max'} || &quit("out of gids to use, contact admin");
$password=''; @members=($createby);
$description= "${createby}'s -- user-defined, no title";
$owner= $createby; @managers=(); @members= ($createby);
$groupfileix=$#groupfile+1;
$grouplistix=$#grouplist+1;
&p("created group $groupname");
} else {
&checkexists;
&p("modifying group $groupname");
}
&weare($owner) || grep(&weare($_),@managers) || !$callinguser ||
&quit("you may not manage $groupname");
$action= 'none';
while (@ARGV) {
$_= shift(@ARGV);
if (m/^--(add|remove)$/) {
$action= $1; $clist= 'members'; $what= 'member';
} elsif (m/^--owner$/) {
!$callinguser || &quit("only root may change owner");
@ARGV || &usage("no username owner after --owner");
$owner= shift(@ARGV);
&p("owner set to $owner");
} elsif (m/^--manager-(add|remove)$/) {
$action= $1; $clist= 'managers'; $what= 'manager';
} elsif (m/^--clear$/) {
&p('cleared list of members');
@members=(); $action='none'; $memc++;
} elsif (m/^--manager-clear$/) {
&p('cleared list of managers');
@managers=(); $action='none';
} elsif (m/^--title$/) {
&weare($owner) || !$callinguser ||
&quit("only group's owner ($owner) may change title");
@ARGV || &usage("no title after --title");
$_= shift(@ARGV); y/\020-\176//cd; y/:\\//d;
if ($opt{'user-create-nameintitle'} &&
$gid >= $opt{'user-create-min'} && $gid <= $opt{'user-create-max'}) {
$_= "${owner}'s -- $_";
}
$description= $_;
&p("title set to $description");
} elsif (m/^-/) {
&usage("unknown option $_");
} elsif (m/^\w[-0-9A-Za-z]*$/) {
y/\n//d;
$chgu=$_;
defined(getpwnam($chgu)) || &quit("username $chgu does not exist");
eval "\@l = \@$clist; 1" || &quit("internal error: $@");
$already= grep($_ eq $chgu, @l);
if ($action eq 'add') {
if ($already) {
&p("$chgu already $what");
} else {
&p("added $what $chgu");
push(@l,$chgu);
$memc+= ($clist eq 'members');
}
} elsif ($action eq 'remove') {
if ($already) {
&p("removed $what $chgu");
@l= grep($_ ne $chgu, @l);
$memc+= ($clist eq 'members');
} else {
&p("$chgu is already not $what");
}
} else {
&usage("username found but no action to take for them");
}
eval "\@$clist = \@l; 1" || &quit("internal error: $@");
} else {
&usage("bad username or option $_");
}
}
&p("nb: a change to group membership only takes effect at the user's next login")
if $memc;
$groupfile[$groupfileix]=
"$groupname:$password:$gid:".join(',',@members)."\n";
$grouplist[$grouplistix]=
"$groupname:$description:$owner:".join(',',@managers).":$homedir\n";
&save($opt{'group-file'},@groupfile);
&save($opt{'grouplist-file'},@grouplist);
if ($opt{'finish-command'}) {
!system($opt{'finish-command'}) || &quit("finish-command: $?");
}
unlink($opt{'gtmp-file'}) || &quit("unlock group (remove gtmp): $!");
&p_out;
exit(0);
sub load {
open(GF,"< $opt{'group-file'}") || &quit("read group: $!");
@groupfile=; close(GF);
$groupfileix=-1;
for ($i=0; $i<=$#groupfile; $i++) {
$_= $groupfile[$i]; s/\n$//;
next if m/^\#/;
m/^(\w[-0-9A-Za-z]*):([^:]*):(\d+):([-0-9A-Za-z,]*)$/ ||
&quit("bad entry in group: $_");
$gname2gid{$1}=$3;
next unless $1 eq $groupname;
$groupfileix<0 || &quit("duplicate entries in group");
$groupfileix= $i;
$password= $2;
$gid= $3;
@members= split(/,/,$4);
}
open(GL,"< $opt{'grouplist-file'}") || &quit("read grouplist: $!");
@grouplist=; close(GL);
$grouplistix=-1;
for ($i=0; $i<=$#grouplist; $i++) {
$_= $grouplist[$i]; s/\n$//;
next if m/^\#/;
m/^(\w[-0-9A-Za-z]*):([^:]*):(\w[-0-9A-Za-z]*):([-0-9A-Za-z,]*):([^:]*)$/ ||
&quit("bad entry in grouplist: $_");
$bythisowner++ if ($create && $3 eq $createby &&
$gname2gid{$1} >= $opt{'user-create-min'} &&
$gname2gid{$1} <= $opt{'user-create-max'});
next unless $1 eq $groupname;
$grouplistix<0 || &quit("duplicate entries in grouplist");
$grouplistix= $i;
$description= $2;
$owner= $3;
$homedir= $5;
@managers= split(/,/,$4);
}
}
sub checkexists {
$grouplistix>=0 || &quit("no entry in grouplist for $groupname");
$groupfileix>=0 || &quit("no entry in group for $groupname");
}
sub weare {
return 0 if $_[0] eq '';
@pw= getpwnam($_[0]);
return @pw && $pw[2] == $callinguser ? 1 : 0;
}
sub save {
$filename= shift(@_);
unlink("$filename~");
open(DUMP,"> $filename.new") || &quit("create new $filename: $!");
print(DUMP @_) || &quit("write new $filename: $!");
close(DUMP) || &quit("close new $filename: $!");
link("$filename","$filename~") || &quit("create backup $filename: $!");
rename("$filename.new","$filename") || &quit("install new $filename: $!");
}
sub quit {
&unlock;
&p_out;
die "groupmanage: @_\n";
}
sub lock {
link($opt{'group-file'},$opt{'gtmp-file'}) || &quit("create gtmp: $!");
$locked++;
}
sub unlock {
return unless $locked;
$locked--;
unlink($opt{'gtmp-file'}) || warn("unlock group file (remove gtmp): $!\n");
}
sub display {
print(<