igopher-validator rewrite in C - gopher-validator - Simple gopher menu validator. Err bitreich.org 70
hgit clone git://bitreich.org/gopher-validator git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/gopher-validator URL:git://bitreich.org/gopher-validator git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/gopher-validator bitreich.org 70
1Log /scm/gopher-validator/log.gph bitreich.org 70
1Files /scm/gopher-validator/files.gph bitreich.org 70
1Refs /scm/gopher-validator/refs.gph bitreich.org 70
1Tags /scm/gopher-validator/tag bitreich.org 70
1README /scm/gopher-validator/file/README.gph bitreich.org 70
1LICENSE /scm/gopher-validator/file/LICENSE.gph bitreich.org 70
i--- Err bitreich.org 70
1commit 5ca656215b1e77b7fef4dcf37cd6e429146b9426 /scm/gopher-validator/commit/5ca656215b1e77b7fef4dcf37cd6e429146b9426.gph bitreich.org 70
1parent 668e42abfef42e56f315c54ad8aea639f02871ca /scm/gopher-validator/commit/668e42abfef42e56f315c54ad8aea639f02871ca.gph bitreich.org 70
hAuthor: Hiltjo Posthuma <hiltjo@codemadness.org> URL:mailto:hiltjo@codemadness.org bitreich.org 70
iDate: Mon, 22 Jul 2019 18:54:33 +0200 Err bitreich.org 70
i Err bitreich.org 70
igopher-validator rewrite in C Err bitreich.org 70
i Err bitreich.org 70
igopher-validator is now a client of it's own and validates more things Err bitreich.org 70
iaccording to the official RFC spec. It does not depend on sacc anymore. Err bitreich.org 70
i Err bitreich.org 70
iDiffstat: Err bitreich.org 70
i M LICENSE | 685 +------------------------------ Err bitreich.org 70
i M Makefile | 84 ++++++++++++++++++------------- Err bitreich.org 70
i A README | 13 +++++++++++++ Err bitreich.org 70
i A TODO | 1 + Err bitreich.org 70
i D gopher-validator | 10 ---------- Err bitreich.org 70
i M gopher-validator.1 | 88 ++++++++++++++++++++----------- Err bitreich.org 70
i A gopher-validator.c | 529 +++++++++++++++++++++++++++++++ Err bitreich.org 70
i Err bitreich.org 70
i7 files changed, 661 insertions(+), 749 deletions(-) Err bitreich.org 70
i--- Err bitreich.org 70
1diff --git a/LICENSE b/LICENSE /scm/gopher-validator/file/LICENSE.gph bitreich.org 70
i@@ -1,676 +1,15 @@ Err bitreich.org 70
i-© 2018 Christoph Lohmann <20h at r-36 dot net> Err bitreich.org 70
i+ISC License Err bitreich.org 70
i Err bitreich.org 70
i- GNU GENERAL PUBLIC LICENSE Err bitreich.org 70
i- Version 3, 29 June 2007 Err bitreich.org 70
i+Copyright (c) 2018-2019 Hiltjo Posthuma <hiltjo@codemadness.org> Err bitreich.org 70
i Err bitreich.org 70
i- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Err bitreich.org 70
i- Everyone is permitted to copy and distribute verbatim copies Err bitreich.org 70
i- of this license document, but changing it is not allowed. Err bitreich.org 70
i+Permission to use, copy, modify, and/or distribute this software for any Err bitreich.org 70
i+purpose with or without fee is hereby granted, provided that the above Err bitreich.org 70
i+copyright notice and this permission notice appear in all copies. Err bitreich.org 70
i Err bitreich.org 70
i- Preamble Err bitreich.org 70
i- Err bitreich.org 70
i- The GNU General Public License is a free, copyleft license for Err bitreich.org 70
i-software and other kinds of works. Err bitreich.org 70
i- Err bitreich.org 70
i- The licenses for most software and other practical works are designed Err bitreich.org 70
i-to take away your freedom to share and change the works. By contrast, Err bitreich.org 70
i-the GNU General Public License is intended to guarantee your freedom to Err bitreich.org 70
i-share and change all versions of a program--to make sure it remains free Err bitreich.org 70
i-software for all its users. We, the Free Software Foundation, use the Err bitreich.org 70
i-GNU General Public License for most of our software; it applies also to Err bitreich.org 70
i-any other work released this way by its authors. You can apply it to Err bitreich.org 70
i-your programs, too. Err bitreich.org 70
i- Err bitreich.org 70
i- When we speak of free software, we are referring to freedom, not Err bitreich.org 70
i-price. Our General Public Licenses are designed to make sure that you Err bitreich.org 70
i-have the freedom to distribute copies of free software (and charge for Err bitreich.org 70
i-them if you wish), that you receive source code or can get it if you Err bitreich.org 70
i-want it, that you can change the software or use pieces of it in new Err bitreich.org 70
i-free programs, and that you know you can do these things. Err bitreich.org 70
i- Err bitreich.org 70
i- To protect your rights, we need to prevent others from denying you Err bitreich.org 70
i-these rights or asking you to surrender the rights. Therefore, you have Err bitreich.org 70
i-certain responsibilities if you distribute copies of the software, or if Err bitreich.org 70
i-you modify it: responsibilities to respect the freedom of others. Err bitreich.org 70
i- Err bitreich.org 70
i- For example, if you distribute copies of such a program, whether Err bitreich.org 70
i-gratis or for a fee, you must pass on to the recipients the same Err bitreich.org 70
i-freedoms that you received. You must make sure that they, too, receive Err bitreich.org 70
i-or can get the source code. And you must show them these terms so they Err bitreich.org 70
i-know their rights. Err bitreich.org 70
i- Err bitreich.org 70
i- Developers that use the GNU GPL protect your rights with two steps: Err bitreich.org 70
i-(1) assert copyright on the software, and (2) offer you this License Err bitreich.org 70
i-giving you legal permission to copy, distribute and/or modify it. Err bitreich.org 70
i- Err bitreich.org 70
i- For the developers' and authors' protection, the GPL clearly explains Err bitreich.org 70
i-that there is no warranty for this free software. For both users' and Err bitreich.org 70
i-authors' sake, the GPL requires that modified versions be marked as Err bitreich.org 70
i-changed, so that their problems will not be attributed erroneously to Err bitreich.org 70
i-authors of previous versions. Err bitreich.org 70
i- Err bitreich.org 70
i- Some devices are designed to deny users access to install or run Err bitreich.org 70
i-modified versions of the software inside them, although the manufacturer Err bitreich.org 70
i-can do so. This is fundamentally incompatible with the aim of Err bitreich.org 70
i-protecting users' freedom to change the software. The systematic Err bitreich.org 70
i-pattern of such abuse occurs in the area of products for individuals to Err bitreich.org 70
i-use, which is precisely where it is most unacceptable. Therefore, we Err bitreich.org 70
i-have designed this version of the GPL to prohibit the practice for those Err bitreich.org 70
i-products. If such problems arise substantially in other domains, we Err bitreich.org 70
i-stand ready to extend this provision to those domains in future versions Err bitreich.org 70
i-of the GPL, as needed to protect the freedom of users. Err bitreich.org 70
i- Err bitreich.org 70
i- Finally, every program is threatened constantly by software patents. Err bitreich.org 70
i-States should not allow patents to restrict development and use of Err bitreich.org 70
i-software on general-purpose computers, but in those that do, we wish to Err bitreich.org 70
i-avoid the special danger that patents applied to a free program could Err bitreich.org 70
i-make it effectively proprietary. To prevent this, the GPL assures that Err bitreich.org 70
i-patents cannot be used to render the program non-free. Err bitreich.org 70
i- Err bitreich.org 70
i- The precise terms and conditions for copying, distribution and Err bitreich.org 70
i-modification follow. Err bitreich.org 70
i- Err bitreich.org 70
i- TERMS AND CONDITIONS Err bitreich.org 70
i- Err bitreich.org 70
i- 0. Definitions. Err bitreich.org 70
i- Err bitreich.org 70
i- "This License" refers to version 3 of the GNU General Public License. Err bitreich.org 70
i- Err bitreich.org 70
i- "Copyright" also means copyright-like laws that apply to other kinds of Err bitreich.org 70
i-works, such as semiconductor masks. Err bitreich.org 70
i- Err bitreich.org 70
i- "The Program" refers to any copyrightable work licensed under this Err bitreich.org 70
i-License. Each licensee is addressed as "you". "Licensees" and Err bitreich.org 70
i-"recipients" may be individuals or organizations. Err bitreich.org 70
i- Err bitreich.org 70
i- To "modify" a work means to copy from or adapt all or part of the work Err bitreich.org 70
i-in a fashion requiring copyright permission, other than the making of an Err bitreich.org 70
i-exact copy. The resulting work is called a "modified version" of the Err bitreich.org 70
i-earlier work or a work "based on" the earlier work. Err bitreich.org 70
i- Err bitreich.org 70
i- A "covered work" means either the unmodified Program or a work based Err bitreich.org 70
i-on the Program. Err bitreich.org 70
i- Err bitreich.org 70
i- To "propagate" a work means to do anything with it that, without Err bitreich.org 70
i-permission, would make you directly or secondarily liable for Err bitreich.org 70
i-infringement under applicable copyright law, except executing it on a Err bitreich.org 70
i-computer or modifying a private copy. Propagation includes copying, Err bitreich.org 70
i-distribution (with or without modification), making available to the Err bitreich.org 70
i-public, and in some countries other activities as well. Err bitreich.org 70
i- Err bitreich.org 70
i- To "convey" a work means any kind of propagation that enables other Err bitreich.org 70
i-parties to make or receive copies. Mere interaction with a user through Err bitreich.org 70
i-a computer network, with no transfer of a copy, is not conveying. Err bitreich.org 70
i- Err bitreich.org 70
i- An interactive user interface displays "Appropriate Legal Notices" Err bitreich.org 70
i-to the extent that it includes a convenient and prominently visible Err bitreich.org 70
i-feature that (1) displays an appropriate copyright notice, and (2) Err bitreich.org 70
i-tells the user that there is no warranty for the work (except to the Err bitreich.org 70
i-extent that warranties are provided), that licensees may convey the Err bitreich.org 70
i-work under this License, and how to view a copy of this License. If Err bitreich.org 70
i-the interface presents a list of user commands or options, such as a Err bitreich.org 70
i-menu, a prominent item in the list meets this criterion. Err bitreich.org 70
i- Err bitreich.org 70
i- 1. Source Code. Err bitreich.org 70
i- Err bitreich.org 70
i- The "source code" for a work means the preferred form of the work Err bitreich.org 70
i-for making modifications to it. "Object code" means any non-source Err bitreich.org 70
i-form of a work. Err bitreich.org 70
i- Err bitreich.org 70
i- A "Standard Interface" means an interface that either is an official Err bitreich.org 70
i-standard defined by a recognized standards body, or, in the case of Err bitreich.org 70
i-interfaces specified for a particular programming language, one that Err bitreich.org 70
i-is widely used among developers working in that language. Err bitreich.org 70
i- Err bitreich.org 70
i- The "System Libraries" of an executable work include anything, other Err bitreich.org 70
i-than the work as a whole, that (a) is included in the normal form of Err bitreich.org 70
i-packaging a Major Component, but which is not part of that Major Err bitreich.org 70
i-Component, and (b) serves only to enable use of the work with that Err bitreich.org 70
i-Major Component, or to implement a Standard Interface for which an Err bitreich.org 70
i-implementation is available to the public in source code form. A Err bitreich.org 70
i-"Major Component", in this context, means a major essential component Err bitreich.org 70
i-(kernel, window system, and so on) of the specific operating system Err bitreich.org 70
i-(if any) on which the executable work runs, or a compiler used to Err bitreich.org 70
i-produce the work, or an object code interpreter used to run it. Err bitreich.org 70
i- Err bitreich.org 70
i- The "Corresponding Source" for a work in object code form means all Err bitreich.org 70
i-the source code needed to generate, install, and (for an executable Err bitreich.org 70
i-work) run the object code and to modify the work, including scripts to Err bitreich.org 70
i-control those activities. However, it does not include the work's Err bitreich.org 70
i-System Libraries, or general-purpose tools or generally available free Err bitreich.org 70
i-programs which are used unmodified in performing those activities but Err bitreich.org 70
i-which are not part of the work. For example, Corresponding Source Err bitreich.org 70
i-includes interface definition files associated with source files for Err bitreich.org 70
i-the work, and the source code for shared libraries and dynamically Err bitreich.org 70
i-linked subprograms that the work is specifically designed to require, Err bitreich.org 70
i-such as by intimate data communication or control flow between those Err bitreich.org 70
i-subprograms and other parts of the work. Err bitreich.org 70
i- Err bitreich.org 70
i- The Corresponding Source need not include anything that users Err bitreich.org 70
i-can regenerate automatically from other parts of the Corresponding Err bitreich.org 70
i-Source. Err bitreich.org 70
i- Err bitreich.org 70
i- The Corresponding Source for a work in source code form is that Err bitreich.org 70
i-same work. Err bitreich.org 70
i- Err bitreich.org 70
i- 2. Basic Permissions. Err bitreich.org 70
i- Err bitreich.org 70
i- All rights granted under this License are granted for the term of Err bitreich.org 70
i-copyright on the Program, and are irrevocable provided the stated Err bitreich.org 70
i-conditions are met. This License explicitly affirms your unlimited Err bitreich.org 70
i-permission to run the unmodified Program. The output from running a Err bitreich.org 70
i-covered work is covered by this License only if the output, given its Err bitreich.org 70
i-content, constitutes a covered work. This License acknowledges your Err bitreich.org 70
i-rights of fair use or other equivalent, as provided by copyright law. Err bitreich.org 70
i- Err bitreich.org 70
i- You may make, run and propagate covered works that you do not Err bitreich.org 70
i-convey, without conditions so long as your license otherwise remains Err bitreich.org 70
i-in force. You may convey covered works to others for the sole purpose Err bitreich.org 70
i-of having them make modifications exclusively for you, or provide you Err bitreich.org 70
i-with facilities for running those works, provided that you comply with Err bitreich.org 70
i-the terms of this License in conveying all material for which you do Err bitreich.org 70
i-not control copyright. Those thus making or running the covered works Err bitreich.org 70
i-for you must do so exclusively on your behalf, under your direction Err bitreich.org 70
i-and control, on terms that prohibit them from making any copies of Err bitreich.org 70
i-your copyrighted material outside their relationship with you. Err bitreich.org 70
i- Err bitreich.org 70
i- Conveying under any other circumstances is permitted solely under Err bitreich.org 70
i-the conditions stated below. Sublicensing is not allowed; section 10 Err bitreich.org 70
i-makes it unnecessary. Err bitreich.org 70
i- Err bitreich.org 70
i- 3. Protecting Users' Legal Rights From Anti-Circumvention Law. Err bitreich.org 70
i- Err bitreich.org 70
i- No covered work shall be deemed part of an effective technological Err bitreich.org 70
i-measure under any applicable law fulfilling obligations under article Err bitreich.org 70
i-11 of the WIPO copyright treaty adopted on 20 December 1996, or Err bitreich.org 70
i-similar laws prohibiting or restricting circumvention of such Err bitreich.org 70
i-measures. Err bitreich.org 70
i- Err bitreich.org 70
i- When you convey a covered work, you waive any legal power to forbid Err bitreich.org 70
i-circumvention of technological measures to the extent such circumvention Err bitreich.org 70
i-is effected by exercising rights under this License with respect to Err bitreich.org 70
i-the covered work, and you disclaim any intention to limit operation or Err bitreich.org 70
i-modification of the work as a means of enforcing, against the work's Err bitreich.org 70
i-users, your or third parties' legal rights to forbid circumvention of Err bitreich.org 70
i-technological measures. Err bitreich.org 70
i- Err bitreich.org 70
i- 4. Conveying Verbatim Copies. Err bitreich.org 70
i- Err bitreich.org 70
i- You may convey verbatim copies of the Program's source code as you Err bitreich.org 70
i-receive it, in any medium, provided that you conspicuously and Err bitreich.org 70
i-appropriately publish on each copy an appropriate copyright notice; Err bitreich.org 70
i-keep intact all notices stating that this License and any Err bitreich.org 70
i-non-permissive terms added in accord with section 7 apply to the code; Err bitreich.org 70
i-keep intact all notices of the absence of any warranty; and give all Err bitreich.org 70
i-recipients a copy of this License along with the Program. Err bitreich.org 70
i- Err bitreich.org 70
i- You may charge any price or no price for each copy that you convey, Err bitreich.org 70
i-and you may offer support or warranty protection for a fee. Err bitreich.org 70
i- Err bitreich.org 70
i- 5. Conveying Modified Source Versions. Err bitreich.org 70
i- Err bitreich.org 70
i- You may convey a work based on the Program, or the modifications to Err bitreich.org 70
i-produce it from the Program, in the form of source code under the Err bitreich.org 70
i-terms of section 4, provided that you also meet all of these conditions: Err bitreich.org 70
i- Err bitreich.org 70
i- a) The work must carry prominent notices stating that you modified Err bitreich.org 70
i- it, and giving a relevant date. Err bitreich.org 70
i- Err bitreich.org 70
i- b) The work must carry prominent notices stating that it is Err bitreich.org 70
i- released under this License and any conditions added under section Err bitreich.org 70
i- 7. This requirement modifies the requirement in section 4 to Err bitreich.org 70
i- "keep intact all notices". Err bitreich.org 70
i- Err bitreich.org 70
i- c) You must license the entire work, as a whole, under this Err bitreich.org 70
i- License to anyone who comes into possession of a copy. This Err bitreich.org 70
i- License will therefore apply, along with any applicable section 7 Err bitreich.org 70
i- additional terms, to the whole of the work, and all its parts, Err bitreich.org 70
i- regardless of how they are packaged. This License gives no Err bitreich.org 70
i- permission to license the work in any other way, but it does not Err bitreich.org 70
i- invalidate such permission if you have separately received it. Err bitreich.org 70
i- Err bitreich.org 70
i- d) If the work has interactive user interfaces, each must display Err bitreich.org 70
i- Appropriate Legal Notices; however, if the Program has interactive Err bitreich.org 70
i- interfaces that do not display Appropriate Legal Notices, your Err bitreich.org 70
i- work need not make them do so. Err bitreich.org 70
i- Err bitreich.org 70
i- A compilation of a covered work with other separate and independent Err bitreich.org 70
i-works, which are not by their nature extensions of the covered work, Err bitreich.org 70
i-and which are not combined with it such as to form a larger program, Err bitreich.org 70
i-in or on a volume of a storage or distribution medium, is called an Err bitreich.org 70
i-"aggregate" if the compilation and its resulting copyright are not Err bitreich.org 70
i-used to limit the access or legal rights of the compilation's users Err bitreich.org 70
i-beyond what the individual works permit. Inclusion of a covered work Err bitreich.org 70
i-in an aggregate does not cause this License to apply to the other Err bitreich.org 70
i-parts of the aggregate. Err bitreich.org 70
i- Err bitreich.org 70
i- 6. Conveying Non-Source Forms. Err bitreich.org 70
i- Err bitreich.org 70
i- You may convey a covered work in object code form under the terms Err bitreich.org 70
i-of sections 4 and 5, provided that you also convey the Err bitreich.org 70
i-machine-readable Corresponding Source under the terms of this License, Err bitreich.org 70
i-in one of these ways: Err bitreich.org 70
i- Err bitreich.org 70
i- a) Convey the object code in, or embodied in, a physical product Err bitreich.org 70
i- (including a physical distribution medium), accompanied by the Err bitreich.org 70
i- Corresponding Source fixed on a durable physical medium Err bitreich.org 70
i- customarily used for software interchange. Err bitreich.org 70
i- Err bitreich.org 70
i- b) Convey the object code in, or embodied in, a physical product Err bitreich.org 70
i- (including a physical distribution medium), accompanied by a Err bitreich.org 70
i- written offer, valid for at least three years and valid for as Err bitreich.org 70
i- long as you offer spare parts or customer support for that product Err bitreich.org 70
i- model, to give anyone who possesses the object code either (1) a Err bitreich.org 70
i- copy of the Corresponding Source for all the software in the Err bitreich.org 70
i- product that is covered by this License, on a durable physical Err bitreich.org 70
i- medium customarily used for software interchange, for a price no Err bitreich.org 70
i- more than your reasonable cost of physically performing this Err bitreich.org 70
i- conveying of source, or (2) access to copy the Err bitreich.org 70
i- Corresponding Source from a network server at no charge. Err bitreich.org 70
i- Err bitreich.org 70
i- c) Convey individual copies of the object code with a copy of the Err bitreich.org 70
i- written offer to provide the Corresponding Source. This Err bitreich.org 70
i- alternative is allowed only occasionally and noncommercially, and Err bitreich.org 70
i- only if you received the object code with such an offer, in accord Err bitreich.org 70
i- with subsection 6b. Err bitreich.org 70
i- Err bitreich.org 70
i- d) Convey the object code by offering access from a designated Err bitreich.org 70
i- place (gratis or for a charge), and offer equivalent access to the Err bitreich.org 70
i- Corresponding Source in the same way through the same place at no Err bitreich.org 70
i- further charge. You need not require recipients to copy the Err bitreich.org 70
i- Corresponding Source along with the object code. If the place to Err bitreich.org 70
i- copy the object code is a network server, the Corresponding Source Err bitreich.org 70
i- may be on a different server (operated by you or a third party) Err bitreich.org 70
i- that supports equivalent copying facilities, provided you maintain Err bitreich.org 70
i- clear directions next to the object code saying where to find the Err bitreich.org 70
i- Corresponding Source. Regardless of what server hosts the Err bitreich.org 70
i- Corresponding Source, you remain obligated to ensure that it is Err bitreich.org 70
i- available for as long as needed to satisfy these requirements. Err bitreich.org 70
i- Err bitreich.org 70
i- e) Convey the object code using peer-to-peer transmission, provided Err bitreich.org 70
i- you inform other peers where the object code and Corresponding Err bitreich.org 70
i- Source of the work are being offered to the general public at no Err bitreich.org 70
i- charge under subsection 6d. Err bitreich.org 70
i- Err bitreich.org 70
i- A separable portion of the object code, whose source code is excluded Err bitreich.org 70
i-from the Corresponding Source as a System Library, need not be Err bitreich.org 70
i-included in conveying the object code work. Err bitreich.org 70
i- Err bitreich.org 70
i- A "User Product" is either (1) a "consumer product", which means any Err bitreich.org 70
i-tangible personal property which is normally used for personal, family, Err bitreich.org 70
i-or household purposes, or (2) anything designed or sold for incorporation Err bitreich.org 70
i-into a dwelling. In determining whether a product is a consumer product, Err bitreich.org 70
i-doubtful cases shall be resolved in favor of coverage. For a particular Err bitreich.org 70
i-product received by a particular user, "normally used" refers to a Err bitreich.org 70
i-typical or common use of that class of product, regardless of the status Err bitreich.org 70
i-of the particular user or of the way in which the particular user Err bitreich.org 70
i-actually uses, or expects or is expected to use, the product. A product Err bitreich.org 70
i-is a consumer product regardless of whether the product has substantial Err bitreich.org 70
i-commercial, industrial or non-consumer uses, unless such uses represent Err bitreich.org 70
i-the only significant mode of use of the product. Err bitreich.org 70
i- Err bitreich.org 70
i- "Installation Information" for a User Product means any methods, Err bitreich.org 70
i-procedures, authorization keys, or other information required to install Err bitreich.org 70
i-and execute modified versions of a covered work in that User Product from Err bitreich.org 70
i-a modified version of its Corresponding Source. The information must Err bitreich.org 70
i-suffice to ensure that the continued functioning of the modified object Err bitreich.org 70
i-code is in no case prevented or interfered with solely because Err bitreich.org 70
i-modification has been made. Err bitreich.org 70
i- Err bitreich.org 70
i- If you convey an object code work under this section in, or with, or Err bitreich.org 70
i-specifically for use in, a User Product, and the conveying occurs as Err bitreich.org 70
i-part of a transaction in which the right of possession and use of the Err bitreich.org 70
i-User Product is transferred to the recipient in perpetuity or for a Err bitreich.org 70
i-fixed term (regardless of how the transaction is characterized), the Err bitreich.org 70
i-Corresponding Source conveyed under this section must be accompanied Err bitreich.org 70
i-by the Installation Information. But this requirement does not apply Err bitreich.org 70
i-if neither you nor any third party retains the ability to install Err bitreich.org 70
i-modified object code on the User Product (for example, the work has Err bitreich.org 70
i-been installed in ROM). Err bitreich.org 70
i- Err bitreich.org 70
i- The requirement to provide Installation Information does not include a Err bitreich.org 70
i-requirement to continue to provide support service, warranty, or updates Err bitreich.org 70
i-for a work that has been modified or installed by the recipient, or for Err bitreich.org 70
i-the User Product in which it has been modified or installed. Access to a Err bitreich.org 70
i-network may be denied when the modification itself materially and Err bitreich.org 70
i-adversely affects the operation of the network or violates the rules and Err bitreich.org 70
i-protocols for communication across the network. Err bitreich.org 70
i- Err bitreich.org 70
i- Corresponding Source conveyed, and Installation Information provided, Err bitreich.org 70
i-in accord with this section must be in a format that is publicly Err bitreich.org 70
i-documented (and with an implementation available to the public in Err bitreich.org 70
i-source code form), and must require no special password or key for Err bitreich.org 70
i-unpacking, reading or copying. Err bitreich.org 70
i- Err bitreich.org 70
i- 7. Additional Terms. Err bitreich.org 70
i- Err bitreich.org 70
i- "Additional permissions" are terms that supplement the terms of this Err bitreich.org 70
i-License by making exceptions from one or more of its conditions. Err bitreich.org 70
i-Additional permissions that are applicable to the entire Program shall Err bitreich.org 70
i-be treated as though they were included in this License, to the extent Err bitreich.org 70
i-that they are valid under applicable law. If additional permissions Err bitreich.org 70
i-apply only to part of the Program, that part may be used separately Err bitreich.org 70
i-under those permissions, but the entire Program remains governed by Err bitreich.org 70
i-this License without regard to the additional permissions. Err bitreich.org 70
i- Err bitreich.org 70
i- When you convey a copy of a covered work, you may at your option Err bitreich.org 70
i-remove any additional permissions from that copy, or from any part of Err bitreich.org 70
i-it. (Additional permissions may be written to require their own Err bitreich.org 70
i-removal in certain cases when you modify the work.) You may place Err bitreich.org 70
i-additional permissions on material, added by you to a covered work, Err bitreich.org 70
i-for which you have or can give appropriate copyright permission. Err bitreich.org 70
i- Err bitreich.org 70
i- Notwithstanding any other provision of this License, for material you Err bitreich.org 70
i-add to a covered work, you may (if authorized by the copyright holders of Err bitreich.org 70
i-that material) supplement the terms of this License with terms: Err bitreich.org 70
i- Err bitreich.org 70
i- a) Disclaiming warranty or limiting liability differently from the Err bitreich.org 70
i- terms of sections 15 and 16 of this License; or Err bitreich.org 70
i- Err bitreich.org 70
i- b) Requiring preservation of specified reasonable legal notices or Err bitreich.org 70
i- author attributions in that material or in the Appropriate Legal Err bitreich.org 70
i- Notices displayed by works containing it; or Err bitreich.org 70
i- Err bitreich.org 70
i- c) Prohibiting misrepresentation of the origin of that material, or Err bitreich.org 70
i- requiring that modified versions of such material be marked in Err bitreich.org 70
i- reasonable ways as different from the original version; or Err bitreich.org 70
i- Err bitreich.org 70
i- d) Limiting the use for publicity purposes of names of licensors or Err bitreich.org 70
i- authors of the material; or Err bitreich.org 70
i- Err bitreich.org 70
i- e) Declining to grant rights under trademark law for use of some Err bitreich.org 70
i- trade names, trademarks, or service marks; or Err bitreich.org 70
i- Err bitreich.org 70
i- f) Requiring indemnification of licensors and authors of that Err bitreich.org 70
i- material by anyone who conveys the material (or modified versions of Err bitreich.org 70
i- it) with contractual assumptions of liability to the recipient, for Err bitreich.org 70
i- any liability that these contractual assumptions directly impose on Err bitreich.org 70
i- those licensors and authors. Err bitreich.org 70
i- Err bitreich.org 70
i- All other non-permissive additional terms are considered "further Err bitreich.org 70
i-restrictions" within the meaning of section 10. If the Program as you Err bitreich.org 70
i-received it, or any part of it, contains a notice stating that it is Err bitreich.org 70
i-governed by this License along with a term that is a further Err bitreich.org 70
i-restriction, you may remove that term. If a license document contains Err bitreich.org 70
i-a further restriction but permits relicensing or conveying under this Err bitreich.org 70
i-License, you may add to a covered work material governed by the terms Err bitreich.org 70
i-of that license document, provided that the further restriction does Err bitreich.org 70
i-not survive such relicensing or conveying. Err bitreich.org 70
i- Err bitreich.org 70
i- If you add terms to a covered work in accord with this section, you Err bitreich.org 70
i-must place, in the relevant source files, a statement of the Err bitreich.org 70
i-additional terms that apply to those files, or a notice indicating Err bitreich.org 70
i-where to find the applicable terms. Err bitreich.org 70
i- Err bitreich.org 70
i- Additional terms, permissive or non-permissive, may be stated in the Err bitreich.org 70
i-form of a separately written license, or stated as exceptions; Err bitreich.org 70
i-the above requirements apply either way. Err bitreich.org 70
i- Err bitreich.org 70
i- 8. Termination. Err bitreich.org 70
i- Err bitreich.org 70
i- You may not propagate or modify a covered work except as expressly Err bitreich.org 70
i-provided under this License. Any attempt otherwise to propagate or Err bitreich.org 70
i-modify it is void, and will automatically terminate your rights under Err bitreich.org 70
i-this License (including any patent licenses granted under the third Err bitreich.org 70
i-paragraph of section 11). Err bitreich.org 70
i- Err bitreich.org 70
i- However, if you cease all violation of this License, then your Err bitreich.org 70
i-license from a particular copyright holder is reinstated (a) Err bitreich.org 70
i-provisionally, unless and until the copyright holder explicitly and Err bitreich.org 70
i-finally terminates your license, and (b) permanently, if the copyright Err bitreich.org 70
i-holder fails to notify you of the violation by some reasonable means Err bitreich.org 70
i-prior to 60 days after the cessation. Err bitreich.org 70
i- Err bitreich.org 70
i- Moreover, your license from a particular copyright holder is Err bitreich.org 70
i-reinstated permanently if the copyright holder notifies you of the Err bitreich.org 70
i-violation by some reasonable means, this is the first time you have Err bitreich.org 70
i-received notice of violation of this License (for any work) from that Err bitreich.org 70
i-copyright holder, and you cure the violation prior to 30 days after Err bitreich.org 70
i-your receipt of the notice. Err bitreich.org 70
i- Err bitreich.org 70
i- Termination of your rights under this section does not terminate the Err bitreich.org 70
i-licenses of parties who have received copies or rights from you under Err bitreich.org 70
i-this License. If your rights have been terminated and not permanently Err bitreich.org 70
i-reinstated, you do not qualify to receive new licenses for the same Err bitreich.org 70
i-material under section 10. Err bitreich.org 70
i- Err bitreich.org 70
i- 9. Acceptance Not Required for Having Copies. Err bitreich.org 70
i- Err bitreich.org 70
i- You are not required to accept this License in order to receive or Err bitreich.org 70
i-run a copy of the Program. Ancillary propagation of a covered work Err bitreich.org 70
i-occurring solely as a consequence of using peer-to-peer transmission Err bitreich.org 70
i-to receive a copy likewise does not require acceptance. However, Err bitreich.org 70
i-nothing other than this License grants you permission to propagate or Err bitreich.org 70
i-modify any covered work. These actions infringe copyright if you do Err bitreich.org 70
i-not accept this License. Therefore, by modifying or propagating a Err bitreich.org 70
i-covered work, you indicate your acceptance of this License to do so. Err bitreich.org 70
i- Err bitreich.org 70
i- 10. Automatic Licensing of Downstream Recipients. Err bitreich.org 70
i- Err bitreich.org 70
i- Each time you convey a covered work, the recipient automatically Err bitreich.org 70
i-receives a license from the original licensors, to run, modify and Err bitreich.org 70
i-propagate that work, subject to this License. You are not responsible Err bitreich.org 70
i-for enforcing compliance by third parties with this License. Err bitreich.org 70
i- Err bitreich.org 70
i- An "entity transaction" is a transaction transferring control of an Err bitreich.org 70
i-organization, or substantially all assets of one, or subdividing an Err bitreich.org 70
i-organization, or merging organizations. If propagation of a covered Err bitreich.org 70
i-work results from an entity transaction, each party to that Err bitreich.org 70
i-transaction who receives a copy of the work also receives whatever Err bitreich.org 70
i-licenses to the work the party's predecessor in interest had or could Err bitreich.org 70
i-give under the previous paragraph, plus a right to possession of the Err bitreich.org 70
i-Corresponding Source of the work from the predecessor in interest, if Err bitreich.org 70
i-the predecessor has it or can get it with reasonable efforts. Err bitreich.org 70
i- Err bitreich.org 70
i- You may not impose any further restrictions on the exercise of the Err bitreich.org 70
i-rights granted or affirmed under this License. For example, you may Err bitreich.org 70
i-not impose a license fee, royalty, or other charge for exercise of Err bitreich.org 70
i-rights granted under this License, and you may not initiate litigation Err bitreich.org 70
i-(including a cross-claim or counterclaim in a lawsuit) alleging that Err bitreich.org 70
i-any patent claim is infringed by making, using, selling, offering for Err bitreich.org 70
i-sale, or importing the Program or any portion of it. Err bitreich.org 70
i- Err bitreich.org 70
i- 11. Patents. Err bitreich.org 70
i- Err bitreich.org 70
i- A "contributor" is a copyright holder who authorizes use under this Err bitreich.org 70
i-License of the Program or a work on which the Program is based. The Err bitreich.org 70
i-work thus licensed is called the contributor's "contributor version". Err bitreich.org 70
i- Err bitreich.org 70
i- A contributor's "essential patent claims" are all patent claims Err bitreich.org 70
i-owned or controlled by the contributor, whether already acquired or Err bitreich.org 70
i-hereafter acquired, that would be infringed by some manner, permitted Err bitreich.org 70
i-by this License, of making, using, or selling its contributor version, Err bitreich.org 70
i-but do not include claims that would be infringed only as a Err bitreich.org 70
i-consequence of further modification of the contributor version. For Err bitreich.org 70
i-purposes of this definition, "control" includes the right to grant Err bitreich.org 70
i-patent sublicenses in a manner consistent with the requirements of Err bitreich.org 70
i-this License. Err bitreich.org 70
i- Err bitreich.org 70
i- Each contributor grants you a non-exclusive, worldwide, royalty-free Err bitreich.org 70
i-patent license under the contributor's essential patent claims, to Err bitreich.org 70
i-make, use, sell, offer for sale, import and otherwise run, modify and Err bitreich.org 70
i-propagate the contents of its contributor version. Err bitreich.org 70
i- Err bitreich.org 70
i- In the following three paragraphs, a "patent license" is any express Err bitreich.org 70
i-agreement or commitment, however denominated, not to enforce a patent Err bitreich.org 70
i-(such as an express permission to practice a patent or covenant not to Err bitreich.org 70
i-sue for patent infringement). To "grant" such a patent license to a Err bitreich.org 70
i-party means to make such an agreement or commitment not to enforce a Err bitreich.org 70
i-patent against the party. Err bitreich.org 70
i- Err bitreich.org 70
i- If you convey a covered work, knowingly relying on a patent license, Err bitreich.org 70
i-and the Corresponding Source of the work is not available for anyone Err bitreich.org 70
i-to copy, free of charge and under the terms of this License, through a Err bitreich.org 70
i-publicly available network server or other readily accessible means, Err bitreich.org 70
i-then you must either (1) cause the Corresponding Source to be so Err bitreich.org 70
i-available, or (2) arrange to deprive yourself of the benefit of the Err bitreich.org 70
i-patent license for this particular work, or (3) arrange, in a manner Err bitreich.org 70
i-consistent with the requirements of this License, to extend the patent Err bitreich.org 70
i-license to downstream recipients. "Knowingly relying" means you have Err bitreich.org 70
i-actual knowledge that, but for the patent license, your conveying the Err bitreich.org 70
i-covered work in a country, or your recipient's use of the covered work Err bitreich.org 70
i-in a country, would infringe one or more identifiable patents in that Err bitreich.org 70
i-country that you have reason to believe are valid. Err bitreich.org 70
i- Err bitreich.org 70
i- If, pursuant to or in connection with a single transaction or Err bitreich.org 70
i-arrangement, you convey, or propagate by procuring conveyance of, a Err bitreich.org 70
i-covered work, and grant a patent license to some of the parties Err bitreich.org 70
i-receiving the covered work authorizing them to use, propagate, modify Err bitreich.org 70
i-or convey a specific copy of the covered work, then the patent license Err bitreich.org 70
i-you grant is automatically extended to all recipients of the covered Err bitreich.org 70
i-work and works based on it. Err bitreich.org 70
i- Err bitreich.org 70
i- A patent license is "discriminatory" if it does not include within Err bitreich.org 70
i-the scope of its coverage, prohibits the exercise of, or is Err bitreich.org 70
i-conditioned on the non-exercise of one or more of the rights that are Err bitreich.org 70
i-specifically granted under this License. You may not convey a covered Err bitreich.org 70
i-work if you are a party to an arrangement with a third party that is Err bitreich.org 70
i-in the business of distributing software, under which you make payment Err bitreich.org 70
i-to the third party based on the extent of your activity of conveying Err bitreich.org 70
i-the work, and under which the third party grants, to any of the Err bitreich.org 70
i-parties who would receive the covered work from you, a discriminatory Err bitreich.org 70
i-patent license (a) in connection with copies of the covered work Err bitreich.org 70
i-conveyed by you (or copies made from those copies), or (b) primarily Err bitreich.org 70
i-for and in connection with specific products or compilations that Err bitreich.org 70
i-contain the covered work, unless you entered into that arrangement, Err bitreich.org 70
i-or that patent license was granted, prior to 28 March 2007. Err bitreich.org 70
i- Err bitreich.org 70
i- Nothing in this License shall be construed as excluding or limiting Err bitreich.org 70
i-any implied license or other defenses to infringement that may Err bitreich.org 70
i-otherwise be available to you under applicable patent law. Err bitreich.org 70
i- Err bitreich.org 70
i- 12. No Surrender of Others' Freedom. Err bitreich.org 70
i- Err bitreich.org 70
i- If conditions are imposed on you (whether by court order, agreement or Err bitreich.org 70
i-otherwise) that contradict the conditions of this License, they do not Err bitreich.org 70
i-excuse you from the conditions of this License. If you cannot convey a Err bitreich.org 70
i-covered work so as to satisfy simultaneously your obligations under this Err bitreich.org 70
i-License and any other pertinent obligations, then as a consequence you may Err bitreich.org 70
i-not convey it at all. For example, if you agree to terms that obligate you Err bitreich.org 70
i-to collect a royalty for further conveying from those to whom you convey Err bitreich.org 70
i-the Program, the only way you could satisfy both those terms and this Err bitreich.org 70
i-License would be to refrain entirely from conveying the Program. Err bitreich.org 70
i- Err bitreich.org 70
i- 13. Use with the GNU Affero General Public License. Err bitreich.org 70
i- Err bitreich.org 70
i- Notwithstanding any other provision of this License, you have Err bitreich.org 70
i-permission to link or combine any covered work with a work licensed Err bitreich.org 70
i-under version 3 of the GNU Affero General Public License into a single Err bitreich.org 70
i-combined work, and to convey the resulting work. The terms of this Err bitreich.org 70
i-License will continue to apply to the part which is the covered work, Err bitreich.org 70
i-but the special requirements of the GNU Affero General Public License, Err bitreich.org 70
i-section 13, concerning interaction through a network will apply to the Err bitreich.org 70
i-combination as such. Err bitreich.org 70
i- Err bitreich.org 70
i- 14. Revised Versions of this License. Err bitreich.org 70
i- Err bitreich.org 70
i- The Free Software Foundation may publish revised and/or new versions of Err bitreich.org 70
i-the GNU General Public License from time to time. Such new versions will Err bitreich.org 70
i-be similar in spirit to the present version, but may differ in detail to Err bitreich.org 70
i-address new problems or concerns. Err bitreich.org 70
i- Err bitreich.org 70
i- Each version is given a distinguishing version number. If the Err bitreich.org 70
i-Program specifies that a certain numbered version of the GNU General Err bitreich.org 70
i-Public License "or any later version" applies to it, you have the Err bitreich.org 70
i-option of following the terms and conditions either of that numbered Err bitreich.org 70
i-version or of any later version published by the Free Software Err bitreich.org 70
i-Foundation. If the Program does not specify a version number of the Err bitreich.org 70
i-GNU General Public License, you may choose any version ever published Err bitreich.org 70
i-by the Free Software Foundation. Err bitreich.org 70
i- Err bitreich.org 70
i- If the Program specifies that a proxy can decide which future Err bitreich.org 70
i-versions of the GNU General Public License can be used, that proxy's Err bitreich.org 70
i-public statement of acceptance of a version permanently authorizes you Err bitreich.org 70
i-to choose that version for the Program. Err bitreich.org 70
i- Err bitreich.org 70
i- Later license versions may give you additional or different Err bitreich.org 70
i-permissions. However, no additional obligations are imposed on any Err bitreich.org 70
i-author or copyright holder as a result of your choosing to follow a Err bitreich.org 70
i-later version. Err bitreich.org 70
i- Err bitreich.org 70
i- 15. Disclaimer of Warranty. Err bitreich.org 70
i- Err bitreich.org 70
i- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY Err bitreich.org 70
i-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT Err bitreich.org 70
i-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY Err bitreich.org 70
i-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, Err bitreich.org 70
i-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR Err bitreich.org 70
i-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM Err bitreich.org 70
i-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF Err bitreich.org 70
i-ALL NECESSARY SERVICING, REPAIR OR CORRECTION. Err bitreich.org 70
i- Err bitreich.org 70
i- 16. Limitation of Liability. Err bitreich.org 70
i- Err bitreich.org 70
i- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING Err bitreich.org 70
i-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS Err bitreich.org 70
i-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY Err bitreich.org 70
i-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE Err bitreich.org 70
i-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF Err bitreich.org 70
i-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD Err bitreich.org 70
i-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), Err bitreich.org 70
i-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF Err bitreich.org 70
i-SUCH DAMAGES. Err bitreich.org 70
i- Err bitreich.org 70
i- 17. Interpretation of Sections 15 and 16. Err bitreich.org 70
i- Err bitreich.org 70
i- If the disclaimer of warranty and limitation of liability provided Err bitreich.org 70
i-above cannot be given local legal effect according to their terms, Err bitreich.org 70
i-reviewing courts shall apply local law that most closely approximates Err bitreich.org 70
i-an absolute waiver of all civil liability in connection with the Err bitreich.org 70
i-Program, unless a warranty or assumption of liability accompanies a Err bitreich.org 70
i-copy of the Program in return for a fee. Err bitreich.org 70
i- Err bitreich.org 70
i- END OF TERMS AND CONDITIONS Err bitreich.org 70
i- Err bitreich.org 70
i- How to Apply These Terms to Your New Programs Err bitreich.org 70
i- Err bitreich.org 70
i- If you develop a new program, and you want it to be of the greatest Err bitreich.org 70
i-possible use to the public, the best way to achieve this is to make it Err bitreich.org 70
i-free software which everyone can redistribute and change under these terms. Err bitreich.org 70
i- Err bitreich.org 70
i- To do so, attach the following notices to the program. It is safest Err bitreich.org 70
i-to attach them to the start of each source file to most effectively Err bitreich.org 70
i-state the exclusion of warranty; and each file should have at least Err bitreich.org 70
i-the "copyright" line and a pointer to where the full notice is found. Err bitreich.org 70
i- Err bitreich.org 70
i- <one line to give the program's name and a brief idea of what it does.> Err bitreich.org 70
i- Copyright (C) <year> <name of author> Err bitreich.org 70
i- Err bitreich.org 70
i- This program is free software: you can redistribute it and/or modify Err bitreich.org 70
i- it under the terms of the GNU General Public License as published by Err bitreich.org 70
i- the Free Software Foundation, either version 3 of the License, or Err bitreich.org 70
i- (at your option) any later version. Err bitreich.org 70
i- Err bitreich.org 70
i- This program is distributed in the hope that it will be useful, Err bitreich.org 70
i- but WITHOUT ANY WARRANTY; without even the implied warranty of Err bitreich.org 70
i- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Err bitreich.org 70
i- GNU General Public License for more details. Err bitreich.org 70
i- Err bitreich.org 70
i- You should have received a copy of the GNU General Public License Err bitreich.org 70
i- along with this program. If not, see <http://www.gnu.org/licenses/>. Err bitreich.org 70
i- Err bitreich.org 70
i-Also add information on how to contact you by electronic and paper mail. Err bitreich.org 70
i- Err bitreich.org 70
i- If the program does terminal interaction, make it output a short Err bitreich.org 70
i-notice like this when it starts in an interactive mode: Err bitreich.org 70
i- Err bitreich.org 70
i- <program> Copyright (C) <year> <name of author> Err bitreich.org 70
i- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. Err bitreich.org 70
i- This is free software, and you are welcome to redistribute it Err bitreich.org 70
i- under certain conditions; type `show c' for details. Err bitreich.org 70
i- Err bitreich.org 70
i-The hypothetical commands `show w' and `show c' should show the appropriate Err bitreich.org 70
i-parts of the General Public License. Of course, your program's commands Err bitreich.org 70
i-might be different; for a GUI interface, you would use an "about box". Err bitreich.org 70
i- Err bitreich.org 70
i- You should also get your employer (if you work as a programmer) or school, Err bitreich.org 70
i-if any, to sign a "copyright disclaimer" for the program, if necessary. Err bitreich.org 70
i-For more information on this, and how to apply and follow the GNU GPL, see Err bitreich.org 70
i-<http://www.gnu.org/licenses/>. Err bitreich.org 70
i- Err bitreich.org 70
i- The GNU General Public License does not permit incorporating your program Err bitreich.org 70
i-into proprietary programs. If your program is a subroutine library, you Err bitreich.org 70
i-may consider it more useful to permit linking proprietary applications with Err bitreich.org 70
i-the library. If this is what you want to do, use the GNU Lesser General Err bitreich.org 70
i-Public License instead of this License. But first, please read Err bitreich.org 70
i-<http://www.gnu.org/philosophy/why-not-lgpl.html>. Err bitreich.org 70
i+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES Err bitreich.org 70
i+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF Err bitreich.org 70
i+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR Err bitreich.org 70
i+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES Err bitreich.org 70
i+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN Err bitreich.org 70
i+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF Err bitreich.org 70
i+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Err bitreich.org 70
1diff --git a/Makefile b/Makefile /scm/gopher-validator/file/Makefile.gph bitreich.org 70
i@@ -1,47 +1,59 @@ Err bitreich.org 70
i-# gopher-validator - a tiny gopher validator Err bitreich.org 70
i-# See LICENSE file for copyright and license details. Err bitreich.org 70
i .POSIX: Err bitreich.org 70
i Err bitreich.org 70
i+# paths Err bitreich.org 70
i+PREFIX = /usr/local Err bitreich.org 70
i+MANPREFIX = ${PREFIX}/man Err bitreich.org 70
i+ Err bitreich.org 70
i+# compiler and linker Err bitreich.org 70
i+CC = cc Err bitreich.org 70
i+ Err bitreich.org 70
i NAME = gopher-validator Err bitreich.org 70
i VERSION = 0.1 Err bitreich.org 70
i+BIN = ${NAME} Err bitreich.org 70
i+SRC = ${BIN:=.c} Err bitreich.org 70
i+OBJ = ${BIN:=.o} Err bitreich.org 70
i+MAN1 = ${BIN:=.1} Err bitreich.org 70
i+DOC = LICENSE README Err bitreich.org 70
i Err bitreich.org 70
i-PREFIX = /usr/local Err bitreich.org 70
i-BINDIR = ${PREFIX}/bin Err bitreich.org 70
i-MANDIR = ${PREFIX}/share/man/man1 Err bitreich.org 70
i+# build static: useful in a chroot. Err bitreich.org 70
i+#LDFLAGS += -static Err bitreich.org 70
i+# Linux Err bitreich.org 70
i+#CPPFLAGS += -D_DEFAULT_SOURCE Err bitreich.org 70
i+ Err bitreich.org 70
i+all: ${BIN} Err bitreich.org 70
i Err bitreich.org 70
i-all: info ${NAME} Err bitreich.org 70
i+${BIN}: ${OBJ} Err bitreich.org 70
i+ ${CC} -o $@ ${OBJ} ${LDFLAGS} Err bitreich.org 70
i Err bitreich.org 70
i-info: Err bitreich.org 70
i- @echo Just run make install. Err bitreich.org 70
i+${OBJ}: Makefile Err bitreich.org 70
i Err bitreich.org 70
i clean: Err bitreich.org 70
i- @echo cleaning Err bitreich.org 70
i- @rm -f ${NAME}-${VERSION}.tar.gz Err bitreich.org 70
i- Err bitreich.org 70
i-install: all Err bitreich.org 70
i- @echo installing script to ${DESTDIR}${BINDIR} Err bitreich.org 70
i- @mkdir -p "${DESTDIR}${BINDIR}" Err bitreich.org 70
i- @cp -f ${NAME} "${DESTDIR}${BINDIR}" Err bitreich.org 70
i- @chmod 755 "${DESTDIR}${BINDIR}/${NAME}" Err bitreich.org 70
i- @echo installing manpage to "${DESTDIR}${MANDIR}" Err bitreich.org 70
i- @mkdir -p "${DESTDIR}${MANDIR}" Err bitreich.org 70
i- @cp -f ${NAME}.1 "${DESTDIR}${MANDIR}" Err bitreich.org 70
i- @chmod 644 "${DESTDIR}${MANDIR}/${NAME}.1" Err bitreich.org 70
i+ rm -f ${BIN} ${OBJ} Err bitreich.org 70
i+ Err bitreich.org 70
i+install: Err bitreich.org 70
i+ # installing executable files and scripts. Err bitreich.org 70
i+ mkdir -p "${DESTDIR}${PREFIX}/bin" Err bitreich.org 70
i+ cp -f ${BIN} "${DESTDIR}${PREFIX}/bin" Err bitreich.org 70
i+ for f in ${BIN}; do chmod 755 "${DESTDIR}${PREFIX}/bin/$$f"; done Err bitreich.org 70
i+ # installing manual pages for general commands: section 1. Err bitreich.org 70
i+ mkdir -p "${DESTDIR}${MANPREFIX}/man1" Err bitreich.org 70
i+ cp -f ${MAN1} "${DESTDIR}${MANPREFIX}/man1" Err bitreich.org 70
i+ for m in ${MAN1}; do chmod 644 "${DESTDIR}${MANPREFIX}/man1/$$m"; done Err bitreich.org 70
i Err bitreich.org 70
i uninstall: Err bitreich.org 70
i- @echo removing executable file from ${DESTDIR}${BINDIR} Err bitreich.org 70
i- @rm -f "${DESTDIR}${BINDIR}/${NAME}" Err bitreich.org 70
i- @echo removing manpage from "${DESTDIR}${MANDIR}" Err bitreich.org 70
i- @rm -f "${DESTDIR}${MANDIR}/${NAME}.8" Err bitreich.org 70
i- Err bitreich.org 70
i-dist: clean Err bitreich.org 70
i- @echo creating dist tarball Err bitreich.org 70
i- @mkdir -p ${NAME}-${VERSION} Err bitreich.org 70
i- @cp -R README LICENSE Makefile ${NAME}.1 \ Err bitreich.org 70
i- ${NAME}-${VERSION} Err bitreich.org 70
i- @tar -cf ${NAME}-${VERSION}.tar ${NAME}-${VERSION} Err bitreich.org 70
i- @gzip ${NAME}-${VERSION}.tar Err bitreich.org 70
i- @mv ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}.tgz Err bitreich.org 70
i- @rm -rf "${NAME}-${VERSION}" Err bitreich.org 70
i- Err bitreich.org 70
i-.PHONY: all info clean dist install uninstall Err bitreich.org 70
i+ # removing executable files and scripts. Err bitreich.org 70
i+ for f in ${BIN}; do rm -f "${DESTDIR}${PREFIX}/bin/$$f"; done Err bitreich.org 70
i+ # removing manual pages. Err bitreich.org 70
i+ for m in ${MAN1}; do rm -f "${DESTDIR}${MANPREFIX}/man1/$$m"; done Err bitreich.org 70
i+ Err bitreich.org 70
i+dist: Err bitreich.org 70
i+ rm -rf "${NAME}-${VERSION}" Err bitreich.org 70
i+ mkdir -p "${NAME}-${VERSION}" Err bitreich.org 70
i+ cp -f ${DOC} ${MAN1} ${SRC} Makefile "${NAME}-${VERSION}" Err bitreich.org 70
i+ # make tarball Err bitreich.org 70
i+ tar -cf - "${NAME}-${VERSION}" | \ Err bitreich.org 70
i+ gzip -c > "${NAME}-${VERSION}.tar.gz" Err bitreich.org 70
i+ rm -rf "${NAME}-${VERSION}" Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
i+.PHONY: all clean dist install uninstall Err bitreich.org 70
1diff --git a/README b/README /scm/gopher-validator/file/README.gph bitreich.org 70
i@@ -0,0 +1,13 @@ Err bitreich.org 70
i+gopher-validator Err bitreich.org 70
i+---------------- Err bitreich.org 70
i+ Err bitreich.org 70
i+Validate Gopher directory and search types. Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
i+Dependencies Err bitreich.org 70
i+------------ Err bitreich.org 70
i+ Err bitreich.org 70
i+- C compiler. Err bitreich.org 70
i+- libc + some BSD extensions (dprintf). Err bitreich.org 70
i+- POSIX system. Err bitreich.org 70
i+- make (optional). Err bitreich.org 70
1diff --git a/TODO b/TODO /scm/gopher-validator/file/TODO.gph bitreich.org 70
i@@ -0,0 +1 @@ Err bitreich.org 70
i+- allow CGI-mode for HTTP (add header), keep compatible with Gopher CGI. Err bitreich.org 70
1diff --git a/gopher-validator b/gopher-validator /scm/gopher-validator/file/gopher-validator.gph bitreich.org 70
i@@ -1,10 +0,0 @@ Err bitreich.org 70
i-#!/bin/sh Err bitreich.org 70
i-# Err bitreich.org 70
i-# See the LICENSE for licensing details. Err bitreich.org 70
i-# Err bitreich.org 70
i- Err bitreich.org 70
i-result="$(sacc "$@" | grep "^!")" || printf "valid\n" && exit 0 Err bitreich.org 70
i- Err bitreich.org 70
i-printf "Errors found\n%s\n" "${result}" Err bitreich.org 70
i-exit 1 Err bitreich.org 70
i- Err bitreich.org 70
1diff --git a/gopher-validator.1 b/gopher-validator.1 /scm/gopher-validator/file/gopher-validator.1.gph bitreich.org 70
i@@ -1,43 +1,71 @@ Err bitreich.org 70
i-.Dd August 10, 2018 Err bitreich.org 70
i-.Dt GEOMYIDAE 1 Err bitreich.org 70
i+.Dd July 22, 2019 Err bitreich.org 70
i+.Dt GOPHER-VALIDATOR 1 Err bitreich.org 70
i .Os Err bitreich.org 70
i-. Err bitreich.org 70
i .Sh NAME Err bitreich.org 70
i .Nm gopher-validator Err bitreich.org 70
i .Nd a simple gopher validator Err bitreich.org 70
i-. Err bitreich.org 70
i .Sh SYNOPSIS Err bitreich.org 70
i .Nm Err bitreich.org 70
i-URL Err bitreich.org 70
i-. Err bitreich.org 70
i+.Op Ar url Err bitreich.org 70
i .Sh DESCRIPTION Err bitreich.org 70
i-.Bd -filled Err bitreich.org 70
i .Nm Err bitreich.org 70
i-is a simple script to validate gopher content served on some URI/selector in a Err bitreich.org 70
i-gopher menu. The menu structure is defined in the RFC 1436 (Gopher). Err bitreich.org 70
i+reads raw Gopher data from stdin. Err bitreich.org 70
i+.Pp Err bitreich.org 70
i+When an Err bitreich.org 70
i+.Ar url Err bitreich.org 70
i+is specified it retrieves the raw Gopher data from this url. Err bitreich.org 70
i+.Pp Err bitreich.org 70
i+When the environment variable Err bitreich.org 70
i+.Ev QUERY_STRING Err bitreich.org 70
i+is set the program runs in Command Gateway Interface (CGI) mode. Err bitreich.org 70
i+It will use the content of this variable as if it was Err bitreich.org 70
i+.Ar url . Err bitreich.org 70
i+.Pp Err bitreich.org 70
i .Nm Err bitreich.org 70
i-is using sacc(1) as the gopher protocol implementation. Err bitreich.org 70
i+validates Gopher data of directory (1) and search types (7). Err bitreich.org 70
i+.Sh DIAGNOSTICS Err bitreich.org 70
i+The following output format is used for the fatal, error and warning messages. Err bitreich.org 70
i+These are prefixed with the following texts: Err bitreich.org 70
i+.Bl -tag -width Ds Err bitreich.org 70
i+.It Qq "fatal: " Err bitreich.org 70
i+.Pp Err bitreich.org 70
i+Fatal program errors such as connection errors. Err bitreich.org 70
i+These messages are written to stderr, unless Err bitreich.org 70
i+.Nm Err bitreich.org 70
i+runs in CGI mode. Err bitreich.org 70
i+.It Qq "error: " Err bitreich.org 70
i+.Pp Err bitreich.org 70
i+Gopher errors violating the RFC specification. Err bitreich.org 70
i+These messages are written to stdout. Err bitreich.org 70
i+.It Qq "warning: " Err bitreich.org 70
i+.Pp Err bitreich.org 70
i+Recommendations according to the RFC specification. Err bitreich.org 70
i+These messages are written to stdout. Err bitreich.org 70
i+.El Err bitreich.org 70
i+.Pp Err bitreich.org 70
i+If possible the messages are also prefixed with the output line number. Err bitreich.org 70
i+.Sh EXIT STATUS Err bitreich.org 70
i+When there is a fatal error the exitcode is 2. Err bitreich.org 70
i+When there is any Gopher error the exitcode is 1. Err bitreich.org 70
i+When there is no error (could still have a warning) the exitcode is 0. Err bitreich.org 70
i+.Sh EXAMPLES Err bitreich.org 70
i+.Bd -literal Err bitreich.org 70
i+printf '\\r\\n' | nc codemadness.org 70 | gopher-validator Err bitreich.org 70
i+.Ed Err bitreich.org 70
i+.Bd -literal Err bitreich.org 70
i+gopher-validator gopher://codemadness.org Err bitreich.org 70
i .Ed Err bitreich.org 70
i-. Err bitreich.org 70
i-.Sh RETURN VALUES Err bitreich.org 70
i-.Bd -filled Err bitreich.org 70
i+.Sh SEE ALSO Err bitreich.org 70
i+.Xr nc 1 Err bitreich.org 70
i+.Sh STANDARDS Err bitreich.org 70
i+RFC1436 is followed as closely as possible. Err bitreich.org 70
i+The only deviation is checking for UTF-8 instead of LATIN-1 text encoding, Err bitreich.org 70
i+for now. Err bitreich.org 70
i .Nm Err bitreich.org 70
i-will return an exit status of 1 in case anything went wrong. It will write on Err bitreich.org 70
i-stdout the error and lines found to be erroneous. If everything went right, Err bitreich.org 70
i+uses the standard C library locale functions and respects the user locale Err bitreich.org 70
i+environment. Err bitreich.org 70
i+To check text encoding it is assumed Err bitreich.org 70
i .Nm Err bitreich.org 70
i-will return the string "valid" and an exit status of 0. Err bitreich.org 70
i-. Err bitreich.org 70
i-.Sh SEE ALSO Err bitreich.org 70
i-sacc (1) Err bitreich.org 70
i-. Err bitreich.org 70
i+runs in the same locale environment as the server. Err bitreich.org 70
i .Sh AUTHORS Err bitreich.org 70
i-See LICENSE file for authors in the distribution. Err bitreich.org 70
i-. Err bitreich.org 70
i-.Sh LICENSE Err bitreich.org 70
i-See LICENSE file for the license. Err bitreich.org 70
i-. Err bitreich.org 70
i-.Sh BUGS Err bitreich.org 70
i-.Ss "Reporting Bugs" Err bitreich.org 70
i-Report bugs to: Err bitreich.org 70
i-.An "Christoph Lohmann" Aq 20h@R-36.net Err bitreich.org 70
i- Err bitreich.org 70
i+.An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org Err bitreich.org 70
1diff --git a/gopher-validator.c b/gopher-validator.c /scm/gopher-validator/file/gopher-validator.c.gph bitreich.org 70
i@@ -0,0 +1,529 @@ Err bitreich.org 70
i+#include <sys/socket.h> Err bitreich.org 70
i+#include <sys/time.h> Err bitreich.org 70
i+#include <sys/types.h> Err bitreich.org 70
i+ Err bitreich.org 70
i+#include <ctype.h> Err bitreich.org 70
i+#include <errno.h> Err bitreich.org 70
i+#include <locale.h> Err bitreich.org 70
i+#include <limits.h> Err bitreich.org 70
i+#include <netdb.h> Err bitreich.org 70
i+#include <stdarg.h> Err bitreich.org 70
i+#include <stdio.h> Err bitreich.org 70
i+#include <stdlib.h> Err bitreich.org 70
i+#include <string.h> Err bitreich.org 70
i+#include <unistd.h> Err bitreich.org 70
i+#include <wchar.h> Err bitreich.org 70
i+#include <wctype.h> Err bitreich.org 70
i+ Err bitreich.org 70
i+#define MAX_RESPONSETIMEOUT 10 /* timeout in seconds */ Err bitreich.org 70
i+ Err bitreich.org 70
i+#ifndef __OpenBSD__ Err bitreich.org 70
i+#define pledge(a,b) 0 Err bitreich.org 70
i+#endif Err bitreich.org 70
i+ Err bitreich.org 70
i+struct uri { Err bitreich.org 70
i+ char host[256]; Err bitreich.org 70
i+ char port[8]; Err bitreich.org 70
i+ char path[1024]; Err bitreich.org 70
i+}; Err bitreich.org 70
i+ Err bitreich.org 70
i+struct visited { Err bitreich.org 70
i+ int _type; Err bitreich.org 70
i+ char username[1024]; Err bitreich.org 70
i+ char path[1024]; Err bitreich.org 70
i+ char server[256]; Err bitreich.org 70
i+ char port[8]; Err bitreich.org 70
i+}; Err bitreich.org 70
i+ Err bitreich.org 70
i+/* check valid types with extension in path */ Err bitreich.org 70
i+struct { Err bitreich.org 70
i+ const char *ext; Err bitreich.org 70
i+ const char *allow; Err bitreich.org 70
i+} types [] = { Err bitreich.org 70
i+ { .ext = "md5", "0" }, Err bitreich.org 70
i+ { .ext = "md5sum", "0" }, Err bitreich.org 70
i+ { .ext = "sha1", "0" }, Err bitreich.org 70
i+ { .ext = "sha1sum", "0" }, Err bitreich.org 70
i+ { .ext = "sha256", "0" }, Err bitreich.org 70
i+ { .ext = "sha256sum", "0" }, Err bitreich.org 70
i+ { .ext = "sha512", "0" }, Err bitreich.org 70
i+ { .ext = "sha512sum", "0" }, Err bitreich.org 70
i+ { .ext = "asc", "0" }, Err bitreich.org 70
i+ { .ext = "rss", "0" }, Err bitreich.org 70
i+ { .ext = "xml", "0" }, Err bitreich.org 70
i+ { .ext = "txt", "0" }, Err bitreich.org 70
i+ { .ext = "json", "0" }, Err bitreich.org 70
i+ { .ext = "md", "0" }, Err bitreich.org 70
i+ { .ext = "c", "0" }, Err bitreich.org 70
i+ { .ext = "h", "0" }, Err bitreich.org 70
i+ { .ext = "sh", "0" }, Err bitreich.org 70
i+ { .ext = "go", "0" }, Err bitreich.org 70
i+ { .ext = "srt", "0" }, Err bitreich.org 70
i+ { .ext = "m3u", "0" }, Err bitreich.org 70
i+ { .ext = "htm", "0h" }, Err bitreich.org 70
i+ { .ext = "html", "0h" }, Err bitreich.org 70
i+ { .ext = "gph", "1" }, Err bitreich.org 70
i+ { .ext = "dcgi", "17" }, Err bitreich.org 70
i+ { .ext = "gif", "gI" }, Err bitreich.org 70
i+ { .ext = "jpg", "I" }, Err bitreich.org 70
i+ { .ext = "jpeg", "I" }, Err bitreich.org 70
i+ { .ext = "png", "I" }, Err bitreich.org 70
i+ { .ext = "doc", "9" }, Err bitreich.org 70
i+ { .ext = "pdf", "9" }, Err bitreich.org 70
i+ { .ext = "iso", "9" }, Err bitreich.org 70
i+ { .ext = "exe", "9" }, Err bitreich.org 70
i+ { .ext = "gz", "9" }, Err bitreich.org 70
i+ { .ext = "tgz", "9" }, Err bitreich.org 70
i+ { .ext = "bz2", "9" }, Err bitreich.org 70
i+ { .ext = "xz", "9" }, Err bitreich.org 70
i+ { .ext = "lzma", "9" }, Err bitreich.org 70
i+ { .ext = "wav", "9" }, Err bitreich.org 70
i+ { .ext = "mp3", "9" }, Err bitreich.org 70
i+ { .ext = "ogg", "9" }, Err bitreich.org 70
i+ { .ext = "avi", "9" }, Err bitreich.org 70
i+ { .ext = "mp4", "9" }, Err bitreich.org 70
i+ { .ext = "mkv", "9" }, Err bitreich.org 70
i+ { .ext = "ogv", "9" }, Err bitreich.org 70
i+}; Err bitreich.org 70
i+ Err bitreich.org 70
i+int exitcode = 0; Err bitreich.org 70
i+FILE *errfp, *outfp; Err bitreich.org 70
i+ Err bitreich.org 70
i+void Err bitreich.org 70
i+die(const char *fmt, ...) Err bitreich.org 70
i+{ Err bitreich.org 70
i+ va_list ap; Err bitreich.org 70
i+ Err bitreich.org 70
i+ fputs("fatal: ", errfp); Err bitreich.org 70
i+ Err bitreich.org 70
i+ va_start(ap, fmt); Err bitreich.org 70
i+ vfprintf(errfp, fmt, ap); Err bitreich.org 70
i+ va_end(ap); Err bitreich.org 70
i+ Err bitreich.org 70
i+ exit(2); Err bitreich.org 70
i+} Err bitreich.org 70
i+ Err bitreich.org 70
i+void Err bitreich.org 70
i+error(const char *fmt, ...) Err bitreich.org 70
i+{ Err bitreich.org 70
i+ va_list ap; Err bitreich.org 70
i+ Err bitreich.org 70
i+ fputs("error: ", outfp); Err bitreich.org 70
i+ Err bitreich.org 70
i+ va_start(ap, fmt); Err bitreich.org 70
i+ vfprintf(outfp, fmt, ap); Err bitreich.org 70
i+ va_end(ap); Err bitreich.org 70
i+ Err bitreich.org 70
i+ exitcode = 1; Err bitreich.org 70
i+} Err bitreich.org 70
i+ Err bitreich.org 70
i+void Err bitreich.org 70
i+warning(const char *fmt, ...) Err bitreich.org 70
i+{ Err bitreich.org 70
i+ va_list ap; Err bitreich.org 70
i+ Err bitreich.org 70
i+ fputs("warning: ", outfp); Err bitreich.org 70
i+ Err bitreich.org 70
i+ va_start(ap, fmt); Err bitreich.org 70
i+ vfprintf(outfp, fmt, ap); Err bitreich.org 70
i+ va_end(ap); Err bitreich.org 70
i+} Err bitreich.org 70
i+ Err bitreich.org 70
i+int Err bitreich.org 70
i+edial(const char *host, const char *port) Err bitreich.org 70
i+{ Err bitreich.org 70
i+ struct addrinfo hints, *res, *res0; Err bitreich.org 70
i+ int error, save_errno, s; Err bitreich.org 70
i+ const char *cause = NULL; Err bitreich.org 70
i+ struct timeval timeout; Err bitreich.org 70
i+ Err bitreich.org 70
i+ memset(&hints, 0, sizeof(hints)); Err bitreich.org 70
i+ hints.ai_family = AF_UNSPEC; Err bitreich.org 70
i+ hints.ai_socktype = SOCK_STREAM; Err bitreich.org 70
i+ hints.ai_flags = AI_NUMERICSERV; /* numeric port only */ Err bitreich.org 70
i+ if ((error = getaddrinfo(host, port, &hints, &res0))) Err bitreich.org 70
i+ die("%s: %s: %s:%s\n", __func__, gai_strerror(error), host, port); Err bitreich.org 70
i+ s = -1; Err bitreich.org 70
i+ for (res = res0; res; res = res->ai_next) { Err bitreich.org 70
i+ s = socket(res->ai_family, res->ai_socktype, Err bitreich.org 70
i+ res->ai_protocol); Err bitreich.org 70
i+ if (s == -1) { Err bitreich.org 70
i+ cause = "socket"; Err bitreich.org 70
i+ continue; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ timeout.tv_sec = MAX_RESPONSETIMEOUT; Err bitreich.org 70
i+ timeout.tv_usec = 0; Err bitreich.org 70
i+ if (setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)) == -1) Err bitreich.org 70
i+ die("%s: setsockopt: %s\n", __func__, strerror(errno)); Err bitreich.org 70
i+ Err bitreich.org 70
i+ timeout.tv_sec = MAX_RESPONSETIMEOUT; Err bitreich.org 70
i+ timeout.tv_usec = 0; Err bitreich.org 70
i+ if (setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)) == -1) Err bitreich.org 70
i+ die("%s: setsockopt: %s\n", __func__, strerror(errno)); Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (connect(s, res->ai_addr, res->ai_addrlen) == -1) { Err bitreich.org 70
i+ cause = "connect"; Err bitreich.org 70
i+ save_errno = errno; Err bitreich.org 70
i+ close(s); Err bitreich.org 70
i+ errno = save_errno; Err bitreich.org 70
i+ s = -1; Err bitreich.org 70
i+ continue; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ break; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ if (s == -1) Err bitreich.org 70
i+ die("%s: %s: %s:%s\n", __func__, cause, host, port); Err bitreich.org 70
i+ freeaddrinfo(res0); Err bitreich.org 70
i+ Err bitreich.org 70
i+ return s; Err bitreich.org 70
i+} Err bitreich.org 70
i+ Err bitreich.org 70
i+void Err bitreich.org 70
i+checkdir(FILE *fp) Err bitreich.org 70
i+{ Err bitreich.org 70
i+ struct visited v; Err bitreich.org 70
i+ char line[1024], *end, *s; Err bitreich.org 70
i+ size_t linenr; Err bitreich.org 70
i+ ssize_t n; Err bitreich.org 70
i+ long long l; Err bitreich.org 70
i+ int i, r, len, hasdotend = 0, c, primarytype = 0, wc, col; Err bitreich.org 70
i+ wchar_t w; Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (pledge("stdio", NULL) == -1) Err bitreich.org 70
i+ die("pledge: %s\n", strerror(errno)); Err bitreich.org 70
i+ Err bitreich.org 70
i+ for (linenr = 1; fgets(line, sizeof(line), fp); linenr++) { Err bitreich.org 70
i+ n = strcspn(line, "\n"); Err bitreich.org 70
i+ if (line[n] != '\n') Err bitreich.org 70
i+ die("%zu: line too long\n", linenr); /* fatal */ Err bitreich.org 70
i+ if (n && line[n] == '\n') Err bitreich.org 70
i+ line[n] = '\0'; Err bitreich.org 70
i+ if (n && line[n - 1] == '\r') Err bitreich.org 70
i+ line[--n] = '\0'; Err bitreich.org 70
i+ else Err bitreich.org 70
i+ error("%zu: invalid line-ending, not CRLF (\\r\\n)\n", linenr); Err bitreich.org 70
i+ if (n == 1 && line[0] == '.') { Err bitreich.org 70
i+ hasdotend = 1; Err bitreich.org 70
i+ break; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ memset(&v, 0, sizeof(v)); Err bitreich.org 70
i+ Err bitreich.org 70
i+ v._type = line[0]; Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* "username" */ Err bitreich.org 70
i+ i = 1; Err bitreich.org 70
i+ len = strcspn(line + i, "\t"); Err bitreich.org 70
i+ if (len + 1 < sizeof(v.username)) { Err bitreich.org 70
i+ memcpy(v.username, line + i, len); Err bitreich.org 70
i+ v.username[len] = '\0'; Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+ error("%zu: username field too long\n", linenr); Err bitreich.org 70
i+ continue; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ if (line[i + len] == '\t') { Err bitreich.org 70
i+ i += len + 1; Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+ error("%zu: invalid line / field count\n", linenr); Err bitreich.org 70
i+ continue; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* selector / path */ Err bitreich.org 70
i+ len = strcspn(line + i, "\t"); Err bitreich.org 70
i+ if (len + 1 < sizeof(v.path)) { Err bitreich.org 70
i+ memcpy(v.path, line + i, len); Err bitreich.org 70
i+ v.path[len] = '\0'; Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+ error("%zu: path field too long\n", linenr); Err bitreich.org 70
i+ continue; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ if (line[i + len] == '\t') { Err bitreich.org 70
i+ i += len + 1; Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+ error("%zu: invalid line / field count\n", linenr); Err bitreich.org 70
i+ continue; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* server */ Err bitreich.org 70
i+ len = strcspn(line + i, "\t"); Err bitreich.org 70
i+ if (len + 1 < sizeof(v.server)) { Err bitreich.org 70
i+ memcpy(v.server, line + i, len); Err bitreich.org 70
i+ v.server[len] = '\0'; Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+ error("%zu: server field too long\n", linenr); Err bitreich.org 70
i+ continue; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ if (line[i + len] == '\t') { Err bitreich.org 70
i+ i += len + 1; Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+ error("%zu: invalid line / field count\n", linenr); Err bitreich.org 70
i+ continue; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* port */ Err bitreich.org 70
i+ len = strcspn(line + i, "\t"); Err bitreich.org 70
i+ if (len + 1 < sizeof(v.port)) { Err bitreich.org 70
i+ memcpy(v.port, line + i, len); Err bitreich.org 70
i+ v.port[len] = '\0'; Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+ error("%zu: port field too long\n", linenr); Err bitreich.org 70
i+ continue; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* check non-standard types */ Err bitreich.org 70
i+ c = v._type; Err bitreich.org 70
i+ if (v._type == '+' && !primarytype) Err bitreich.org 70
i+ error("%zu: mirror type used, but no previous type set\n", linenr); Err bitreich.org 70
i+ if (v._type != '+') Err bitreich.org 70
i+ primarytype = v._type; Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (!(isdigit(c) || c == 'g' || c == 'I' || c == 'T' || c == '+')) { Err bitreich.org 70
i+ /* common-used */ Err bitreich.org 70
i+ if (c == 'i' || c == 'h') { Err bitreich.org 70
i+#if 0 Err bitreich.org 70
i+ warning("%zu: non-standard, but common-used type: %c\n", Err bitreich.org 70
i+ linenr, c); Err bitreich.org 70
i+#endif Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+ /* 3.8: "Characters '0' through 'Z' are reserved. Local Err bitreich.org 70
i+ experiments should use other characters. Err bitreich.org 70
i+ Machine-specific extensions are not encouraged." */ Err bitreich.org 70
i+ if (c >= '0' && c <= 'Z') Err bitreich.org 70
i+ error("%zu: unknown / non-standard type: %c\n", Err bitreich.org 70
i+ linenr, c); Err bitreich.org 70
i+ } Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* check type with file extension */ Err bitreich.org 70
i+ if ((s = strrchr(v.path, '.')) && !strchr(s, '/')) { Err bitreich.org 70
i+ s++; Err bitreich.org 70
i+ for (i = 0; i < sizeof(types) / sizeof(*types); i++) { Err bitreich.org 70
i+ if (primarytype == 'h' && Err bitreich.org 70
i+ !strncmp(v.path, "URL:", sizeof("URL:") - 1)) Err bitreich.org 70
i+ continue; Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (!strcasecmp(s, types[i].ext) && Err bitreich.org 70
i+ !strchr(types[i].allow, primarytype)) { Err bitreich.org 70
i+ warning("%zu: invalid type '%c' for extension '%s', valid types: '%s'\n", Err bitreich.org 70
i+ linenr, primarytype, types[i].ext, types[i].allow); Err bitreich.org 70
i+ break; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ } Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* check port, must be numeric and in range, port 0 is allowed: Err bitreich.org 70
i+ "Appendix: Err bitreich.org 70
i+ Note: Port corresponds the the TCP Port Number, its value should Err bitreich.org 70
i+ be in the range [0..65535]; port 70 is officially assigned Err bitreich.org 70
i+ to gopher." */ Err bitreich.org 70
i+ Err bitreich.org 70
i+ errno = 0; Err bitreich.org 70
i+ l = strtoll(v.port, &end, 10); Err bitreich.org 70
i+ if (errno || *end || l < 0 || l > 65535) { Err bitreich.org 70
i+ error("%zu: invalid port: %s\n", linenr, v.port); Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+#if 0 Err bitreich.org 70
i+ if (l != 70) Err bitreich.org 70
i+ warning("%zu: non-standard gopher port: %lld, not 70\n", Err bitreich.org 70
i+ linenr, l); Err bitreich.org 70
i+#endif Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* RFC "Notes": "The Selector string should be no longer than Err bitreich.org 70
i+ 255 characters." */ Err bitreich.org 70
i+ if ((len = strlen(v.path)) > 255) Err bitreich.org 70
i+ error("%zu: selector should not be longer than 255 characters: %d bytes\n", Err bitreich.org 70
i+ linenr, len); Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* decode UTF-8 (text-encoding is ASCII/Latin1 in the RFC, but Err bitreich.org 70
i+ Latin1 sucks, recommend UTF-8 instead. Err bitreich.org 70
i+ Check column length as recommended as described in the RFC Err bitreich.org 70
i+ in section 3.9. */ Err bitreich.org 70
i+ s = v.username; Err bitreich.org 70
i+ len = strlen(s); Err bitreich.org 70
i+ col = 0; Err bitreich.org 70
i+ for (i = 0; i < len; i += r) { Err bitreich.org 70
i+ r = mbtowc(&w, &s[i], len - i < 4 ? len - i : 4); Err bitreich.org 70
i+ if (r == 0) Err bitreich.org 70
i+ break; Err bitreich.org 70
i+ if (r == -1) { Err bitreich.org 70
i+ warning("%zu:%d: username: first invalid byte, not UTF-8\n", Err bitreich.org 70
i+ linenr, i); Err bitreich.org 70
i+ break; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ if ((wc = wcwidth(w)) == -1) Err bitreich.org 70
i+ wc = 1; Err bitreich.org 70
i+ col += (size_t)wc; Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* RFC "Notes": "It is *highly* recommended that the Err bitreich.org 70
i+ User_Name field contain only printable characters". */ Err bitreich.org 70
i+ if (!iswprint(w)) { Err bitreich.org 70
i+ error("%zu:%d: first non-printable character in username field\n", Err bitreich.org 70
i+ linenr, i); Err bitreich.org 70
i+ break; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ } Err bitreich.org 70
i+#if 0 Err bitreich.org 70
i+ /* instead of 70 check 79 */ Err bitreich.org 70
i+ if (col > 79) Err bitreich.org 70
i+ warning("%zu: username column length is > 79 (%d), see section 3.9 of the RFC\n", Err bitreich.org 70
i+ linenr, col); Err bitreich.org 70
i+#endif Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (!strcmp(v.path, "..") || strstr(v.path, "../")) Err bitreich.org 70
i+ warning("%zu: found ../ in path: don't use relative paths\n", linenr); Err bitreich.org 70
i+ } Err bitreich.org 70
i+ if (ferror(fp)) Err bitreich.org 70
i+ die("fgets: %s\n", strerror(errno)); Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (!hasdotend) Err bitreich.org 70
i+ error("no .\\r\\n end\n"); Err bitreich.org 70
i+} Err bitreich.org 70
i+ Err bitreich.org 70
i+void Err bitreich.org 70
i+checkremote(const char *server, const char *port, const char *path, const char *param) Err bitreich.org 70
i+{ Err bitreich.org 70
i+ FILE *fp; Err bitreich.org 70
i+ int fd, r; Err bitreich.org 70
i+ Err bitreich.org 70
i+ fd = edial(server, port); Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (param[0]) Err bitreich.org 70
i+ r = dprintf(fd, "%s\t%s\r\n", path, param); Err bitreich.org 70
i+ else Err bitreich.org 70
i+ r = dprintf(fd, "%s\r\n", path); Err bitreich.org 70
i+ if (r == -1) Err bitreich.org 70
i+ die("write: %s\n", strerror(errno)); Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (!(fp = fdopen(fd, "rb+"))) Err bitreich.org 70
i+ die("fdopen: %s\n", strerror(errno)); Err bitreich.org 70
i+ checkdir(fp); Err bitreich.org 70
i+ fclose(fp); Err bitreich.org 70
i+} Err bitreich.org 70
i+ Err bitreich.org 70
i+int Err bitreich.org 70
i+parseuri(const char *str, struct uri *u) Err bitreich.org 70
i+{ Err bitreich.org 70
i+ const char *s, *e; Err bitreich.org 70
i+ Err bitreich.org 70
i+ memset(u, 0, sizeof(struct uri)); Err bitreich.org 70
i+ Err bitreich.org 70
i+ s = str; Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* IPv6 */ Err bitreich.org 70
i+ if (*s == '[') { Err bitreich.org 70
i+ s++; Err bitreich.org 70
i+ e = strchr(s, ']'); Err bitreich.org 70
i+ if (!e || e - s + 1 >= sizeof(u->host)) Err bitreich.org 70
i+ return 0; Err bitreich.org 70
i+ memcpy(u->host, s, e - s); Err bitreich.org 70
i+ u->host[e - s] = '\0'; Err bitreich.org 70
i+ e++; Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+ e = &s[strcspn(s, ":/")]; Err bitreich.org 70
i+ if (e - s + 1 >= sizeof(u->host)) Err bitreich.org 70
i+ return 0; Err bitreich.org 70
i+ memcpy(u->host, s, e - s); Err bitreich.org 70
i+ u->host[e - s] = '\0'; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (*e == ':') { Err bitreich.org 70
i+ s = e + 1; Err bitreich.org 70
i+ e = &s[strcspn(s, "/")]; Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (e - s + 1 >= sizeof(u->port)) Err bitreich.org 70
i+ return 0; Err bitreich.org 70
i+ memcpy(u->port, s, e - s); Err bitreich.org 70
i+ u->port[e - s] = '\0'; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ if (*e && *e != '/') Err bitreich.org 70
i+ return 0; /* invalid path */ Err bitreich.org 70
i+ Err bitreich.org 70
i+ s = e; Err bitreich.org 70
i+ e = s + strlen(s); Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (e - s + 1 >= sizeof(u->path)) Err bitreich.org 70
i+ return 0; Err bitreich.org 70
i+ memcpy(u->path, s, e - s); Err bitreich.org 70
i+ u->path[e - s] = '\0'; Err bitreich.org 70
i+ Err bitreich.org 70
i+ return 1; Err bitreich.org 70
i+} Err bitreich.org 70
i+ Err bitreich.org 70
i+int Err bitreich.org 70
i+main(int argc, char **argv) Err bitreich.org 70
i+{ Err bitreich.org 70
i+ struct uri u; Err bitreich.org 70
i+ const char *path, *uri = "", *param = "", *s; Err bitreich.org 70
i+ int _type = '1'; Err bitreich.org 70
i+ Err bitreich.org 70
i+ setlocale(LC_CTYPE, ""); Err bitreich.org 70
i+ Err bitreich.org 70
i+ outfp = stdout; Err bitreich.org 70
i+ errfp = stderr; Err bitreich.org 70
i+ Err bitreich.org 70
i+ /* CGI-mode or stand-alone */ Err bitreich.org 70
i+ if ((s = getenv("QUERY_STRING"))) { Err bitreich.org 70
i+ uri = s; Err bitreich.org 70
i+ param = ""; Err bitreich.org 70
i+ errfp = stdout; /* output errors to stdout also in CGI mode */ Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+ switch (argc) { Err bitreich.org 70
i+ case 3: Err bitreich.org 70
i+ param = argv[2]; Err bitreich.org 70
i+ case 2: Err bitreich.org 70
i+ uri = argv[1]; Err bitreich.org 70
i+ break; Err bitreich.org 70
i+ case 1: Err bitreich.org 70
i+ checkdir(stdin); Err bitreich.org 70
i+ return exitcode; Err bitreich.org 70
i+ default: Err bitreich.org 70
i+ fprintf(errfp, "usage: %s [uri] [param]\n", argv[0]); Err bitreich.org 70
i+ return 1; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (pledge("stdio inet dns", NULL) == -1) Err bitreich.org 70
i+ die("pledge: %s\n", strerror(errno)); Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (!strncmp(uri, "gopher://&;, sizeof("gopher://&;) - 1)) Err bitreich.org 70
i+ uri += sizeof("gopher://&;) - 1; Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (!parseuri(uri, &u)) Err bitreich.org 70
i+ die("Invalid uri\n"); Err bitreich.org 70
i+ if (u.host[0] == '\0') Err bitreich.org 70
i+ die("Invalid hostname\n"); Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (u.path[0] == '\0') Err bitreich.org 70
i+ memcpy(u.path, "/", 2); Err bitreich.org 70
i+ if (u.port[0] == '\0') Err bitreich.org 70
i+ memcpy(u.port, "70", 3); Err bitreich.org 70
i+ Err bitreich.org 70
i+ path = u.path; Err bitreich.org 70
i+ if (path[0] == '/') { Err bitreich.org 70
i+ path++; Err bitreich.org 70
i+ if (*path) { Err bitreich.org 70
i+ _type = *path; Err bitreich.org 70
i+ path++; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ } else { Err bitreich.org 70
i+ path = ""; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ switch (_type) { Err bitreich.org 70
i+ case '1': Err bitreich.org 70
i+ case '7': Err bitreich.org 70
i+ break; /* handled below */ Err bitreich.org 70
i+ default: /* these types are not validated */ Err bitreich.org 70
i+ fprintf(errfp, "only types 1 (dir) and 7 (search) are validated\n"); Err bitreich.org 70
i+ return 1; Err bitreich.org 70
i+ } Err bitreich.org 70
i+ Err bitreich.org 70
i+ if (_type != '7') Err bitreich.org 70
i+ param = ""; Err bitreich.org 70
i+ Err bitreich.org 70
i+ checkremote(u.host, u.port, path, param); Err bitreich.org 70
i+ Err bitreich.org 70
i+ return exitcode; Err bitreich.org 70
i+} Err bitreich.org 70
.
Response:
text/plain