diff --git a/Makefile b/Makefile index 0c9a29b14f..55e8972ec4 100644 --- a/Makefile +++ b/Makefile @@ -1,42 +1,42 @@ -# $Id: Makefile,v 1.8 1999-08-29 16:53:23 nik Exp $ +# $FreeBSD$ LINKS= en/ja en/es en/ru en/zh ja/web.mk LINKS+= web.mk ../doc/en_US.ISO_8859-1/web.mk LINKS+= ../doc/en_US.ISO_8859-1/includes.sgml SUBDIR= en all: links links: ${LINKS} clean: rm -f ${LINKS} en/ja: cd en; ln -sf ../ja en/es: cd en; ln -sf ../es en/ru: cd en; ln -sf ../ru en/zh: cd en; ln -sf ../zh ja/web.mk: cd ja; ln -sf ../en/web.mk web.mk: cd .; ln -sf en/web.mk ../doc/en_US.ISO_8859-1/web.mk: cd ../doc/en_US.ISO_8859-1; ln -sf ../../www/en/web.mk ../doc/en_US.ISO_8859-1/includes.sgml: cd ../doc/en_US.ISO_8859-1; ln -sf ../../www/en/includes.sgml .include diff --git a/en/FAQ/Makefile b/en/FAQ/Makefile index b51f080483..cb970b79a5 100644 --- a/en/FAQ/Makefile +++ b/en/FAQ/Makefile @@ -1,11 +1,11 @@ # -# $Id: Makefile,v 1.2 1999-09-03 14:01:12 kuriyama Exp $ +# $FreeBSD$ # # Build the FreeBSD FAQ *outside* of the www tree, and install it # in to the right place as necessary. all install clean: (cd ../../../doc/en_US.ISO_8859-1/books/faq && make 'FORMATS=html-split html' DESTDIR=${DESTDIR}/data/FAQ ${.TARGET}) .if make(install) (cd ${DESTDIR}/data/FAQ; ln -sf index.html FAQ.html) .endif diff --git a/en/Makefile b/en/Makefile index abbaaba40a..6f96c6ffe9 100644 --- a/en/Makefile +++ b/en/Makefile @@ -1,74 +1,74 @@ -# $Id: Makefile,v 1.48 1999-02-10 14:53:59 motoyuki Exp $ +# $FreeBSD$ .if exists(Makefile.conf) .include "Makefile.conf" .endif # These are turned into validated, normalized HTML files. DOCS= applications.sgml DOCS+= auditors.sgml DOCS+= availability.sgml DOCS+= docs.sgml DOCS+= features.sgml DOCS+= register.sgml DOCS+= index.sgml DOCS+= internet.sgml DOCS+= mailto.sgml DOCS+= publish.sgml DOCS+= send-pr.sgml DOCS+= support.sgml DOCS+= where.sgml DOCS+= y2kbug.sgml CLEANFILES+=atoz.sgml site.sgml # These will be directly installed. #DATA= COPYING COPYING.LIB README.mirror robots.txt index.html DATA= robots.txt index.html # Subdirectories # SGML SUBDIR= security SUBDIR+= commercial SUBDIR+= docproj SUBDIR+= news SUBDIR+= alpha SUBDIR+= internal SUBDIR+= copyright SUBDIR+= search SUBDIR+= gallery SUBDIR+= ports SUBDIR+= projects SUBDIR+= releases # Non-SGML SUBDIR+= gifs SUBDIR+= cgi # Non-English .if !defined(ENGLISH_ONLY) || empty(ENGLISH_ONLY) .if !defined(WEB_LANG) || empty(WEB_LANG) SUBDIR+= ja SUBDIR+= es SUBDIR+= ru SUBDIR+= zh .else SUBDIR+= ${WEB_LANG} .endif .endif .if !defined(WEB_ONLY) || empty(WEB_ONLY) # Extern SUBDIR+= tutorials DOCSUBDIR= FAQ handbook .endif SGMLOPTS+= -links -hdr ${.CURDIR}/doc.hdr -ftr ${.CURDIR}/doc.ftr WEBDIR= data .include "web.mk" diff --git a/en/Makefile.inc b/en/Makefile.inc index c44a0696a1..1c72a3f6af 100644 --- a/en/Makefile.inc +++ b/en/Makefile.inc @@ -1,3 +1,3 @@ -# $Id: Makefile.inc,v 1.6 1998-01-18 22:27:30 jfieber Exp $ +# $FreeBSD$ WEBBASE?= /data diff --git a/en/alpha/Makefile b/en/alpha/Makefile index 115e924187..3861e49ce6 100644 --- a/en/alpha/Makefile +++ b/en/alpha/Makefile @@ -1,11 +1,11 @@ -# $Id: Makefile,v 1.5 1998-09-30 07:20:50 jb Exp $ +# $FreeBSD$ .if exists(../Makefile.conf) .include "../Makefile.conf" .endif DOCS= alpha.sgml INDEXLINK=alpha.html .include "../web.mk" diff --git a/en/alpha/alpha.sgml b/en/alpha/alpha.sgml index b1d7065f19..ec0aa967a3 100644 --- a/en/alpha/alpha.sgml +++ b/en/alpha/alpha.sgml @@ -1,38 +1,38 @@ - + %includes; ]> - + &header;

This page contains information about porting FreeBSD to Alpha systems.

FreeBSD/Alpha Specific Links

Other Links of Interest

Hardware

Projects

&footer; diff --git a/en/applications.sgml b/en/applications.sgml index ed6e7a9707..66d9db99a0 100644 --- a/en/applications.sgml +++ b/en/applications.sgml @@ -1,148 +1,148 @@ + %includes; ]> - + &header;

Experience the possibilities with FreeBSD

FreeBSD can handle nearly any task you would expect of a UNIX workstation, as well as many you might not expect:


FreeBSD is a true open system with full source code.

There is no doubt that so-called open systems are the requirement for today's computing applications. But no commercial vendor-supplied solution is more open than one which includes full source code to the entire operating system, including the kernel plus all of the system daemons, programs, and utilities. You can modify any part of FreeBSD to suit your personal, organizational, or corporate needs.

With its generous licensing policy, you can use FreeBSD as the basis for any number of free or commercial applications.


FreeBSD runs thousands of applications.

Because FreeBSD is based on 4.4BSD, an industry-standard version of UNIX, it is easy to compile and run programs. FreeBSD also includes an extensive packages collection and ports collection that bring precompiled and easy-to-build software right to your desktop or enterprise server. There is also a growing number of commercial applications written for FreeBSD.

Here are some examples of the environments in which FreeBSD is used:


An operating system that will grow with your needs.

Though FreeBSD is free software, it is also user supported software. Any questions you have can be posted to hundreds of FreeBSD developers and users simply by e-mailing to the freebsd-questions@FreeBSD.ORG mailing list.

FreeBSD also has a worldwide group of programmers and writers who fix bugs, add new features and document the system. Support for new devices or special features is an almost constant development process, and the team keeps a special eye out for problems which effect system stability. FreeBSD users are quite proud of not only how fast but how reliable their systems are.

What experts have to say . . .

``FreeBSD handles [our] heavy load quite well and it is nothing short of amazing. Salutations to the FreeBSD team.''

---Mark Hittinger, administrator of WinNet Communications, Inc.

&footer; diff --git a/en/auditors.sgml b/en/auditors.sgml index 32b1faef63..300ae48bfd 100644 --- a/en/auditors.sgml +++ b/en/auditors.sgml @@ -1,730 +1,730 @@ + %includes; ]> - + &header;

General Information

- Last Updated: $Date: 1999-07-30 21:05:51 $ + Last Updated: $FreeBSD$

Overview

In light of our recent (and still ongoing) security concerns, it has become rather obvious that nothing less than a rigorous and comprehensive security review of the FreeBSD source tree will enable us to really have much confidence in the security of our operating system, an OS that many have come increasingly to rely upon and must be made more than reasonably secure if they are to continue to be able to do so.

The sheer amount of legacy code & code from outside sources in FreeBSD also makes it especially easy for security holes to go unnoticed until it's rather too late, and no truly large-scale attempt has been made up to this point to really go through the codebase with a specific focus on security issues, that being a rather big project and most FreeBSD developers being more than busy enough elsewhere. This situation must now change, however, if we are to remain the kind of operating system that people can continue to rely upon as the Internet continues to grow and (I suspect) become an ever-more hostile environment for improperly protected systems. Proper security is something of a cooperative arrangement between the local administrator and the OS vendor, and this "OS vendor" needs to do its part.

The core team's first step in becoming more serious about security was to bring the project's security officer, Guido van Rooij, into the team so that one of the "voices at the table" would have security as his primary mandate and representation in all the important security mailing lists external to the FreeBSD Project. He will also keep the rest of us in core much more aware of security concerns as they arise, hopefully not to be taken quite so by surprise as we have a few times in the past.

Our second step will be this audit, an attempt to methodically go through every line of source in FreeBSD looking for obvious buffer overflows (sprintf()/strcpy() vs snprintf()/strncpy() and so on), less obvious security holes, instances of insufficiently defensive coding, amusing comment strings to forward to freebsd-chat, whatever we run across.

Using the modules database as an outline, we will split the source tree into more manageable pieces, keeping a sign-up sheet in a prominent place so that people can see which modules are covered and which are not. A carefully selected team of individuals is now also being formed, that team being composed of "auditors" and "reviewers" (most members of the team being both). An auditor has principle responsibility, which may be shared with another auditor, for actually going through the code and looking for security holes and/or bugs. Once a reasonable pile of diffs have been accumulated, assuming that any problems were found, they are send to one or more reviewers who are responsible for giving the changes another once-over and, if the auditor does not have commit privileges, to actually commit the changes when & if they're deemed acceptable.

Requirements:

In order to be an auditor, you should either have commit privileges on freefall.freebsd.org or an arrangement with another auditor/reviewer who does. You should also be running or have immediate access to FreeBSD-current sources since all of our changes will be made relative to that branch and then brought back (as necessary) into the 2.1 and 2.2 branches.

What to look for and what the general rules to follow are is sufficiently complex that I have turned it into a FreeBSD Security Guide. Please read this now if you haven't already. Other excellent documents are the Secure Programming Checklist and the Unix Security Checklist, both available from AUSCERT.

Sign-Up sheet:

Here is the sign-up sheet as it sits so far. This is *very* skeletal at this stage, given that we've just now started, and as people indicate which module(s) they're willing to either audit or review, we'll fill it in. If this tabular format also becomes unwieldy as it fills up, we can change it or put it on a web page or something. :) I've left some sample entries open just as place-holders, and they in no way imply that someone has to be willing to pick up pieces that large.

Anything in the modules database represents a potential auditing target - from ones as small as "cat" to ones as large as "lib", the most important being that people bite off pieces no larger than they think they can chew. If you take 15 things onto your plate and deal with only 5, you're not doing anyone any favors since the other auditors will be assuming that the other 10 items are handled!

To sign up for something, please send mail to jmb@FreeBSD.org.

Module Auditor(s) Reviewer(s) Status
bin ac ee* gvr* jh ka mu vk imp* jmb* md* gvr* Open
contrib cg gvr* Open
eBones mrvm* gvr* Open
games ab ee* xaa gvr* Open
init gl gvr* Open
lib ak bjn pst* dg* imp* jkh* gvr* Open
libc ee* mu gvr* Open
libexec crh ee* imp* mr witr gvr* Open
lkm dob* gvr* Open
sbin ee* imp* or* tao jmb* md* gvr* Open
secure dc mrvm* gvr* Open
telnetd ac dn imp* gvr* Open
usr.bin bob ee* jha jm ky* rb rd rjk vk md* gvr* Open
usr.sbin ee* ejc gl imp* jm marc rd md* gvr* Open

Auditor/Reviewer keys

This is the list of people who have volunteered to participate as auditors or reviewers in this process. They may also be reached collectively by sending mail to the auditors@FreeBSD.org alias at times when it is appropriate to send mail to all auditors. If you wish to reach just the auditors & reviewers for a specific category, say usr.sbin for example, then you would send mail to audit-usr.sbin@FreeBSD.org.

Key Auditor/Reviewer Name and Email address
ab Aaron Bornstein aaronb@j51.com
ac Adrian Chadd adrian@psinet.net.au
ak Adam Kubicki apk@itl.waw.pl
am Albert Mietus gam@gamp.hacom.nl
avk Alexander V. Kalganov top@sonic.cris.net
bb Bob Bishop rb@gid.co.uk
bjn Brent J. Nordquist nordquist@platinum.com
bob Bob Willcox bob@luke.pmr.com
btm Brian T. Michely brianm@cmhcsys.com
cg Coranth Gryphon gryphon@healer.com
cl Chris Lambertus cmlambertus@ucdavis.edu
crh Charles Henrich henrich@crh.cl.msu.edu
dc Dan Cross tenser@spitfire.ecsel.psu.edu
dg* David Greenman davidg@FreeBSD.org
din Dinesh Nair dinesh@alphaque.com
dn David Nugent davidn@labs.usn.blaze.net.au
dob* David E. O'Brien obrien@NUXI.com
dz Danny J. Zerkel dzerkel@phofarm.com
ee* Eivind Eklund eivind@FreeBSD.org
eh Elijah Hempstone avatar@gandalf.bss.sol.net
ehu Ernest Hua hua@chromatic.com
ejc Eric J. Chet ejc@gargoyle.bazzle.com
gl Giles Lean giles@nemeton.com.au
gvr* Guido van Rooij guido@FreeBSD.org
gw Graham Wheeler gram@oms.co.za
imp* Warner Losh imp@FreeBSD.org
jb Jim Bresler jfb11@inlink.com
jh Jake Hamby jehamby@lightside.com
jha John H. Aughey jha@cs.purdue.edu
jk Jerry Kendall Jerry@kcis.com
jkh* Jordan K. Hubbard jkh@FreeBSD.org
jm Josef Moellers mollers.pad@sni.de
jmb* Jonathan M. Bresler jmb@FreeBSD.org
joe* Joe Greco jgreco@solaria.sol.net
ka Kalganov Alexander top@bird.cris.net
ki Kenneth Ingham ingham@i-pi.com
ky* Kazutaka YOKOTA yokota@zodiac.mech.utsunomiya-u.ac.jp
marc Marc Slemko marcs@znep.com
md* Matt Dillon dillon@best.net
mr Mike Romaniw msr@cuc.com
mrvm* Mark Murray mark@grondar.za
mu Mudge mudge@l0pht.com
or* Ollivier Robert roberto@keltia.freenix.fr
pb Peter Blake ppb@baloo.tcp.co.uk
peter* Peter Wemm peter@FreeBSD.org
phk* Poul-Henning Kamp phk@FreeBSD.org
pst* Paul Traina pst@FreeBSD.org
rb Reinier Bezuidenhout rbezuide@oskar.nanoteq.co.za
rd Rajiv Dighe rajivd@sprynet.com
rel Roger Espel Llima espel@llaic.univ-bpclermont.fr
rjk Richard J Kuhns rjk@grauel.com
rm Robin Melville robmel@nadt.org.uk
rs Robert Sexton robert@kudra.com
sc Sergei Chechetkin csl@whale.sunbay.crimea.ua
tao Brian Tao taob@risc.org
tdr Thomas David Rivers ponds!rivers@dg-rtp.dg.com
vk Vadim Kolontsov vadim@tversu.ac.ru
witr Robert Withrow witr@rwwa.com
xaa Mark Huizer xaa@stack.nl

* = Has CVS commit privileges.

&footer; diff --git a/en/availability.sgml b/en/availability.sgml index 4ba5b53282..07cb036f0d 100644 --- a/en/availability.sgml +++ b/en/availability.sgml @@ -1,103 +1,103 @@ + %includes; ]> - + &header;

Availability of FreeBSD

FreeBSD is free and is available for downloading over the Internet or on CD-ROM for a small fee.


Hardware requirements.

FreeBSD requires a PC-type personal computer running with an Intel, AMD, Cyrix, or compatible 386, 486, or Pentium CPU. You computer needs an ISA, EISA, VESA, or PCI bus. You will also need 8 megabytes of RAM to install FreeBSD (though only 4 megabytes to run it after installation). For best performance, you should have 16 megabytes or more. 100MB of disk space is required for a minimal installation.

FreeBSD supports most popular Ethernet adaptors, SCSI controllers, IDE hard drives, multiport serial cards, CD-ROM drives, tape drives, sound cards, mice, and other hardware. See both the Frequently Asked Questions list and the &a.latest.not;release notes for complete information on supported hardware.


Where to get it.

You can get FreeBSD free via anonymous FTP from ftp://ftp.freebsd.org/pub/FreeBSD. You might also want to check a geographically close mirror site.

If you have a CD-ROM drive, you can get FreeBSD on CD-ROM for a modest price from Walnut Creek CDROM:

Walnut Creek CDROM
4041 Pike Lane, Suite F
Concord, CA 94520
USA
Phone: +1 925 674-0783
Phone: +1 800 786-9907
Fax: +1 925 674-0821
Email: info@cdrom.com

In addition to FreeBSD, the CD-ROM comes with hundreds of ready-to-run programs. It is backed by an unconditional money back guarantee.


About the FreeBSD Project.

FreeBSD is developed and supported by a worldwide team of programmers. Jordan Hubbard, one of the project's founders, has written a brief history of the FreeBSD project. Information about who's responsible for what is also available. If you are curious, take a look at some pictures of the team members. A more complete listing of contributors is available in the Contributors section of the FreeBSD Handbook. FreeBSD is an open project welcomes the help of individuals who have time and or skills to offer.

This "about" section was created by Sean Kelly.

Inside your PC is a daemon waiting to be unleashed. Free it with FreeBSD.

&footer; diff --git a/en/cgi/Makefile b/en/cgi/Makefile index b1763db56b..6e2baea916 100644 --- a/en/cgi/Makefile +++ b/en/cgi/Makefile @@ -1,20 +1,20 @@ -# $Id: Makefile,v 1.14 1999-01-15 19:31:26 wosch Exp $ +# $FreeBSD$ .if exists(../Makefile.conf) .include "../Makefile.conf" .endif DATA= ftp.mirrors CGI= ftp.cgi gallery.cgi mirror.cgi cgi-lib.pl cgi-style.pl CGI+= search.cgi cvsweb.cgi query-pr.cgi query-pr-summary.cgi CGI+= dosendpr.cgi freebsd.def html.pl reg.cgi missing_handler.cgi CGI+= ports.cgi pds.cgi man.cgi url.cgi getmsg.cgi mid.cgi CGI+= mailindex.cgi .SUFFIXES: .C .cgi .C.cgi: ${CXX} ${CFLAGS} -o ${.TARGET} ${.IMPSRC} .include "../web.mk" diff --git a/en/cgi/cgi-lib.pl b/en/cgi/cgi-lib.pl index 418ea890ed..9eb9fcbe10 100644 --- a/en/cgi/cgi-lib.pl +++ b/en/cgi/cgi-lib.pl @@ -1,123 +1,123 @@ #!/usr/bin/perl -- -*- C -*- # Perl Routines to Manipulate CGI input # S.E.Brenner@bioc.cam.ac.uk -# $Header: /home/ncvs/www/en/cgi/cgi-lib.pl,v 1.2 1996-10-06 20:16:38 jfieber Exp $ +# $FreeBSD$ # # Copyright 1994 Steven E. Brenner # Unpublished work. # Permission granted to use and modify this library so long as the # copyright above is maintained, modifications are documented, and # credit is given for any use of the library. # # Thanks are due to many people for reporting bugs and suggestions # especially Meng Weng Wong, Maki Watanabe, Bo Frese Rasmussen, # Andrew Dalke, Mark-Jason Dominus and Dave Dittrich. # For more information, see: # http://www.bio.cam.ac.uk/web/form.html # http://www.seas.upenn.edu/~mengwong/forms/ # Minimalist http form and script (http://www.bio.cam.ac.uk/web/minimal.cgi): # # require "cgi-lib.pl"; # if (&ReadParse(*input)) { # print &PrintHeader, &PrintVariables(%input); # } else { # print &PrintHeader,'
Data: '; #} # ReadParse # Reads in GET or POST data, converts it to unescaped text, and puts # one key=value in each member of the list "@in" # Also creates key/value pairs in %in, using '\0' to separate multiple # selections # Returns TRUE if there was input, FALSE if there was no input # UNDEF may be used in the future to indicate some failure. # Now that cgi scripts can be put in the normal file space, it is useful # to combine both the form and the script in one place. If no parameters # are given (i.e., ReadParse returns FALSE), then a form could be output. # If a variable-glob parameter (e.g., *cgi_input) is passed to ReadParse, # information is stored there, rather than in $in, @in, and %in. # -# $Id: cgi-lib.pl,v 1.2 1996-10-06 20:16:38 jfieber Exp $ +# $FreeBSD$ # sub ReadParse { local (*in) = @_ if @_; local ($i, $key, $val); # Read in text if (&MethGet) { $in = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); } @in = split(/&/,$in); foreach $i (0 .. $#in) { # Convert plus's to spaces $in[$i] =~ s/\+/ /g; # Split into key and value. ($key, $val) = split(/=/,$in[$i],2); # splits on the first =. # Convert %XX from hex numbers to alphanumeric $key =~ s/%(..)/pack("c",hex($1))/ge; $key =~ tr/[^A-Za-z0-9\-\_\$\+\=\~\.\,]//; # allow only safe chars $val =~ s/%(..)/pack("c",hex($1))/ge; $val =~ tr/[^A-Za-z0-9\-\_\$\+\=\~\.\,]//; # allow only safe chars # Associate key and value $in{$key} .= "\0" if (defined($in{$key})); # \0 is the multiple separator $in{$key} .= $val; } return length($in); } # PrintHeader # Returns the magic line which tells WWW that we're an HTML document sub PrintHeader { return "Content-type: text/html\n\n"; } # MethGet # Return true if this cgi call was using the GET request, false otherwise sub MethGet { return ($ENV{'REQUEST_METHOD'} eq "GET"); } # MyURL # Returns a URL to the script sub MyURL { return 'http://' . $ENV{'SERVER_NAME'} . $ENV{'SCRIPT_NAME'}; } # CgiError # Prints out an error message which containes appropriate headers, # markup, etcetera. # Parameters: # If no parameters, gives a generic error message # Otherwise, the first parameter will be the title and the rest will # be given as different paragraphs of the body sub CgiError { local (@msg) = @_; local ($i,$name); if (!@msg) { $name = &MyURL; @msg = ("Error: script $name encountered fatal error"); }; print &PrintHeader; print "$msg[0]\n"; print "

$msg[0]

\n"; foreach $i (1 .. $#msg) { print "

$msg[$i]

\n"; } print "\n"; } # PrintVariables # Nicely formats variables in an associative array passed as a parameter # And returns the HTML string. sub PrintVariables { local (%in) = @_; local ($old, $out, $output); $old = $*; $* =1; $output .= "
"; foreach $key (sort keys(%in)) { foreach (split("\0", $in{$key})) { ($out = $_) =~ s/\n/
/g; $output .= "
$key
$out
"; } } $output .= "
"; $* = $old; return $output; } 1; diff --git a/en/cgi/cgi-style.pl b/en/cgi/cgi-style.pl index d3a67187e4..470d404577 100644 --- a/en/cgi/cgi-style.pl +++ b/en/cgi/cgi-style.pl @@ -1,77 +1,77 @@ -# $Id: cgi-style.pl,v 1.13 1999-05-30 10:56:57 wosch Exp $ +# $FreeBSD$ # # Perl routines to encapsulate various elements of HTML page style. # For future reference, when is now? ($se,$mn,$hr,$md,$mo,$yr,$wd,$yd,$dst) = localtime(time); $yr += 1900; $mo += 1; $timestamp = "$mo-$md-$yr"; # Colors for the body $t_body = ""; if (!defined($hsty_base)) { $hsty_base = ".."; } if (!defined($hsty_email)) { $hsty_email = "www\@freebsd.org"; } if (!defined($hsty_author)) { $hsty_author = "$hsty_email"; } $i_topbar = "\"Navigation \"Top\" \"Applications\" \"Support\" \"Documentation\" \"Vendors\" \"Search\" \"Index\" \"Top\" \"Top\" "; if ($hsty_home eq "") { $hsty_home = "\"FreeBSD"; } sub html_header { local ($title) = @_; return "Content-type: text/html\n\n" . "\n$title\n" . "\n\n$t_body\n" . "$i_topbar

$title

\n"; } sub short_html_header { local ($title) = @_; return "Content-type: text/html\n\n" . "\n$title\n" . "\n\n$t_body\n" . "$i_topbar"; } sub html_footer { return "
$hsty_author
$hsty_date
\n"; } sub get_the_source { return if $ENV{'PATH_INFO'} ne '/get_the_source'; open(R, $0) || do { print "Oops! open $0: $!\n"; # should not reached exit; }; print "Content-type: text/plain\n\n"; while() { print } close R; exit; } diff --git a/en/cgi/cvsweb.cgi b/en/cgi/cvsweb.cgi index 26a11a316d..19b5254b2c 100755 --- a/en/cgi/cvsweb.cgi +++ b/en/cgi/cvsweb.cgi @@ -1,846 +1,846 @@ #!/usr/bin/perl -s # # cvsweb - a CGI interface to the CVS tree. # # Written by Bill Fenner on his own time. # # Copyright (c) 1996-1998 Bill Fenner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: cvsweb.cgi,v 1.32 1999-07-26 21:41:06 wosch Exp $ +# $FreeBSD$ # #HTTP_USER_AGENT: Mozilla/1.1N (X11; I; SunOS 4.1.3_U1 sun4m) via proxy gateway CERN-HTTPD/3.0 libwww/2.17 #SERVER_NAME: www.freebsd.org #QUERY_STRING: baz #SCRIPT_FILENAME: /usr/local/www/cgi-bin/env.pl #SERVER_PORT: 80 #HTTP_ACCEPT: */*, image/gif, image/x-xbitmap, image/jpeg #SERVER_PROTOCOL: HTTP/1.0 #HTTP_COOKIE: s=beta26429821397802167 #PATH_INFO: /foo/bar #REMOTE_ADDR: 13.1.64.94 #DOCUMENT_ROOT: /usr/local/www/data/ #PATH: /sbin:/bin:/usr/sbin:/usr/bin #PATH_TRANSLATED: /usr/local/www/data//foo/bar #GATEWAY_INTERFACE: CGI/1.1 #REQUEST_METHOD: GET #SCRIPT_NAME: /cgi-bin/env.pl #SERVER_SOFTWARE: Apache/1.0.0 #REMOTE_HOST: beta.xerox.com #SERVER_ADMIN: webmaster@freebsd.org # require 'timelocal.pl'; require 'ctime.pl'; $hsty_base = ""; require 'cgi-style.pl'; #&get_the_source; %CVSROOT = ( 'freebsd', '/home/ncvs', 'learn', '/c/learncvs', ); %CVSROOTdescr = ( 'freebsd', 'FreeBSD', 'learn', 'Learn', ); %mirrors = ( 'Germany', 'http://www.de.freebsd.org/cgi/cvsweb.cgi', 'Spain', 'http://www.es.freebsd.org/cgi/cvsweb.cgi', 'California', 'http://www.freebsd.org/cgi/cvsweb.cgi', 'Japan', 'http://www.jp.freebsd.org/cgi/cvsweb.cgi', ); $cvstreedefault = 'freebsd'; $cvstree = $cvstreedefault; $cvsroot = $CVSROOT{"$cvstree"} || "/home/ncvs"; $intro = " This is a WWW interface to the FreeBSD CVS tree. You can browse the file hierarchy by picking directories (which have slashes after them, e.g. src/). If you pick a file, you will see the revision history for that file. Selecting a revision number will download that revision of the file. There is a link at each revision to display diffs between that revision and the previous one, and a form at the bottom of the page that allows you to display diffs between arbitrary revisions.

If you would like to use this CGI script on your own web server and CVS tree, see the CVSWeb distribution site or the current FreeBSD version.

Please send any suggestions, comments, etc. to Bill Fenner <fenner\@freebsd.org> "; $shortinstr = " Click on a directory to enter that directory. Click on a file to display its revision history and to get a chance to display diffs between revisions. "; $verbose = $v; ($where = $ENV{'PATH_INFO'}) =~ s|^/||; $where =~ s|/$||; ($scriptname = $ENV{'SCRIPT_NAME'}) =~ s|^/?|/|; $scriptname =~ s|/$||; $scriptwhere = $scriptname . '/' . $where; $scriptwhere =~ s|/$||; if ($query = $ENV{'QUERY_STRING'}) { foreach (split(/&/, $query)) { s/%(..)/sprintf("%c", hex($1))/ge; # unquote %-quoted if (/(\S+)=(.*)/) { $input{$1} = $2; } else { $input{$_}++; } } $query = "?" . $query; } $config = '/usr/local/etc/cvsweb'; do "$config" if -f $config; if ($input{'cvsroot'}) { if ($CVSROOT{$input{'cvsroot'}}) { $cvstree = $input{'cvsroot'}; $cvsroot = $CVSROOT{"$cvstree"}; } } do "$config-$cvstree" if -f "$config-$cvstree"; $fullname = $cvsroot . '/' . $where; if (!-d $cvsroot) { &fatal("500 Internal Error",'$CVSROOT not found!

The server on which the CVS tree lives is probably down. Please try again in a few minutes.'); } { local(@foo, $i); local($scriptname) = $ENV{'SCRIPT_NAME'}; foreach (sort keys %CVSROOT) { if (-d $CVSROOT{$_}) { push(@foo, $_); } } if ($#foo > 1) { $intro .= "

\nThis script supports the following CVS trees:\n"; for($i = 0; $i <= $#foo; $i++) { $intro .= qq{} . ($CVSROOTdescr{$foo[$i]} ? $CVSROOTdescr{$foo[$i]} : $foo[$i]) . qq{} . ($i == $#foo ? ".\n" : ",\n"); } } } { local(@mirrors) = sort keys %mirrors;; if ($#mirrors >= 0) { $intro .= "

\nThis script is mirrored in:\n"; local($m); for($m = 0; $m <= $#mirrors; $m++) { $intro .= qq($mirrors[$m]); $intro .= ',' if $m != $#mirrors; $intro .= "\n"; } } } if (-d $fullname) { opendir(DIR, $fullname) || &fatal("404 Not Found","$where: $!"); @dir = readdir(DIR); closedir(DIR); if ($where eq '') { print &html_header("FreeBSD CVS Repository"); print $intro; } else { print &html_header("/$where"); print $shortinstr; } print "

"; print "Current CVS tree: ", ($CVSROOTdescr{"$cvstree"} ? $CVSROOTdescr{"$cvstree"} : $cvstree), "
\n"; print "Current directory: /$where\n"; print "


\n"; # Using in this manner violates the HTML2.0 spec but # provides the results that I want in most browsers. Another # case of layout spooging up HTML. print "\n"; lookingforattic: for ($i = 0; $i <= $#dir; $i++) { if ($dir[$i] eq "Attic") { last lookingforattic; } } $haveattic = 1 if ($i <= $#dir); if (!$input{"showattic"} && ($i <= $#dir) && opendir(DIR, $fullname . "/Attic")) { splice(@dir, $i, 1, grep((s|^|Attic/|,!m|/\.|), readdir(DIR))); closedir(DIR); } # Sort without the Attic/ pathname. foreach (sort {($c=$a)=~s|.*/||;($d=$b)=~s|.*/||;($c cmp $d)} @dir) { if ($_ eq '.') { next; } # ignore CVS lock and stale NFS files next if /^#cvs\.|^,|^\.nfs/; if (s|^Attic/||) { $attic = " (in the Attic)"; } else { $attic = ""; } if ($_ eq '..') { next if ($where eq ''); ($updir = $scriptwhere) =~ s|[^/]+$||; print " ", &link("Previous Directory",$updir . $query), "
"; # print " ", # &link("Directory-wide diffs", $scriptwhere . '/*'), "
"; } elsif (-d $fullname . "/" . $_) { print " ", &link($_ . "/", $scriptwhere . '/' . $_ . '/' . $query), $attic, "
"; } elsif (s/,v$//) { # TODO: add date/time? How about sorting? print " ", &link($_, $scriptwhere . '/' . ($attic ? "Attic/" : "") . $_ . $query), $attic, "
"; } } print "
\n"; if ($input{"only_on_branch"}) { print "
\n"; print "Currently showing only branch $input{'only_on_branch'}.\n"; $input{"only_on_branch"}=""; foreach $k (keys %input) { print "\n" if $input{$k}; } print "\n"; print "\n"; } $formwhere = $scriptwhere; $formwhere =~ s|Attic/?$|| if ($input{"showattic"}); if ($haveattic) { print "
\n"; $input{"showattic"}=!$input{"showattic"}; foreach $k (keys %input) { print "\n" if $input{$k}; } print "\n"; print "
\n"; } print &html_footer; print "\n"; } elsif (-f $fullname . ',v') { if ($input{'rev'} =~ /^[\d\.]+$/) { &checkout($fullname, $input{'rev'}); exit; } if ($input{'r1'} && $input{'r2'}) { &dodiff($fullname, $input{'r1'}, $input{'tr1'}, $input{'r2'}, $input{'tr2'}, $input{'f'}); exit; } print("going to dolog($fullname)\n") if ($verbose); &dolog($fullname); } elsif ($fullname =~ s/\.diff$// && -f $fullname . ",v" && $input{'r1'} && $input{'r2'}) { # Allow diffs using the ".diff" extension # so that browsers that default to the URL # for a save filename don't save diff's as # e.g. foo.c &dodiff($fullname, $input{'r1'}, $input{'tr1'}, $input{'r2'}, $input{'tr2'}, $input{'f'}); exit; } elsif (($newname = $fullname) =~ s|/([^/]+)$|/Attic/$1| && -f $newname . ",v") { # The file has been removed and is in the Attic. # Send a redirect pointing to the file in the Attic. ($newplace = $scriptwhere) =~ s|/([^/]+)$|/Attic/$1|; &redirect($newplace); exit; } elsif (0 && (@files = &safeglob($fullname . ",v"))) { print "Content-type: text/plain\n\n"; print "You matched the following files:\n"; print join("\n", @files); # Find the tags from each file # Display a form offering diffs between said tags } else { # Assume it's a module name with a potential path following it. $xtra = $& if (($module = $where) =~ s|/.*||); # Is there an indexed version of modules? if (open(MODULES, "$cvsroot/CVSROOT/modules")) { while () { if (/^(\S+)\s+(\S+)/o && $module eq $1 && -d "${cvsroot}/$2" && $module ne $2) { &redirect($scriptname . '/' . $2 . $xtra); } } } &fatal("404 Not Found","$where: no such file or directory"); } sub htmlify { local($string, $pr) = @_; $string =~ s/&/&/g; $string =~ s//>/g; if ($pr) { $string =~ s!\b((pr[:#]?\s*#?)|((bin|conf|docs|gnu|i386|kern|misc|ports)\/))(\d+)\b!$&!ig; } $string; } sub link { local($name, $where) = @_; "$name\n"; } sub revcmp { local($rev1, $rev2) = @_; local(@r1) = split(/\./, $rev1); local(@r2) = split(/\./, $rev2); local($a,$b); while (($a = shift(@r1)) && ($b = shift(@r2))) { if ($a != $b) { return $a <=> $b; } } if (@r1) { return 1; } if (@r2) { return -1; } return 0; } sub fatal { local($errcode, $errmsg) = @_; print "Status: $errcode\n"; print &html_header("Error"); # print "Content-type: text/html\n"; # print "\n"; # print "Error\n"; # print "Error: $errmsg\n"; print "Error: $errmsg\n"; print &html_footer; exit(1); } sub redirect { local($url) = @_; print "Status: 301 Moved\n"; print "Location: $url\n"; print &html_header("Moved"); # print "Content-type: text/html\n"; # print "\n"; # print "Moved\n"; # print "This document is located here.\n"; print "This document is located here.\n"; print &html_footer; exit(1); } sub safeglob { local($filename) = @_; local($dirname); local(@results); ($dirname = $filename) =~ s|/[^/]+$||; $filename =~ s|.*/||; if (opendir(DIR, $dirname)) { $glob = $filename; # transform filename from glob to regex. Deal with: # [, {, ?, * as glob chars # make sure to escape all other regex chars $glob =~ s/([\.\(\)\|\+])/\\$1/g; $glob =~ s/\*/.*/g; $glob =~ s/\?/./g; $glob =~ s/{([^}]+)}/($t = $1) =~ s-,-|-g; "($t)"/eg; foreach (readdir(DIR)) { if (/^${glob}$/) { push(@results, $dirname . "/" .$_); } } } @results; } sub checkout { local($fullname, $rev) = @_; open(RCS, "co -p$rev '$fullname' 2>&1 |") || &fail("500 Internal Error", "Couldn't co: $!"); # /home/ncvs/src/sys/netinet/igmp.c,v --> standard output # or # /home/ncvs/src/sys/netinet/igmp.c,v --> stdout # revision 1.1.1.2 # /* $_ = ; if (/^(\S+),v\s+-->\s+st(andar)?d ?out(put)?\s*$/o && $1 eq $fullname) { # As expected } else { &fatal("500 Internal Error", "Unexpected output from co: $_"); } $_ = ; if ($rev eq ".") { # latest rev requested, don't check } elsif (/^revision\s+$rev\s*$/) { # As expected } else { &fatal("500 Internal Error", "Unexpected output from co: $_"); } $| = 1; print "Content-type: text/plain\n\n"; print ; close(RCS); } sub dodiff { local($fullname, $r1, $tr1, $r2, $tr2, $f) = @_; if ($r1 =~ /([^:]+)(:(.+))?/) { $rev1 = $1; $sym1 = $3; } if ($rev1 eq 'text') { $rev1 = $tr1; } if ($r2 =~ /([^:]+)(:(.+))?/) { $rev2 = $1; $sym2 = $3; } if ($rev2 eq 'text') { $rev2 = $tr2; } if (!($rev1 =~ /^[\d\.]+$/) || !($rev2 =~ /^[\d\.]+$/)) { &fatal("404 Not Found", "Malformed query \"$ENV{'QUERY_STRING'}\""); } # # rev1 and rev2 are now both numeric revisions. # Thus we do a DWIM here and swap them if rev1 is after rev2. # XXX should we warn about the fact that we do this? if (&revcmp($rev1,$rev2) > 0) { ($tmp1, $tmp2) = ($rev1, $sym1); ($rev1, $sym1) = ($rev2, $sym2); ($rev2, $sym2) = ($tmp1, $tmp2); } # # XXX Putting '-p' here is a personal preference if ($f eq 'c') { $difftype = '-p -c'; $diffname = "Context diff"; } elsif ($f eq 's') { $difftype = '--side-by-side --width=164'; $diffname = "Side by Side"; } else { $difftype = '-p -u'; $diffname = "Unidiff"; } # XXX should this just be text/plain # or should it have an HTML header and then a
 	print "Content-type: text/plain\n\n";
 	open(RCSDIFF, "rcsdiff $difftype -r$rev1 -r$rev2 '$fullname' 2>&1 |") ||
 	    &fail("500 Internal Error", "Couldn't rcsdiff: $!");
 #
 #===================================================================
 #RCS file: /home/ncvs/src/sys/netinet/tcp_output.c,v
 #retrieving revision 1.16
 #retrieving revision 1.17
 #diff -c -r1.16 -r1.17
 #*** /home/ncvs/src/sys/netinet/tcp_output.c     1995/11/03 22:08:08     1.16
 #--- /home/ncvs/src/sys/netinet/tcp_output.c     1995/12/05 17:46:35     1.17
 #
 # Ideas:
 # - nuke the stderr output if it's what we expect it to be
 # - Add "no differences found" if the diff command supplied no output.
 #
 #*** src/sys/netinet/tcp_output.c     1995/11/03 22:08:08     1.16
 #--- src/sys/netinet/tcp_output.c     1995/12/05 17:46:35     1.17 RELENG_2_1_0
 # (bogus example, but...)
 #
 	if ($difftype eq '-u') {
 	    $f1 = '---';
 	    $f2 = '\+\+\+';
 	} else {
 	    $f1 = '\*\*\*';
 	    $f2 = '---';
 	}
 	while () {
 	    if (m|^$f1 $cvsroot|o) {
 		s|$cvsroot/||o;
 		if ($sym1) {
 		    chop;
 		    $_ .= " " . $sym1 . "\n";
 		}
 	    } elsif (m|^$f2 $cvsroot|o) {
 		s|$cvsroot/||o;
 		if ($sym2) {
 		    chop;
 		    $_ .= " " . $sym2 . "\n";
 		}
 	    }
 	    print $_;
 	}
 	close(RCSDIFF);
 }
 
 sub dolog {
 	local($fullname) = @_;
 	local($curbranch,$symnames);	#...
 
 	print("Going to rlog '$fullname'\n") if ($verbose);
 	open(RCS, "rlog '$fullname'|") || &fatal("500 Internal Error",
 						"Failed to spawn rlog");
 	while () {
 	    print if ($verbose);
 	    if (/^branch:\s+([\d\.]+)/) {
 		$curbranch = $1;
 	    }
 	    if ($symnames) {
 		if (/^\s+([^:]+):\s+([\d\.]+)/) {
 		    $symrev{$1} = $2;
 		    if ($revsym{$2}) {
 			$revsym{$2} .= ", ";
 		    }
 		    $revsym{$2} .= $1;
 		} else {
 		    $symnames = 0;
 		}
 	    } elsif (/^symbolic names/) {
 		$symnames = 1;
 	    } elsif (/^-----/) {
 		last;
 	    }
 	}
 
 	if ($onlyonbranch = $input{'only_on_branch'}) {
 	    ($onlyonbranch = $symrev{$onlyonbranch}) =~ s/\.0\././;
 	    ($onlybranchpoint = $onlyonbranch) =~ s/\.\d+$//;
 	}
 
 # each log entry is of the form:
 # ----------------------------
 # revision 3.7.1.1
 # date: 1995/11/29 22:15:52;  author: fenner;  state: Exp;  lines: +5 -3
 # log info
 # ----------------------------
 	logentry:
 	while (!/^=========/) {
 	    $_ = ;
 	    last logentry if (!defined($_));	# EOF
 	    print "R:", $_ if ($verbose);
 	    if (/^revision ([\d\.]+)/) {
 		$rev = $1;
 	    } elsif (/^========/ || /^----------------------------$/) {
 		next logentry;
 	    } else {
 		# The rlog output is syntactically ambiguous.  We must
 		# have guessed wrong about where the end of the last log
 		# message was.
 		# Since this is likely to happen when people put rlog output
 		# in their commit messages, don't even bother keeping
 		# these lines since we don't know what revision they go with
 		# any more.
 		next logentry;
 #		&fatal("500 Internal Error","Error parsing RCS output: $_");
 	    }
 	    $_ = ;
 	    print "D:", $_ if ($verbose);
 	    if (m|^date:\s+(\d+)/(\d+)/(\d+)\s+(\d+):(\d+):(\d+);\s+author:\s+(\S+);\s+state:\s+(\S+);|) {
 		$yr = $1;
 		# damn 2-digit year routines
 		if ($yr > 100) {
 		    $yr -= 1900;
 		}
 		$date{$rev} = &timelocal($6,$5,$4,$3,$2 - 1,$yr);
 		$author{$rev} = $7;
 		$state{$rev} = $8;
 	    } else {
 		&fatal("500 Internal Error", "Error parsing RCS output: $_");
 	    }
 	    line:
 	    while () {
 		print "L:", $_ if ($verbose);
 		next line if (/^branches:\s/);
 		last line if (/^----------------------------$/ || /^=========/);
 		$log{$rev} .= $_;
 	    }
 	    print "E:", $_ if ($verbose);
 	}
 	close(RCS);
 	print "Done reading RCS file\n" if ($verbose);
 #
 # Sort the revisions into commit-date order.
 	@revorder = sort {$date{$b} <=> $date{$a}} keys %date;
 	print "Done sorting revisions\n" if ($verbose);
 #
 # HEAD is an artificial tag which is simply the highest tag number on the main
 # branch, unless there is a branch tag in the RCS file in which case it's the
 # highest revision on that branch.  Find it by looking through @revorder; it
 # is the first commit listed on the appropriate branch.
 	$headrev = $curbranch || "1";
 	revision:
 	for ($i = 0; $i <= $#revorder; $i++) {
 	    if ($revorder[$i] =~ /^(\S*)\.\d+$/ && $headrev eq $1) {
 		if ($revsym{$revorder[$i]}) {
 		    $revsym{$revorder[$i]} .= ", ";
 		}
 		$revsym{$revorder[$i]} .= "HEAD";
 		$symrev{"HEAD"} = $revorder[$i];
 		last revision;
 	    }
 	}
 	print "Done finding HEAD\n" if ($verbose);
 #
 # Now that we know all of the revision numbers, we can associate
 # absolute revision numbers with all of the symbolic names, and
 # pass them to the form so that the same association doesn't have
 # to be built then.
 #
 # should make this a case-insensitive sort
 	foreach (sort keys %symrev) {
 	    $rev = $symrev{$_};
 	    if ($rev =~ /^(\d+(\.\d+)+)\.0\.(\d+)$/) {
 		push(@branchnames, $_);
 		#
 		# A revision number of A.B.0.D really translates into
 		# "the highest current revision on branch A.B.D".
 		#
 		# If there is no branch A.B.D, then it translates into
 		# the head A.B .
 		#
 		$head = $1;
 		$branch = $3;
 		$regex = $head . "." . $branch;
 		$regex =~ s/\./\./g;
 		#             <
 		#           \____/
 		$rev = $head;
 
 		revision:
 		foreach $r (@revorder) {
 		    if ($r =~ /^${regex}/) {
 			$rev = $head . "." . $branch;
 			last revision;
 		    }
 		}
 		$revsym{$rev} .= ", " if ($revsym{$rev});
 		$revsym{$rev} .= $_;
 		if ($rev ne $head) {
 		    $branchpoint{$head} .= ", " if ($branchpoint{$head});
 		    $branchpoint{$head} .= $_;
 		}
 	    }
 	    $sel .= "