Compare commits

..
Author SHA1 Message Date
cvs2svn 49bb443250 This commit was manufactured by cvs2svn to create tag
'RELENG_2_2_6_RELEASE'.
1998-03-24 11:00:04 +00:00
1347 changed files with 40079 additions and 102985 deletions

No files matched your search

+12 -30
View File
@@ -1,13 +1,15 @@
#
# $Id: Makefile,v 1.109.2.32 1998/06/29 10:15:32 jkh Exp $
# $Id: Makefile,v 1.109.2.24 1998/03/09 14:18:02 jkh Exp $
#
# Make command line options:
# -DCLOBBER will remove /usr/include
# -DMAKE_KERBEROS4 to build KerberosIV
# -DALLLANG to build documentation for all languages
# (where available -- see share/doc/Makefile)
#
# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
# -DNOCLEAN do not clean at all
# -DNOTOOLS do not rebuild any tools first
# -DNOTOOLS do not rebuild any tools first
# -DNOCRYPT will prevent building of crypt versions
# -DNOLKM do not build loadable kernel modules
# -DNOOBJDIR do not run ``${MAKE} obj''
@@ -16,7 +18,6 @@
# -DNOGAMES do not go into games subdir
# -DNOSHARE do not go into share subdir
# -DNOINFO do not make or install info files
# -DNOLIBC_R do not build libc_r.
# -DNOPERL do not make or install perl
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
@@ -125,8 +126,8 @@ CLEANDIR= cleandir
.endif
.endif
SUP?= cvsup
SUPFLAGS?= -g -L 2 -P -
SUP?= sup
SUPFLAGS?= -v
#
# While building tools for bootstrapping, we dont need to waste time on
@@ -344,7 +345,7 @@ reinstall:
update:
.if defined(SUP_UPDATE)
@echo "--------------------------------------------------------------"
@echo "Running ${SUP}"
@echo "Running sup"
@echo "--------------------------------------------------------------"
@${SUP} ${SUPFLAGS} ${SUPFILE}
.if defined(SUPFILE1)
@@ -525,14 +526,14 @@ lib-tools:
usr.bin/tsort \
gnu/usr.bin/as \
gnu/usr.bin/bison \
gnu/usr.bin/cc \
usr.bin/ar \
usr.bin/compile_et \
usr.bin/lex/lib \
usr.bin/mk_cmds \
usr.bin/nm \
usr.bin/ranlib \
usr.bin/uudecode \
gnu/usr.bin/cc
usr.bin/uudecode
cd ${.CURDIR}/$d && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all && \
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
@@ -552,16 +553,6 @@ libraries:
${MAKE} ${MK_FLAGS} all && \
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
.endif
.if exists(lib/libc)
cd ${.CURDIR}/lib/libc && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all && \
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
.endif
.if exists(lib/libmytinfo)
cd ${.CURDIR}/lib/libmytinfo && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all && \
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
.endif
.if exists(lib/libncurses)
cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all && \
@@ -603,13 +594,6 @@ libraries:
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
.endif
# Exclude perl from the build-tools if NOPERL is defined.
.if defined(NOPERL)
_perl=
.else
_perl= gnu/usr.bin/perl/perl
.endif
#
# build-tools - build and install any other tools needed to complete the
# compile and install.
@@ -635,6 +619,7 @@ build-tools:
bin/mkdir \
bin/mv \
bin/rm \
bin/sh \
bin/test \
gnu/usr.bin/awk \
gnu/usr.bin/bc \
@@ -642,10 +627,9 @@ build-tools:
gnu/usr.bin/groff \
gnu/usr.bin/gzip \
gnu/usr.bin/man/makewhatis \
gnu/usr.bin/patch \
${_perl} \
gnu/usr.bin/sort \
gnu/usr.bin/texinfo \
share/info \
usr.bin/basename \
usr.bin/cap_mkdb \
usr.bin/chflags \
@@ -656,7 +640,6 @@ build-tools:
usr.bin/file2c \
usr.bin/find \
usr.bin/gencat \
usr.bin/id \
usr.bin/lorder \
usr.bin/m4 \
usr.bin/mkdep \
@@ -677,8 +660,7 @@ build-tools:
usr.bin/yacc \
usr.sbin/chown \
usr.sbin/mtree \
usr.sbin/zic \
bin/sh
usr.sbin/zic
cd ${.CURDIR}/$d && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all && \
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
+2 -4
View File
@@ -1,5 +1,5 @@
This is the top level of the FreeBSD source directory. This file
was last revised on: $Id: README,v 1.7.2.2 1998/02/15 10:47:57 jkh Exp $
was last revised on: $Id: README,v 1.7.2.1 1997/08/13 19:49:35 jkh Exp $
For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
@@ -34,7 +34,7 @@ bin System/User commands.
contrib Packages contributed by 3rd parties.
crypto Export controlled stuff (see crypto/README).
eBones Kerberos package - NOT FOR EXPORT!
etc Template files for /etc
@@ -45,8 +45,6 @@ gnu Various commands and libraries under the GNU Public License.
include System include files.
kerberosIV Kerberos package - also export controlled.
lib System libraries.
libexec System daemons.
+18 -16
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)cat.1 8.3 (Berkeley) 5/2/95
.\" $Id: cat.1,v 1.3.2.2 1998/06/30 06:42:19 charnier Exp $
.\" $Id: cat.1,v 1.6 1997/02/22 14:01:26 peter Exp $
.\"
.Dd May 2, 1995
.Dt CAT 1
@@ -48,7 +48,7 @@
.Op Ar
.Sh DESCRIPTION
The
.Nm
.Nm cat
utility reads files sequentially, writing them to the standard output.
The
.Ar file
@@ -56,44 +56,47 @@ operands are processed in command line order.
A single dash represents the standard input.
.Pp
The options are as follows:
.Bl -tag -width indent
.Bl -tag -width Ds
.It Fl b
Number the non-blank output lines, starting at 1.
Implies the
.Fl n
option but doesn't number blank lines.
.It Fl e
Display non-printing characters (see the
Implies the
.Fl v
option), and display a dollar sign
option, and displays a dollar sign
.Pq Ql \&$
at the end of each line.
at the end of each line
as well.
.It Fl n
Number the output lines, starting at 1.
.It Fl s
Squeeze multiple adjacent empty lines, causing the output to be
single spaced.
.It Fl t
Display non-printing characters (see the
Implies the
.Fl v
option), and display tab characters as
.Ql ^I .
option, and displays tab characters as
.Ql ^I
as well.
.It Fl u
The
.Fl u
option guarantees that the output is unbuffered.
.It Fl v
Display non-printing characters so they are visible.
Displays non-printing characters so they are visible.
Control characters print as
.Ql ^X
for control-X; the delete
character (octal 0177) prints as
.Ql ^?
.Pf Non- Tn ASCII
characters (with the high bit set) are printed as
Non-ascii characters (with the high bit set) are printed as
.Ql M-
(for meta) followed by the character for the low 7 bits.
.El
.Pp
The
.Nm
.Nm cat
utility exits 0 on success, and >0 if an error occurs.
.Sh BUGS
Because of the shell language mechanism used to perform output
@@ -116,8 +119,7 @@ will cause the original data in file1 to be destroyed!
A
.Nm
command appeared in Version 1 AT&T UNIX.
.An Dennis Ritchie
designed and wrote the first man page.
Dennis Ritchie designed and wrote the first man page.
It appears to have been
.Xr cat 1 .
+53 -55
View File
@@ -30,8 +30,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd April 2, 1996
.Dt CHIO 1
.Os
@@ -63,53 +61,49 @@ rather than the default device
.El
.Pp
The default changer may be overridden by setting the environment variable
.Ev CHANGER
.Nm CHANGER
to the desired changer device.
.Pp
A medium changer apparatus is made up of
.Em elements .
.Pa elements .
There are four element types:
.Em picker
.Pa picker
(medium transport),
.Em slot
.Pa slot
(storage),
.Em portal
.Pa portal
(import/export), and
.Em drive
.Pa drive
(data transfer). In this command description, the shorthand
.Em ET
.Nm ET
will be used to represent an element type, and
.Em EU
.Nm EU
will be used to represent an element unit. For example, to represent
the first robotic arm in the changer, the
.Em ET
would be
the first robotic arm in the changer, the ET would be
.Dq picker
and the
.Em EU
would be
and the EU would be
.Dq 0 .
.Pp
.Sh SUPPORTED COMMANDS
.Bl -tag -width indent
.It Xo Nm chio move
.Nm chio move
.Ar <from ET> <from EU> <to ET> <to EU>
.Op Ar inv
.Xc
Move the media unit from
.Pp
Moves the media unit from
.Pa <from ET/EU>
to
.Pa <to ET/EU> .
If the optional modifier
.Pa inv
is specified, the media unit will be inverted before insertion.
.It Xo Nm chio exchange
.Pp
.Nm chio exchange
.Ar <src ET> <src EU> <dst1 ET> <dst1 EU>
.Op Ar <dst2 ET> <dst2 ET>
.Op Ar inv1
.Op Ar inv2
.Xc
Perform a media unit exchange operation. The media unit in
.Pp
Performs a media unit exchange operation. The media unit in
.Pa <src ET/EU>
is moved to
.Pa <dst1 ET/EU>
@@ -136,10 +130,11 @@ Note that not all medium changers support the
.Nm exchange
operation; The changer must have multiple free pickers or emulate
multiple free pickers with transient storage.
.It Xo Nm chio position
.Pp
.Nm chio position
.Ar <to ET> <to EU>
.Op Ar inv
.Xc
.Pp
Position the picker in front of the element described by
.Pa <to ET/EU> .
If the optional modifier
@@ -147,59 +142,62 @@ If the optional modifier
is specified, the media unit will be inverted before insertion.
.Pp
Note that not all changers behave as expected when issued this command.
.It Nm chio params
.Pp
.Nm chio params
.Pp
Report the number of slots, drives, pickers, and portals in the changer,
and which picker unit the changer is currently configured to use.
.It Nm chio getpicker
.Pp
.Nm chio getpicker
.Pp
Report which picker unit the changer is currently configured to use.
.It Xo Nm chio setpicker
.Pp
.Nm chio setpicker
.Ar <unit>
.Xc
.Pp
Configure the changer to use picker
.Pa <unit> .
.It Xo Nm chio status
.Pp
.Nm chio status
.Op Ar <type>
.Xc
.Pp
Report the status of all elements in the changer. If
.Pa <type>
is specified, report the status of all elements of type
.Pa <type> .
.El
.Pp
The status bits are defined as follows:
.Bl -tag -width indent
.It FULL
.It Nm FULL
Element contains a media unit.
.It IMPEXP
.It Nm IMPEXP
Media was deposited into element by an outside human operator.
.It EXCEPT
.It Nm EXCEPT
Element is in an abnormal state.
.It ACCESS
.It Nm ACCESS
Media in this element is accessible by a picker.
.It EXENAB
Element supports passing media (exporting) to an outside human operator.
.It INENAB
.It Nm EXENAB
Element supports passing media (exporting) to an outsite human operator.
.It Nm INENAB
Element supports receiving media (importing) from an outside human operator.
.El
.Pp
.Sh EXAMPLES
.Bl -tag -width indent
.It Nm chio move slot 3 drive 0
Move the media in slot 3 (fourth slot) to drive 0 (first drive).
.It Nm chio setpicker 2
Configure the changer to use picker 2 (third picker) for operations.
.El
.Nm chio move slot 3 drive 0
.Pp
Moves the media in slot 3 (fourth slot) to drive 0 (first drive).
.Pp
.Nm chio setpicker 2
Configures the changer to use picker 2 (third picker) for operations.
.Pp
.Sh FILES
.Bl -tag -width /dev/ch0 -compact
.It Pa /dev/ch0
default changer device
.El
/dev/ch0 - default changer device
.Sh SEE ALSO
.Xr mt 1 ,
.Xr ch 4 ,
.Xr mount 8
.Sh AUTHORS
.Xr mount 8 .
.Sh AUTHOR
The
.Nm
program and SCSI changer driver were written by
.An Jason R. Thorpe Aq [email protected]
for And Communications, http://www.and.com/
.Nm chio
program and SCSI changer driver were written by Jason R. Thorpe
<[email protected]> for And Communications, http://www.and.com/
+24 -50
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)chmod.1 8.4 (Berkeley) 3/31/94
.\" $Id: chmod.1,v 1.4.2.3 1998/05/22 10:41:45 jkoshy Exp $
.\" $Id: chmod.1,v 1.4.2.1 1997/02/28 07:54:25 mpp Exp $
.\"
.Dd March 31, 1994
.Dt CHMOD 1
@@ -51,7 +51,7 @@
.Ar file ...
.Sh DESCRIPTION
The
.Nm
.Nm chmod
utility modifies the file mode bits of the listed files
as specified by the
.Ar mode
@@ -82,7 +82,7 @@ Symbolic links do not have modes, so unless the
or
.Fl L
option is set,
.Nm
.Nm chmod
on a symbolic link always succeeds and has no effect.
The
.Fl H ,
@@ -99,63 +99,39 @@ Only the owner of a file or the super-user is permitted to change
the mode of a file.
.Pp
The
.Nm
.Nm chmod
utility exits 0 on success, and >0 if an error occurs.
.Sh MODES
Modes may be absolute or symbolic.
An absolute mode is an octal number constructed from the sum of
one or more of the following values:
An absolute mode is an octal number constructed by
.Ar or-ing
the following values:
.Pp
.Bl -tag -width 6n -compact -offset indent
.It Li 4000
(the set-user-ID-on-execution bit) Executable files with this bit set
will run with effective uid set to the uid of the file owner.
Directories with the set-user-id bit set will force all files and
sub-directories created in them to be owned by the directory owner
and not by the uid of the creating process, if the underlying file
system supports this feature: see
set-user-ID-on-execution
( see
.Xr chmod 2
and the
.Ar suiddir
option to
.Xr mount 1 .
for directories )
.It Li 2000
(the set-group-ID-on-execution bit) Executable files with this bit set
will run with effective gid set to the gid of the file owner.
set-group-ID-on-execution
.It Li 1000
(the sticky bit)
When set on a directory, unprivileged users can delete and rename
only those files in the directory that are owned by them, regardless of
the permissions on the directory. Under FreeBSD, the sticky bit is
ignored for executable files and may only be set for directories (see
.Xr sticky 8 ).
sticky bit, see
.Xr chmod 2
.It Li 0400
Allow read by owner.
read by owner
.It Li 0200
Allow write by owner.
write by owner
.It Li 0100
For files, allow execution by owner. For directories, allow the owner to
search in the directory.
.It Li 0040
Allow read by group members.
.It Li 0020
Allow write by group members.
.It Li 0010
For files, allow execution by group members. For directories, allow
group members to search in the directory.
.It Li 0004
Allow read by others.
.It Li 0002
Allow write by others.
.It Li 0001
For files, allow execution by others. For directories allow others to
search in the directory.
execute (or search for directories) by owner
.It Li 0070
read, write, execute/search by group
.It Li 0007
read, write, execute/search by others
.El
.Pp
For example, the absolute mode that permits read, write and execute by
the owner, read and execute by group members, read and execute by
others, and no set-uid or set-gid behaviour is 755
(400+200+100+040+010+004+001).
The read, write, and execute/search values for group and others
are encoded as described for owner.
.Pp
The symbolic mode is described by the following grammar:
.Bd -literal -offset indent
@@ -304,18 +280,16 @@ option for the naughty bits.
.Sh SEE ALSO
.Xr chflags 1 ,
.Xr install 1 ,
.Xr mount 1 ,
.Xr chmod 2 ,
.Xr stat 2 ,
.Xr umask 2 ,
.Xr fts 3 ,
.Xr setmode 3 ,
.Xr symlink 7 ,
.Xr chown 8 ,
.Xr sticky 8
.Xr chown 8
.Sh STANDARDS
The
.Nm
.Nm chmod
utility is expected to be
.St -p1003.2
compatible with the exception of the
+11 -11
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
.\" $Id: cp.1,v 1.6.2.1 1997/02/28 07:54:27 mpp Exp $
.\" $Id: cp.1,v 1.9 1997/02/22 14:01:32 peter Exp $
.\"
.Dd April 18, 1994
.Dt CP 1
@@ -60,7 +60,7 @@
.Ar source_file ... target_directory
.Sh DESCRIPTION
In the first synopsis form, the
.Nm
.Nm cp
utility copies the contents of the
.Ar source_file
to the
@@ -72,7 +72,7 @@ is copied to the destination
.Ar target_directory .
The names of the files themselves are not changed.
If
.Nm
.Nm cp
detects an attempt to copy a file to itself, the copy will fail.
.Pp
The following options are available:
@@ -94,11 +94,11 @@ option is specified, no symbolic links are followed.
If
.Ar source_file
designates a directory,
.Nm
.Nm cp
copies the directory and the entire subtree connected at that point.
This option also causes symbolic links to be copied, rather than
indirected through, and for
.Nm
.Nm cp
to create special files rather than copying them as normal files.
Created directories have the same mode as the corresponding source
directory, unmodified by the process' umask.
@@ -112,8 +112,8 @@ option overrides any previous
.Fl i
options.)
.It Fl i
Cause
.Nm
Causes
.Nm cp
to write a prompt to the standard error output before copying a file
that would overwrite an existing file.
If the response from the standard input begins with the character
@@ -127,8 +127,8 @@ option overrides any previous
.Fl f
options.)
.It Fl p
Cause
.Nm
Causes
.Nm cp
to preserve in the copy as many of the modification time, access time,
file flags, file mode, user ID, and group ID as allowed by permissions.
.Pp
@@ -200,7 +200,7 @@ command's actions are determined by the last one specified.
exits 0 on success, >0 if an error occurred.
.Sh COMPATIBILITY
Historic versions of the
.Nm
.Nm cp
utility had a
.Fl r
option.
@@ -215,7 +215,7 @@ or fifo's.
.Xr symlink 7
.Sh STANDARDS
The
.Nm
.Nm cp
command is expected to be
.St -p1003.2
compatible.
+1 -2
View File
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: cp.c,v 1.10.2.1 1997/08/24 10:34:45 jkh Exp $
* $Id: cp.c,v 1.10 1996/03/08 06:58:06 wosch Exp $
*/
#ifndef lint
@@ -261,7 +261,6 @@ copy(argv, type, fts_options)
for (rval = 0; (curr = fts_read(ftsp)) != NULL;) {
switch (curr->fts_info) {
case FTS_NS:
case FTS_DNR:
case FTS_ERR:
warnx("%s: %s",
curr->fts_path, strerror(curr->fts_errno));
+16 -30
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: utils.c,v 1.9.2.2 1998/02/15 10:53:17 jkh Exp $
* $Id: utils.c,v 1.9.2.1 1997/08/24 10:34:49 jkh Exp $
*/
#ifndef lint
@@ -207,7 +207,7 @@ copy_link(p, exists)
int len;
char link[MAXPATHLEN];
if ((len = readlink(p->fts_path, link, sizeof(link) - 1)) == -1) {
if ((len = readlink(p->fts_path, link, sizeof(link))) == -1) {
warn("readlink: %s", p->fts_path);
return (1);
}
@@ -262,9 +262,7 @@ setfile(fs, fd)
int fd;
{
static struct timeval tv[2];
struct stat ts;
int rval;
int gotstat;
rval = 0;
fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX |
@@ -276,42 +274,30 @@ setfile(fs, fd)
warn("utimes: %s", to.p_path);
rval = 1;
}
if (fd ? fstat(fd, &ts) : stat(to.p_path, &ts))
gotstat = 0;
else {
gotstat = 1;
ts.st_mode &= S_ISUID | S_ISGID | S_ISVTX |
S_IRWXU | S_IRWXG | S_IRWXO;
}
/*
* Changing the ownership probably won't succeed, unless we're root
* or POSIX_CHOWN_RESTRICTED is not set. Set uid/gid before setting
* the mode; current BSD behavior is to remove all setuid bits on
* chown. If chown fails, lose setuid/setgid bits.
*/
if (!gotstat || fs->st_uid != ts.st_uid || fs->st_gid != ts.st_gid)
if (fd ? fchown(fd, fs->st_uid, fs->st_gid) :
chown(to.p_path, fs->st_uid, fs->st_gid)) {
if (errno != EPERM) {
warn("chown: %s", to.p_path);
rval = 1;
}
fs->st_mode &= ~(S_ISUID | S_ISGID);
}
if (!gotstat || fs->st_mode != ts.st_mode)
if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) {
if (fd ? fchown(fd, fs->st_uid, fs->st_gid) :
chown(to.p_path, fs->st_uid, fs->st_gid)) {
if (errno != EPERM) {
warn("chown: %s", to.p_path);
rval = 1;
}
fs->st_mode &= ~(S_ISUID | S_ISGID);
}
if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) {
warn("chown: %s", to.p_path);
rval = 1;
}
if (!gotstat || fs->st_flags != ts.st_flags)
if (fd ?
fchflags(fd, fs->st_flags) : chflags(to.p_path, fs->st_flags)) {
warn("chflags: %s", to.p_path);
rval = 1;
}
if (fd ?
fchflags(fd, fs->st_flags) : chflags(to.p_path, fs->st_flags)) {
warn("chflags: %s", to.p_path);
rval = 1;
}
return (rval);
}
+76 -85
View File
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)csh.1 8.2 (Berkeley) 1/21/94
.\" $Id: csh.1,v 1.5.2.2 1998/06/30 06:42:24 charnier Exp $
.\" $Id: csh.1,v 1.8 1997/02/22 14:01:40 peter Exp $
.\"
.Dd January 21, 1994
.Dt CSH 1
@@ -46,15 +46,15 @@
.Op Fl l
.Sh DESCRIPTION
The
.Nm
.Nm csh
is a command language interpreter
incorporating a history mechanism (see
.Sx History Substitutions ) ,
.Nm History Substitutions ) ,
job control facilities (see
.Sx Jobs ) ,
.Nm Jobs ) ,
interactive file name
and user name completion (see
.Sx File Name Completion ) ,
.Nm File Name Completion ) ,
and a C-like syntax. It is used both as an interactive
login shell and a shell script command processor.
.Ss Argument list processing
@@ -100,7 +100,7 @@ is the only flag specified).
The shell loads
.Pa .cshrc
even if it does not belong to the effective user.
.Xr Su 1
.Xr su 1
can pass
.Fl m
to the shell.
@@ -116,16 +116,16 @@ A
may be used to escape the newline at the end of this
line and continue onto another line.
.It Fl v
Cause the
Causes the
.Ar verbose
variable to be set, with the effect
that command input is echoed after history substitution.
.It Fl x
Cause the
Causes the
.Ar echo
variable to be set, so that commands are echoed immediately before execution.
.It Fl V
Cause the
Causes the
.Ar verbose
variable to be set even before
.Pa .cshrc
@@ -157,7 +157,7 @@ Remaining arguments initialize the variable
.Ar argv .
.Pp
An instance of
.Nm
.Nm csh
begins by executing commands from the file
.Pa /etc/csh.cshrc
and,
@@ -256,7 +256,7 @@ showing that the job which was started asynchronously was job number
1 and had one (top-level) process, whose process id was 1234.
.Pp
If you are running a job and wish to do something else you may hit the key
.Em ^Z
.Nm ^Z
(control-Z) which sends a STOP signal to the current job.
The shell will then normally show that the job has been `Stopped',
and print another prompt. You can then manipulate the state of this job,
@@ -271,11 +271,11 @@ the
command
.Ar fg .
A
.Em ^Z
.Nm ^Z
takes effect immediately and
is like an interrupt in that pending output and unread input are discarded
when it is typed. There is another special key
.Em ^Y
.Nm ^Y
that does not generate a STOP signal until a program attempts to
.Xr read 2
it.
@@ -353,7 +353,7 @@ the shell variable
.Ar filec
(see
.Ic set ) ,
.Nm
.Nm csh
will
interactively complete file names and user names from unique
prefixes, when they are input from the terminal followed by
@@ -370,7 +370,7 @@ and the input is
.Pp
.Dl % vi ch<escape>
.Pp
.Nm
.Nm csh
will complete the prefix ``ch''
to the only matching file name ``chaosnet'', changing the input
line to
@@ -381,7 +381,7 @@ However, given
.Pp
.Dl % vi D<escape>
.Pp
.Nm
.Nm csh
will only expand the input to
.Pp
.Dl % vi DSC.
@@ -391,7 +391,7 @@ incomplete, since there are two file names matching the prefix ``D''.
.Pp
If a partial file name is followed by the end-of-file character
(usually control-D), then, instead of completing the name,
.Nm
.Nm csh
will list all file names matching the prefix. For example,
the input
.Pp
@@ -455,7 +455,7 @@ in the previous command with little typing and a high degree of confidence.
History substitutions begin with the character `!' and may begin
.Ar anywhere
in the input stream (with the proviso that they
.Em "do not"
.Nm "do not"
nest.)
This `!' may be preceded by a `\e' to prevent its special meaning; for
convenience, an `!' is passed unchanged when it is followed by a blank,
@@ -631,7 +631,7 @@ Strings enclosed in `"' may be expanded as described below.
.Pp
In both cases the resulting text becomes (all or part of) a single word;
only in one special case (see
.Sx Command Substitution
.Em Command Substitution
below) does a `"' quoted string yield parts of more than one word;
`\'' quoted strings never do.
.Ss Alias substitution
@@ -708,7 +708,7 @@ occurs, and within `\''s where it
.Em never
occurs.
Strings quoted by `\*(ga' are interpreted later (see
.Sx "Command substitution"
.Nm "Command substitution"
below) so `$' substitution does not occur there until later, if at all.
A `$' is passed unchanged if followed by a blank, tab, or end-of-line.
.Pp
@@ -764,11 +764,11 @@ It is not an error for a range to be empty if the second argument is omitted
or in range.
.It $#name
.It ${#name}
Give the number of words in the variable.
Gives the number of words in the variable.
This is useful for later use in a
`$argv[selector]'.
.It $0
Substitute the name of the file from which command input is being read.
Substitutes the name of the file from which command input is being read.
An error occurs if the name is not known.
.It $number
.It ${number}
@@ -788,16 +788,16 @@ The following substitutions may not be modified with `:' modifiers.
.Bl -tag -width Ds -compact -offset indent
.It $?name
.It ${?name}
Substitute the string `1' if name is set, `0' if it is not.
Substitutes the string `1' if name is set, `0' if it is not.
.It $?0
Substitute `1' if the current input filename is known, `0' if it is not.
Substitutes `1' if the current input filename is known, `0' if it is not.
.It \&$\&$\&
Substitute the (decimal) process number of the (parent) shell.
.It $!
Substitute the (decimal) process number of the last background process
started by this shell.
.It $<
Substitute a line from the standard
Substitutes a line from the standard
input, with no further interpretation.
It can be used to read from the keyboard in a shell script.
.El
@@ -922,7 +922,7 @@ is expanded in the same way as `<' input filenames are.
.It >>& name
.It >>! name
.It >>&! name
Use file
Uses file
.Ar name
as the standard output;
like `>' but places output at the end of the file.
@@ -961,11 +961,11 @@ Several of the builtin commands (to be described later)
take expressions, in which the operators are similar to those of C, with
the same precedence.
These expressions appear in the
.Em @ ,
.Em exit ,
.Em if ,
.Nm @,
.Ar exit ,
.Ar if ,
and
.Em while
.Ar while
commands.
The following operators are available:
.Bd -ragged -offset indent
@@ -1076,7 +1076,7 @@ or
.Ar unalias .
.Pp
.It Ic alloc
Show the amount of dynamic memory acquired, broken down into used and
Shows the amount of dynamic memory acquired, broken down into used and
free memory.
With an argument shows the number of free and used blocks in each size
category. The categories start at size 8 and double at each step.
@@ -1085,11 +1085,11 @@ systems other than the VAX may use a different memory allocator.
.Pp
.It Ic bg
.It Ic bg \&% Ns Ar job ...
Put the current or specified jobs into the background, continuing them
Puts the current or specified jobs into the background, continuing them
if they were stopped.
.Pp
.It Ic break
Cause execution to resume after the
Causes execution to resume after the
.Ic end
of the nearest enclosing
.Ic foreach
@@ -1099,7 +1099,7 @@ The remaining commands on the current line are executed.
Multi-level breaks are thus possible by writing them all on one line.
.Pp
.It Ic breaksw
Cause a break from a
Causes a break from a
.Ic switch ,
resuming after the
.Ic endsw .
@@ -1137,7 +1137,7 @@ or
The rest of the commands on the current line are executed.
.Pp
.It Ic default :
Label the default case in a
Labels the default case in a
.Ic switch
statement.
The default should come after all
@@ -1145,7 +1145,7 @@ The default should come after all
labels.
.Pp
.It Ic dirs
Print the directory stack; the top of the stack is at the left,
Prints the directory stack; the top of the stack is at the left,
the first directory in the stack being the current directory.
.Pp
.It Ic echo Ar wordlist
@@ -1192,7 +1192,7 @@ variable (first form) or with the value of the specified
.Pp
.It Ic fg
.It Ic fg % Ns Ar job ...
Bring the current or specified jobs into the foreground, continuing them if
Brings the current or specified jobs into the foreground, continuing them if
they were stopped.
.Pp
.It Ic foreach Ar name (wordlist)
@@ -1252,7 +1252,7 @@ that does not begin with a `/'.
.It Ic history Ar n
.It Ic history Fl r Ar n
.It Ic history Fl h Ar n
Display the history event list; if
Displays the history event list; if
.Ar n
is given only the
.Ar n
@@ -1324,7 +1324,7 @@ must appear alone on its input line or after an
.Pp
.It Ic jobs
.It Ic jobs Fl l
List the active jobs; the
Lists the active jobs; the
.Fl l
option lists process id's in addition to the normal information.
.Pp
@@ -1332,10 +1332,10 @@ option lists process id's in addition to the normal information.
.It Ic kill Ar pid
.It Ic kill Fl sig Ar pid ...
.It Ic kill Fl l
Send either the TERM (terminate) signal or the
Sends either the TERM (terminate) signal or the
specified signal to the specified jobs or processes.
Signals are either given by number or by names (as given in
.Pa /usr/include/signal.h ,
.Pa /usr/include/signal.h,
stripped of the prefix ``SIG'').
The signal names are listed by ``kill \-l''.
There is no default, just saying `kill' does not
@@ -1349,7 +1349,7 @@ then the job or process will be sent a CONT (continue) signal as well.
.It Ic limit Fl h
.It Ic limit Fl h Ar resource
.It Ic limit Fl h Ar resource maximum-use
Limit the consumption by the current process and each process
Limits the consumption by the current process and each process
it creates to not individually exceed
.Ar maximum-use
on the
@@ -1405,7 +1405,7 @@ of the names suffice.
.Pp
.It Ic login
Terminate a login shell, replacing it with an instance of
.Pa /usr/bin/login .
.Pa /usr/bin/login.
This is one way to log off, included for compatibility with
.Xr sh 1 .
.Pp
@@ -1448,7 +1448,7 @@ All processes detached with `&' are effectively
.Pp
.It Ic notify
.It Ic notify % Ns Ar job ...
Cause the shell to notify the user asynchronously when the status of the
Causes the shell to notify the user asynchronously when the status of the
current or specified jobs change; normally notification is presented
before a prompt. This is automatic if the shell variable
.Ic notify
@@ -1478,7 +1478,7 @@ are disabled (/etc/csh.cshrc, /etc/csh.login).
.Pp
.It Ic popd
.It Ic popd Ar +n
Pop the directory stack, returning to the new top directory.
Pops the directory stack, returning to the new top directory.
With an argument
.Ns \`+ Ar n Ns \'
discards the
@@ -1511,7 +1511,7 @@ stack around to be the top element and changes to it. The members
of the directory stack are numbered from the top starting at 0.
.Pp
.It Ic rehash
Cause the internal hash table of the contents of the directories in
Causes the internal hash table of the contents of the directories in
the
.Ic path
variable to be recomputed. This is needed if new commands are added
@@ -1589,7 +1589,7 @@ The most commonly used environment variables
and
.Ev PATH
are automatically imported to and exported from the
.Nm
.Nm csh
variables
.Ar user ,
.Ar term ,
@@ -1625,21 +1625,19 @@ commands.
Normally input during
.Ic source
commands is not placed on the history list;
the
.Fl h
option causes the commands to be placed on the
the \-h option causes the commands to be placed on the
history list without being executed.
.Pp
.It Ic stop
.It Ic stop % Ns Ar job ...
Stop the current or specified jobs that are executing in the background.
Stops the current or specified jobs that are executing in the background.
.Pp
.It Ic suspend
Cause the shell to stop in its tracks, much as if it had been sent a stop
Causes the shell to stop in its tracks, much as if it had been sent a stop
signal with
.Em ^Z .
.Ic ^Z .
This is most often used to stop shells started by
.Xr su 1 .
.Xr su 1 .
.Pp
.It Ic switch Ar (string)
.It Ic case Ar str1 :
@@ -1701,7 +1699,7 @@ is disabled.
.It Ic unlimit Ar resource
.It Ic unlimit Fl h
.It Ic unlimit Fl h Ar resource
Remove the limitation on
Removes the limitation on
.Ar resource .
If no
.Ar resource
@@ -1720,7 +1718,7 @@ It is not an error for nothing to be
.Ic unset .
.Pp
.It Ic unsetenv Ar pattern
Remove all variables whose name match the specified pattern from the
Removes all variables whose name match the specified pattern from the
environment. See also the
.Ic setenv
command above and
@@ -1732,7 +1730,7 @@ If the shell is interactive, then an interrupt can disrupt the wait.
After the interrupt, the shell prints names and job numbers of all jobs
known to be outstanding.
.It Ic which Ar command
Display the resolved command that will be executed by the shell.
Displays the resolved command that will be executed by the shell.
.Pp
.It Ic while Ar (expr)
.It \&...
@@ -1757,10 +1755,10 @@ Prompting occurs here the first time through the loop as for the
statement if the input is a terminal.
.Pp
.It Ic % Ns Ar job
Bring the specified job into the foreground.
Brings the specified job into the foreground.
.Pp
.It Ic % Ns Ar job Ic &
Continue the specified job in the background.
Continues the specified job in the background.
.Pp
.It Ic @
.It Ic @ Ar name Ns = Ns expr
@@ -1833,7 +1831,7 @@ is likewise handled; it is not
necessary to worry about its setting other than in the file
.Ar \&.cshrc
as inferior
.Nm
.Nm csh
processes will import the definition of
.Ar path
from the environment, and re-export it if you then change it.
@@ -1844,7 +1842,7 @@ positional parameters are substituted, i.e., `$1' is replaced by
`$argv[1]',
etc.
.It Ic cdpath
Give a list of alternate directories searched to find subdirectories
Gives a list of alternate directories searched to find subdirectories
in
.Ar chdir
commands.
@@ -1912,9 +1910,10 @@ files are not accidentally destroyed, and that `>>' redirections
refer to existing files.
.It Ic noglob
If set, filename expansion is inhibited.
This inhibition is most useful in shell scripts that are not dealing with
filenames, or after a list of filenames has been obtained and further
expansions are not desirable.
This inhibition is most useful in shell scripts that
are not dealing with filenames,
or after a list of filenames has been obtained and further expansions
are not desirable.
.It Ic nonomatch
If set, it is not an error for a filename expansion to not match any
existing files; instead the primitive pattern is returned.
@@ -1982,7 +1981,7 @@ If it terminated abnormally, then 0200 is added to the status.
Builtin commands that fail return exit status `1',
all other builtin commands set status to `0'.
.It Ic time
Control automatic timing of commands.
Controls automatic timing of commands.
If set, then any command that takes more than this many cpu seconds
will cause a line giving user, system, and real times and a utilization
percentage which is the ratio of user plus system times to real time
@@ -2081,35 +2080,27 @@ signal; otherwise this signal is passed on to children from the state in the
shell's parent.
Interrupts are not allowed when a login shell is reading the file
.Pa \&.logout .
.Sh AUTHORS
.An William Joy .
.Pp
Job control and directory stack features first implemented by
.An J.E. Kulp
of IIASA, Laxenburg, Austria,
.Sh AUTHOR
William Joy.
Job control and directory stack features first implemented by J.E. Kulp of
IIASA, Laxenburg, Austria,
with different syntax than that used now.
.Pp
File name completion code written by
.An Ken Greer ,
HP Labs.
.Pp
Eight-bit implementation
.An Christos S. Zoulas ,
Cornell University.
File name completion code written by Ken Greer, HP Labs.
Eight-bit implementation Christos S. Zoulas, Cornell University.
.Sh FILES
.Bl -tag -width /etc/passwd -compact
.It Pa ~/.cshrc
read at beginning of execution by each shell.
Read at beginning of execution by each shell.
.It Pa ~/.login
read by login shell, after `.cshrc' at login.
Read by login shell, after `.cshrc' at login.
.It Pa ~/.logout
read by login shell, at logout.
Read by login shell, at logout.
.It Pa /bin/sh
standard shell, for shell scripts not starting with a `#'.
Standard shell, for shell scripts not starting with a `#'.
.It Pa /tmp/sh*
temporary file for `<<'.
Temporary file for `<<'.
.It Pa /etc/passwd
source of home directories for `~name'.
Source of home directories for `~name'.
.El
.Sh LIMITATIONS
Word lengths \-
+6 -6
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: csh.c,v 1.6.2.2 1998/01/31 17:06:13 joerg Exp $
* $Id: csh.c,v 1.6.2.1 1997/08/24 21:41:29 jkh Exp $
*/
#ifndef lint
@@ -525,7 +525,7 @@ notty:
{
int osetintr = setintr;
sig_t oparintr = parintr;
int omask = sigblock(sigmask(SIGINT));
sigset_t omask = sigblock(sigmask(SIGINT));
setintr = 0;
parintr = SIG_IGN; /* Disable onintr */
@@ -696,7 +696,7 @@ srcunit(unit, onlyown, hflg)
bool otell = cantell;
struct Bin saveB;
volatile int omask;
volatile sigset_t omask;
jmp_buf oldexit;
/* The (few) real local variables */
@@ -932,9 +932,9 @@ pintr1(wantnl)
bool wantnl;
{
Char **v;
int omask;
sigset_t omask;
omask = sigblock(0);
omask = sigblock((sigset_t) 0);
if (setintr) {
(void) sigsetmask(omask & ~sigmask(SIGINT));
if (pjobs) {
@@ -1004,7 +1004,7 @@ process(catch)
* Interruptible during interactive reads
*/
if (setintr)
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
/*
* For the sake of reset()
+5 -3
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: dir.c,v 1.4.2.1 1997/08/24 21:41:30 jkh Exp $
* $Id: dir.c,v 1.4 1995/06/18 14:34:48 ache Exp $
*/
#ifndef lint
@@ -702,7 +702,8 @@ dcanon(cp, p)
*/
*--sp = 0; /* form the pathname for readlink */
if (sp != cp && !adrof(STRignore_symlinks) &&
(cc = readlink(short2str(cp), tlink, sizeof(tlink) - 1)) >= 0) {
(cc = readlink(short2str(cp), tlink,
sizeof tlink)) >= 0) {
(void) Strcpy(link, str2short(tlink));
link[cc] = '\0';
@@ -786,7 +787,8 @@ dcanon(cp, p)
if (sp != cp && adrof(STRchase_symlinks) &&
!adrof(STRignore_symlinks) &&
(cc = readlink(short2str(cp), tlink, sizeof(tlink) - 1)) >= 0) {
(cc = readlink(short2str(cp), tlink,
sizeof tlink)) >= 0) {
(void) Strcpy(link, str2short(tlink));
link[cc] = '\0';
+2 -2
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: exec.c,v 1.4.2.1 1997/08/24 21:41:31 jkh Exp $
* $Id: exec.c,v 1.4 1995/06/18 14:20:16 ache Exp $
*/
#ifndef lint
@@ -193,7 +193,7 @@ doexec(v, t)
* We must do this AFTER any possible forking (like `foo` in glob) so that
* this shell can still do subprocesses.
*/
(void) sigsetmask(0);
(void) sigsetmask((sigset_t) 0);
/*
* If no path, no words in path, or a / in the filename then restrict the
* command search.
+5 -5
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: func.c,v 1.5.2.1 1997/08/24 21:41:33 jkh Exp $
* $Id: func.c,v 1.5 1996/08/11 23:10:38 ache Exp $
*/
#ifndef lint
@@ -507,7 +507,7 @@ preread()
{
whyles->w_end.type = I_SEEK;
if (setintr)
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
search(T_BREAK, 0, NULL); /* read the expression in */
if (setintr)
@@ -565,7 +565,7 @@ dorepeat(v, kp)
struct command *kp;
{
int i;
int omask = 0;
sigset_t omask = 0;
i = getn(v[1]);
if (setintr)
@@ -907,7 +907,7 @@ xecho(sep, v)
int nonl = 0;
if (setintr)
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
v++;
if (*v == 0)
return;
@@ -955,7 +955,7 @@ dosetenv(v, t)
Char **ep;
if (setintr)
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
for (ep = STR_environ; *ep; ep++)
(void) fprintf(cshout, "%s\n", vis_str(*ep));
return;
+2 -2
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: hist.c,v 1.2.8.1 1997/08/24 21:41:34 jkh Exp $
* $Id: hist.c,v 1.2 1994/09/24 02:54:06 davidg Exp $
*/
#ifndef lint
@@ -127,7 +127,7 @@ dohist(v, t)
if (getn(value(STRhistory)) == 0)
return;
if (setintr)
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
while (*++v && **v == '-') {
Char *vp = *v;
+10 -10
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: proc.c,v 1.2.8.2 1998/01/31 17:06:15 joerg Exp $
* $Id: proc.c,v 1.2.8.1 1997/08/24 21:41:37 jkh Exp $
*/
#ifndef lint
@@ -205,7 +205,7 @@ pnote()
{
struct process *pp;
int flags;
int omask;
sigset_t omask;
neednote = 0;
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next) {
@@ -228,7 +228,7 @@ void
pwait()
{
struct process *fp, *pp;
int omask;
sigset_t omask;
/*
* Here's where dead procs get flushed.
@@ -259,7 +259,7 @@ pjwait(pp)
{
struct process *fp;
int jobflags, reason;
int omask;
sigset_t omask;
while (pp->p_pid != pp->p_jobid)
pp = pp->p_friends;
@@ -348,7 +348,7 @@ dowait(v, t)
struct command *t;
{
struct process *pp;
int omask;
sigset_t omask;
pjobs++;
omask = sigblock(sigmask(SIGCHLD));
@@ -356,7 +356,7 @@ loop:
for (pp = proclist.p_next; pp; pp = pp->p_next)
if (pp->p_pid && /* pp->p_pid == pp->p_jobid && */
pp->p_flags & PRUNNING) {
(void) sigpause(0);
(void) sigpause((sigset_t) 0);
goto loop;
}
(void) sigsetmask(omask);
@@ -1003,7 +1003,7 @@ pkill(v, signum)
struct process *pp, *np;
int jobflags = 0;
int pid, err1 = 0;
int omask;
sigset_t omask;
Char *cp;
omask = sigmask(SIGCHLD);
@@ -1087,7 +1087,7 @@ pstart(pp, foregnd)
int foregnd;
{
struct process *np;
int omask;
sigset_t omask;
long jobflags = 0;
omask = sigblock(sigmask(SIGCHLD));
@@ -1233,7 +1233,7 @@ pfork(t, wanttty)
int pid;
bool ignint = 0;
int pgrp;
int omask;
sigset_t omask;
/*
* A child will be uninterruptible only under very special conditions.
@@ -1330,7 +1330,7 @@ void
pgetty(wanttty, pgrp)
int wanttty, pgrp;
{
int omask = 0;
sigset_t omask = 0;
/*
* christos: I am blocking the tty signals till I've set things
+4 -4
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sem.c,v 1.3.6.1 1997/08/24 21:41:38 jkh Exp $
* $Id: sem.c,v 1.3 1995/05/30 00:06:37 rgrimes Exp $
*/
#ifndef lint
@@ -70,9 +70,9 @@ execute(t, wanttty, pipein, pipeout)
int pid = 0;
int pv[2];
static int csigmask;
static sigset_t csigmask;
static int ocsigmask;
static sigset_t ocsigmask;
static int onosigchld = 0;
static int nosigchld = 0;
@@ -226,7 +226,7 @@ execute(t, wanttty, pipein, pipeout)
else {
int ochild, osetintr, ohaderr, odidfds;
int oSHIN, oSHOUT, oSHERR, oOLDSTD, otpgrp;
int omask;
sigset_t omask;
/*
* Prepare for the vfork by saving everything that the child
+2 -2
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: set.c,v 1.4.2.1 1997/08/24 21:41:38 jkh Exp $
* $Id: set.c,v 1.4 1995/07/07 23:13:11 ache Exp $
*/
#ifndef lint
@@ -819,7 +819,7 @@ plist(p)
int len;
if (setintr)
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
for (;;) {
while (p->v_left)
+15 -15
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
.\" $Id: date.1,v 1.8.2.8 1998/06/30 06:42:44 charnier Exp $
.\" $Id: date.1,v 1.8.2.6 1997/10/03 12:54:28 danny Exp $
.\"
.Dd November 17, 1993
.Dt DATE 1
@@ -52,7 +52,7 @@
.Op Fl f Ar fmt Ar date | [[[[yy]mm]dd]HH]MM[\&.ss]
.Op Cm + Ns Ar format
.Sh DESCRIPTION
.Nm Date
.Nm
displays the current date and time when invoked without arguments.
Providing arguments will format the date and time in a user-defined
way or set the date.
@@ -84,12 +84,12 @@ is used to synchronize the clocks on groups of machines.
By default, if
.Xr timed
is running,
.Nm
.Nm date
will set the time on all of the machines in the local group.
The
.Fl n
option stops
.Nm
.Nm date
from setting the time for other than the current machine.
.It Fl r
Print out the date and time in
@@ -112,14 +112,14 @@ Adjust the minute, hour, month day, week day, month or year according to
.Ar val .
If
.Ar val
is preceded with a plus or minus sign, the date is adjusted forwards
is preceeded with a plus or minus sign, the date is adjusted forwards
or backwards according to the remaining string, otherwise the relevant
part of the date is set. The date can be adjusted as many times as
required using these flags. Flags are processed in the order given.
.Pp
Minutes are in the range 0-59, hours are in the range 1-12, month days
are in the range 1-31, week days are in the range 0-6 (Sun-Sat), months
are in the range 1-12 (Jan-Dec) and years are in the range 80-38 or
are in the range 1-31, week days are in the range 0-6 (sun-sat), months
are in the range 1-12 (jan-dec) and years are in the range 80-38 or
1980-2038.
.Pp
If
@@ -219,7 +219,7 @@ The command:
date -v1d -v+1m -v-1d -v-fri
.Ed
.Pp
will display the last Friday of the month:
will display the last friday of the month:
.Bd -literal -offset indent
Fri Aug 29 04:31:11 BST 1997
.Ed
@@ -242,7 +242,7 @@ date 1432
sets the time to
.Li "2:32 PM" ,
without modifying the date.
.Sh ENVIRONMENT
.Sh ENVIRONMENT VARIABLES
The execution of
.Nm
is affected by the following environment variables:
@@ -250,7 +250,7 @@ is affected by the following environment variables:
.It Ev TZ
The timezone to use when displaying dates.
The normal format is a pathname relative to
.Pa /usr/share/zoneinfo .
.Dq Pa /usr/share/zoneinfo .
For example, the command
.Dq TZ=America/Los_Angeles date
displays the current time in California.
@@ -261,9 +261,9 @@ for more information.
.Sh FILES
.Bl -tag -width /var/log/messages -compact
.It Pa /var/log/wtmp
a record of date resets and time changes
A record of date resets and time changes.
.It Pa /var/log/messages
a record of the user setting the time
A record of the user setting the time.
.El
.Sh SEE ALSO
.Xr gettimeofday 2 ,
@@ -285,14 +285,14 @@ Occasionally, when
synchronizes the time on many hosts, the setting of a new time value may
require more than a few seconds.
On these occasions,
.Nm
.Nm date
prints:
.Ql Network time being set .
The message
.Ql Communication error with timed
occurs when the communication
between
.Nm
.Nm date
and
.Xr timed
fails.
@@ -313,7 +313,7 @@ will be running on
.Tn GMT .
.Sh STANDARDS
The
.Nm
.Nm date
command is expected to be compatible with
.St -p1003.2 .
.Sh HISTORY
+9 -9
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)dd.1 8.2 (Berkeley) 1/13/94
.\" $Id: dd.1,v 1.2.8.3 1998/02/15 11:04:28 jkh Exp $
.\" $Id: dd.1,v 1.2.8.2 1997/08/24 21:45:30 jkh Exp $
.\"
.Dd January 13, 1994
.Dt DD 1
@@ -52,7 +52,7 @@ Input data is read and written in 512-byte blocks.
If input reads are short, input from multiple reads are aggregated
to form the output block.
When finished,
.Nm
.Nm dd
displays the number of complete and partial input and output blocks
and truncated input records to the standard error output.
.Pp
@@ -237,7 +237,7 @@ will be positioned past the block in which the error occurred using
Do not truncate the output file.
This will preserve any blocks in the output file not explicitly written
by
.Nm Ns .
.Nm dd .
The
.Cm notrunc
value is not supported for tapes.
@@ -287,7 +287,7 @@ in an integer, respectively.
Two or more numbers may be separated by an ``x'' to indicate a product.
.Pp
When finished,
.Nm
.Nm dd
displays the number of complete and partial input and output blocks,
truncated input records and odd-length byte-swapping blocks to the
standard error output.
@@ -310,7 +310,7 @@ This means that the final output block may be shorter than the output
block size.
.Pp
If
.Nm
.Nm dd
receives a
.Dv SIGINFO
(see the ``status'' argument for
@@ -319,17 +319,17 @@ signal, the current input and output block counts will
be written to the standard error output
in the same format as the standard completion message.
If
.Nm
.Nm dd
receives a
.Dv SIGINT
signal, the current input and output block counts will
be written to the standard error output
in the same format as the standard completion message and
.Nm
.Nm dd
will exit.
.Pp
The
.Nm
.Nm dd
utility exits 0 on success and >0 if an error occurred.
.Sh SEE ALSO
.Xr cp 1 ,
@@ -337,7 +337,7 @@ utility exits 0 on success and >0 if an error occurred.
.Xr tr 1
.Sh STANDARDS
The
.Nm
.Nm dd
utility is expected to be a superset of the
.St -p1003.2
standard.
+4 -5
View File
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: misc.c,v 1.2.8.4 1998/02/15 11:04:30 jkh Exp $
* $Id: misc.c,v 1.2.8.3 1998/02/11 02:24:41 asami Exp $
*/
#ifndef lint
@@ -100,10 +100,9 @@ summaryx(notused)
/* ARGSUSED */
void
terminate(sig)
int sig;
terminate(notused)
int notused;
{
/* XXX exit() shouldn't call exit() from a signal handler. */
exit(sig == 0 ? 0 : 1);
exit(0);
}
+25 -32
View File
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)df.1 8.2 (Berkeley) 1/13/94
.\" $Id: df.1,v 1.4.2.3 1998/02/15 11:06:23 jkh Exp $
.\" $Id: df.1,v 1.4.2.2 1997/09/19 06:18:10 charnier Exp $
.\"
.Dd January 13, 1994
.Dt DF 1
@@ -40,7 +40,7 @@
.Nd display free disk space
.Sh SYNOPSIS
.Nm df
.Op Fl ikn
.Op Fl ink
.Op Fl t Ar type
.Op Ar file | Ar filesystem ...
.Sh DESCRIPTION
@@ -72,37 +72,31 @@ This option should be used if it is possible that one or more
filesystems are in a state such that they will not be able to provide
statistics without a long delay.
When this option is specified,
.Nm
.Nm df
will not request new statistics from the filesystems, but will respond
with the possibly stale statistics that were previously obtained.
.It Fl t
Only print out statistics for filesystems of the specified types.
More than one type may be specified in a comma separated list.
The list of filesystem types can be prefixed with
.Dq no
to specify the filesystem types for which action should
.Em not
be taken.
For example, the
.Nm
command:
.Bd -literal -offset indent
df -t nonfs,mfs
.Ed
.Pp
lists all filesystems except those of type
.Tn NFS
and
.Tn MFS .
The
.Xr sysctl 8
command can be used to find out the types of filesystems
that are available on the system:
.Bd -literal -offset indent
sysctl vfs
.Ed
The recognized types are:
ufs, nfs, mfs, lfs, msdos, fdesc, portal, kernfs, procfs, afs, isofs,
iso9660fs, cdfs, and cd9660,
along with the aggregates:
all (the default),
local (ufs, mfs, lfs, msdos, cd9660),
and misc (fdesc, portal, kernfs, procfs).
The names isofs, iso9660fs, cdfs, and cd9660 are aliases to each other
all of them refering to the same type of file system.
The string ``no'' may be prepending to a type to get its complement
(e.g. ``nonfs'' to get non-NFS filesystems). The first
.Fl t
option overrides the default, additional such options will add to
(or subtract from) the current set of types; e.g. either
``df -t ufs -t lfs''
or
``df -t local -t nomfs''
will display statistics for UFS and LFS filesystems.
.El
.Sh ENVIRONMENT
.Sh ENVIRONMENT VARIABLES
.Bl -tag -width BLOCKSIZE
.It Ev BLOCKSIZE
If the environment variable
@@ -117,16 +111,15 @@ and
flags are ignored if a file or filesystem is specified.
.Sh SEE ALSO
.Xr quota 1 ,
.Xr statfs 2 ,
.Xr fstatfs 2 ,
.Xr getfsstat 2 ,
.Xr statfs 2 ,
.Xr getmntinfo 3 ,
.Xr fstab 5 ,
.Xr mount 8 ,
.Xr quot 8 ,
.Xr sysctl 8
.Xr quot 8
.Sh HISTORY
A
.Nm
.Nm df
command appeared in
.At v1 .
+2 -2
View File
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" From: @(#)hostname.1 8.1 (Berkeley) 5/31/93
.\" $Id: domainname.1,v 1.2.6.1 1997/08/24 21:48:26 jkh Exp $
.\" $Id: domainname.1,v 1.2 1995/01/14 17:02:33 ats Exp $
.\"
.Dd September 18, 1994
.Dt DOMAINNAME 1
@@ -42,7 +42,7 @@
.Nm domainname
.Op Ar ypdomain
.Sh DESCRIPTION
.Nm Domainname
.Nm domainname
prints the name of the current YP/NIS domain. The super-user can
set the domain name by supplying an argument; this is usually done in the
network initialization script
+4 -4
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)echo.1 8.1 (Berkeley) 7/22/93
.\" $Id: echo.1,v 1.3 1995/08/31 17:25:54 jkh Exp $
.\" $Id: echo.1,v 1.2 1994/09/24 02:55:17 davidg Exp $
.\"
.Dd July 22, 1993
.Dt ECHO 1
@@ -47,7 +47,7 @@
.Op "string ..."
.Sh DESCRIPTION
The
.Nm
.Nm echo
utility writes any specified operands, separated by single blank (`` '')
characters and followed by a newline (``\en'') character, to the standard
output.
@@ -61,13 +61,13 @@ by iBCS2 compatible systems.
.El
.Pp
The
.Nm
.Nm echo
utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr printf 1
.Sh STANDARDS
The
.Nm
.Nm echo
utility is expected to be
.St -p1003.2
compatible.
+4 -4
View File
@@ -1,11 +1,11 @@
# $Id: Makefile,v 1.13 1995/10/22 20:14:13 ache Exp $
# $Id: Makefile,v 1.12 1995/10/03 15:44:50 markm Exp $
PROG= ed
SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
LINKS= ${BINDIR}/ed ${BINDIR}/red
MLINKS= ed.1 red.1
LINKS= ${BINDIR}/ed ${BINDIR}/red
MLINKS= ed.1 red.1
.if exists(${.CURDIR}/../../secure) && !defined(NOCRYPT) && !defined(NOSECURE)
.if exists(../../secure) && !defined(NOCRYPT) && !defined(NOSECURE)
DISTRIBUTION=des
CFLAGS+=-DDES
LDADD+= -L${CIPHEROBJDIR} -lcipher
+549 -441
View File
File diff suppressed because it is too large. Load diff
+10 -4
View File
@@ -1,7 +1,13 @@
# $Id: Makefile,v 1.10 1996/06/02 17:05:48 phk Exp $
# /b/source/CVS/src/bin/expr/Makefile,v 1.5 1993/06/14 19:56:06 jtc Exp
# $Id: Makefile,v 1.8 1996/05/07 23:14:17 wosch Exp $
PROG= expr
SRCS= expr.y
YFLAGS=
PROG= expr
SRCS= expr.c
CLEANFILES+= expr.c y.tab.h
expr.c:
${YACC} -d ${.IMPSRC}
mv -f y.tab.c expr.c
.include <bsd.prog.mk>
+11 -11
View File
@@ -28,7 +28,7 @@
.\" (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: expr.1,v 1.4 1996/01/29 22:53:24 mpp Exp $
.\" $Id: expr.1,v 1.3 1994/04/24 01:18:46 jkh Exp $
.\"
.Dd July 3, 1993
.Dt EXPR 1
@@ -41,13 +41,13 @@
.Ar expression
.Sh DESCRIPTION
The
.Nm
.Nm expr
utility evaluates
.Ar expression
and writes the result on standard output.
.Pp
All operators are separate arguments to the
.Nm
.Nm expr
utility.
Characters special to the command interpreter must be escaped.
.Pp
@@ -55,26 +55,26 @@ Operators are listed below in order of increasing precedence.
Operators with equal precedence are grouped within { } symbols.
.Bl -tag -width indent
.It Ar expr1 Li | Ar expr2
Return the evaluation of
Returns the evaluation of
.Ar expr1
if it is neither an empty string nor zero;
otherwise, returns the evaluation of
.Ar expr2 .
.It Ar expr1 Li & Ar expr2
Return the evaluation of
Returns the evaluation of
.Ar expr1
if neither expression evaluates to an empty string or zero;
otherwise, returns zero.
.It Ar expr1 Li "{=, >, >=, <, <=, !=}" Ar expr2
Return the results of integer comparison if both arguments are integers;
Returns the results of integer comparison if both arguments are integers;
otherwise, returns the results of string comparison using the locale-specific
collation sequence.
The result of each comparison is 1 if the specified relation is true,
or 0 if the relation is false.
.It Ar expr1 Li "{+, -}" Ar expr2
Return the results of addition or subtraction of integer-valued arguments.
Returns the results of addition or subtraction of integer-valued arguments.
.It Ar expr1 Li "{*, /, %}" Ar expr2
Return the results of multiplication, integer division, or remainder of integer-valued arguments.
Returns the results of multiplication, integer division, or remainder of integer-valued arguments.
.It Ar expr1 Li : Ar expr2
The
.Dq \:
@@ -115,9 +115,9 @@ The following example returns the number of characters in variable a.
.El
.Sh DIAGNOSTICS
The
.Nm
.Nm expr
utility exits with one of the following values:
.Bl -tag -width indent -compact
.Bl -tag -width Ds -compact
.It 0
the expression is neither an empty string nor 0.
.It 1
@@ -127,6 +127,6 @@ the expression is invalid.
.El
.Sh STANDARDS
The
.Nm
.Nm expr
utility conforms to
.St -p1003.2 .
+4 -4
View File
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)hostname.1 8.2 (Berkeley) 4/28/95
.\" $Id: hostname.1,v 1.3.2.3 1998/06/30 06:43:13 charnier Exp $
.\" $Id: hostname.1,v 1.3.2.1 1997/02/28 07:54:36 mpp Exp $
.\"
.Dd April 28, 1995
.Dt HOSTNAME 1
@@ -43,7 +43,7 @@
.Op Fl s
.Op Ar name-of-host
.Sh DESCRIPTION
.Nm Hostname
.Nm
prints the name of the current host. The super-user can
set the hostname by supplying an argument; this is usually done in the
network initialization script
@@ -54,13 +54,13 @@ time.
Options:
.Bl -tag -width flag
.It Fl s
Trim off any domain information from the printed
Trims off any domain information from the printed
name.
.El
.Sh SEE ALSO
.Xr gethostname 3
.Sh HISTORY
The
.Nm
.Nm hostname
command appeared in
.Bx 4.2 .
+6 -6
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)kill.1 8.2 (Berkeley) 4/28/95
.\" $Id: kill.1,v 1.3.2.2 1998/05/22 10:50:26 jkoshy Exp $
.\" $Id$
.\"
.Dd April 28, 1995
.Dt KILL 1
@@ -110,22 +110,22 @@ ALRM (alarm clock)
TERM (software termination signal)
.El
.Pp
.Nm Kill
.Nm
is a built-in to
.Xr csh 1 ;
it allows job specifiers of the form ``%...'' as arguments
so process id's are not as often used as
.Nm
.Nm kill
arguments.
See
.Xr csh 1
.Xr csh 1
for details.
.Sh SEE ALSO
.Xr csh 1 ,
.Xr killall 1 ,
.Xr ps 1 ,
.Xr kill 2 ,
.Xr sigaction 2
.Xr sigvec 2
.Sh STANDARDS
The
.Nm
@@ -134,7 +134,7 @@ function is expected to be
compatible.
.Sh HISTORY
A
.Nm
.Nm kill
command appeared in
.At v6 .
.Sh BUGS
+6 -6
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)ln.1 8.2 (Berkeley) 12/30/93
.\" $Id: ln.1,v 1.3 1996/08/29 18:05:55 wosch Exp $
.\" $Id: ln.1,v 1.2 1994/09/24 02:55:47 davidg Exp $
.\"
.Dd December 30, 1993
.Dt LN 1
@@ -52,7 +52,7 @@
.Op target_dir
.Sh DESCRIPTION
The
.Nm
.Nm ln
utility creates a new directory entry (linked file) which has the
same modes as the original file.
It is useful for maintaining multiple copies of a file in many places
@@ -75,7 +75,7 @@ Create a symbolic link.
.El
.Pp
By default
.Nm
.Nm ln
makes
.Em hard
links.
@@ -99,7 +99,7 @@ call may be used to read the contents of a symbolic link.
Symbolic links may span file systems and may refer to directories.
.Pp
Given one or two arguments,
.Nm
.Nm ln
creates a link to an existing file
.Ar source_file .
If
@@ -113,7 +113,7 @@ to the last component of
.Ar source_file .
.Pp
Given more than two arguments,
.Nm
.Nm ln
makes links in
.Ar target_dir
to all the named source files.
@@ -127,6 +127,6 @@ The links made will have the same name as the files being linked to.
.Xr symlink 7
.Sh HISTORY
A
.Nm
.Nm ln
command appeared in
.At v1 .
+21 -16
View File
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)symlink.7 8.3 (Berkeley) 3/31/94
.\" $Id: symlink.7,v 1.2.8.2 1997/06/19 01:09:09 jdp Exp $
.\" $Id: symlink.7,v 1.2.8.1 1997/06/14 18:47:31 jdp Exp $
.\"
.Dd March 31, 1994
.Dt SYMLINK 7
@@ -200,8 +200,6 @@ option is not specified),
the
.Nm ls
command follows symbolic links named as arguments if the
.Fl H
or
.Fl L
option is specified,
or if the
@@ -209,13 +207,16 @@ or if the
.Fl d
or
.Fl l
options are not specified. (The
.Nm ls
command is the only command where the
.Fl H
and
options are not specified.
(If the
.Fl L
options affect its behavior even though it is not doing a walk of
option is specified,
.Nm ls
always follows symbolic links.
.Nm Ls
is the only command where the
.Fl L
option affects its behavior even though it is not doing a walk of
a file tree.)
.Pp
The
@@ -393,19 +394,23 @@ options.
To maintain compatibility with historic systems,
the
.Nm ls
command acts a little differently. If you do not specify the
.Fl F ,
.Fl d or
.Fl l
options,
.Nm ls
will follow symbolic links specified on the command line. If the
command never follows symbolic links unless the
.Fl L
flag is specified.
If the
.Fl L
flag is specified,
.Nm ls
follows all symbolic links,
regardless of their type,
whether specified on the command line or encountered in the tree walk.
The
.Nm ls
command does not support the
.Fl H
or
.Fl P
options.
.Sh SEE ALSO
.Xr chflags 1 ,
.Xr chgrp 1 ,
+1 -3
View File
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)extern.h 8.1 (Berkeley) 5/31/93
* $Id: extern.h,v 1.2 1994/09/24 02:55:52 davidg Exp $
* $Id$
*/
int acccmp __P((const FTSENT *, const FTSENT *));
@@ -49,5 +49,3 @@ void printcol __P((DISPLAY *));
void printlong __P((DISPLAY *));
void printscol __P((DISPLAY *));
void usage __P((void));
int len_octal __P((char *, int));
int prn_octal __P((char *));
+21 -76
View File
@@ -13,7 +13,7 @@
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgment:
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)ls.1 8.6 (Berkeley) 4/18/94
.\" $Id: ls.1,v 1.5.2.5 1997/12/25 09:35:55 hoek Exp $
.\" $Id: ls.1,v 1.5.2.4 1997/09/19 06:18:11 charnier Exp $
.\"
.Dd April 18, 1994
.Dt LS 1
@@ -43,20 +43,20 @@
.Nd list directory contents
.Sh SYNOPSIS
.Nm ls
.Op Fl ABCFHLPRTWabcdfgikloqrstu1
.Op Fl ACFLRTacdfgikloqrstu1
.Op Ar file ...
.Sh DESCRIPTION
For each operand that names a
.Ar file
of a type other than
directory,
.Nm
.Nm ls
displays its name as well as any requested,
associated information.
For each operand that names a
.Ar file
of type directory,
.Nm
.Nm ls
displays the names of files contained
within that directory, as well as any requested, associated
information.
@@ -76,9 +76,6 @@ List all entries except for
and
.Ql \&.. .
Always set for the super-user.
.It Fl B
Force printing of non-graphic characters in file names as \\xxx,
where xxx is the numeric value of the character in octal.
.It Fl C
Force multi-column output; this is the default when output is to a terminal.
.It Fl F
@@ -87,47 +84,24 @@ that is a directory, an asterisk (*) after each that is
executable,
an at sign (@) after each symbolic link,
an equals sign (=) after each socket,
a percent sign (%) after each whiteout,
and a vertical bar (|) after each that is a
.Tn FIFO .
.It Fl H
Symbolic links on the command line are followed. This option is assumed if
none of the
.Fl F ,
.Fl d ,
or
.Fl l
options are specified.
.Tn FIFO .
.It Fl L
If argument is a symbolic link, list the file or directory the link references
rather than the link itself. This option cancels the
.Fl P
option.
.It Fl P
If argument is a symbolic link, list the link itself rather than the
object the link references. This option cancels the
.Fl H
and
.Fl L
options.
rather than the link itself.
.It Fl R
Recursively list subdirectories encountered.
.It Fl T
Display complete time information for the file, including
month, day, hour, minute, second, and year.
.It Fl W
Display whiteouts when scanning directories.
.It Fl a
Include directory entries whose names begin with a
dot (.).
.It Fl b
As
.Fl B ,
but use C escape codes whenever possible.
.It Fl c
Use time when file status was last changed for sorting or printing.
.It Fl d
Directories are listed as plain files (not searched recursively).
Directories are listed as plain files (not searched recursively) and
symbolic links in the argument list are not indirected through.
.It Fl f
Output is not sorted.
.It Fl g
@@ -140,10 +114,8 @@ format output.
.It Fl i
For each file, print the file's file serial number (inode number).
.It Fl k
If the
.Fl s
option is specified, print the file size allocation in kilobytes,
not blocks. This option overrides the environment variable BLOCKSIZE.
If the 's' option is specified, print the file size allocation in kilobytes,
not blocks.
.It Fl l
(The lowercase letter ``ell.'') List in long format. (See below.)
If the output is to a terminal, a total sum for all the file
@@ -162,8 +134,7 @@ lexicographical order or the oldest entries first.
Display the number of file system blocks actually used by each file, in units
of 512 bytes, where partial units are rounded up to the next integer value.
If the output is to a terminal, a total sum for all the file
sizes is output on a line before the listing. The environment variable
BLOCKSIZE overrides the unit size of 512 bytes.
sizes is output on a line before the listing.
.It Fl t
Sort by time modified (most recently modified
first) before sorting the operands by lexicographical
@@ -191,30 +162,14 @@ options all override each other; the last one specified determines
the format used.
.Pp
The
.Fl c
.Fl c ,
and
.Fl u
options override each other; the last one specified determines
the file time used.
.Pp
The
.Fl B ,
.Fl b
and
.Fl q
options all override each other; the last one specified determines
the format used for non-printable characters.
.Pp
The
.Fl H,
.Fl L
and
.Fl P
options all override each other (either partially or fully); they
are applied in the order specified.
.Pp
By default,
.Nm
.Nm ls
lists one entry per line to standard
output; the exceptions are to terminals or when the
.Fl C
@@ -243,10 +198,6 @@ number of 512-byte blocks used by the files in the directory is displayed
on a line by itself immediately before the information for the files in the
directory.
.Pp
If the modification time of the file is more than 6 months
in the past or future, then the year of the last modification
is displayed in place of the hour and minute fields.
.Pp
If the owner or group names are not a known user or group name
the numeric ID's are displayed.
.Pp
@@ -256,9 +207,7 @@ in the size field. If the file is a symbolic link the pathname of the
linked-to file is preceded by
.Dq \-> .
.Pp
The file mode printed under the
.Fl l
option consists of the
The file mode printed under the -l option consists of the
entry type, owner permissions, and group permissions.
The entry type character describes the type of file, as
follows:
@@ -343,11 +292,11 @@ or
.El
.Pp
The
.Nm
.Nm ls
utility exits 0 on success, and >0 if an error occurs.
.Sh ENVIRONMENT
.Sh ENVIRONMENT VARIABLES
The following environment variables affect the execution of
.Nm Ns :
.Nm ls :
.Bl -tag -width BLOCKSIZE
.It Ev BLOCKSIZE
If the environment variable
@@ -362,7 +311,7 @@ decimal integer, it is used as the
column position width for displaying
multiple-text-column output.
The
.Nm
.Nm ls
utility calculates how
many pathname text columns to display
based on the width provided.
@@ -385,16 +334,12 @@ specification.
.Xr sticky 8
.Sh HISTORY
An
.Nm
.Nm ls
command appeared in
.At v1 .
.Sh STANDARDS
The
.Nm
.Nm ls
function is expected to be a superset of the
.St -p1003.2
specification.
.Sh BUGS
To maintain backward compatibility, the relationships between the many
options is quite complex.
+13 -33
View File
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ls.c,v 1.10.2.1 1997/12/03 05:40:06 imp Exp $
* $Id: ls.c,v 1.10 1996/08/27 21:51:48 adam Exp $
*/
#ifndef lint
@@ -82,16 +82,16 @@ int f_kblocks; /* print size in kilobytes */
int f_listdir; /* list actual directory, not contents */
int f_listdot; /* list files beginning with . */
int f_longform; /* long listing format */
int f_newline; /* if precede with newline */
int f_nonprint; /* show unprintables as ? */
int f_nosort; /* don't sort output */
int f_octal; /* show unprintables as \xxx */
int f_octal_escape; /* like f_octal but use C escapes if possible */
int f_recursive; /* ls subdirectories also */
int f_reversesort; /* reverse whatever sort is used */
int f_sectime; /* print the real time for all files */
int f_singlecol; /* use single column output */
int f_size; /* list size in short listing */
int f_statustime; /* use time of last mode change */
int f_dirname; /* if precede with directory name */
int f_timesort; /* sort by time vice name */
int f_type; /* add type character for non-regular files */
@@ -131,7 +131,7 @@ main(argc, argv)
f_listdot = 1;
fts_options = FTS_PHYSICAL;
while ((ch = getopt(argc, argv, "1ABCFHLPRTWabcdfgikloqrstu")) != -1) {
while ((ch = getopt(argc, argv, "1ACFLRTacdfgikloqrstu")) != -1) {
switch (ch) {
/*
* The -1, -C and -l options all override each other so shell
@@ -141,11 +141,6 @@ main(argc, argv)
f_singlecol = 1;
f_column = f_longform = 0;
break;
case 'B':
f_nonprint = 0;
f_octal = 1;
f_octal_escape = 0;
break;
case 'C':
f_column = 1;
f_longform = f_singlecol = 0;
@@ -166,18 +161,10 @@ main(argc, argv)
case 'F':
f_type = 1;
break;
case 'H':
fts_options |= FTS_COMFOLLOW;
break;
case 'L':
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
break;
case 'P':
fts_options &= ~FTS_COMFOLLOW;
fts_options &= ~FTS_LOGICAL;
fts_options |= FTS_PHYSICAL;
break;
case 'R':
f_recursive = 1;
break;
@@ -208,8 +195,6 @@ main(argc, argv)
break;
case 'q':
f_nonprint = 1;
f_octal = 0;
f_octal_escape = 0;
break;
case 'r':
f_reversesort = 1;
@@ -223,11 +208,6 @@ main(argc, argv)
case 't':
f_timesort = 1;
break;
case 'b':
f_nonprint = 0;
f_octal = 0;
f_octal_escape = 1;
break;
default:
case '?':
usage();
@@ -431,10 +411,6 @@ display(p, list)
prcopy(cur->fts_name, cur->fts_name, cur->fts_namelen);
if (cur->fts_namelen > maxlen)
maxlen = cur->fts_namelen;
if (f_octal || f_octal_escape) {
int t = len_octal(cur->fts_name, cur->fts_namelen);
if (t > maxlen) maxlen = t;
}
if (needstats) {
sp = cur->fts_statp;
if (sp->st_blocks > maxblock)
@@ -537,12 +513,16 @@ mastercmp(a, b)
if (a_info == FTS_NS || b_info == FTS_NS)
return (namecmp(*a, *b));
if (a_info != b_info &&
(*a)->fts_level == FTS_ROOTLEVEL && !f_listdir) {
if (a_info == b_info)
return (sortfcn(*a, *b));
if ((*a)->fts_level == FTS_ROOTLEVEL)
if (a_info == FTS_D)
return (1);
if (b_info == FTS_D)
else if (b_info == FTS_D)
return (-1);
}
return (sortfcn(*a, *b));
else
return (sortfcn(*a, *b));
else
return (sortfcn(*a, *b));
}
+1 -4
View File
@@ -1,4 +1,3 @@
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)ls.h 8.1 (Berkeley) 5/31/93
* $Id: ls.h,v 1.2 1994/09/24 02:55:55 davidg Exp $
* $Id$
*/
#define NO_PRINT 1
@@ -46,8 +45,6 @@ extern int f_accesstime; /* use time of last access */
extern int f_flags; /* show flags associated with a file */
extern int f_inode; /* print inode */
extern int f_longform; /* long listing format */
extern int f_octal; /* print unprintables in octal */
extern int f_octal_escape; /* like f_octal but use C escapes if possible */
extern int f_sectime; /* print the real time for all files */
extern int f_size; /* list size in short listing */
extern int f_statustime; /* use time of last mode change */
+7 -17
View File
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: print.c,v 1.8 1996/01/20 10:31:14 mpp Exp $
* $Id: print.c,v 1.7 1995/12/30 18:15:30 joerg Exp $
*/
#ifndef lint
@@ -95,7 +95,7 @@ printlong(dp)
continue;
sp = p->fts_statp;
if (f_inode)
(void)printf("%*lu ", dp->s_inode, (u_long)sp->st_ino);
(void)printf("%*lu ", dp->s_inode, sp->st_ino);
if (f_size)
(void)printf("%*qd ",
dp->s_block, howmany(sp->st_blocks, blocksize));
@@ -124,8 +124,7 @@ printlong(dp)
printtime(sp->st_ctime);
else
printtime(sp->st_mtime);
if (f_octal || f_octal_escape) (void)prn_octal(p->fts_name);
else (void)printf("%s", p->fts_name);
(void)printf("%s", p->fts_name);
if (f_type)
(void)printtype(sp->st_mode);
if (S_ISLNK(sp->st_mode))
@@ -216,12 +215,11 @@ printaname(p, inodefield, sizefield)
sp = p->fts_statp;
chcnt = 0;
if (f_inode)
chcnt += printf("%*lu ", (int)inodefield, (u_long)sp->st_ino);
chcnt += printf("%*lu ", (int)inodefield, sp->st_ino);
if (f_size)
chcnt += printf("%*qd ",
(int)sizefield, howmany(sp->st_blocks, blocksize));
chcnt += (f_octal || f_octal_escape) ? prn_octal(p->fts_name)
: printf("%s", p->fts_name);
chcnt += printf("%s", p->fts_name);
if (f_type)
chcnt += printtype(sp->st_mode);
return (chcnt);
@@ -233,10 +231,6 @@ printtime(ftime)
{
int i;
char longstring[80];
static time_t now;
if (now == 0)
now = time(NULL);
strftime(longstring, sizeof(longstring), "%c", localtime(&ftime));
for (i = 4; i < 11; ++i)
@@ -246,7 +240,7 @@ printtime(ftime)
if (f_sectime)
for (i = 11; i < 24; i++)
(void)putchar(longstring[i]);
else if (ftime + SIXMONTHS > now && ftime < now + SIXMONTHS)
else if (ftime + SIXMONTHS > time(NULL))
for (i = 11; i < 16; ++i)
(void)putchar(longstring[i]);
else {
@@ -299,9 +293,5 @@ printlink(p)
return;
}
path[lnklen] = '\0';
if (f_octal || f_octal_escape) {
(void)printf(" -> ");
(void)prn_octal(path);
}
else (void)printf(" -> %s", path);
(void)printf(" -> %s", path);
}
+2 -89
View File
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: util.c,v 1.5.2.1 1997/03/26 17:55:19 obrien Exp $
* $Id: util.c,v 1.5 1996/03/31 16:14:11 ache Exp $
*/
#ifndef lint
@@ -65,96 +65,9 @@ prcopy(src, dest, len)
}
}
/*
* The fts system makes it difficult to replace fts_name with a different-
* sized string, so we just calculate the real length here and do the
* conversion in prn_octal()
*
* XXX when using f_octal_escape (-b) rather than f_octal (-B), the
* length computed by len_octal may be too big. I just can't be buggered
* to fix this as an efficient fix would involve a lookup table. Same goes
* for the rather inelegant code in prn_octal.
*
* DES 1998/04/23
*/
int
len_octal(s, len)
char *s;
int len;
{
int r = 0;
while (len--)
if (isprint((unsigned char)*s++)) r++; else r += 4;
return r;
}
int
prn_octal(s)
char *s;
{
unsigned char ch;
int len = 0;
while ((ch = *s++))
{
if (isprint(ch) && (ch != '\"') && (ch != '\\'))
putchar(ch), len++;
else if (f_octal_escape) {
putchar('\\');
switch (ch) {
case '\\':
putchar('\\');
break;
case '\"':
putchar('"');
break;
case '\a':
putchar('a');
break;
case '\b':
putchar('b');
break;
case '\f':
putchar('f');
break;
case '\n':
putchar('n');
break;
case '\r':
putchar('r');
break;
case '\t':
putchar('t');
break;
case '\v':
putchar('v');
break;
default:
putchar('0' + (ch >> 6));
putchar('0' + ((ch >> 3) & 3));
putchar('0' + (ch & 3));
len += 2;
break;
}
len += 2;
}
else {
putchar('\\');
putchar('0' + (ch >> 6));
putchar('0' + ((ch >> 3) & 3));
putchar('0' + (ch & 3));
len += 4;
}
}
return len;
}
void
usage()
{
(void)fprintf(stderr, "usage: ls [-ACFHLPRTWacdfgikloqrstu1]"
" [file ...]\n");
(void)fprintf(stderr, "usage: ls [-1ACFLRTacdfikloqrstu] [file ...]\n");
exit(1);
}
+4 -4
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mkdir.1 8.2 (Berkeley) 1/25/94
.\" $Id: mkdir.1,v 1.3.2.2 1998/06/30 06:42:30 charnier Exp $
.\" $Id: mkdir.1,v 1.6 1997/02/22 14:04:08 peter Exp $
.\"
.Dd January 25, 1994
.Dt MKDIR 1
@@ -47,7 +47,7 @@
.Op Fl m Ar mode
.Ar directory_name ...
.Sh DESCRIPTION
.Nm Mkdir
.Nm
creates the directories named as operands, in the order specified,
using mode
.Li rwxrwxrwx (\&0777)
@@ -81,13 +81,13 @@ permission for the owner.
.Pp
The user must have write permission in the parent directory.
.Pp
.Nm Mkdir
.Nm
exits 0 if successful, and >0 if an error occurred.
.Sh SEE ALSO
.Xr rmdir 1
.Sh STANDARDS
The
.Nm
.Nm mkdir
utility is expected to be
.St -p1003.2
compatible.
+10 -9
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mv.1 8.1 (Berkeley) 5/31/93
.\" $Id: mv.1,v 1.7.2.1 1998/02/15 11:16:27 jkh Exp $
.\" $Id: mv.1,v 1.7 1996/08/29 18:06:04 wosch Exp $
.\"
.Dd May 31, 1993
.Dt MV 1
@@ -49,8 +49,9 @@
.Op Fl f | Fl i
.Ar source ... directory
.Sh DESCRIPTION
.Pp
In its first form, the
.Nm
.Nm mv
utility renames the file named by the
.Ar source
operand to the destination path named by the
@@ -60,7 +61,7 @@ This form is assumed when the last operand does not name an already
existing directory.
.Pp
In its second form,
.Nm
.Nm mv
moves each file named by a
.Ar source
operand to a destination file in the existing directory named by the
@@ -81,8 +82,8 @@ option overrides any previous
.Fl i
options.)
.It Fl i
Cause
.Nm
Causes
.Nm mv
to write a prompt to standard error before moving a file that would
overwrite an existing file.
If the response from the standard input begins with the character
@@ -102,7 +103,7 @@ It is an error for either the
operand or the destination path to specify a directory unless both do.
.Pp
If the destination path does not have a mode which permits writing,
.Nm
.Nm mv
prompts the user for confirmation as specified for the
.Fl i
option.
@@ -110,7 +111,7 @@ option.
As the
.Xr rename 2
call does not work across file systems,
.Nm
.Nm mv
uses
.Xr cp 1
and
@@ -124,7 +125,7 @@ rm -f destination_path && \e
.Ed
.Pp
The
.Nm
.Nm mv
utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr cp 1 ,
@@ -132,7 +133,7 @@ utility exits 0 on success, and >0 if an error occurs.
.Xr symlink 7
.Sh STANDARDS
The
.Nm
.Nm mv
utility is expected to be
.St -p1003.2
compatible.
+6 -10
View File
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mv.c,v 1.8.2.3 1998/05/25 22:45:42 steve Exp $
* $Id: mv.c,v 1.8.2.1 1997/08/25 08:33:11 jkh Exp $
*/
#ifndef lint
@@ -78,7 +78,7 @@ main(argc, argv)
register char *p, *endp;
struct stat sb;
int ch;
char path[MAXPATHLEN];
char path[MAXPATHLEN + 1];
while ((ch = getopt(argc, argv, "fi")) != -1)
switch (ch) {
@@ -110,15 +110,11 @@ main(argc, argv)
}
/* It's a directory, move each file into it. */
if (strlen(argv[argc - 1]) > sizeof(path) - 1)
errx(1, "%s: destination pathname too long", *argv);
(void)strcpy(path, argv[argc - 1]);
baselen = strlen(path);
endp = &path[baselen];
if (!baselen || *(endp - 1) != '/') {
*endp++ = '/';
++baselen;
}
*endp++ = '/';
++baselen;
for (rval = 0; --argc; ++argv) {
/*
* Find the last component of the source pathname. It
@@ -270,8 +266,8 @@ err: if (unlink(to))
oldmode = sbp->st_mode & ALLPERMS;
if (fchown(to_fd, sbp->st_uid, sbp->st_gid)) {
warn("%s: set owner/group (was: %lu/%lu)", to,
(u_long)sbp->st_uid, (u_long)sbp->st_gid);
warn("%s: set owner/group (was: %u/%u)", to, sbp->st_uid,
sbp->st_gid);
if (oldmode & (S_ISUID | S_ISGID)) {
warnx(
"%s: owner/group changed; clearing suid/sgid (mode was 0%03o)",
+3 -3
View File
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ftree.c,v 1.4.2.3 1998/02/15 11:18:19 jkh Exp $
* $Id: ftree.c,v 1.4.2.2 1997/09/14 13:07:23 jkh Exp $
*/
#ifndef lint
@@ -506,14 +506,14 @@ next_file(arcn)
* have to read the symlink path from the file
*/
if ((cnt = readlink(ftent->fts_path, arcn->ln_name,
PAXPATHLEN - 1)) < 0) {
PAXPATHLEN)) < 0) {
sys_warn(1, errno, "Unable to read symlink %s",
ftent->fts_path);
continue;
}
/*
* set link name length, watch out readlink does not
* allways NUL terminate the link path
* allways null terminate the link path
*/
arcn->ln_name[cnt] = '\0';
arcn->ln_nlen = cnt;
+39 -40
View File
@@ -34,7 +34,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)pax.1 8.4 (Berkeley) 4/18/94
.\" $Id: pax.1,v 1.3.2.2 1998/06/30 06:42:49 charnier Exp $
.\" $Id: pax.1,v 1.2 1994/09/24 02:56:26 davidg Exp $
.\"
.Dd April 18, 1994
.Dt PAX 1
@@ -194,7 +194,7 @@ The presence of the
and the
.Fl w
options specifies which of the following functional modes
.Nm
.Nm pax
will operate under:
.Em list , read , write ,
and
@@ -284,7 +284,7 @@ While processing a damaged archive during a
or
.Em list
operation,
.Nm
.Nm pax
will attempt to recover from media defects and will search through the archive
to locate and process the largest number of archive members possible (see the
.Fl E
@@ -298,7 +298,7 @@ If the
.Ar directory
operand does not exist, or it is not writable by the user,
or it is not of type directory,
.Nm
.Nm Pax
will exit with a non-zero exit status.
.Pp
The
@@ -317,7 +317,7 @@ be selected.
When a
.Ar pattern
operand does not select at least one archive member,
.Nm
.Nm pax
will write these
.Ar pattern
operands in a diagnostic message to
@@ -330,7 +330,7 @@ operand specifies the pathname of a file to be copied or archived.
When a
.Ar file
operand does not select at least one archive member,
.Nm
.Nm pax
will write these
.Ar file
operand pathnames in a diagnostic message to
@@ -357,7 +357,7 @@ and
as the mode argument.
When the selected archive format supports the specification of linked
files and these files cannot be linked while the archive is being extracted,
.Nm
.Nm pax
will write a diagnostic message to
.Dv standard error
and exit with a non-zero exit status at the completion of operation.
@@ -381,7 +381,7 @@ If an archive format is not specified with a
option, the format currently being used in the archive will be selected.
Any attempt to append to an archive in a format different from the
format already used in the archive will cause
.Nm
.Nm pax
to exit immediately
with a non-zero exit status.
The blocking size used in the archive volume where writing starts
@@ -450,7 +450,7 @@ or
.Em write ) .
A single archive may span multiple files and different archive devices.
When required,
.Nm
.Nm pax
will prompt for the pathname of the file or device of the next volume in the
archive.
.It Fl i
@@ -460,7 +460,7 @@ For each archive member matching a
operand or each file matching a
.Ar file
operand,
.Nm
.Nm pax
will prompt to
.Pa /dev/tty
giving the name of the file, its file mode and its modification time.
@@ -569,7 +569,7 @@ nor the
.Cm o
specification character is specified, or the user ID and group ID are not
preserved for any reason,
.Nm
.Nm pax
will not set the
.Dv S_ISUID
.Em ( setuid )
@@ -578,7 +578,7 @@ and
.Em ( setgid )
bits of the file mode.
If the preservation of any of these items fails for any reason,
.Nm
.Nm pax
will write a diagnostic message to
.Dv standard error .
Failure to preserve these items will affect the final exit status,
@@ -636,9 +636,9 @@ File or archive member names that substitute to the empty string
are not selected and will be skipped.
.It Fl t
Reset the access times of any file or directory read or accessed by
.Nm
.Nm pax
to be the same as they were before being read or accessed by
.Nm Ns .
.Nm pax .
.It Fl u
Ignore files that are older (having a less recent file modification time)
than a pre-existing file or archive member with the same name.
@@ -699,7 +699,7 @@ standard.
The default blocksize for this format is 5120 bytes.
Inode and device information about a file (used for detecting file hard links
by this format) which may be truncated by this format is detected by
.Nm
.Nm pax
and is repaired.
.It Ar bcpio
The old binary cpio format.
@@ -708,21 +708,21 @@ This format is not very portable and should not be used when other formats
are available.
Inode and device information about a file (used for detecting file hard links
by this format) which may be truncated by this format is detected by
.Nm
.Nm pax
and is repaired.
.It Ar sv4cpio
The System V release 4 cpio.
The default blocksize for this format is 5120 bytes.
Inode and device information about a file (used for detecting file hard links
by this format) which may be truncated by this format is detected by
.Nm
.Nm pax
and is repaired.
.It Ar sv4crc
The System V release 4 cpio with file crc checksums.
The default blocksize for this format is 5120 bytes.
Inode and device information about a file (used for detecting file hard links
by this format) which may be truncated by this format is detected by
.Nm
.Nm pax
and is repaired.
.It Ar tar
The old BSD tar format as found in BSD4.3.
@@ -790,20 +790,20 @@ archives to
.Ar limit .
With a positive
.Ar limit ,
.Nm
.Nm pax
will attempt to recover from an archive read error and will
continue processing starting with the next file stored in the archive.
A
.Ar limit
of 0 will cause
.Nm
.Nm pax
to stop operation after the first read error is detected on an archive volume.
A
.Ar limit
of
.Li NONE
will cause
.Nm
.Nm pax
to attempt to recover from read errors forever.
The default
.Ar limit
@@ -813,7 +813,7 @@ is a small positive number of retries.
Using this option with
.Li NONE
should be used with extreme caution as
.Nm
.Nm pax
may get stuck in an infinite loop on a very badly flawed archive.
.It Fl G Ar group
Select a file based on its
@@ -857,7 +857,7 @@ only files with a modification or inode change time of exactly that
time will be selected.
.Pp
When
.Nm
.Nm pax
is in the
.Em write
or
@@ -887,7 +887,7 @@ created and had their modification time reset to an older time (as what
happens when a file is extracted from an archive and the modification time
is preserved).
Time comparisons using both file times is useful when
.Nm
.Nm pax
is used to create a time based incremental archive (only files that were
changed during a specified time range will be archived).
.Pp
@@ -1053,13 +1053,13 @@ gives the verbose table of contents for an archive stored in
.Pa filename .
.Pp
The following commands:
.Dl mkdir /tmp/foo
.Dl cd /tmp/bar
.Dl pax -rw .\ /tmp/foo
.Dl mkdir newdir
.Dl cd olddir
.Dl pax -rw .\ newdir
will copy the entire
.Pa /tmp/bar
.Pa olddir
directory hierarchy to
.Pa /tmp/foo .
.Pa newdir .
.Pp
The command:
.Dl pax -r -s ',^//*usr//*,,' -f a.pax
@@ -1093,7 +1093,7 @@ files with the same name found in the source file tree
.Pa home .
.Sh STANDARDS
The
.Nm
.Nm pax
utility is a superset of the
.St -p1003.2
standard.
@@ -1121,11 +1121,10 @@ and
operations are extensions to the
.Tn POSIX
standard.
.Sh AUTHORS
.An Keith Muller
at the University of California, San Diego
.Sh AUTHOR
Keith Muller at the University of California, San Diego
.Sh ERRORS
.Nm Pax
.Nm pax
will exit with one of the following values:
.Bl -tag -width 2n
.It 0
@@ -1135,7 +1134,7 @@ An error occurred.
.El
.Pp
Whenever
.Nm
.Nm pax
cannot create a file or a link when reading an archive or cannot
find a file when writing an archive, or cannot preserve the user ID,
group ID, or file mode when the
@@ -1144,28 +1143,28 @@ option is specified, a diagnostic message is written to
.Dv standard error
and a non-zero exit status will be returned, but processing will continue.
In the case where pax cannot create a link to a file,
.Nm
.Nm pax
will not create a second copy of the file.
.Pp
If the extraction of a file from an archive is prematurely terminated by
a signal or error,
.Nm
.Nm pax
may have only partially extracted a file the user wanted.
Additionally, the file modes of extracted files and directories
may have incorrect file bits, and the modification and access times may be
wrong.
.Pp
If the creation of an archive is prematurely terminated by a signal or error,
.Nm
.Nm pax
may have only partially created the archive which may violate the specific
archive format specification.
.Pp
If while doing a
.Em copy ,
.Nm
.Nm pax
detects a file is about to overwrite itself, the file is not copied,
a diagnostic message is written to
.Dv standard error
and when
.Nm
.Nm pax
completes it will exit with a non-zero exit status.
+1 -2
View File
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)extern.h 8.3 (Berkeley) 4/2/94
* $Id: extern.h,v 1.3 1996/10/21 07:30:23 peter Exp $
* $Id: extern.h,v 1.2 1994/09/24 02:56:42 davidg Exp $
*/
struct kinfo;
@@ -64,7 +64,6 @@ void parsefmt __P((char *));
void pcpu __P((KINFO *, VARENT *));
void pmem __P((KINFO *, VARENT *));
void pri __P((KINFO *, VARENT *));
void rtprior __P((KINFO *, VARENT *));
void printheader __P((void));
void pvar __P((KINFO *, VARENT *));
void rssize __P((KINFO *, VARENT *));
+2 -11
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: fmt.c,v 1.6.2.1 1997/03/10 19:10:52 guido Exp $
* $Id: fmt.c,v 1.6 1995/10/23 21:03:40 ache Exp $
*/
#ifndef lint
@@ -44,7 +44,6 @@ static char sccsid[] = "@(#)fmt.c 8.4 (Berkeley) 4/15/94";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <vis.h>
#include "ps.h"
@@ -59,16 +58,8 @@ static char *
shquote(argv)
char **argv;
{
long arg_max;
char **p, *dst, *src;
static char *buf = NULL;
if (buf == NULL) {
if ((arg_max = sysconf(_SC_ARG_MAX)) == -1)
errx(1, "sysconf _SC_ARG_MAX failed");
if ((buf = malloc((4 * arg_max) + 1)) == NULL)
errx(1, "malloc failed");
}
static char buf[4*ARG_MAX]; /* XXX */
if (*argv == 0) {
buf[0] = 0;
+2 -2
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: keyword.c,v 1.9 1996/07/31 09:27:23 davidg Exp $
* $Id: keyword.c,v 1.8 1995/10/28 20:11:15 phk Exp $
*/
#ifndef lint
@@ -139,7 +139,7 @@ VAR var[] = {
{"rss", "RSS", NULL, 0, p_rssize, 4},
{"rssize", "", "rsz"},
{"rsz", "RSZ", NULL, 0, rssize, 4},
{"rtprio", "RTPRIO", NULL, 0, rtprior, 7, POFF(p_rtprio)},
{"rtprio", "RTPRIO", NULL, 0, pvar, 7, POFF(p_rtprio), LONG, "d"},
{"ruid", "RUID", NULL, 0, evar, UIDLEN, EOFF(e_pcred.p_ruid),
ULONG, UIDFMT},
{"ruser", "RUSER", NULL, LJUST, runame, USERLEN},
+2 -34
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: print.c,v 1.16.2.2 1997/08/03 08:33:17 peter Exp $
* $Id: print.c,v 1.16.2.1 1997/04/16 16:10:48 jdp Exp $
*/
#ifndef lint
@@ -164,13 +164,12 @@ logname(k, ve)
VARENT *ve;
{
VAR *v;
char *s;
v = ve->var;
#ifndef NEWVM
(void)printf("%-*s", v->width, KI_PROC(k)->p_logname);
#else
(void)printf("%-*s", v->width, (s = KI_EPROC(k)->e_login, *s) ? s : "-");
(void)printf("%-*s", v->width, KI_EPROC(k)->e_login);
#endif
}
@@ -658,37 +657,6 @@ trss(k, ve)
}
#endif
void
rtprior(k, ve)
KINFO *k;
VARENT *ve;
{
VAR *v;
struct rtprio *prtp;
char str[8];
unsigned type, prio;
v = ve->var;
prtp = (struct rtprio *) ((char *)KI_PROC(k) + v->off);
prio = prtp->prio;
switch (type = prtp->type) {
case RTP_PRIO_REALTIME:
snprintf(str, sizeof(str), "real:%u", prio);
break;
case RTP_PRIO_NORMAL:
strncpy(str, "normal", sizeof(str));
break;
case RTP_PRIO_IDLE:
snprintf(str, sizeof(str), "idle:%u", prio);
break;
default:
snprintf(str, sizeof(str), "%u:%u", type, prio);
break;
}
str[sizeof(str)-1] = '\0';
(void)printf("%*s", v->width, str);
}
/*
* Generic output routines. Print fields from various prototype
* structures.
+3 -3
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)pwd.1 8.2 (Berkeley) 4/28/95
.\" $Id: pwd.1,v 1.2.8.2 1998/06/30 06:43:02 charnier Exp $
.\" $Id: pwd.1,v 1.5 1997/02/22 14:05:15 peter Exp $
.\"
.Dd April 28, 1995
.Dt PWD 1
@@ -44,14 +44,14 @@
.Sh SYNOPSIS
.Nm pwd
.Sh DESCRIPTION
.Nm Pwd
.Nm
writes the absolute pathname of the current working directory to
the standard output.
.Pp
The pwd utility exits 0 on success, and >0 if an error occurs.
.Sh STANDARDS
The
.Nm
.Nm pwd
command is expected to be
.St -p1003.2
compatible.
+1 -3
View File
@@ -31,12 +31,10 @@
* SUCH DAMAGE.
*
* @(#)pathnames.h 8.1 (Berkeley) 5/31/93
* $Id: pathnames.h,v 1.2 1994/09/24 02:56:55 davidg Exp $
* $Id$
*/
#include <paths.h>
#define _PATH_CP "/bin/cp"
#define _PATH_RCP "/bin/rcp"
#define _PATH_RLOGIN "/usr/bin/rlogin"
#define _PATH_RSH "/usr/bin/rsh"
+21 -14
View File
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)rcp.1 8.1 (Berkeley) 5/31/93
.\" $Id: rcp.1,v 1.2.8.1 1997/02/28 07:54:41 mpp Exp $
.\" $Id: rcp.1,v 1.5 1997/02/22 14:05:21 peter Exp $
.\"
.Dd May 31, 1993
.Dt RCP 1
@@ -58,21 +58,26 @@ argument is either a remote file name of the
form ``rname@rhost:path'', or a local file name (containing no `:' characters,
or a `/' before any `:'s).
.Pp
The following options are available:
.Bl -tag -width indent
.Bl -tag -width flag
.It Fl K
Turn off all Kerberos authentication.
The
.Fl K
option turns off all Kerberos authentication.
.It Fl k
Request
.Nm
The
.Fl k
option requests
.Nm rcp
to obtain tickets
for the remote host in realm
.Ar realm
instead of the remote host's realm as determined by
.Xr krb_realmofhost 3 .
.It Fl p
Cause
.Nm
The
.Fl p
option causes
.Nm rcp
to attempt to preserve (duplicate) in its copies the modification
times and modes of the source files, ignoring the
.Ar umask .
@@ -84,14 +89,16 @@ modified by the
on the destination host is used.
.It Fl r
If any of the source files are directories,
.Nm
.Nm rcp
copies each subtree rooted at that name; in this case
the destination must be a directory.
.It Fl x
Turn on
The
.Fl x
option turns on
.Tn DES
encryption for all data passed by
.Nm Ns .
.Nm rcp .
This may impact response time and
.Tn CPU
utilization, but provides
@@ -127,11 +134,11 @@ are on the current machine.
.Xr rsh 1
.Sh HISTORY
The
.Nm
.Nm rcp
command appeared in
.Bx 4.2 .
The version of
.Nm
.Nm rcp
described here
has been reimplemented with Kerberos in
.Bx 4.3 Reno .
@@ -150,4 +157,4 @@ The destination user and hostname may have to be specified as
``rhost.rname'' when the destination machine is running the
.Bx 4.2
version of
.Nm Ns .
.Nm rcp .
+11 -24
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: rcp.c,v 1.8.2.4 1998/02/18 11:38:37 markm Exp $
* $Id$
*/
#ifndef lint
@@ -72,6 +72,8 @@ static char const sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94";
#include <des.h>
#include <krb.h>
/* #include "../../usr.bin/rlogin/krb.h" */
char dst_realm_buf[REALM_SZ];
char *dest_realm = NULL;
int use_kerberos = 1;
@@ -94,9 +96,6 @@ uid_t userid;
int errs, rem;
int pflag, iamremote, iamrecursive, targetshouldbedirectory;
static int argc_copy;
static char **argv_copy;
#define CMDNEEDS 64
char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
@@ -120,24 +119,6 @@ main(argc, argv)
struct servent *sp;
int ch, fflag, tflag;
char *targ, *shell;
int i;
/*
* Prepare for execing ourselves.
*/
argc_copy = argc + 1;
argv_copy = malloc((argc_copy + 1) * sizeof(*argv_copy));
if (argv_copy == NULL)
err(1, "malloc");
argv_copy[0] = argv[0];
argv_copy[1] = "-K";
for(i = 1; i < argc; ++i) {
argv_copy[i + 1] = strdup(argv[i]);
if (argv_copy[i + 1] == NULL)
errx(1, "strdup: out of memory");
}
argv_copy[argc + 1] = NULL;
fflag = tflag = 0;
while ((ch = getopt(argc, argv, OPTIONS)) != -1)
@@ -793,8 +774,10 @@ int
kerberos(host, bp, locuser, user)
char **host, *bp, *locuser, *user;
{
struct servent *sp;
again:
if (use_kerberos) {
setuid(getuid());
rem = KSUCCESS;
errno = 0;
if (dest_realm == NULL)
@@ -808,11 +791,15 @@ kerberos(host, bp, locuser, user)
krcmd(host, port, user, bp, 0, dest_realm);
if (rem < 0) {
use_kerberos = 0;
if ((sp = getservbyname("shell", "tcp")) == NULL)
errx(1, "unknown service shell/tcp");
if (errno == ECONNREFUSED)
oldw("remote host doesn't support Kerberos");
else if (errno == ENOENT)
oldw("can't provide Kerberos authentication data");
execv(_PATH_RCP, argv_copy);
port = sp->s_port;
goto again;
}
} else {
#ifdef CRYPT
+8 -13
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)rm.1 8.2 (Berkeley) 4/18/94
.\" $Id: rm.1,v 1.4.2.2 1997/04/09 05:05:46 mpp Exp $
.\" $Id: rm.1,v 1.4.2.1 1997/04/08 20:43:37 mpp Exp $
.\"
.Dd April 18, 1994
.Dt RM 1
@@ -44,11 +44,11 @@
.Sh SYNOPSIS
.Nm rm
.Op Fl f | Fl i
.Op Fl dPRrW
.Op Fl dPRr
.Ar file ...
.Sh DESCRIPTION
The
.Nm
.Nm rm
utility attempts to remove the non-directory type files specified on the
command line.
If the permissions of the file do not permit writing, and the standard
@@ -100,27 +100,23 @@ that directory is skipped.
.It Fl r
Equivalent to
.Fl R .
.It Fl W
Attempt to undelete the named files.
Currently, this option can only be used to recover
files covered by whiteouts.
.El
.Pp
The
.Nm
.Nm rm
utility removes symbolic links, not the files referenced by the links.
.Pp
It is an error to attempt to remove the files ``.'' and ``..''.
.Pp
The
.Nm
.Nm rm
utility exits 0 if all of the named files or file hierarchies were removed,
or if the
.Fl f
option was specified and all of the existing files or file hierarchies were
removed.
If an error occurs,
.Nm
.Nm rm
exits with a value >0.
.Sh NOTE
The
@@ -145,7 +141,6 @@ This is useful for commands that do not use
to parse the command line arguments.
.Sh SEE ALSO
.Xr rmdir 1 ,
.Xr undelete 2 ,
.Xr unlink 2 ,
.Xr fts 3 ,
.Xr getopt 3 ,
@@ -160,7 +155,7 @@ In addition, only regular files are overwritten, other types of files
are not.
.Sh COMPATIBILITY
The
.Nm
.Nm rm
utility differs from historical implementations in that the
.Fl f
option only masks attempts to remove non-existent files instead of
@@ -172,7 +167,7 @@ implementations prompted on the standard output,
not the standard error output.
.Sh STANDARDS
The
.Nm
.Nm rm
command is expected to be
.St -p1003.2
compatible.
+18 -22
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: rm.c,v 1.11.2.1 1997/12/03 05:40:08 imp Exp $
* $Id: rm.c,v 1.11 1996/03/07 23:26:59 wosch Exp $
*/
#ifndef lint
@@ -81,7 +81,7 @@ main(argc, argv)
{
int ch, rflag;
Pflag = rflag = 0;
rflag = 0;
while ((ch = getopt(argc, argv, "dfiPRr")) != -1)
switch(ch) {
case 'd':
@@ -112,17 +112,16 @@ main(argc, argv)
usage();
checkdot(argv);
if (!*argv)
exit (eval);
stdin_ok = isatty(STDIN_FILENO);
uid = geteuid();
if (*argv) {
stdin_ok = isatty(STDIN_FILENO);
if (rflag)
rm_tree(argv);
else
rm_file(argv);
}
if (rflag)
rm_tree(argv);
else
rm_file(argv);
exit (eval);
}
@@ -133,14 +132,13 @@ rm_tree(argv)
FTS *fts;
FTSENT *p;
int needstat;
int flags;
int rval;
/*
* Remove a file hierarchy. If forcing removal (-f), or interactive
* (-i) or can't ask anyway (stdin_ok), don't stat the file.
*/
needstat = !uid || (!fflag && !iflag && stdin_ok);
needstat = !uid || !fflag && !iflag && stdin_ok;
/*
* If the -i option is specified, the user can skip on the pre-order
@@ -178,7 +176,7 @@ rm_tree(argv)
continue;
case FTS_D:
/* Pre-order: give user chance to skip. */
if (!fflag && !check(p->fts_path, p->fts_accpath,
if (iflag && !check(p->fts_path, p->fts_accpath,
p->fts_statp)) {
(void)fts_set(fts, p, FTS_SKIP);
p->fts_number = SKIPPED;
@@ -195,11 +193,10 @@ rm_tree(argv)
if (p->fts_number == SKIPPED)
continue;
break;
default:
if (!fflag &&
!check(p->fts_path, p->fts_accpath, p->fts_statp))
continue;
}
if (!fflag &&
!check(p->fts_path, p->fts_accpath, p->fts_statp))
continue;
rval = 0;
if (!uid &&
@@ -360,9 +357,9 @@ check(path, name, sp)
* first because we may not have stat'ed the file.
*/
if (!stdin_ok || S_ISLNK(sp->st_mode) ||
(!access(name, W_OK) &&
!access(name, W_OK) &&
!(sp->st_flags & (SF_APPEND|SF_IMMUTABLE)) &&
(!(sp->st_flags & (UF_APPEND|UF_IMMUTABLE)) || !uid)))
(!(sp->st_flags & (UF_APPEND|UF_IMMUTABLE)) || !uid))
return (1);
strmode(sp->st_mode, modep);
strcpy(flagsp, flags_to_string(sp->st_flags, NULL));
@@ -401,8 +398,7 @@ checkdot(argv)
if (!complained++)
warnx("\".\" and \"..\" may not be removed");
eval = 1;
for (save = t; (t[0] = t[1]) != NULL; ++t)
continue;
for (save = t; (t[0] = t[1]) != NULL; ++t);
t = save;
} else
++t;
+6 -6
View File
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)rmail.8 6.10 (Berkeley) 4/29/93
.\" $Id: rmail.8,v 1.2.8.2 1998/06/30 06:43:18 charnier Exp $
.\" $Id: rmail.8,v 1.5 1997/02/22 14:05:30 peter Exp $
.\"
.Dd April 29, 1993
.Dt RMAIL 8
@@ -42,7 +42,7 @@
.Nm rmail
.Ar user ...
.Sh DESCRIPTION
.Nm Rmail
.Nm
interprets incoming mail received via
.Xr uucp 1 ,
collapsing ``From'' lines in the form generated
@@ -52,18 +52,18 @@ into a single line of the form ``return-path!sender'',
and passing the processed mail on to
.Xr sendmail 8 .
.Pp
.Nm Rmail
.Nm
is explicitly designed for use with
.Xr uucp 1
.Xr uucp
and
.Xr sendmail 8 .
.Xr sendmail .
.Sh SEE ALSO
.Xr uucp 1 ,
.Xr mail.local 8 ,
.Xr sendmail 8
.Sh HISTORY
The
.Nm
.Nm rmail
program appeared in
.Bx 4.2 .
.Sh BUGS
+6 -8
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)rmdir.1 8.1 (Berkeley) 5/31/93
.\" $Id: rmdir.1,v 1.3.2.2 1998/06/30 06:42:35 charnier Exp $
.\" $Id: rmdir.1,v 1.3 1996/08/29 18:06:08 wosch Exp $
.\"
.Dd May 31, 1993
.Dt RMDIR 1
@@ -46,9 +46,7 @@
.Op Fl p
.Ar directory ...
.Sh DESCRIPTION
The
.Nm
utility removes the directory entry specified by
The rmdir utility removes the directory entry specified by
each
.Ar directory
argument, provided it is empty.
@@ -58,11 +56,11 @@ In order to remove both a parent directory and a subdirectory
of that parent, the subdirectory
must be specified first so the parent directory
is empty when
.Nm
.Nm rmdir
tries to remove it.
.Pp
The following option is available:
.Bl -tag -width indent
.Bl -tag -width Ds
.It Fl p
Each
.Ar directory
@@ -75,7 +73,7 @@ for fully non-discriminant recursive removal.)
.El
.Pp
The
.Nm
.Nm rmdir
utility exits with one of the following values:
.Bl -tag -width Ds
.It Li \&0
@@ -89,7 +87,7 @@ An error occurred.
.Xr rm 1
.Sh STANDARDS
The
.Nm
.Nm rmdir
command is expected to be
.St -p1003.2
compatible.
+10 -6
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: rmdir.c,v 1.2.8.1 1997/08/25 08:43:06 jkh Exp $
* $Id: rmdir.c,v 1.2 1994/09/24 02:57:13 davidg Exp $
*/
#ifndef lint
@@ -40,11 +40,7 @@ static char const copyright[] =
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)rmdir.c 8.3 (Berkeley) 4/2/94";
#endif
static const char rcsid[] =
"$Id$";
static char const sccsid[] = "@(#)rmdir.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <err.h>
@@ -82,6 +78,14 @@ main(argc, argv)
usage();
for (errors = 0; *argv; argv++) {
char *p;
/* Delete trailing slashes, per POSIX. */
p = *argv + strlen(*argv);
while (--p > *argv && *p == '/')
;
*++p = '\0';
if (rmdir(*argv) < 0) {
warn("%s", *argv);
errors = 1;
+2 -5
View File
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: eval.c,v 1.7.2.3 1997/08/25 09:09:42 jkh Exp $
* $Id: eval.c,v 1.7.2.2 1997/05/13 19:18:56 steve Exp $
*/
#ifndef lint
@@ -764,10 +764,7 @@ evalcommand(cmd, flags, backcmd)
for (sp = varlist.list ; sp ; sp = sp->next)
mklocal(sp->text);
funcnest++;
if (flags & EV_TESTED)
evaltree(cmdentry.u.func, EV_TESTED);
else
evaltree(cmdentry.u.func, 0);
evaltree(cmdentry.u.func, 0);
funcnest--;
INTOFF;
poplocalvars();
+3 -3
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $Id: sh.1,v 1.9.2.8 1998/02/15 11:32:26 jkh Exp $
.\" $Id: sh.1,v 1.9.2.7 1998/02/12 01:25:29 jdp Exp $
.\"
.Dd May 5, 1995
.Dt SH 1
@@ -48,7 +48,7 @@
.Op Fl c Ar string
.Op Ar arg ...
.Sh DESCRIPTION
.Nm Sh
.Nm sh
is the standard command interpreter for the system.
The current version of
.Nm
@@ -1092,7 +1092,7 @@ The following environment variables affect the execution of fc:
.It Va FCEDIT
Name of the editor to use.
.It Va HISTSIZE
The number of previous commands that are accessible.
The number of previous commands that are accessable.
.El
.It fg [ job ]
Move the specified job or the current job to the
+5 -5
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)sleep.1 8.3 (Berkeley) 4/18/94
.\" $Id: sleep.1,v 1.2.8.3 1998/06/30 06:43:08 charnier Exp $
.\" $Id: sleep.1,v 1.2.8.1 1997/02/28 07:54:48 mpp Exp $
.\"
.Dd April 18, 1994
.Dt SLEEP 1
@@ -46,17 +46,17 @@
.Ar seconds
.Sh DESCRIPTION
The
.Nm
.Nm sleep
command
suspends execution for a minimum of
.Ar seconds .
.Nm Sleep
.Nm
is used to schedule the execution of other commands (see
.Sx EXAMPLES
below).
.Pp
If the
.Nm
.Nm sleep
command
receives a SIGALRM signal, it terminates normally with a zero exit status,
for any other signal it takes the standard action.
@@ -117,7 +117,7 @@ awk job.
.Xr sleep 3
.Sh STANDARDS
The
.Nm
.Nm sleep
command is expected to be
.St -p1003.2
compatible.
+3 -5
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: gfmt.c,v 1.4.6.1 1997/08/25 09:24:02 jkh Exp $
* $Id: gfmt.c,v 1.4 1995/05/30 00:07:26 rgrimes Exp $
*/
#ifndef lint
@@ -65,12 +65,10 @@ gprint(tp, wp, ldisc)
struct cchar *cp;
(void)printf("gfmt1:cflag=%lx:iflag=%lx:lflag=%lx:oflag=%lx:",
(u_long)tp->c_cflag, (u_long)tp->c_iflag, (u_long)tp->c_lflag,
(u_long)tp->c_oflag);
tp->c_cflag, tp->c_iflag, tp->c_lflag, tp->c_oflag);
for (cp = cchars1; cp->name; ++cp)
(void)printf("%s=%x:", cp->name, tp->c_cc[cp->sub]);
(void)printf("ispeed=%lu:ospeed=%lu\n",
(u_long)cfgetispeed(tp), (u_long)cfgetospeed(tp));
(void)printf("ispeed=%ld:ospeed=%ld\n", cfgetispeed(tp), cfgetospeed(tp));
}
void
+2 -2
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: key.c,v 1.4.6.2 1997/08/25 09:24:04 jkh Exp $
* $Id: key.c,v 1.4.6.1 1996/12/10 16:40:37 joerg Exp $
*/
#ifndef lint
@@ -286,7 +286,7 @@ f_speed(ip)
struct info *ip;
{
(void)printf("%lu\n", (u_long)cfgetospeed(&ip->t));
(void)printf("%ld\n", cfgetospeed(&ip->t));
}
void
+8 -10
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)stty.1 8.4 (Berkeley) 4/18/94
.\" $Id: stty.1,v 1.4.2.4 1998/06/30 06:43:23 charnier Exp $
.\" $Id: stty.1,v 1.4.2.1 1997/03/12 16:00:05 mpp Exp $
.\"
.Dd April 18, 1994
.Dt STTY 1
@@ -48,7 +48,7 @@
.Op operands
.Sh DESCRIPTION
The
.Nm
.Nm stty
utility sets or reports on terminal
characteristics for the device that is its standard input.
If no options or operands are specified, it reports the settings of a subset
@@ -60,7 +60,7 @@ Some combinations of arguments are mutually
exclusive on some terminal types.
.Pp
The following options are available:
.Bl -tag -width indent
.Bl -tag -width Ds
.It Fl a
Display all the current settings for the terminal to standard output
as per
@@ -84,7 +84,7 @@ block on the open.
.It Fl g
Display all the current settings for the terminal to standard output
in a form that may be used as an argument to a subsequent invocation of
.Nm
.Nm stty
to restore the current terminal state as per
.St -p1003.2 .
.El
@@ -146,7 +146,7 @@ Enable (disable) the receiver.
Assume a line without (with) modem
control.
.It Cm crtscts Pq Fl crtscts
Enable (disable) RTS/CTS flow control.
Enable RTS/CTS flow control.
.El
.Ss Input Modes:
This corresponds to the c_iflag in the termios structure.
@@ -493,9 +493,7 @@ first rows, then columns.
.Ss Compatibility Modes:
.Pp
These modes remain for compatibility with the previous version of
the
.Nm
command.
the stty command.
.Bl -tag -width Fl
.It Cm all
Reports all the terminal modes as with
@@ -566,13 +564,13 @@ Same as the control character
.El
.Pp
The
.Nm
.Nm stty
utility exits with a value of 0 if successful, and >0 if an error occurs.
.Sh SEE ALSO
.Xr termios 4
.Sh STANDARDS
The
.Nm
.Nm stty
function is expected to be
.St -p1003.2
compatible. The flags
+5 -5
View File
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)sync.8 8.1 (Berkeley) 5/31/93
.\" $Id: sync.8,v 1.3.2.2 1998/06/30 06:42:40 charnier Exp $
.\" $Id: sync.8,v 1.3 1996/02/12 00:45:47 mpp Exp $
.\"
.Dd May 31, 1993
.Dt SYNC 8
@@ -48,14 +48,14 @@ processor is halted in a way not suitably done by
or
.Xr halt 8 .
Generally, it is preferable to use
.Xr reboot 8
.Xr reboot
or
.Xr halt 8
.Xr halt
to shut down the system,
as they may perform additional actions
such as resynchronizing the hardware clock
and flushing internal caches before performing a final
.Nm Ns .
.Nm sync .
.Pp
.Nm Sync
utilizes the
@@ -69,6 +69,6 @@ function call.
.Xr reboot 8
.Sh HISTORY
A
.Nm
.Nm sync
command appeared in
.At v6 .
+7 -7
View File
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)test.1 8.1 (Berkeley) 5/31/93
.\" $Id: test.1,v 1.2.8.1 1997/06/02 06:40:08 charnier Exp $
.\" $Id: test.1,v 1.2 1994/09/24 02:59:14 davidg Exp $
.\"
.Dd May 31, 1993
.Dt TEST 1
@@ -46,7 +46,7 @@
.Ar expression
.Sh DESCRIPTION
The
.Nm
.Nm test
utility evaluates the expression and, if it evaluates
to true, returns a zero (true) exit status; otherwise
it returns 1 (false).
@@ -54,11 +54,11 @@ If there is no expression, test also
returns 1 (false).
.Pp
All operators and flags are separate arguments to the
.Nm
.Nm test
utility.
.Pp
The following primaries are used to construct expression:
.Bl -tag -width indent
.Bl -tag -width Ar
.It Fl b Ar file
True if
.Ar file
@@ -228,7 +228,7 @@ operator has higher precedence than the
operator.
.Sh GRAMMAR AMBIGUITY
The
.Nm
.Nm test
grammar is inherently ambiguous. In order to assure a degree of consistency,
the cases described in the
.St -p1003.2 ,
@@ -238,7 +238,7 @@ standards document. All other cases are subject to the ambiguity in the
command semantics.
.Sh RETURN VALUES
The
.Nm
.Nm test
utility exits with one of the following values:
.Bl -tag -width Ds
.It 0
@@ -251,7 +251,7 @@ An error occurred.
.El
.Sh STANDARDS
The
.Nm
.Nm test
function is expected to be
.St -p1003.2
compatible.
+1 -13
View File
@@ -1,16 +1,4 @@
$Id: CHANGES,v 8.56 1998/04/07 04:59:42 vixie Exp $
--- 4.9.7-T1A released ---
808. [security] A number of routines did insufficient bounds checking which
could cause crashes by reading from an invalid memory
location. (From BIND-8).
807. [bug] The server sometimes leaked the flushset (ns_resp.c).
(From BIND-8).
806. [bug] add_related_additional() leaked memory if the name
was already in the related array. (From BIND-8).
$Id: CHANGES,v 8.53 1997/06/01 20:34:25 vixie Exp vixie $
--- 4.9.6 released ---
+1 -1
View File
@@ -1,4 +1,4 @@
$Id: INSTALL,v 8.9 1997/06/24 06:43:50 vixie Exp $
$Id: INSTALL,v 8.8 1997/06/01 20:34:25 vixie Exp vixie $
THE FILES:
----------
+2 -2
View File
@@ -1,7 +1,7 @@
# Makefile for BIND>=4.9 top level
# vixie@decwrl December, 1992 [original]
#
# $Id: Makefile,v 8.52 1998/04/07 04:59:42 vixie Exp $
# $Id: Makefile,v 8.49 1997/06/01 20:34:25 vixie Exp vixie $
## Copyright (c) 1989
## The Regents of the University of California. All rights reserved.
@@ -52,7 +52,7 @@
## ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
## SOFTWARE.
VER = 4.9.7-T1B
VER = 4.9.6-REL
SHELL = /bin/sh
MAKE = make
DESTDIR =
+10 -16
View File
@@ -1,24 +1,18 @@
Internet Software Consortium
BIND Release 4.9.7 README
$Date: 1998/04/07 04:24:01 $
The official version of ISC BIND is now 8.1.1. This is ISC BIND 4.9.7,
hoped to be the last of 4.*, which we are releasing since it has an important
security bug (plus some memory leaks) fixed.
The official version of BIND is now 8.1.1. This is 4.9.6, the last of 4.*
which we are releasing since it has some important security bugs fixed.
The official place to get BIND is <URL:ftp://ftp.isc.org/isc/bind/src>.
The official mailing lists are: <[email protected]> - users/admins
(use *-request@* for admin mail) <[email protected]> - developers
The official mailing lists are: [email protected] - users/admins
(use *-request@* for admin mail) [email protected] - developers
The official Usenet newsgroups are: <URL:news:comp.protocols.dns.bind>
<URL:news:comp.protocols.dns.ops>
<URL:news:comp.protocols.dns.std>
The official Usenet newsgroups are: comp.protocols.tcp-ip.domains
comp.protocols.dns.bind
comp.protocols.dns.ops
comp.protocols.dns.std
BIND is maintained by: The Internet Software Consortium
(see <URL:http://www.isc.org/>)
Bug reports should be sent to: <[email protected]>
BIND is currently maintained by: The Internet Software Consortium
(see <URL:http://www.isc.org/isc>.)
Read the top of CHANGES for interesting stuff.
+10 -52
View File
@@ -92,7 +92,7 @@ char copyright[] =
#if !defined(lint) && !defined(SABER)
static char sccsid[] = "@(#)named-xfer.c 4.18 (Berkeley) 3/7/91";
static char rcsid[] = "$Id: named-xfer.c,v 8.24 1998/04/07 04:59:45 vixie Exp $";
static char rcsid[] = "$Id: named-xfer.c,v 8.23 1997/06/01 20:34:34 vixie Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -740,10 +740,6 @@ getzone(zp, serial_no, port)
goto badsoa;
}
tmp += n;
if (tmp + 2 * INT16SZ > eom) {
badsoa_msg = "query error";
goto badsoa;
}
GETSHORT(type, tmp);
GETSHORT(class, tmp);
if (class != curclass || type != T_SOA ||
@@ -782,10 +778,6 @@ getzone(zp, serial_no, port)
GETSHORT(class, cp4);
GETLONG(ttl, cp4);
GETSHORT(dlen, cp4);
if (cp4 + dlen > eom) {
badsoa_msg = "zinfo dlen too big";
goto badsoa;
}
if (type == T_SOA)
break;
/* Skip to next record, if any. */
@@ -1163,8 +1155,6 @@ soa_zinfo(zp, cp, eom)
register int n;
int type, class;
u_long ttl;
u_int dlen;
u_char *rdatap;
/* Are type, class, and ttl OK? */
if (eom - cp < 3 * INT16SZ + INT32SZ)
@@ -1172,8 +1162,7 @@ soa_zinfo(zp, cp, eom)
GETSHORT(type, cp);
GETSHORT(class, cp);
GETLONG(ttl, cp);
GETSHORT(dlen, cp);
rdatap = cp;
cp += INT16SZ; /* dlen */
if (type != T_SOA || class != curclass)
return ("zinfo wrong typ/cla/ttl");
/* Skip master name and contact name, we can't validate them. */
@@ -1191,19 +1180,9 @@ soa_zinfo(zp, cp, eom)
GETLONG(zp->z_retry, cp);
GETLONG(zp->z_expire, cp);
GETLONG(zp->z_minimum, cp);
if (cp != rdatap + dlen)
return ("bad soa dlen");
return (NULL);
}
#define BOUNDS_CHECK(ptr, count) \
do { \
if ((ptr) + (count) > eom) { \
hp->rcode = FORMERR; \
return (-1); \
} \
} while (0)
/*
* Parse the message, determine if it should be printed, and if so, print it
* in .db file form.
@@ -1223,7 +1202,7 @@ print_output(zp, serial_no, msg, msglen, rrp)
int i, j, tab, result, class, type, dlen, n1, n;
char data[BUFSIZ];
u_char *cp1, *cp2, *temp_ptr, *eom, *rr_type_ptr;
u_char *cdata, *rdatap;
u_char *cdata;
char *origin, *proto, dname[MAXDNAME];
char *ignore = "";
const char *badsoa_msg;
@@ -1237,13 +1216,10 @@ print_output(zp, serial_no, msg, msglen, rrp)
}
cp += n;
rr_type_ptr = cp;
BOUNDS_CHECK(cp, 3 * INT16SZ + INT32SZ);
GETSHORT(type, cp);
GETSHORT(class, cp);
GETLONG(ttl, cp);
GETSHORT(dlen, cp);
BOUNDS_CHECK(cp, dlen);
rdatap = cp;
origin = strchr(dname, '.');
if (origin == NULL)
@@ -1318,7 +1294,10 @@ print_output(zp, serial_no, msg, msglen, rrp)
cp += n;
cp1 += strlen((char *) cp1) + 1;
if (type == T_SOA) {
BOUNDS_CHECK(cp, 5 * INT32SZ);
if ((eom - cp) < (5 * INT32SZ)) {
hp->rcode = FORMERR;
return (-1);
}
temp_ptr = cp + 4 * INT32SZ;
GETLONG(minimum_ttl, temp_ptr);
n = 5 * INT32SZ;
@@ -1332,31 +1311,24 @@ print_output(zp, serial_no, msg, msglen, rrp)
case T_NAPTR:
/* Grab weight and port. */
BOUNDS_CHECK(cp, INT16SZ*2);
bcopy(cp, data, INT16SZ*2);
cp1 = (u_char *) (data + INT16SZ*2);
cp += INT16SZ*2;
/* Flags */
BOUNDS_CHECK(cp, 1);
n = *cp++;
BOUNDS_CHECK(cp, n);
*cp1++ = n;
bcopy(cp, cp1, n);
cp += n; cp1 += n;
/* Service */
BOUNDS_CHECK(cp, 1);
n = *cp++;
BOUNDS_CHECK(cp, n);
n = *cp++;
*cp1++ = n;
bcopy(cp, cp1, n);
cp += n; cp1 += n;
/* Regexp */
BOUNDS_CHECK(cp, 1);
n = *cp++;
BOUNDS_CHECK(cp, n);
n = *cp++;
*cp1++ = n;
bcopy(cp, cp1, n);
cp += n; cp1 += n;
@@ -1380,13 +1352,11 @@ print_output(zp, serial_no, msg, msglen, rrp)
case T_RT:
case T_SRV:
/* grab preference */
BOUNDS_CHECK(cp, INT16SZ);
bcopy((char *)cp, data, INT16SZ);
cp1 = (u_char *)data + INT16SZ;
cp += INT16SZ;
if (type == T_SRV) {
BOUNDS_CHECK(cp, INT16SZ);
bcopy((char *)cp, cp1, INT16SZ*2);
cp1 += INT16SZ*2;
cp += INT16SZ*2;
@@ -1408,7 +1378,6 @@ print_output(zp, serial_no, msg, msglen, rrp)
case T_PX:
/* grab preference */
BOUNDS_CHECK(cp, INT16SZ);
bcopy((char *)cp, data, INT16SZ);
cp1 = (u_char *)data + INT16SZ;
cp += INT16SZ;
@@ -1439,7 +1408,6 @@ print_output(zp, serial_no, msg, msglen, rrp)
/* first just copy over the type_covered, algorithm, */
/* labels, orig ttl, two timestamps, and the footprint */
BOUNDS_CHECK(cp, 18);
bcopy( cp, cp1, 18 );
cp += 18;
cp1 += 18;
@@ -1455,10 +1423,8 @@ print_output(zp, serial_no, msg, msglen, rrp)
/* finally, we copy over the variable-length signature.
Its size is the total data length, minus what we copied. */
n = dlen - (18 + n);
if (n > (int)((sizeof data) - (int)(cp1 - (u_char *)data))) {
hp->rcode = FORMERR;
if (n > (sizeof data) - (cp1 - (u_char *)data))
return (-1); /* out of room! */
}
bcopy(cp, cp1, n);
cp += n;
cp1 += n;
@@ -1482,14 +1448,6 @@ print_output(zp, serial_no, msg, msglen, rrp)
hp->rcode = FORMERR;
return (-1);
}
if (cp != rdatap + dlen) {
dprintf(1, (ddt,
"encoded rdata length is %u, but actual length was %u\n",
dlen, (u_int)(cp - rdatap)));
hp->rcode = FORMERR;
return (-1);
}
cdata = cp1;
result = cp - rrp;
+7 -27
View File
@@ -21,13 +21,6 @@
#ifdef NCACHE
#define BOUNDS_CHECK(ptr, count) \
do { \
if ((ptr) + (count) > eom) { \
return; \
} \
} while (0)
void
cache_n_resp(msg, msglen)
u_char *msg;
@@ -35,7 +28,7 @@ cache_n_resp(msg, msglen)
{
register struct databuf *dp;
HEADER *hp;
u_char *cp, *eom, *rdatap;
u_char *cp;
char dname[MAXDNAME];
int n;
int type, class;
@@ -43,22 +36,19 @@ cache_n_resp(msg, msglen)
int Vcode;
#endif
int flags;
u_int dlen;
nameserIncr(from_addr.sin_addr, nssRcvdNXD);
hp = (HEADER *)msg;
cp = msg+HFIXEDSZ;
eom = msg + msglen;
n = dn_expand(msg, eom, cp, dname, sizeof dname);
n = dn_expand(msg, msg + msglen, cp, dname, sizeof dname);
if (n < 0) {
dprintf(1, (ddt, "Query expand name failed:cache_n_resp\n"));
hp->rcode = FORMERR;
return;
}
cp += n;
BOUNDS_CHECK(cp, 2 * INT16SZ);
GETSHORT(type, cp);
GETSHORT(class, cp);
dprintf(1, (ddt,
@@ -86,14 +76,13 @@ cache_n_resp(msg, msglen)
if (hp->rcode == NXDOMAIN)
type = T_SOA;
/* store their SOA record */
n = dn_skipname(tp, eom);
/* store ther SOA record */
n = dn_skipname(tp, msg + msglen);
if (n < 0) {
dprintf(3, (ddt, "ncache: form error\n"));
return;
}
tp += n;
BOUNDS_CHECK(tp, 3 * INT16SZ + INT32SZ);
GETSHORT(atype, tp); /* type */
if (atype != T_SOA) {
dprintf(3, (ddt,
@@ -102,12 +91,10 @@ cache_n_resp(msg, msglen)
}
tp += INT16SZ; /* class */
GETLONG(ttl, tp); /* ttl */
GETSHORT(dlen, tp); /* dlen */
BOUNDS_CHECK(tp, dlen);
rdatap = tp;
tp += INT16SZ; /* dlen */
/* origin */
n = dn_expand(msg, eom, tp, (char*)data, len);
n = dn_expand(msg, msg + msglen, tp, (char*)data, len);
if (n < 0) {
dprintf(3, (ddt, "ncache: form error 2\n"));
return;
@@ -126,17 +113,10 @@ cache_n_resp(msg, msglen)
n = strlen((char*)cp1) + 1;
cp1 += n;
len -= n;
n = 5 * INT32SZ;
BOUNDS_CHECK(tp, n);
bcopy(tp, cp1, n);
bcopy(tp, cp1, n = 5 * INT32SZ);
/* serial, refresh, retry, expire, min */
cp1 += n;
len -= n;
tp += n;
if (tp != rdatap + dlen) {
dprintf(3, (ddt, "ncache: form error 2\n"));
return;
}
/* store the zone of the soa record */
n = dn_expand(msg, msg + msglen, cp, (char*)cp1, len);
if (n < 0) {
+9 -47
View File
@@ -1,6 +1,6 @@
#if !defined(lint) && !defined(SABER)
static char sccsid[] = "@(#)ns_req.c 4.47 (Berkeley) 7/1/91";
static char rcsid[] = "$Id: ns_req.c,v 8.29 1998/04/07 04:59:45 vixie Exp $";
static char rcsid[] = "$Id: ns_req.c,v 8.28 1997/06/01 20:34:34 vixie Exp $";
#endif /* not lint */
/*
@@ -328,11 +328,6 @@ req_notify(hp, cpp, eom, msg, from)
hp->rcode = FORMERR;
return (Finish);
}
if (*cpp + 2 * INT16SZ > eom) {
dprintf(1, (ddt, "FORMERR notify too short"));
hp->rcode = FORMERR;
return (Finish);
}
*cpp += n;
GETSHORT(type, *cpp);
GETSHORT(class, *cpp);
@@ -466,13 +461,13 @@ req_query(hp, cpp, eom, qsp, buflenp, msglenp, msg, dfd, from)
return (Finish);
}
*cpp += n;
if (*cpp + 2 * INT16SZ > eom) {
GETSHORT(type, *cpp);
GETSHORT(class, *cpp);
if (*cpp > eom) {
dprintf(1, (ddt, "FORMERR Query message length short\n"));
hp->rcode = FORMERR;
return (Finish);
}
GETSHORT(type, *cpp);
GETSHORT(class, *cpp);
if (*cpp < eom) {
dprintf(6, (ddt,"message length > received message\n"));
*msglenp = *cpp - msg;
@@ -995,11 +990,6 @@ req_iquery(hp, cpp, eom, buflenp, msg, from)
return (Finish);
}
*cpp += n;
if (*cpp + 3 * INT16SZ + INT32SZ > eom) {
dprintf(1, (ddt, "FORMERR IQuery message too short"));
hp->rcode = FORMERR;
return (Finish);
}
GETSHORT(type, *cpp);
GETSHORT(class, *cpp);
*cpp += INT32SZ; /* ttl */
@@ -1017,7 +1007,7 @@ req_iquery(hp, cpp, eom, buflenp, msg, from)
switch (type) {
case T_A:
#ifndef INVQ
if (!fake_iquery || dlen != INT32SZ)
if (!fake_iquery)
return (Refuse);
#endif
#ifdef INVQ
@@ -1031,10 +1021,7 @@ req_iquery(hp, cpp, eom, buflenp, msg, from)
dprintf(1, (ddt, "req: IQuery class %d type %d\n", class, type));
fname = (char *)msg + HFIXEDSZ;
alen = (char *)*cpp - fname;
if ((size_t)alen > sizeof anbuf)
return (Refuse);
bcopy(fname, anbuf, alen);
bcopy(fname, anbuf, alen = (char *)*cpp - fname);
data = anbuf + alen - dlen;
*cpp = (u_char *)fname;
*buflenp -= HFIXEDSZ;
@@ -1081,10 +1068,6 @@ req_iquery(hp, cpp, eom, buflenp, msg, from)
return (Finish);
}
*cpp += n;
if (*cpp + 2 * INT16SZ > dnbuf + *buflenp) {
hp->tc = 1;
return (Finish);
}
PUTSHORT((u_int16_t)dp->d_type, *cpp);
PUTSHORT((u_int16_t)dp->d_class, *cpp);
*buflenp -= n;
@@ -1273,8 +1256,6 @@ make_rr(name, dp, buf, buflen, doadd)
}
buflen -= RRFIXEDSZ;
if (buflen < 0)
return (-1);
#if defined(RETURNSOA) && defined(NCACHE)
if (dp->d_rcode) {
name = (char *)dp->d_data;
@@ -1288,8 +1269,6 @@ make_rr(name, dp, buf, buflen, doadd)
return (-1);
cp = buf + n;
buflen -= n;
if (buflen < 0)
return (-1);
PUTSHORT((u_int16_t)type, cp);
PUTSHORT((u_int16_t)dp->d_class, cp);
PUTLONG(ttl, cp);
@@ -1329,8 +1308,6 @@ make_rr(name, dp, buf, buflen, doadd)
return (-1);
cp += n;
buflen -= type == T_SOA ? n + 5 * INT32SZ : n;
if (buflen < 0)
return (-1);
cp1 += strlen((char *)cp1) + 1;
n = dn_comp((char *)cp1, cp, buflen, dnptrs, edp);
if (n < 0)
@@ -1349,10 +1326,10 @@ make_rr(name, dp, buf, buflen, doadd)
/* cp1 == our data/ cp == data of RR */
cp1 = dp->d_data;
/* copy order */
buflen -= INT16SZ;
if (buflen < 0)
if ((buflen -= INT16SZ) < 0)
return (-1);
/* copy order */
bcopy(cp1, cp, INT16SZ);
cp += INT16SZ;
cp1 += INT16SZ;
@@ -1360,9 +1337,6 @@ make_rr(name, dp, buf, buflen, doadd)
dprintf(1, (ddt, "current size n = %u\n", n));
/* copy preference */
buflen -= INT16SZ;
if (buflen < 0)
return (-1);
bcopy(cp1, cp, INT16SZ);
cp += INT16SZ;
cp1 += INT16SZ;
@@ -1371,9 +1345,6 @@ make_rr(name, dp, buf, buflen, doadd)
/* Flags */
n = *cp1++;
buflen -= n + 1;
if (buflen < 0)
return (-1);
dprintf(1, (ddt, "size of n at flags = %d\n", n));
*cp++ = n;
bcopy(cp1,cp,n);
@@ -1384,9 +1355,6 @@ make_rr(name, dp, buf, buflen, doadd)
/* Service */
n = *cp1++;
buflen -= n + 1;
if (buflen < 0)
return (-1);
*cp++ = n;
bcopy(cp1,cp,n);
cp += n;
@@ -1396,9 +1364,6 @@ make_rr(name, dp, buf, buflen, doadd)
/* Regexp */
n = *cp1++;
buflen -= n + 1;
if (buflen < 0)
return (-1);
*cp++ = n;
bcopy(cp1,cp,n);
cp += n;
@@ -1437,9 +1402,6 @@ make_rr(name, dp, buf, buflen, doadd)
cp1 += INT16SZ;
if (type == T_SRV) {
buflen -= INT16SZ*2;
if (buflen < 0)
return (-1);
bcopy(cp1, cp, INT16SZ*2);
cp += INT16SZ*2;
cp1 += INT16SZ*2;
+41 -115
View File
@@ -1,6 +1,6 @@
#if !defined(lint) && !defined(SABER)
static char sccsid[] = "@(#)ns_resp.c 4.65 (Berkeley) 3/3/91";
static char rcsid[] = "$Id: ns_resp.c,v 8.41 1998/04/07 04:59:45 vixie Exp $";
static char rcsid[] = "$Id: ns_resp.c,v 8.38 1997/06/01 20:34:34 vixie Exp vixie $";
#endif /* not lint */
/*
@@ -132,8 +132,7 @@ struct flush_set {
static void rrsetadd __P((struct flush_set *, char *,
struct databuf *)),
rrsetupdate __P((struct flush_set *, int flags)),
flushrrset __P((struct flush_set *)),
free_flushset __P((struct flush_set *));
flushrrset __P((struct flush_set *));
static int rrsetcmp __P((char *, struct db_list *)),
check_root __P((void)),
check_ns __P((void)),
@@ -240,7 +239,7 @@ ns_resp(msg, msglen)
register struct databuf *ns, *ns2;
register u_char *cp;
u_char *eom = msg + msglen;
struct flush_set *flushset = NULL;
struct flush_set *flushset;
struct sockaddr_in *nsa;
struct databuf *nsp[NSMAX];
int i, c, n, qdcount, ancount, aucount, nscount, arcount, arfirst;
@@ -265,6 +264,8 @@ ns_resp(msg, msglen)
struct fwdinfo *fwd;
char *tname = NULL;
free_related_additional();
nameserIncr(from_addr.sin_addr, nssRcvdR);
nsp[0] = NULL;
hp = (HEADER *) msg;
@@ -301,10 +302,6 @@ ns_resp(msg, msglen)
goto formerr;
}
cp += n;
if (cp + 2 * INT16SZ > eom) {
formerrmsg = outofDataQuery;
goto formerr;
}
GETSHORT(qtype, cp);
GETSHORT(qclass, cp);
if (!ns_nameok(qname, qclass, response_trans,
@@ -584,12 +581,16 @@ ns_resp(msg, msglen)
goto formerr;
}
tp += n;
if (tp + 2 * INT16SZ > eom) {
GETSHORT(type, tp);
if (tp >= eom) {
formerrmsg = outofDataAuth;
goto formerr;
}
GETSHORT(type, tp);
GETSHORT(class, tp);
if (tp >= eom) {
formerrmsg = outofDataAuth;
goto formerr;
}
if (!ns_nameok(name, class, response_trans,
ns_ownercontext(type, response_trans),
name, from_addr.sin_addr)) {
@@ -644,7 +645,6 @@ ns_resp(msg, msglen)
u_int16_t type, class, dlen;
u_int32_t serial;
u_char *tp = cp;
u_char *rdatap;
n = dn_expand(msg, eom, tp, name, sizeof name);
if (n < 0) {
@@ -652,15 +652,14 @@ ns_resp(msg, msglen)
goto formerr;
}
tp += n; /* name */
if (tp + 3 * INT16SZ + INT32SZ > eom) {
formerrmsg = outofDataAnswer;
goto formerr;
}
GETSHORT(type, tp); /* type */
GETSHORT(class, tp); /* class */
tp += INT32SZ; /* ttl */
GETSHORT(dlen, tp); /* dlen */
rdatap = tp; /* start of rdata */
if (tp >= eom) {
formerrmsg = outofDataAnswer;
goto formerr;
}
if (!ns_nameok(name, class, response_trans,
ns_ownercontext(type, response_trans),
name, from_addr.sin_addr)) {
@@ -676,6 +675,10 @@ ns_resp(msg, msglen)
formerrmsg = msgbuf;
goto formerr;
}
if ((u_int)dlen < (5 * INT32SZ)) {
formerrmsg = dlenUnderrunAnswer;
goto formerr;
}
if (0 >= (n = dn_skipname(tp, eom))) {
formerrmsg = skipnameFailedAnswer;
@@ -687,16 +690,7 @@ ns_resp(msg, msglen)
goto formerr;
}
tp += n; /* rname */
if (tp + 5 * INT32SZ > eom) {
formerrmsg = dlenUnderrunAnswer;
goto formerr;
}
GETLONG(serial, tp);
tp += 4 * INT32SZ; /* Skip rest of SOA. */
if ((u_int)(tp - rdatap) != dlen) {
formerrmsg = dlenOverrunAnswer;
goto formerr;
}
qserial_answer(qp, serial);
qremove(qp);
@@ -792,18 +786,12 @@ ns_resp(msg, msglen)
maybe_free(&tname);
if (cp >= eom) {
free_related_additional();
if (flushset != NULL)
free_flushset(flushset);
formerrmsg = outofDataFinal;
goto formerr;
}
n = rrextract(msg, msglen, cp, &dp, name, sizeof name, &tname);
if (n < 0) {
free_related_additional();
maybe_free(&tname);
if (flushset != NULL)
free_flushset(flushset);
formerrmsg = outofDataFinal;
goto formerr;
}
@@ -933,11 +921,13 @@ ns_resp(msg, msglen)
}
rrsetadd(flushset, name, dp);
}
free_related_additional();
maybe_free(&tname);
if (flushset) {
rrsetupdate(flushset, dbflags);
free_flushset(flushset);
for (i = 0; i < count; i++)
if (flushset[i].fs_name)
free(flushset[i].fs_name);
free((char*)flushset);
}
if (lastwascname && !externalcname)
syslog(LOG_DEBUG, "%s (%s)", danglingCname, aname);
@@ -1375,14 +1365,6 @@ ns_resp(msg, msglen)
return;
}
#define BOUNDS_CHECK(ptr, count) \
do { \
if ((ptr) + (count) > eom) { \
hp->rcode = FORMERR; \
return (-1); \
} \
} while (0)
static int
rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
u_char *msg;
@@ -1393,7 +1375,7 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
int namelen;
char **tnamep;
{
register u_char *cp, *eom, *rdatap;
register u_char *cp;
register int n;
int class, type, dlen, n1;
u_int32_t ttl;
@@ -1407,19 +1389,15 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
*dpp = NULL;
cp = rrp;
eom = msg + msglen;
if ((n = dn_expand(msg, eom, cp, dname, namelen)) < 0) {
if ((n = dn_expand(msg, msg + msglen, cp, dname, namelen)) < 0) {
hp->rcode = FORMERR;
return (-1);
}
cp += n;
BOUNDS_CHECK(cp, 2*INT16SZ + INT32SZ + INT16SZ);
GETSHORT(type, cp);
GETSHORT(class, cp);
GETLONG(ttl, cp);
GETSHORT(dlen, cp);
BOUNDS_CHECK(cp, dlen);
rdatap = cp;
if (!ns_nameok(dname, class, response_trans,
ns_ownercontext(type, response_trans),
dname, from_addr.sin_addr)) {
@@ -1478,7 +1456,8 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
case T_MR:
case T_NS:
case T_PTR:
n = dn_expand(msg, eom, cp, (char *)data, sizeof data);
n = dn_expand(msg, msg + msglen, cp,
(char *)data, sizeof data);
if (n < 0) {
hp->rcode = FORMERR;
return (-1);
@@ -1504,7 +1483,8 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
context = mailname_ctx;
/* FALLTHROUGH */
soa_rp_minfo:
n = dn_expand(msg, eom, cp, (char *)data, sizeof data);
n = dn_expand(msg, msg + msglen, cp,
(char *)data, sizeof data);
if (n < 0) {
hp->rcode = FORMERR;
return (-1);
@@ -1515,15 +1495,11 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
return (-1);
}
cp += n;
/*
* The next use of 'cp' is dn_expand(), so we don't have
* to BOUNDS_CHECK() here.
*/
cp1 = data + (n = strlen((char *)data) + 1);
n1 = sizeof(data) - n;
if (type == T_SOA)
n1 -= 5 * INT32SZ;
n = dn_expand(msg, eom, cp, (char *)cp1, n1);
n = dn_expand(msg, msg + msglen, cp, (char *)cp1, n1);
if (n < 0) {
hp->rcode = FORMERR;
return (-1);
@@ -1540,9 +1516,7 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
cp += n;
cp1 += strlen((char *)cp1) + 1;
if (type == T_SOA) {
n = 5 * INT32SZ;
BOUNDS_CHECK(cp, n);
bcopy(cp, cp1, n);
bcopy(cp, cp1, n = 5 * INT32SZ);
cp += n;
cp1 += n;
}
@@ -1552,37 +1526,30 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
case T_NAPTR:
/* Grab weight and port. */
BOUNDS_CHECK(cp, INT16SZ*2);
bcopy(cp, data, INT16SZ*2);
cp1 = data + INT16SZ*2;
cp += INT16SZ*2;
/* Flags */
BOUNDS_CHECK(cp, 1);
n = *cp++;
BOUNDS_CHECK(cp, n);
*cp1++ = n;
bcopy(cp, cp1, n);
cp += n; cp1 += n;
/* Service */
BOUNDS_CHECK(cp, 1);
n = *cp++;
BOUNDS_CHECK(cp, n);
*cp1++ = n;
bcopy(cp, cp1, n);
cp += n; cp1 += n;
/* Regexp */
BOUNDS_CHECK(cp, 1);
n = *cp++;
BOUNDS_CHECK(cp, n);
*cp1++ = n;
bcopy(cp, cp1, n);
cp += n; cp1 += n;
/* Replacement */
n = dn_expand(msg, eom, cp, (char *)cp1,
n = dn_expand(msg, msg + msglen, cp, (char *)cp1,
sizeof data - (cp1 - data));
if (n < 0) {
hp->rcode = FORMERR;
@@ -1607,21 +1574,19 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
case T_RT:
case T_SRV:
/* grab preference */
BOUNDS_CHECK(cp, INT16SZ);
bcopy(cp, data, INT16SZ);
cp1 = data + INT16SZ;
cp += INT16SZ;
if (type == T_SRV) {
/* Grab weight and port. */
BOUNDS_CHECK(cp, INT16SZ*2);
bcopy(cp, cp1, INT16SZ*2);
cp1 += INT16SZ*2;
cp += INT16SZ*2;
}
/* get name */
n = dn_expand(msg, eom, cp, (char *)cp1,
n = dn_expand(msg, msg + msglen, cp, (char *)cp1,
sizeof data - (cp1 - data));
if (n < 0) {
hp->rcode = FORMERR;
@@ -1646,14 +1611,13 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
case T_PX:
/* grab preference */
BOUNDS_CHECK(cp, INT16SZ);
bcopy(cp, data, INT16SZ);
cp1 = data + INT16SZ;
cp += INT16SZ;
/* get MAP822 name */
n = dn_expand(msg, eom, cp, (char *)cp1,
sizeof data - INT16SZ);
n = dn_expand(msg, msg + msglen, cp, (char *)cp1,
sizeof data - INT16SZ);
if (n < 0) {
hp->rcode = FORMERR;
return (-1);
@@ -1664,13 +1628,9 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
return (-1);
}
cp += n;
/*
* The next use of 'cp' is dn_expand(), so we don't have
* to BOUNDS_CHECK() here.
*/
cp1 += (n = strlen((char *)cp1) + 1);
n1 = sizeof(data) - n;
n = dn_expand(msg, eom, cp, (char *)cp1, n1);
n = dn_expand(msg, msg + msglen, cp, (char *)cp1, n1);
if (n < 0) {
hp->rcode = FORMERR;
return (-1);
@@ -1693,7 +1653,6 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
/* This code is similar to that in db_load.c. */
/* Skip coveredType, alg, labels */
BOUNDS_CHECK(cp, INT16SZ + 1 + 1 + 3*INT32SZ);
cp1 = cp + INT16SZ + 1 + 1;
GETLONG(origTTL, cp1);
GETLONG(exptime, cp1);
@@ -1738,31 +1697,23 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
/* first just copy over the type_covered, algorithm, */
/* labels, orig ttl, two timestamps, and the footprint */
BOUNDS_CHECK(cp, 18);
bcopy(cp, cp1, 18);
cp += 18;
cp1 += 18;
/* then the signer's name */
n = dn_expand(msg, eom, cp, (char *)cp1, (sizeof data) - 18);
if (n < 0) {
hp->rcode = FORMERR;
n = dn_expand(msg, msg + msglen, cp,
(char *)cp1, (sizeof data) - 18);
if (n < 0)
return (-1);
}
cp += n;
cp1 += strlen((char*)cp1)+1;
/* finally, we copy over the variable-length signature.
Its size is the total data length, minus what we copied. */
if (18 + (u_int)n > dlen) {
hp->rcode = FORMERR;
return (-1);
}
n = dlen - (18 + n);
if (n > ((int)(sizeof data) - (int)(cp1 - (u_char *)data))) {
hp->rcode = FORMERR;
if (n > (sizeof data) - (cp1 - (u_char *)data))
return (-1); /* out of room! */
}
bcopy(cp, cp1, n);
cp += n;
cp1 += n;
@@ -1777,18 +1728,6 @@ rrextract(msg, msglen, rrp, dpp, dname, namelen, tnamep)
dprintf(3, (ddt, "unknown type %d\n", type));
return ((cp - rrp) + dlen);
}
if (cp > eom) {
hp->rcode = FORMERR;
return (-1);
}
if ((u_int)(cp - rdatap) != dlen) {
dprintf(3, (ddt,
"encoded rdata length is %u, but actual length was %u",
dlen, (u_int)(cp - rdatap)));
hp->rcode = FORMERR;
return (-1);
}
if (n > MAXDATA) {
dprintf(1, (ddt,
"update type %d: %d bytes is too much data\n",
@@ -3124,17 +3063,6 @@ flushrrset(fs)
db_free(dp);
}
static void
free_flushset(flushset)
struct flush_set *flushset;
{
struct flush_set *fs;
for (fs = flushset; fs->fs_name != NULL; fs++)
free(fs->fs_name);
free((char *)flushset);
}
/*
* This is best thought of as a "cache invalidate" function.
* It is called whenever a piece of data is determined to have
@@ -3197,10 +3125,8 @@ add_related_additional(name)
if (num_related >= MAX_RELATED - 1)
return;
for (i = 0; i < num_related; i++)
if (strcasecmp(name, related[i]) == 0) {
free(name);
if (strcasecmp(name, related[i]) == 0)
return;
}
related[num_related++] = name;
}
+4 -41
View File
@@ -55,7 +55,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "$Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vixie Exp $";
static char rcsid[] = "$Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -152,23 +152,6 @@ dprintf(msg, num)
# define dprintf(msg, num) /*nada*/
#endif
#define BOUNDED_INCR(x) \
do { \
cp += x; \
if (cp > eom) { \
h_errno = NO_RECOVERY; \
return (NULL); \
} \
} while (0)
#define BOUNDS_CHECK(ptr, count) \
do { \
if ((ptr) + (count) > eom) { \
h_errno = NO_RECOVERY; \
return (NULL); \
} \
} while (0)
static struct hostent *
getanswer(answer, anslen, qname, qtype)
const querybuf *answer;
@@ -179,7 +162,7 @@ getanswer(answer, anslen, qname, qtype)
register const HEADER *hp;
register const u_char *cp;
register int n;
const u_char *eom, *erdata;
const u_char *eom;
char *bp, **ap, **hap;
int type, class, buflen, ancount, qdcount;
int haveanswer, had_error;
@@ -210,8 +193,7 @@ getanswer(answer, anslen, qname, qtype)
qdcount = ntohs(hp->qdcount);
bp = hostbuf;
buflen = sizeof hostbuf;
cp = answer->buf;
BOUNDED_INCR(HFIXEDSZ);
cp = answer->buf + HFIXEDSZ;
if (qdcount != 1) {
h_errno = NO_RECOVERY;
return (NULL);
@@ -221,7 +203,7 @@ getanswer(answer, anslen, qname, qtype)
h_errno = NO_RECOVERY;
return (NULL);
}
BOUNDED_INCR(n + QFIXEDSZ);
cp += n + QFIXEDSZ;
if (qtype == T_A || qtype == T_AAAA) {
/* res_send() has already verified that the query name is the
* same as the one we sent; this just gets the expanded name
@@ -253,15 +235,12 @@ getanswer(answer, anslen, qname, qtype)
continue;
}
cp += n; /* name */
BOUNDS_CHECK(cp, 3 * INT16SZ + INT32SZ);
type = _getshort(cp);
cp += INT16SZ; /* type */
class = _getshort(cp);
cp += INT16SZ + INT32SZ; /* class, TTL */
n = _getshort(cp);
cp += INT16SZ; /* len */
BOUNDS_CHECK(cp, n);
erdata = cp + n;
if (class != C_IN) {
/* XXX - debug? syslog? */
cp += n;
@@ -276,10 +255,6 @@ getanswer(answer, anslen, qname, qtype)
continue;
}
cp += n;
if (cp != erdata) {
h_errno = NO_RECOVERY;
return (NULL);
}
/* Store alias. */
*ap++ = bp;
n = strlen(bp) + 1; /* for the \0 */
@@ -308,10 +283,6 @@ getanswer(answer, anslen, qname, qtype)
continue;
}
cp += n;
if (cp != erdata) {
h_errno = NO_RECOVERY;
return (NULL);
}
/* Get canonical name. */
n = strlen(tbuf) + 1; /* for the \0 */
if (n > buflen || n >= MAXHOSTNAMELEN) {
@@ -347,10 +318,6 @@ getanswer(answer, anslen, qname, qtype)
}
#if MULTI_PTRS_ARE_ALIASES
cp += n;
if (cp != erdata) {
h_errno = NO_RECOVERY;
return (NULL);
}
if (!haveanswer)
host.h_name = bp;
else if (ap < &host_aliases[MAXALIASES-1])
@@ -421,10 +388,6 @@ getanswer(answer, anslen, qname, qtype)
bp += n;
buflen -= n;
cp += n;
if (cp != erdata) {
h_errno = NO_RECOVERY;
return (NULL);
}
break;
default:
abort();
+242 -668
View File
@@ -55,7 +55,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "$Id: res_comp.c,v 8.13 1998/04/07 04:24:06 vixie Exp $";
static char rcsid[] = "$Id: res_comp.c,v 8.12 1997/06/01 20:34:37 vixie Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -63,10 +63,9 @@ static char rcsid[] = "$Id: res_comp.c,v 8.13 1998/04/07 04:24:06 vixie Exp $";
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <ctype.h>
#include <errno.h>
#include <resolv.h>
#include <stdio.h>
#include <resolv.h>
#include <ctype.h>
#if defined(BSD) && (BSD >= 199103)
# include <unistd.h>
@@ -75,17 +74,8 @@ static char rcsid[] = "$Id: res_comp.c,v 8.13 1998/04/07 04:24:06 vixie Exp $";
# include "../conf/portability.h"
#endif
static int ns_name_ntop __P((const u_char *, char *, size_t));
static int ns_name_pton __P((const char *, u_char *, size_t));
static int ns_name_unpack __P((const u_char *, const u_char *,
const u_char *, u_char *, size_t));
static int ns_name_pack __P((const u_char *, u_char *, int,
const u_char **, const u_char **));
static int ns_name_uncompress __P((const u_char *, const u_char *,
const u_char *, char *, size_t));
static int ns_name_compress __P((const char *, u_char *, size_t,
const u_char **, const u_char **));
static int ns_name_skip __P((const u_char **, const u_char *));
static int dn_find __P((u_char *exp_dn, u_char *msg,
u_char **dnptrs, u_char **lastdnptr));
/*
* Expand compressed domain name 'comp_dn' to full domain name.
@@ -95,40 +85,261 @@ static int ns_name_skip __P((const u_char **, const u_char *));
* Return size of compressed name or -1 if there was an error.
*/
int
dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
char *dst, int dstsiz)
dn_expand(msg, eomorig, comp_dn, exp_dn, length)
const u_char *msg, *eomorig, *comp_dn;
char *exp_dn;
int length;
{
int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
register const u_char *cp;
register char *dn;
register int n, c;
char *eom;
int len = -1, checked = 0, octets = 0;
if (n > 0 && dst[0] == '.')
dst[0] = '\0';
return (n);
dn = exp_dn;
cp = comp_dn;
eom = exp_dn + length;
/*
* fetch next label in domain name
*/
while (n = *cp++) {
/*
* Check for indirection
*/
switch (n & INDIR_MASK) {
case 0:
octets += (n + 1);
if (octets > MAXCDNAME)
return (-1);
if (dn != exp_dn) {
if (dn >= eom)
return (-1);
*dn++ = '.';
}
if (dn+n >= eom)
return (-1);
checked += n + 1;
while (--n >= 0) {
if (((c = *cp++) == '.') || (c == '\\')) {
if (dn + n + 2 >= eom)
return (-1);
*dn++ = '\\';
}
*dn++ = c;
if (cp >= eomorig) /* out of range */
return (-1);
}
break;
case INDIR_MASK:
if (len < 0)
len = cp - comp_dn + 1;
cp = msg + (((n & 0x3f) << 8) | (*cp & 0xff));
if (cp < msg || cp >= eomorig) /* out of range */
return (-1);
checked += 2;
/*
* Check for loops in the compressed name;
* if we've looked at the whole message,
* there must be a loop.
*/
if (checked >= eomorig - msg)
return (-1);
break;
default:
return (-1); /* flag error */
}
}
*dn = '\0';
if (len < 0)
len = cp - comp_dn;
return (len);
}
/*
* Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
* Compress domain name 'exp_dn' into 'comp_dn'.
* Return the size of the compressed name or -1.
* 'length' is the size of the array pointed to by 'comp_dn'.
* 'dnptrs' is a list of pointers to previous compressed names. dnptrs[0]
* is a pointer to the beginning of the message. The list ends with NULL.
* 'lastdnptr' is a pointer to the end of the arrary pointed to
* by 'dnptrs'. Side effect is to update the list of pointers for
* labels inserted into the message as we compress the name.
* If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
* is NULL, we don't update the list.
*/
int
dn_comp(const char *src, u_char *dst, int dstsiz,
u_char **dnptrs, u_char **lastdnptr)
dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr)
const char *exp_dn;
u_char *comp_dn, **dnptrs, **lastdnptr;
int length;
{
return (ns_name_compress(src, dst, (size_t)dstsiz,
(const u_char **)dnptrs,
(const u_char **)lastdnptr));
register u_char *cp, *dn;
register int c, l;
u_char **cpp, **lpp, *sp, *eob;
u_char *msg;
dn = (u_char *)exp_dn;
cp = comp_dn;
if (length > MAXCDNAME)
length = MAXCDNAME;
eob = cp + length;
lpp = cpp = NULL;
if (dnptrs != NULL) {
if ((msg = *dnptrs++) != NULL) {
for (cpp = dnptrs; *cpp != NULL; cpp++)
;
lpp = cpp; /* end of list to search */
}
} else
msg = NULL;
for (c = *dn++; c != '\0'; ) {
/* look to see if we can use pointers */
if (msg != NULL) {
if ((l = dn_find(dn-1, msg, dnptrs, lpp)) >= 0) {
if (cp+1 >= eob)
return (-1);
*cp++ = (l >> 8) | INDIR_MASK;
*cp++ = l % 256;
return (cp - comp_dn);
}
/* not found, save it */
if (lastdnptr != NULL && cpp < lastdnptr-1) {
*cpp++ = cp;
*cpp = NULL;
}
}
sp = cp++; /* save ptr to length byte */
do {
if (c == '.') {
c = *dn++;
break;
}
if (c == '\\') {
if ((c = *dn++) == '\0')
break;
}
if (cp >= eob) {
if (msg != NULL)
*lpp = NULL;
return (-1);
}
*cp++ = c;
} while ((c = *dn++) != '\0');
/* catch trailing '.'s but not '..' */
if ((l = cp - sp - 1) == 0 && c == '\0') {
cp--;
break;
}
if (l <= 0 || l > MAXLABEL) {
if (msg != NULL)
*lpp = NULL;
return (-1);
}
*sp = l;
}
if (cp >= eob) {
if (msg != NULL)
*lpp = NULL;
return (-1);
}
*cp++ = '\0';
return (cp - comp_dn);
}
/*
* Skip over a compressed domain name. Return the size or -1.
*/
int
__dn_skipname(const u_char *ptr, const u_char *eom) {
const u_char *saveptr = ptr;
__dn_skipname(comp_dn, eom)
const u_char *comp_dn, *eom;
{
register const u_char *cp;
register int n;
if (ns_name_skip(&ptr, eom) == -1)
cp = comp_dn;
while (cp < eom && (n = *cp++)) {
/*
* check for indirection
*/
switch (n & INDIR_MASK) {
case 0: /* normal case, n == len */
cp += n;
continue;
case INDIR_MASK: /* indirection */
cp++;
break;
default: /* illegal type */
return (-1);
}
break;
}
if (cp > eom)
return (-1);
return (ptr - saveptr);
return (cp - comp_dn);
}
static int
mklower(ch)
register int ch;
{
if (isascii(ch) && isupper(ch))
return (tolower(ch));
return (ch);
}
/*
* Search for expanded name from a list of previously compressed names.
* Return the offset from msg if found or -1.
* dnptrs is the pointer to the first name on the list,
* not the pointer to the start of the message.
*/
static int
dn_find(exp_dn, msg, dnptrs, lastdnptr)
u_char *exp_dn, *msg;
u_char **dnptrs, **lastdnptr;
{
register u_char *dn, *cp, **cpp;
register int n;
u_char *sp;
for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
dn = exp_dn;
sp = cp = *cpp;
while (n = *cp++) {
/*
* check for indirection
*/
switch (n & INDIR_MASK) {
case 0: /* normal case, n == len */
while (--n >= 0) {
if (*dn == '.')
goto next;
if (*dn == '\\')
dn++;
if (mklower(*dn++) != mklower(*cp++))
goto next;
}
if ((n = *dn++) == '\0' && *cp == '\0')
return (sp - msg);
if (n == '.')
continue;
goto next;
case INDIR_MASK: /* indirection */
cp = msg + (((n & 0x3f) << 8) | *cp);
break;
default: /* illegal type */
return (-1);
}
}
if (*dn == '\0')
return (sp - msg);
next: ;
}
return (-1);
}
/*
@@ -298,640 +509,3 @@ __putlong(l, msgp)
{
PUTLONG(l, msgp);
}
/* ++ From BIND 8.1.1. ++ */
/*
* Copyright (c) 1996 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/*"Id: ns_name.c,v 1.1 1997/12/13 02:41:13 vixie Exp vixie"*/
/*#include "port_before.h"*/
/*#include <sys/types.h>*/
/*#include <netinet/in.h>*/
/*#include <arpa/nameser.h>*/
/*#include <errno.h>*/
/*#include <resolv.h>*/
/*#include <string.h>*/
/*#include "port_after.h"*/
#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
#define NS_MAXCDNAME 255 /* maximum compressed domain name */
/* Data. */
static char digits[] = "0123456789";
/* Forward. */
static int special(int);
static int printable(int);
static int dn_find(const u_char *, const u_char *,
const u_char * const *,
const u_char * const *);
/* Public. */
/*
* ns_name_ntop(src, dst, dstsiz)
* Convert an encoded domain name to printable ascii as per RFC1035.
* return:
* Number of bytes written to buffer, or -1 (with errno set)
* notes:
* The root is returned as "."
* All other domains are returned in non absolute form
*/
static int
ns_name_ntop(src, dst, dstsiz)
const u_char *src;
char *dst;
size_t dstsiz;
{
const u_char *cp;
char *dn, *eom;
u_char c;
u_int n;
cp = src;
dn = dst;
eom = dst + dstsiz;
while ((n = *cp++) != 0) {
if ((n & NS_CMPRSFLGS) != 0) {
/* Some kind of compression pointer. */
errno = EMSGSIZE;
return (-1);
}
if (dn != dst) {
if (dn >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = '.';
}
if (dn + n >= eom) {
errno = EMSGSIZE;
return (-1);
}
for ((void)NULL; n > 0; n--) {
c = *cp++;
if (special(c)) {
if (dn + 1 >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = '\\';
*dn++ = (char)c;
} else if (!printable(c)) {
if (dn + 3 >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = '\\';
*dn++ = digits[c / 100];
*dn++ = digits[(c % 100) / 10];
*dn++ = digits[c % 10];
} else {
if (dn >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = (char)c;
}
}
}
if (dn == dst) {
if (dn >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = '.';
}
if (dn >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = '\0';
return (dn - dst);
}
/*
* ns_name_pton(src, dst, dstsiz)
* Convert a ascii string into an encoded domain name as per RFC1035.
* return:
* -1 if it fails
* 1 if string was fully qualified
* 0 is string was not fully qualified
* notes:
* Enforces label and domain length limits.
*/
static int
ns_name_pton(src, dst, dstsiz)
const char *src;
u_char *dst;
size_t dstsiz;
{
u_char *label, *bp, *eom;
int c, n, escaped;
char *cp;
escaped = 0;
bp = dst;
eom = dst + dstsiz;
label = bp++;
while ((c = *src++) != 0) {
if (escaped) {
if ((cp = strchr(digits, c)) != NULL) {
n = (cp - digits) * 100;
if ((c = *src++) == 0 ||
(cp = strchr(digits, c)) == NULL) {
errno = EMSGSIZE;
return (-1);
}
n += (cp - digits) * 10;
if ((c = *src++) == 0 ||
(cp = strchr(digits, c)) == NULL) {
errno = EMSGSIZE;
return (-1);
}
n += (cp - digits);
if (n > 255) {
errno = EMSGSIZE;
return (-1);
}
c = n;
}
escaped = 0;
} else if (c == '\\') {
escaped = 1;
continue;
} else if (c == '.') {
c = (bp - label - 1);
if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
errno = EMSGSIZE;
return (-1);
}
if (label >= eom) {
errno = EMSGSIZE;
return (-1);
}
*label = c;
/* Fully qualified ? */
if (*src == '\0') {
if (c != 0) {
if (bp >= eom) {
errno = EMSGSIZE;
return (-1);
}
*bp++ = '\0';
}
if ((bp - dst) > MAXCDNAME) {
errno = EMSGSIZE;
return (-1);
}
return (1);
}
if (c == 0) {
errno = EMSGSIZE;
return (-1);
}
label = bp++;
continue;
}
if (bp >= eom) {
errno = EMSGSIZE;
return (-1);
}
*bp++ = (u_char)c;
}
c = (bp - label - 1);
if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
errno = EMSGSIZE;
return (-1);
}
if (label >= eom) {
errno = EMSGSIZE;
return (-1);
}
*label = c;
if (c != 0) {
if (bp >= eom) {
errno = EMSGSIZE;
return (-1);
}
*bp++ = 0;
}
if ((bp - dst) > MAXCDNAME) { /* src too big */
errno = EMSGSIZE;
return (-1);
}
return (0);
}
/*
* ns_name_unpack(msg, eom, src, dst, dstsiz)
* Unpack a domain name from a message, source may be compressed.
* return:
* -1 if it fails, or consumed octets if it succeeds.
*/
static int
ns_name_unpack(msg, eom, src, dst, dstsiz)
const u_char *msg;
const u_char *eom;
const u_char *src;
u_char *dst;
size_t dstsiz;
{
const u_char *srcp, *dstlim;
u_char *dstp;
int n, c, len, checked;
len = -1;
checked = 0;
dstp = dst;
srcp = src;
dstlim = dst + dstsiz;
if (srcp < msg || srcp >= eom) {
errno = EMSGSIZE;
return (-1);
}
/* Fetch next label in domain name. */
while ((n = *srcp++) != 0) {
/* Check for indirection. */
switch (n & NS_CMPRSFLGS) {
case 0:
/* Limit checks. */
if (dstp + n + 1 >= dstlim || srcp + n >= eom) {
errno = EMSGSIZE;
return (-1);
}
checked += n + 1;
*dstp++ = n;
memcpy(dstp, srcp, n);
dstp += n;
srcp += n;
break;
case NS_CMPRSFLGS:
if (srcp >= eom) {
errno = EMSGSIZE;
return (-1);
}
if (len < 0)
len = srcp - src + 1;
srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff));
if (srcp < msg || srcp >= eom) { /* Out of range. */
errno = EMSGSIZE;
return (-1);
}
checked += 2;
/*
* Check for loops in the compressed name;
* if we've looked at the whole message,
* there must be a loop.
*/
if (checked >= eom - msg) {
errno = EMSGSIZE;
return (-1);
}
break;
default:
errno = EMSGSIZE;
return (-1); /* flag error */
}
}
*dstp = '\0';
if (len < 0)
len = srcp - src;
return (len);
}
/*
* ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
* Pack domain name 'domain' into 'comp_dn'.
* return:
* Size of the compressed name, or -1.
* notes:
* 'dnptrs' is an array of pointers to previous compressed names.
* dnptrs[0] is a pointer to the beginning of the message. The array
* ends with NULL.
* 'lastdnptr' is a pointer to the end of the array pointed to
* by 'dnptrs'.
* Side effects:
* The list of pointers in dnptrs is updated for labels inserted into
* the message as we compress the name. If 'dnptr' is NULL, we don't
* try to compress names. If 'lastdnptr' is NULL, we don't update the
* list.
*/
static int
ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
const u_char *src;
u_char *dst;
int dstsiz;
const u_char **dnptrs;
const u_char **lastdnptr;
{
u_char *dstp;
const u_char **cpp, **lpp, *eob, *msg;
const u_char *srcp;
int n, l;
srcp = src;
dstp = dst;
eob = dstp + dstsiz;
lpp = cpp = NULL;
if (dnptrs != NULL) {
if ((msg = *dnptrs++) != NULL) {
for (cpp = dnptrs; *cpp != NULL; cpp++)
(void)NULL;
lpp = cpp; /* end of list to search */
}
} else
msg = NULL;
/* make sure the domain we are about to add is legal */
l = 0;
do {
n = *srcp;
if ((n & NS_CMPRSFLGS) != 0) {
errno = EMSGSIZE;
return (-1);
}
l += n + 1;
if (l > MAXCDNAME) {
errno = EMSGSIZE;
return (-1);
}
srcp += n + 1;
} while (n != 0);
srcp = src;
do {
/* Look to see if we can use pointers. */
n = *srcp;
if (n != 0 && msg != NULL) {
l = dn_find(srcp, msg, (const u_char * const *)dnptrs,
(const u_char * const *)lpp);
if (l >= 0) {
if (dstp + 1 >= eob) {
errno = EMSGSIZE;
return (-1);
}
*dstp++ = (l >> 8) | NS_CMPRSFLGS;
*dstp++ = l % 256;
return (dstp - dst);
}
/* Not found, save it. */
if (lastdnptr != NULL && cpp < lastdnptr - 1 &&
(dstp - msg) < 0x4000) {
*cpp++ = dstp;
*cpp = NULL;
}
}
/* copy label to buffer */
if (n & NS_CMPRSFLGS) { /* Should not happen. */
errno = EMSGSIZE;
return (-1);
}
if (dstp + 1 + n >= eob) {
errno = EMSGSIZE;
return (-1);
}
memcpy(dstp, srcp, n + 1);
srcp += n + 1;
dstp += n + 1;
} while (n != 0);
if (dstp > eob) {
if (msg != NULL)
*lpp = NULL;
errno = EMSGSIZE;
return (-1);
}
return (dstp - dst);
}
/*
* ns_name_uncompress(msg, eom, src, dst, dstsiz)
* Expand compressed domain name to presentation format.
* return:
* Number of bytes read out of `src', or -1 (with errno set).
* note:
* Root domain returns as "." not "".
*/
static int
ns_name_uncompress(msg, eom, src, dst, dstsiz)
const u_char *msg;
const u_char *eom;
const u_char *src;
char *dst;
size_t dstsiz;
{
u_char tmp[NS_MAXCDNAME];
int n;
if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1)
return (-1);
if (ns_name_ntop(tmp, dst, dstsiz) == -1)
return (-1);
return (n);
}
/*
* ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr)
* Compress a domain name into wire format, using compression pointers.
* return:
* Number of bytes consumed in `dst' or -1 (with errno set).
* notes:
* 'dnptrs' is an array of pointers to previous compressed names.
* dnptrs[0] is a pointer to the beginning of the message.
* The list ends with NULL. 'lastdnptr' is a pointer to the end of the
* array pointed to by 'dnptrs'. Side effect is to update the list of
* pointers for labels inserted into the message as we compress the name.
* If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
* is NULL, we don't update the list.
*/
static int
ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr)
const char *src;
u_char *dst;
size_t dstsiz;
const u_char **dnptrs;
const u_char **lastdnptr;
{
u_char tmp[NS_MAXCDNAME];
if (ns_name_pton(src, tmp, sizeof tmp) == -1)
return (-1);
return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr));
}
/*
* ns_name_skip(ptrptr, eom)
* Advance *ptrptr to skip over the compressed name it points at.
* return:
* 0 on success, -1 (with errno set) on failure.
*/
static int
ns_name_skip(ptrptr, eom)
const u_char **ptrptr;
const u_char *eom;
{
const u_char *cp;
u_int n;
cp = *ptrptr;
while (cp < eom && (n = *cp++) != 0) {
/* Check for indirection. */
switch (n & NS_CMPRSFLGS) {
case 0: /* normal case, n == len */
cp += n;
continue;
case NS_CMPRSFLGS: /* indirection */
cp++;
break;
default: /* illegal type */
errno = EMSGSIZE;
return (-1);
}
break;
}
if (cp > eom) {
errno = EMSGSIZE;
return (-1);
}
*ptrptr = cp;
return (0);
}
/* Private. */
/*
* special(ch)
* Thinking in noninternationalized USASCII (per the DNS spec),
* is this characted special ("in need of quoting") ?
* return:
* boolean.
*/
static int
special(ch)
int ch;
{
switch (ch) {
case 0x22: /* '"' */
case 0x2E: /* '.' */
case 0x3B: /* ';' */
case 0x5C: /* '\\' */
/* Special modifiers in zone files. */
case 0x40: /* '@' */
case 0x24: /* '$' */
return (1);
default:
return (0);
}
}
/*
* printable(ch)
* Thinking in noninternationalized USASCII (per the DNS spec),
* is this character visible and not a space when printed ?
* return:
* boolean.
*/
static int
printable(ch)
int ch;
{
return (ch > 0x20 && ch < 0x7f);
}
/*
* Thinking in noninternationalized USASCII (per the DNS spec),
* convert this character to lower case if it's upper case.
*/
static int
mklower(ch)
int ch;
{
if (ch >= 0x41 && ch <= 0x5A)
return (ch + 0x20);
return (ch);
}
/*
* dn_find(domain, msg, dnptrs, lastdnptr)
* Search for the counted-label name in an array of compressed names.
* return:
* offset from msg if found, or -1.
* notes:
* dnptrs is the pointer to the first name on the list,
* not the pointer to the start of the message.
*/
static int
dn_find(domain, msg, dnptrs, lastdnptr)
const u_char *domain;
const u_char *msg;
const u_char * const *dnptrs;
const u_char * const *lastdnptr;
{
const u_char *dn, *cp, *sp;
const u_char * const *cpp;
u_int n;
for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
dn = domain;
sp = cp = *cpp;
while ((n = *cp++) != 0) {
/*
* check for indirection
*/
switch (n & NS_CMPRSFLGS) {
case 0: /* normal case, n == len */
if (n != *dn++)
goto next;
for ((void)NULL; n > 0; n--)
if (mklower(*dn++) != mklower(*cp++))
goto next;
/* Is next root for both ? */
if (*dn == '\0' && *cp == '\0')
return (sp - msg);
if (*dn)
continue;
goto next;
case NS_CMPRSFLGS: /* indirection */
cp = msg + (((n & 0x3f) << 8) | *cp);
break;
default: /* illegal type */
errno = EMSGSIZE;
return (-1);
}
}
next: ;
}
errno = ENOENT;
return (-1);
}
/* -- From BIND 8.1.1. -- */
+4 -40
View File
@@ -55,7 +55,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "$Id: res_send.c,v 8.14 1998/04/07 04:59:46 vixie Exp $";
static char rcsid[] = "$Id: res_send.c,v 8.13 1997/06/01 20:34:37 vixie Exp $";
#endif /* LIBC_SCCS and not lint */
/* change this to "0"
@@ -214,8 +214,6 @@ res_isourserver(inp)
/* int
* res_nameinquery(name, type, class, buf, eom)
* look for (name,type,class) in the query section of packet (buf,eom)
* requires:
* buf + HFIXESDZ <= eom
* returns:
* -1 : format error
* 0 : not found
@@ -240,8 +238,6 @@ res_nameinquery(name, type, class, buf, eom)
if (n < 0)
return (-1);
cp += n;
if (cp + 2 * INT16SZ > eom)
return (-1);
ttype = _getshort(cp); cp += INT16SZ;
tclass = _getshort(cp); cp += INT16SZ;
if (ttype == type &&
@@ -271,9 +267,6 @@ res_queriesmatch(buf1, eom1, buf2, eom2)
register const u_char *cp = buf1 + HFIXEDSZ;
int qdcount = ntohs(((HEADER*)buf1)->qdcount);
if (buf1 + HFIXEDSZ > eom1 || buf2 + HFIXEDSZ > eom2)
return (-1);
if (qdcount != ntohs(((HEADER*)buf2)->qdcount))
return (0);
while (qdcount-- > 0) {
@@ -284,8 +277,6 @@ res_queriesmatch(buf1, eom1, buf2, eom2)
if (n < 0)
return (-1);
cp += n;
if (cp + 2 * INT16SZ > eom1)
return (-1);
ttype = _getshort(cp); cp += INT16SZ;
tclass = _getshort(cp); cp += INT16SZ;
if (!res_nameinquery(tname, ttype, tclass, buf2, eom2))
@@ -311,10 +302,6 @@ res_send(buf, buflen, ans, anssiz)
/* errno should have been set by res_init() in this case. */
return (-1);
}
if (anssiz < HFIXEDSZ) {
errno = EINVAL;
return (-1);
}
DprintQ((_res.options & RES_DEBUG) || (_res.pfcode & RES_PRF_QUERY),
(stdout, ";; res_send()\n"), buf, buflen);
v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ;
@@ -459,17 +446,6 @@ read_len:
len = anssiz;
} else
len = resplen;
if (len < HFIXEDSZ) {
/*
* Undersized message.
*/
Dprint(_res.options & RES_DEBUG,
(stdout, ";; undersized: %d\n", len));
terrno = EMSGSIZE;
badns |= (1 << ns);
res_close();
goto next_ns;
}
cp = ans;
while (len != 0 &&
(n = read(s, (char *)cp, (int)len)) > 0) {
@@ -625,12 +601,12 @@ read_len:
if ((long) timeout.tv_sec <= 0)
timeout.tv_sec = 1;
timeout.tv_usec = 0;
wait:
if (s < 0 || s >= FD_SETSIZE) {
Perror(stderr, "s out-of-bounds", EMFILE);
if (s+1 > FD_SETSIZE) {
Perror(stderr, "s+1 > FD_SETSIZE", EMFILE);
res_close();
goto next_ns;
}
wait:
FD_ZERO(&dsmask);
FD_SET(s, &dsmask);
n = select(s+1, &dsmask, (fd_set *)NULL,
@@ -662,18 +638,6 @@ read_len:
goto next_ns;
}
gotsomewhere = 1;
if (resplen < HFIXEDSZ) {
/*
* Undersized message.
*/
Dprint(_res.options & RES_DEBUG,
(stdout, ";; undersized: %d\n",
resplen));
terrno = EMSGSIZE;
badns |= (1 << ns);
res_close();
goto next_ns;
}
if (hp->id != anhp->id) {
/*
* response from old query, ignore it.
+24 -39
View File
@@ -1,12 +1,12 @@
See the Cederqvist manual (cvs.texinfo) for information on how to
report bugs (and what will happen to your bug reports if you do).
See the README file for information on how to report bugs (and what
will happen to your bug reports if you do).
The following is a list of some of the known bugs. It may or may not
be comprehensive. We would dearly love for people to volunteer to
help us keep it up to date (for starters, if you notice any
inaccuracies, please let bug-cvs know as described in the Cederqvist
manual). There are some other reported bugs in MINOR-BUGS; the
difference, at least in theory, is that those bugs are less serious.
inaccuracies, please let bug-cvs know as described in README). There
are some other reported bugs in MINOR-BUGS; the difference, at least
in theory, is that those bugs are less serious.
* For platform-specific information (in some cases including known
@@ -15,45 +15,25 @@ similar file for the unix-like operating systems (not yet, at least).
This file also might contain some platform-specific bugs.
* One cannot specify some files as binary in a "cvs import" using
CVSROOT/cvswrappers (for why, note that client_process_import_file has
no way of knowing about CVSROOT/cvswrappers which is off on the
server).
* Exporting binary files on non-unix clients with "cvs export" does
not work. The workaround is to use "cvs checkout" instead. If you
are thinking of fixing this, check out the comment "For cvs export,
assume it is a text file." in client.c.
* I don't think that "cvs add" honors any of the -k wrappers, at least
not in client/server mode. I would think it should. Getting
CVSROOT/cvswrappers to work would presumably best be done by keeping a
copy of it in the CVS directory on the client, as has also been
discussed for CVS/Template, &c. Getting a client-side .cvswrappers to
work is a separate issue.
* Need more work on the procedure for fixing it if a binary file is
accidentally added in text mode (sanity.sh test cases, better
documentation, probably update and/or admin -kb should update
the -k setting in CVS/Entries).
* Wrappers (-t/-f) do not work client/server, and there are a variety of other
* Wrappers do not work client/server, and there are a variety of other
bugs and annoyances with wrappers.
* If your login name contains a space or various other characters
(particularly an issue on Windows), CVS will have trouble (it will
write invalid RCS files, probably). The fix would be to have CVS
change such characters to underscores before writing them to the RCS
file. Furthermore, the LOGNAME or USER environment variables usually
won't override the system login name, so this can be hard to work
around.
* If you specify the -w global option to client/server CVS, it only
overrides a CVSREAD environment variable set on the client, not a
CVSREAD variable which was set on the server (for example, in .bashrc
when the server was run via rsh). The fix of course will be to
provide a "Option-read-write" request which sends -w, in addition to
"Global_option -r" which sends -r.
* Some people have reported seeing the message "dying gasps from %s
unexpected" (where %s is the name of your server) when using
client/server CVS. One person reported that this had to do with using
pserver and trying to run a program not in the PATH (which is set up
by inetd, I think) from one of the *info scripts. But noone has
carefully tracked this down (is it caused by something in the server
writing to stdout or stderr when it shouldn't? But then wouldn't the
"dying gasps" message be preceded by "warning: unrecognized response
`%s' from cvs server"?).
* "make remotecheck" sometimes fails on test 187a3 with
@@ -77,6 +57,11 @@ file's description.
(and from the repository)?
* `cvs checkout -d nested/dir/path <module>' just doesn't work. The
simpler version -- `cvs checkout -d single-dir <module>' works,
however.
* The following bug was reported against CVS 1.9:
Create a module named test with a file named test in it.
-523
View File
@@ -1,526 +1,3 @@
1998-03-04 Jim Kingdon <[email protected]>
* acconfig.h, configure.in: Add PRESERVE_PERMISSIONS_SUPPORT and
always define it.
* configure, config.h.in: Regenerated.
Tue Feb 17 18:32:36 1998 Ian Lance Taylor <[email protected]>
* configure.in: Add memmove back to AC_REPLACE_FUNCS list.
* configure: Rebuild.
1998-02-16 Jim Kingdon <[email protected]>
* TODO (190): Remove "failed to check out" from commit.c from
lists of error messages suppressed by -q; it no longer is.
4 Feb 1998 Jim Kingdon
* cvsnt.mak: The usual "because Visual C++ feels like it"
changes. These ones seem to have to do with reordering
files and release versus debug configurations, mainly.
Fri Jan 30 10:37:40 1998 Jim Kingdon <[email protected]>
* INSTALL: Update which version of CVS was tested with EMX.
15 Jan 1998 W. L. Estes <[email protected]>
and Jim Kingdon <[email protected]>
* cvs.spec, Makefile.in: Fix some problems with the spec file
distributed with cvs. RPM chokes on a build root of slash, so
that is gone now. CVS is relocatable (as far as I know) so I
added a prefix tag. The source location was incorrect and in
fixing that I had to add a `g' flag to one of the sed commands in
the Makefile.in so the spec file gets generated correctly.
13 Jan 1998 Jim Kingdon
* cvsnt.mak: Add lib/fncase.c. Plus of course the usual
"because Visual C++ feels like it" changes.
Tue Jan 13 16:49:38 1998 Ian Lance Taylor <[email protected]>
* acconfig.h (USE_SETMODE_STDOUT): Add undef line.
(HAVE_SETMODE): Likewise.
* configure.in: If cygwin32, define USE_SETMODE_STDOUT and
HAVE_SETMODE.
* configure, config.h.in: Regenerate.
* acconfig.h (UTIME_EXPECTS_WRITABLE): Add undef line.
* configure.in: If cygwin32, define UTIME_EXPECTS_WRITABLE.
* configure, config.h.in: Regenerate.
* configure.in: Add test for cygwin32, and set LIBOBJS and LIBS
accordingly.
* configure: Regenerate.
Sun Jan 11 11:43:55 1998 Jim Kingdon <[email protected]>
* HACKING: Add example of indentation for switch statement. I
always have to look this one up, and it seems worthwhile to
specify it here rather than be unsure which switch statement in
CVS to use as an example.
Wed Jan 7 09:41:08 1998 Jim Kingdon <[email protected]>
* TODO: Revise item 149 (concerning changing CVS/Root and such).
"This whole area is a rather bad pile of individual decisions which
accumulated over time, some of them probably bad decisions with
hindsight."
Wed Dec 31 09:25:20 1997 Jim Kingdon <[email protected]>
* FAQ: Re-import from FAQ-O-Matic. Features a change regarding
removing directories.
Tue Dec 23 08:28:44 1997 Jim Kingdon <[email protected]>
* README.VMS, INSTALL, HACKING, BUGS, README: Change bug-cvs
address from prep.ai.mit.edu to gnu.org per email from Martin
Hamilton. When referring to bug-reporting procedure refer to
Cederqvist not README.
Tue Dec 16 13:13:53 1997 Jim Kingdon <[email protected]>
* FAQ: Re-import from FAQ-O-Matic. The content is the same, but
instead of being from Mosaic, it is from "lynx -dump -nolist".
This output is somewhat better (for example, it is formatted for
80 columns or so, rather than Mosaic which is rather
inconsistent), and also lynx is free and still maintained whereas
NCSA Mosaic is proprietary and no longer maintained.
* FAQ: Re-import from FAQ-O-Matic. Features an update to the
Sablime question.
* NEWS: Add item about GSSAPI.
Fri Dec 12 14:00:57 1997 Ian Lance Taylor <[email protected]>
* configure.in: Add --with-gssapi option, and look for gssapi.h
and GSSAPI Kerberos v5 libraries.
* acconfig.h: Add HAVE_GSSAPI.
* configure, config.h.in: Regenerate.
Thu Dec 11 15:58:06 1997 Eric Mumpower <[email protected]>
* configure.in: Let --with-krb4 override the system Kerberos
header files and libraries, if any.
* configure: Regenerate.
Thu Dec 4 20:01:02 1997 Jim Kingdon <[email protected]>
* configure.in (AC_CHECK_FUNCS): Remove mempcpy per change to
src/rcs.c.
* configure: Regenerated (never was regenerated after getwd change).
1997-12-04 Jim Meyering <[email protected]>
* configure.in (AC_CHECK_FUNCS): Add mempcpy.
Thu Dec 4 10:42:32 1997 Jim Kingdon <[email protected]>
* BUGS: Update for kfogel .cvswrappers fix.
Tue Dec 2 22:14:03 1997 Jim Kingdon <[email protected]>
* MINOR-BUGS: Update per info-cvs mail from Steve Cameron.
1997-11-29 Jim Kingdon
* cvsnt.mak: Remove lib/getwd.c (see lib/ChangeLog for rationale).
* cvsnt.mak: The usual "because Developer Studio feels like
it" changes.
Sat Nov 29 22:10:32 1997 Jim Kingdon <[email protected]>
* configure.in (AC_REPLACE_FUNCS): Remove getwd (see lib/ChangeLog
for rationale).
Mon Nov 24 10:36:39 1997 Jim Kingdon <[email protected]>
* INSTALL: Update QNX information per email from Michael Hunter of
QNX.
Wed Nov 19 17:44:21 1997 Jim Kingdon <[email protected]>
* INSTALL: Add Sequent entry per bug-cvs report.
1997-11-17 Karl Fogel <[email protected]>
* BUGS: Remove item about exporting binary files to non-unix
clients; this is fixed.
Mon Nov 17 09:07:44 1997 Jim Kingdon <[email protected]>
* BUGS: Add yet another binary files problem.
1997-11-14 Karl Fogel <[email protected]>
* cvsnt.mak: updated for diff/ subdir.
Fri Nov 14 12:25:10 1997 Jim Kingdon <[email protected]>
* BUGS: Remove item about dying gasps message. At least one known
cause has been fixed.
Wed Nov 12 20:24:49 1997 Jim Kingdon <[email protected]>
* FAQ: Re-import from FAQ-O-Matic. Features a wording fix to
"What do I do first? How do I create a Repository?" and a
formatting fix (makes it clear which bullets are under what)
to "What is a module?"
* NEWS: Add item about RCS library. Remove item about RCSBIN in
CVSROOT/config.
* INSTALL: Simplify instructions to reflect the fact that one need
not any longer install RCS and GNU diff.
* PROJECTS: Remove item about RCS library; it is done.
Mon, 10 Nov 1997 Jim Kingdon
* cvsnt.dsp: For diff/diff.c, also look for include files in
diff directory. This means we get diff/system.h not lib/system.h.
Sun Nov 9 16:16:56 1997 Jim Kingdon <[email protected]>
* TODO (#195): New item, about rsync and such issues.
Thu Nov 6 14:29:14 1997 Jim Kingdon <[email protected]>
* TODO (#194): New item, about separated metadata.
* TODO (#186): Rewrite paragraph on CVSclusters to be clearer
about what this can do and why I think it is a cool idea.
Sun Nov 2 19:34:30 1997 Jim Kingdon <[email protected]>
* DEVEL-CVS: Wording fix: want to specify that new developers are
granted checkin access and the ability to send to devel-cvs, not
specify whether this is implemented via an "account" (whatever
that is) (editorial change, not run by devel-cvs).
Fri Oct 31 16:30:57 1997 Jim Kingdon <[email protected]>
* NEWS: Mention admin -o rev1::rev2.
Wed Oct 29 08:40:05 1997 Jim Kingdon <[email protected]>
* TODO: Add item 193, about alternatives to timestamps in CVS/Entries.
Tue Oct 28 19:59:48 1997 Jim Kingdon <[email protected]>
* TODO (190): "rcs failed" message is no longer affected by global
-q option.
1997-10-28 Jim Kingdon
* .cvsignore: Add Visual C++ files du jour, namely
{diff,vc50}.{pdb,idb,pch}.
* cvsnt.dsp: Add files for diff library. The custom build
stuff for diff/version.c and diff/diff.c was to deal with
there also being a src/version.c and src/diff.c. There
might be an easier way.
Mon Oct 27 11:21:15 1997 Jim Kingdon <[email protected]>
* FAQ: Re-import from FAQ-O-Matic. Features an edit from Larry
Jones regarding CVS on Windows.
Mon Oct 20 15:23:17 1997 Jim Kingdon <[email protected]>
* BUGS: Add item about spaces in login names.
Mon Oct 20 10:25:42 1997 Hannes R. Boehm <[email protected]>
* INSTALL (Tested platforms): Add Red Hat Linux 4.2.
Wed Oct 15 10:55:20 1997 Jim Kingdon <[email protected]>
* TODO (#192): Also mention issue with opening connections to new
servers if CVSROOT changes.
* TODO (#191): Add thoughts on external difference programs.
1997-10-11 Noel Cragg <[email protected]>
* BUGS: remove note about the `-d' flag bug that was just fixed.
* TODO: new item 192.
Thu Oct 9 12:59:28 1997 Jim Kingdon <[email protected]>
* TODO: Revise item #182 to be clearer and to point to the
unofficial patch.
Thu Sep 25 14:48:26 1997 Jim Kingdon <[email protected]>
* build.com: Also recurse into diff directory.
Wed Sep 24 10:35:50 1997 Jim Kingdon <[email protected]>
* configure.in: Don't check for system-supplied regex matcher; see
comment for rationale.
* configure: Regenerated.
Tue Sep 23 16:00:25 1997 Jim Kingdon <[email protected]>
* BUGS: Add item about cvs add and -k wrappers.
Mon Sep 22 11:21:11 1997 Jim Kingdon <[email protected]>
* TODO: Revise item #191 in response to xdelta 1.10 release and a
few other random thoughts.
Sun Sep 21 17:56:28 1997 Jim Kingdon <[email protected]>
* configure.in: Instead of checking for memchr, just define
HAVE_MEMCHR and HAVE_STRCHR.
Add comment about AC_FUNC_VFORK and vfork in general.
* acconfig.h: Add HAVE_MEMCHR and HAVE_STRCHR.
* configure, config.h.in: Regenerated.
* config.h.in: Regenerate using autoheader from autoconf 2.10.
Sat Sep 20 01:17:10 1997 Tim Pierce <[email protected]>
[notes: (1) includes the patches to config.h.in which he sent
(presumably generated), (2) I have omitted a change, which was
sent without a ChangeLog entry, to change re_exec to
re_compile_pattern in configure.in, (3) Also adds diff/Makefile in
AC_OUTPUT -kingdon]
* Makefile.in (USOURCE_SUBDIRS, check, remotecheck, installcheck):
Add diff.
Note that AC_CHECK_FUNCS(vfork)
has been replaced by AC_FUNC_VFORK... libdiff wants the more
specific test, and it seems unlikely to break CVS.
* configure.in: Add AC_FUNC_CLOSEDIR_VOID, AC_FUNC_VFORK,
AC_STRUCT_ST_BLKSIZE.
(AC_CHECK_HEADERS): Add limits.h and sys/file.h.
(AC_REPLACE_FUNCS): Add memchr.
(AC_CHECK_FUNCS): Remove vfork.
Fri Sep 19 09:59:33 1997 Jim Kingdon <[email protected]>
* TODO: Add item #191, concerning how to store binary files.
Wed Sep 17 16:13:49 1997 Jim Kingdon <[email protected]>
* TESTS: Add ideas about ability to pass spaces in arguments, and
stdin, to the program under test, as something to consider for the
different test frameworks.
Tue Sep 16 00:14:55 1997 Jim Kingdon <[email protected]>
* BUGS: Add item about importing binary files.
* TODO: Adjust item #150 to reflect the fact that the client is
not quite so mean about tossing the log message as it was.
Fri Sep 12 13:04:31 1997 Jim Kingdon <[email protected]>
* INSTALL: Update Windows entries per email from Greg Strockbine
<[email protected]>.
Thu Sep 11 15:03:21 1997 Jim Kingdon <[email protected]>
* TODO: New item #190, about meaning of -q and -Q global options.
Wed Sep 10 18:48:41 1997 Jim Kingdon <[email protected]>
* TODO: A few more thoughts on "cvs message" (item 150).
Tue Sep 9 22:20:15 1997 Jim Kingdon <[email protected]>
* README.VMS (Notes regarding compiling on VAX/VMS): Add item
about mode_t and pid_t.
Sun Sep 7 17:34:03 1997 Jim Kingdon <[email protected]>
* FAQ: Re-import from FAQ-O-Matic. The metavariables are back.
* FAQ: Re-import from FAQ-O-Matic. Features comment from
julian@whistle about update -r branch:date. It also clobbered the
metavariables (confusion about "<" as data vs. HTML tag I would
guess), which I plan on fixing in a moment.
* configure.in: Add comment about re_exec and regexp syntax.
* configure.in (AC_REPLACE_FUNCS): Remove strdup; CVS was long
ago converted to use its own routine xstrdup.
* configure: Regenerated.
Sat Sep 6 00:08:20 1997 Jim Kingdon <[email protected]>
* FAQ: Re-import from FAQ-O-Matic. In particular: GIC info
updated, binary files updated (e.g. -kb not -ko), rename database
and rCVS info updated (refer to TODO), tweaks to section on
contributing (HACKING, DEVEL-CVS, &c), Cyclic info updated
(e.g. remove Indiana address), usenet info updated
(e.g. comp.software.config-mgmt not gnu.*).
Fri Sep 5 20:46:26 1997 Jim Kingdon <[email protected]>
* FAQ: Add another introductory paragraph which talks about out of
date material from 1995 FAQ.
* FAQ: Re-import from FAQ-O-Matic. This was mainly as a proof of
concept that I could edit the Cygnus question and have the diffs
come out looking right (which worked), but I also discovered that
the previous checkin was truncated partway through.
* FAQ: Replace file with an introductory paragraph plus a
downloaded copy of Molli's FAQ-O-Matic. I believe the content
closely matches the 1995 Grubbs FAQ but because everything is
re-ordered it would be painstaking work to verify this.
Thu Sep 4 17:33:53 1997 Jim Kingdon <[email protected]>
* BUGS: Add item about -w global option and client/server.
Wed Sep 3 23:03:34 1997 Noel Cragg <[email protected]>
* TODO: Verbosify verbiage in item #189.
Wed Sep 3 14:14:54 1997 Jim Kingdon <[email protected]>
* TODO: Add item #189, concerning renames.
Sat Aug 30 03:26:57 1997 Jim Kingdon <[email protected]>
* TODO: Fix typo in Noel's change.
Sat Aug 30 03:17:36 1997 Noel Cragg <[email protected]>
* TODO: Add a header so emacs chooses the correct editing mode.
Made several entries more verbose (expanded some of the less
well-known acronyms and/or added pointers to further
documentation).
Wed Aug 20 09:51:52 1997 Jim Kingdon <[email protected]>
* INSTALL: Remove "SparcClassing" typo that has been there for
a while.
Wed Aug 20 09:51:52 1997 Jim Kingdon <[email protected]>
and Loren James Rittle <[email protected]>
* INSTALL: Update information for SunOS4, Solaris, Digital Unix,
and HPUX.
Fri Aug 15 16:42:12 1997 Jim Kingdon <[email protected]>
* INSTALL: Remove the "CVS 1.6" crud; it really isn't needed. Add
paragraph about the meaning of the last three arguments to cvs
import.
Thu Aug 14 14:42:53 1997 Jim Kingdon <[email protected]>
and Loren James Rittle <[email protected]>
* INSTALL: Update information for SunOS4 and Solaris.
Mon Aug 4 00:02:24 1997 Jim Kingdon <[email protected]>
* BUGS: Be specific about wrappers not working client/server.
Sat Aug 2 09:23:50 1997 Jim Kingdon <[email protected]>
* INSTALL: In step 4, be more generic (the CVS sources are just an
example, and people might not have them handy).
Fri Jul 25 17:02:30 1997 Jim Kingdon <[email protected]>
* INSTALL: Refer to cvs.texinfo as the Cederqvist manual; that
seems to be the description which best applies no matter how it
was obtained. Be a little more explicit about the "$" prompt
convention and setting environment variables. Use double quotes
because they work on both DOS and Unix.
Thu Jul 24 12:22:49 1997 Jim Kingdon <[email protected]>
* NEWS: Also mention SystemAuth.
* INSTALL (MIPS): Add more detailed report concerning Irix 6.2,
as reported by [email protected] (Larry Jones).
Tue Jul 22 17:35:31 1997 Jim Kingdon <[email protected]>
* INSTALL (PowerPC): Add item for Lynx 2.5.
21 Jul 1997 Jim Kingdon
* Makefile.in (DISTFILES): Add cvsnt.dsp.
Mon Jul 21 09:40:10 1997 Jim Kingdon <[email protected]>
* configure.in: Adjust comment regarding version of autoconf which
introduced --bindir.
Fri Jul 18 09:47:12 1997 Jim Kingdon <[email protected]>
* TODO: Remove item 161 (the comments in cvs.texinfo have a much
more complete discussion of date format issues). In item 30,
change "patch" to "rdiff" and expand discussion slightly. Remove
item 64 (the performance issues in initial checkout have probably
changed quite a bit since that was written and in any event it
isn't particularly useful without specifics of what is slow and
ideas for speeding it up).
* INSTALL: Reorganize to separate out building/installing CVS
executables from what to do once you have them. Adjust Visual C++
instructions to deal with Visual C++ 5.x. Add brief mentions of
platforms other than unix and Windows.
Thu Jul 17 21:13:16 1997 Jim Kingdon <[email protected]>
* TODO: In item 39, talk about how PRCS 1.2 as a possible model.
Sat Jul 12 15:43:01 1997 Jim Kingdon <[email protected]>
* HACKING: Rewrite paragraph on arbitrary limits to reflect the
fact that the known arbitrary limits are gone.
8 Jul 1997 Jim Kingdon
* cvsnt.dsp: Turn on browse information.
Thu Jul 3 10:07:01 1997 Jim Kingdon <[email protected]>
* INSTALL: Sending exact suggested text is almost as good as a diff.
* INSTALL (i386 family): Add lines about Watcom and EMX on OS/2.
* TODO: Add notes about popt and option parsing in general.
Wed Jul 2 13:11:03 1997 Jim Kingdon <[email protected]>
* TODO: Update item 149 to reflect CVS/Root.
* TODO: Add item 187, about usage errors vs. help messages.
Mon Jun 23 18:24:13 1997 Jim Kingdon <[email protected]>
* NEWS: Adjust mention of read-only access in the light of
changes to cvs.texinfo.
* TODO: Add item 186, concerning multisite.
Sun, 22 Jun 1997 Jim Kingdon
* cvsnt.dsp: New file. This apparently is what Visual C++ 5.0
uses in lieu of a .mak file (or so it seems).
* .cvsignore: Add cvsnt.opt cvsnt.dsw cvsnt.plg. These seem to
be the generated files du jour for Visual C++ 5.0.
Thu Jun 19 17:16:39 1997 Jim Kingdon <[email protected]>
* NEWS: Add item about CVSROOT/config.
Wed Jun 18 00:00:02 1997 Jim Kingdon <[email protected]>
* NEWS: Mention pserver --allow-root.
+1 -1
View File
@@ -50,7 +50,7 @@ interest), then one of the developers can ask the devel-cvs mailing
list whether it is OK to make this person a developer (after first
sending the prospective developer a copy of this file and then having
the prospective developer say they want to be a developer). If there
are no objections, the person will be made a developer.
are no objections, an account will be created.
----------------------------------------------------------------------
Policy regarding checkout-only access:
+11 -8585
View File
File diff suppressed because it is too large. Load diff
+1 -2
View File
@@ -13,12 +13,11 @@ lib/getdate.c
tools/pcl-cvs/*.ps
tools/pcl-cvs/*.aux
tools/pcl-cvs/texinfo.tex
cvsnt.*
cvsnt.mak
cvs.spec
build.com
src/build_src.com
lib/build_lib.com
diff/build_diff.com
README.VMS
The following non-freebsd-specific directories were deleted:
+8 -15
View File
@@ -28,12 +28,6 @@ foo (arg)
bar (arg);
baz (arg);
}
switch (c)
{
case 'A':
aflag = 1;
break;
}
}
The file cvs-format.el contains settings for emacs and the NEWS file
@@ -70,13 +64,12 @@ but we want to fix that code. Of course, bad input data, a corrupt
repository, bad options, etc., should always print a real error
message instead.
Do not use arbitrary limits (such as PATH_MAX) except perhaps when the
operating system or some external interface requires it. We spent a
lot of time getting rid of them, and we don't want to put them back.
If you find any that we missed, please report it as with other bugs.
In most cases such code will create security holes (for example, for
anonymous readonly access via the CVS protocol, or if a WWW cgi script
passes client-supplied arguments to CVS).
We realize that CVS contains many arbitrary limits (such as PATH_MAX).
Do not do this in new code; we are trying to *fix* those arbitrary
limits. In particular, it should be possible to pass very long
arguments (e.g. from a WWW cgi script) to CVS without having it
overrun any buffers (which might create a security hole in the WWW
example).
Although this is a long-term goal, it also would be nice to move CVS
in the direction of reentrancy. This reduces the size of the data
@@ -152,7 +145,7 @@ context diffs or unidiffs for patches.
Note that all submitted changes may be distributed under the terms of
the GNU Public License, so if you don't like this, don't submit them.
Submit changes to bug-cvs@gnu.org.
Submit changes to bug-cvs@prep.ai.mit.edu.
Generally speaking if you follow the guidelines in this file you can
expect a yes or no answer about whether your patch is accepted. But
@@ -192,7 +185,7 @@ test-results.
One other list related to CVS development is bug-cvs. This is the
list which users are requested to send bug reports to. Anyone can
subscribe; to do so send mail to bug-cvs-request@gnu.org.
subscribe; to do so send mail to bug-cvs-request@prep.ai.mit.edu.
Other CVS discussions take place on the info-cvs mailing list
(send mail to [email protected] to subscribe) or on
+98 -150
View File
@@ -1,106 +1,13 @@
First, read the README file. If you're still happy...
First you need to obtain and install the CVS executables. If you got
a distribution which contains executables, consult the installation
instructions for that distribution. If you got source code, do not
panic. On many platforms building CVS from source code is a
straightforward process requiring no programming knowledge. See the
section BUILDING FROM SOURCE CODE at the end of this file, which
includes a list of platforms which have been tested.
-------------------------------------------------------------------------------
1) Take a look at the CVS documentation, if desired. For most
purposes you want doc/cvs.texinfo, also known as _Version Management
with CVS_ by Per Cederqvist et al. Looking at it might be as simple
as "info cvs" but this will depend on your installation; see README
for more details.
See what CVS can do for you, and if it fits your environment (or can
possibly be made to fit your environment). If things look good,
continue on. Alternately, just give CVS a try first then figure out
what it is good for.
2) Set the CVSROOT environment variable to where you want to put your
source repository. See the "Setting up the repository" section of
the Cederqvist manual for details, but the quick summary is just to
pick some directory. We'll use /src/master as an example. For
users of a POSIX shell (sh/bash/ksh) on unix, the following
commands can be placed in user's ~/.profile, ~/.bash_profile file;
or in the site-wide /etc/profile:
CVSROOT=/src/master; export CVSROOT
For C shell users on unix place the following commands in the
user's ~/.cshrc, ~/.login, or /etc/chsrc file:
setenv CVSROOT /src/master
For Windows users, supposing the repository will be in
d:\src\master, place the following line in c:\autoexec.bat. On
Windows 95, autoexec.bat might not already exist. In that case,
just create a new file containing the following line.
set CVSROOT=:local:d:\src\master
If these environment variables are not already set in your current
shell, set them now by typing the above line at the command prompt
(or source the login script you just edited).
The instructions for the remaining steps assume that you have set
the CVSROOT environment variable.
3) Create the master source repository. Again, the details are in
the "Setting up the repository" section of cvs.texinfo; the
one-line summary is:
$ cvs init
In this and subsequent examples we use "$" to indicate the command
prompt; do not type the "$".
4) It might be a good idea to jump right in and put some sources or
documents directly under CVS control. From within the top-level
directory of your source tree, run the following commands:
$ cvs import -m "test distribution" ccvs CVS_DIST CVS-TEST
(Those last three items are, respectively, a repository location, a
"vendor tag", and a "release tag". You don't need to understand
them yet, but read the section "Starting new projects" in the
Cederqvist manual for details).
5) Having done step 4, one should be able to checkout a fresh copy of the
sources you just imported and hack away at the sources with the
following command:
$ cd
$ cvs checkout ccvs
This will make the directory "ccvs" in your current directory and
populate it with the appropriate files and directories.
6) You may wish to customize the various administrative files, in particular
modules. See the Cederqvist manual for details.
7) Read the NEWS file to see what's new.
8) Hack away.
-------------------------------------------------------------------------------
BUILDING FROM SOURCE CODE
Tested platforms
CVS has been tested on the following platforms. The most recent
version of CVS reported to have been tested is indicated, but more
recent versions of CVS probably will work too. Please send updates to
this list to bug-cvs@gnu.org (doing so in the form of a diff
to this file, or at least exact suggested text, is encouraged).
"tested" means, at a minimum, that CVS compiles and appears to work on
simple (manual) testing. In many cases it also means "make check"
and/or "make remotecheck" passes, but we don't try to list the
platforms for which that is true.
this list to bug-cvs@prep.ai.mit.edu (doing so in the form of a diff
to this file is encouraged). "tested" means, at a minimum, that CVS
compiles and appears to work on simple (manual) testing. In many
cases it also means "make check" and/or "make remotecheck" passes, but
we don't try to list the platforms for which that is true.
Alpha:
DEC Alpha running OSF/1 version 1.3 using cc (about 1.4A2)
@@ -108,7 +15,6 @@ Alpha:
DEC Alpha running OSF/1 version 2.1 (about 1.4A2)
DEC Alpha running OSF/1 version 3.0 (1.5.95) (footnote 7)
DEC Alpha running OSF/1 version 3.2 (1.9)
DEC Alpha running Digital UNIX v4.0C using gcc 2.7.2.2 (1.9.14)
DEC Alpha running VMS 6.2 (1.8.85 client-only)
Cray:
J90 (CVS 970215 snapshot)
@@ -116,11 +22,10 @@ Cray:
HPPA:
HP 9000/710 running HP-UX 8.07A using gcc (about 1.4A2)
HPPA running HP-UX 9 (1.8)
HPPA running HP-UX 10.01 (1.7)
HPPA 1.1 running HP-UX A.09.03 (1.5.95) (footnote 8)
HPPA 1.1 running HP-UX A.09.04 (1.7.1)
HPPA 9000/735 running HP-UX A.09.05 (1.8.87)
HPPA running HP-UX 10.01 (1.7)
HPPA running HP-UX 10.20 using gcc 2.7.2.2 (1.9.14)
NextSTEP 3.3 (1.7)
i386 family:
Solaris 2.4 using gcc (about 1.4A2)
@@ -128,23 +33,17 @@ i386 family:
Unixware 2.1 (1.8.86)
ISC 4.0.1 (1.8.87)
Linux (kernel 1.2.x) (1.8.86)
Linux (kernel 2.0.x, RedHat 4.2) (1.9)
BSDI 2.0 (1.4.93) (footnote 5)
FreeBSD 2.1.5-stable (1.8.87)
NextSTEP 3.3 (1.7)
SCO Unix 3.2.4.2, gcc 2.7.2 (1.8.87) (footnote 4)
SCO OpenServer 5 (1.8.86)
Sequent Dynix/PTX 4.1.4 (1.9.20 or so + patches)
Lynx 2.3.0 080695 (1.6.86) (footnote 9)
Windows NT 3.51 (1.8.86 client; 1.8.3 local)
Windows NT 3.51 service pack 4 (1.9)
Windows NT 3.51 service pack 5 (1.9) -- DOES NOT WORK (footnote 11)
Windows NT 4.0 (1.9 client and local)
Windows 95 (1.9 client and local)
QNX (1.9.1 + patches for strippath() and va_list)
Windows 95 (1.8.86 client and local)
QNX 4 (1.7 + obvious patches)
OS/2 Version 3 using IBM C/C++ Tools 2.01 (1.8.86 + patches, client)
OS/2 Version 3 using EMX 0.9c (1.9.22, client)
OS/2 Version 3 using Watcom version ? (? - has this been tested?)
m68k:
Sun 3 running SunOS 4.1.1_U1 w/ bundled K&R /usr/5bin/cc (1.8.86+)
NextSTEP 3.3p1 (1.8.87)
@@ -158,7 +57,6 @@ MIPS:
DECstation running Ultrix 4.3 (1.8.85)
SGI running Irix 4.0.5H using gcc and cc (about 1.4A2) (footnote 2)
SGI running Irix 5.3 using gcc 2.7.2 (1.8.87)
SGI running Irix 6.2 using SGI MIPSpro 6.2 and beta 7.2 compilers (1.9)
SGI running Irix-6.2 (1.9.8)
Siemens-Nixdorf RM600 running SINIX-Y (1.6)
PowerPC or RS/6000:
@@ -166,15 +64,13 @@ PowerPC or RS/6000:
IBM RS/6000 running AIX 3.2.5 (1.8)
IBM RS/6000 running AIX 4.1 using gcc and cc (about 1.4A2) (footnote 1)
Lynx 2.3.1 120495 (1.6.86) (footnote 9)
Lynx 2.5 (1.9) (footnote 10)
SPARC:
Sun SPARC running SunOS 4.1.x using gcc 2.7.2.1 (1.9.14)
Sun SPARC running SunOS 4.1.x (1.8.87)
Sun SPARCstation 10 running Solaris 2.3 using gcc and cc (about 1.4A2)
Sun SPARCstation running Solaris 2.4 using gcc and cc (about 1.5.91)
Sun SPARC running Solaris 2.5 (1.8.87)
Sun SPARC running Solaris 2.5.1 using gcc 2.7.2.2 (1.9.14)
NextSTEP 3.3 (1.7)
Sun SPARC running Linux 2.0.17, gcc 2.7.2 (1.8.87)
Sun SparcClassing running Linux 2.0.17, gcc 2.7.2 (1.8.87)
VAX:
VAX running VMS 6.2 (1.9+patches, client-only)
(see README.VMS for information on necessary hacks).
@@ -221,19 +117,11 @@ VAX:
So after running configure I had to undef HAVE_DIRENT_H and
define HAVE_SYS_DIR_H.
(footnote 10)
Had to compile with "make LIBS=-lbsd" (to get gethostbyname
and getservbyname).
(footnote 11)
when I do a `cvs init' I get this message:
ci: 'RCS/loginfo,v' is not a regular file
ci: RCS/loginfo,v: Invalid argument
cvs [init aborted]: failed to checkin n:/safe/CVSROOT/loginfo
-------------------------------------------------------------------------------
Building from source code under Unix:
Installation under Unix (if you got a binary distribution from
somewhere, install it according to procedure for that binary
distribution, then skip to step 5):
1) Run "configure":
@@ -260,8 +148,23 @@ Building from source code under Unix:
Typically this can reduce the size of the executable by around 30%.
Unlike previous versions of CVS, you do not need to install RCS
or GNU diff.
If you are using server or local CVS, RCS needs to be installed in
the user's PATH (or a path you have configured in src/options.h,
or a path specified with the -b option). If you don't have RCS,
you will need to get it from GNU as well. It is best to get the
version 5.7 (or later) version of RCS, available from
prep.ai.mit.edu in the file pub/gnu/rcs-5.7.tar.gz. If you do not
have RCS version 5.x (for example, if you are using the old RCS
shipped with some versions of HPUX), CVS will probably fail to work
entirely. To find out what version of RCS you have, invoke "co -V".
If it fails to print a version number, it is an old version.
If you want version control of files with binary data, make sure
that the RCS configure script finds GNU diff 1.15 or later and
notices that diff supports the -a option. CVS itself is much less
picky about which version of diff it uses, and you shouldn't need
to worry about that. If you are using GNU diff 2.6 or 2.7, you may
want to know about a (subtle) bug described in doc/DIFFUTILS-2.7-BUG.
NOTE: The configure program will cache the results of the previous
configure execution. If you need to re-run configure from scratch, you
@@ -318,8 +221,11 @@ Building from source code under Unix:
END OF NOTE FOR NDBM GUNK.
2) Edit src/options.h. The defaults should be reasonable, and in fact
if you are lazy you can safely skip this step.
2) Edit src/options.h. Appropriate things to look at may be the
invocation locations of programs like DIFF.
Also glance at the default values for the environment variables
that CVS uses, in particular, the RCSBIN variable, which holds the
path to where the RCS programs live on your system.
3) Try to build it:
@@ -351,6 +257,65 @@ Building from source code under Unix:
Depending on your installation's configuration, you may need to be
root to do this.
5) Take a look at the CVS documentation.
$ man cvs
and
$ info cvs
See what it can do for you, and if it fits your environment (or can
possibly be made to fit your environment). If things look good,
continue on...
6) Set up the master source repository. See the "Setting up the repository"
section of cvs.texinfo for details; the one-line summary is (if you
are putting the repository in /src/master):
$ cvs -d /src/master init
7) Have all users of the CVS system set the CVSROOT environment
variable appropriately to reflect the placement of your source
repository. If the above example is used, the following commands
can be placed in user's ~/.profile, ~/.bash_profile file; or in the
site-wide /etc/profile:
CVSROOT=/src/master; export CVSROOT
for sh/bash/ksh users, or place the following commands in the user's
~/.cshrc, ~/.login, or /etc/chsrc file:
setenv CVSROOT /src/master
for csh/tcsh users. If these environment variables are not already set
in your current shell, set them now (or source the login script you
just edited). You will need to have the CVSROOT environment variable
set to continue on to the next step.
8) It might be a good idea to jump right in and put the CVS distribution
directly under CVS control. From within the top-level directory of the
CVS distribution (the one that contains this README file) do the
following commands:
$ make distclean
$ cvs import -m 'CVS 1.6 distribution' cvs CVS_DIST CVS-1_6
9) Having done step 8, one should be able to checkout a fresh copy of the
CVS distribution and hack away at the sources with the following command:
$ cd
$ cvs checkout cvs
This will make the directory "cvs" in your current directory and
populate it with the appropriate CVS files and directories.
10) You may wish to customize the various administrative files, in particular
modules. See cvs.texinfo for details.
11) Read the NEWS file to see what's new.
12) Hack away.
-------------------------------------------------------------------------------
Detailed information about your interaction with "configure":
@@ -386,30 +351,13 @@ behaviour:
appear to be.
-------------------------------------------------------------------------------
Building from source code under Windows NT/95:
Installation under Windows NT:
You may find interesting information in windows-NT/README.
1) Using Microsoft Visual C++ 5.x, open the project `cvsnt.dsp',
in the top directory of the CVS distribution. If you have an older
version of Visual C++, take a look at windows-NT/README.
1) Using Microsoft Visual C++ version 2.1, open the project `cvsnt.mak',
in the top directory of the CVS distribution.
2) Choose "Build cvs.exe" from the "Project" menu.
3) MSVC will place the executable file cvs.exe in WinRel, or whatever
3) MSVC will place the executable file cvs.exe in WinDebug, or whatever
your target directory is.
-------------------------------------------------------------------------------
Building from source code under other platforms:
For OS/2, see os2/README and emx/README.
For VMS, see README.VMS
For Macintosh, see macintosh/README.MacCVS
For a Java client, see jCVS (which is a separate package from CVS
itself, but which might be preferable to the Macintosh port mentioned
above, for example).
-------------------------------------------------------------------------------
+2 -2
View File
@@ -45,8 +45,8 @@ particular reason to think the bug is fixed -kingdon, Sep 96).
...
I claim that CVS dirs should be ignored.
(This reportedly happens if "cvs add CVS" (or "cvs add *")
is followed by "cvs status", in client/server mode - CVS 1.9).
(I don't *think* this always happens; is "-I !" getting picked up somewhere
something like that? -kingdon, Sep 96)
* On remote checkout, files don't have the right time/date stamps in
the CVS/Entries files. Doesn't look like the C/S protocol has any
+3 -6
View File
@@ -89,12 +89,12 @@ DISTFILES = \
ChangeLog NEWS ChangeLog.zoo \
configure configure.in stamp-h.in config.h.in Makefile.in acconfig.h \
cvs-format.el mkinstalldirs install-sh \
cvsnt.mak cvsnt.dsp \
cvsnt.mak \
.cvsignore cvs.spec
### Subdirectories to run make in for the primary targets.
# Unix source subdirs, where we'll want to run lint and etags:
USOURCE_SUBDIRS = lib zlib diff src
USOURCE_SUBDIRS = lib zlib src
# All other subdirs:
SUBDIRS = ${USOURCE_SUBDIRS} man doc contrib tools \
windows-NT os2 emx macintosh vms
@@ -188,21 +188,18 @@ saber:
check:
cd lib ; $(MAKE) $(FLAGS_TO_PASS)
cd zlib ; $(MAKE) $(FLAGS_TO_PASS)
cd diff ; $(MAKE) $(FLAGS_TO_PASS)
cd src ; $(MAKE) $(FLAGS_TO_PASS) check
.PHONY: remotecheck
remotecheck:
cd lib ; $(MAKE) $(FLAGS_TO_PASS)
cd zlib ; $(MAKE) $(FLAGS_TO_PASS)
cd diff ; $(MAKE) $(FLAGS_TO_PASS)
cd src ; $(MAKE) $(FLAGS_TO_PASS) remotecheck
.PHONY: installcheck
installcheck:
cd lib ; $(MAKE) $(FLAGS_TO_PASS)
cd zlib ; $(MAKE) $(FLAGS_TO_PASS)
cd diff ; $(MAKE) $(FLAGS_TO_PASS)
cd src ; $(MAKE) $(FLAGS_TO_PASS) installcheck
.PHONY: lint
@@ -242,7 +239,7 @@ spec:
echo > .fname cvs-`cat .version`
rm -f `cat .fname`.spec
sed < $(top_srcdir)/cvs.spec \
-e 's/@VERSION@/'`cat .version`'/g' \
-e 's/@VERSION@/'`cat .version`'/' \
> `cat .fname`.spec
+4 -28
View File
@@ -1,30 +1,5 @@
Changes since 1.9:
* One can now authenticate and encrypt using the GSSAPI network
security interface. For details see the description of :gserver: in
CVSROOT, and the -a global option.
* All access to RCS files is now implemented internally rather than by
calling RCS programs. The main user-visible consequence of this is
that there is no need to worry about making sure that CVS finds the
correct version of RCS. The -b global option and the RCSBIN setting
in CVSROOT/config are still accepted but don't do anything. The
$RCSBIN internal variable in administrative files is no longer
accepted.
* There is a new syntax, "cvs admin -orev1::rev2", which collapses the
revisions between rev1 and rev2 without deleting rev1 or rev2
themselves.
* There is a new administrative file CVSROOT/config which allows one
to specify miscellaneous aspects of CVS configuration. Currently
supported here:
- SystemAuth, allows you to prevent pserver from checking for system
usernames/passwords.
For more information see the "config" section of cvs.texinfo.
* When setting up the pserver server, one now must specify the
allowable CVSROOT directories in inetd.conf. See the Password
authentication server section of cvs.texinfo for details. Note that
@@ -46,9 +21,10 @@ repository from the cvspass file.
password-authenticated server (other access methods are just governed
by Unix file permissions, since they require login access to the
repository machine anyway). See the "Repository" section of
cvs.texinfo for details, including a discussion of security issues.
Note that the requirement that read-only users be able to create locks
and write the history file still applies.
cvs.texinfo for details. Note that the security cautions in
cvs.texinfo ("Password authentication security"), and the requirement
that read-only users be able to create locks and write the history
file, both apply.
* The "checkout" command now creates a CVS directory at the top level
of the new working directory, in addition to CVS directories created
+7
View File
@@ -46,6 +46,13 @@ are actually more appropriate for this list.
(and modify) indexes. This becomes very apparent with files
with several hundred revisions.
* A RCS "library", so CVS could operate on RCS files directly.
CVS parses RCS files in order to determine if work needs to be done,
and then RCS parses the files again when it is performing the work.
This would be much faster if CVS could do whatever is necessary
by itself. (see comment at start of rcscmds.c for a few notes on this).
1. Improved testsuite/sanity check script
* Need to use a code coverage tool to determine how much the sanity
+1 -1
View File
@@ -164,7 +164,7 @@ ChangeLog files in each directory for a more complete idea.
In addition to the above contributors, the following Beta testers
deserve special mention for their support. This is only a partial
list; if you have helped in this way and would like to be listed, let
bug-cvs know (as described in the Cederqvist manual).
bug-cvs know (as described elsewhere in this file).
Mark D. Baushke <[email protected]>
Per Cederqvist <[email protected]>
-9
View File
@@ -134,12 +134,3 @@ unnecessary baggage. The only dependency would be on tcl (that is,
wish).
* perl or python or <any other serious contenders here?>
It is worth thinking about how to:
a. include spaces in arguments which we pass to the program under
test (sanity.sh dotest cannot do this; see test rcs-9 for a
workaround).
b. pass stdin to the program under test (sanity.sh, again, handles
this by bypassing dotest).
+41 -409
View File
@@ -1,14 +1,10 @@
The "TODO" file! -*-Indented-Text-*-
22. Catch signals for cleanup when "add"ing files.
24. Insist on a log message.
(If done, this should be configurable via commitinfo or some new
config file -kingdon, Jun 1995).
30. Add "rdiff" program option to the modules database (and "diff"
too?). (perhaps should think a little harder about what this is
trying to accomplish and what the best way is -kingdon, Jul 1997).
30. Add "patch" program option to the modules database.
31. Think hard about ^C recovery.
@@ -20,9 +16,7 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
that other branch is already merged. This has pitfalls--it could
easily lead to invisible state which could confuse users very
rapidly--but having to create a tag or some such mechanism to keep
track of what has been merged is a pain. Take a look at PRCS 1.2.
PRCS 1.0 was particularly bad the way it handled the "invisible
state", but 1.2 is significantly better.
track of what has been merged is a pain.
45. Consider enhancing the "rdiff" and "tag" (rtag??) command support in
the module database -- they seem hard to use since these commands
@@ -51,6 +45,9 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
63. The "import" and vendor support commands (co -j) need to be documented
better.
64. Need to greatly increase the performance of an initial checkout.
[[ it got better, then we added functionality, making it worse again ]]
66. Length of the CVS temporary files must be limited to 14 characters for
System-V stupid support. As well as the length on the CVS.adm files.
@@ -60,8 +57,8 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
73. Consider an option (in .cvsrc?) to automatically add files that are new
and specified to commit.
79. Might be nice to have some sort of interface to Sun's Translucent
(?) File System and tagged revisions.
79. Might be nice to have some sort of interface to TFS and tagged
revisions.
82. Maybe the import stuff should allow an arbitrary revision to be
specified.
@@ -69,10 +66,8 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
84. Improve the documentation about administration of the repository and
how to add/remove files and the use of symbolic links.
85. Make symbolic links a valid thing to put under version control.
Perhaps use one of the tag fields in the RCS file? Note that we
can only support symlinks that are relative and within the scope of
the sources being controlled.
85. Add revision controlled symbolic links to CVS using one of the tag
fields in the RCS file.
92. Look into this:
After a bit of soul searching via dbx, I realized my sin was that I'd
@@ -135,12 +130,11 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
113. The "cvs update" command should tee its output to a log file in ".".
(why? What is wrong with piping stdout to "tee"? -kingdon, Jun 1995)
119. When importing a directory tree that is under SCCS/RCS control,
consider an option to have import checkout the SCCS/RCS files if
necessary. (This is if someone wants to import something which
is in RCS or SCCS without preserving the history, but makes sure
they do get the latest versions. It isn't clear to me how useful
that is -kingdon, June 1996).
119. Consider an option to have import checkout the RCS or SCCS files
if necessary. (this is if someone want to import something which is
in RCS or SCCS without preserving the history, but making sure they
do get the latest versions. It isn't clear to me how useful that is
-kingdon, June 1996).
122. If Name_Repository fails, it currently causes CVS to die completely. It
should instead return NULL and have the caller do something reasonable
@@ -148,7 +142,6 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
-kingdon, June 1996).
123. Add a flag to import to not build vendor branches for local code.
(See `importb' tests in src/sanity.sh for more details).
124. Anyway, I thought you might want to add something like the following
to the cvs man pages:
@@ -164,6 +157,8 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
127. Look at *info files; they should all be quiet if the files are not
there. Should be able to point at a RCS directory and go.
128. When I tag a file, the message tells me that I'm tagging a directory.
130. cvs diff with no -r arguments does not need to look up the current RCS
version number since it only cares about what's in the Entries file.
This should make it much faster.
@@ -189,14 +184,10 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
variable to limit the amount of sources that need to be duplicated for
sites with giant source trees and no disk space.
141. Import should accept modules as its directory argument. If we're
going to implement this, we should think hard about how modules
might be expanded and how to handle those cases.
141. Import should accept modules as its directory argument.
143. Update the documentation to show that the source repository is
something far away from the files that you work on. (People who
come from an RCS background are used to their `repository' being
_very_ close to their working directory.)
something far away from the files that you work on.
144. Have cvs checkout look for the environment variable CVSPREFIX
(or CVSMODPREFIX or some such). If it's set, then when looking
@@ -236,42 +227,14 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
.#foo.c.1.5 or whatever), so they can do the interactive part at
that point -kingdon, June 1996).
149. Maybe there should be an option to cvs admin that allows a user to
change the Repository/Root file with some degree of error checking?
149. On Sun, 2 Feb 92 22:01:38 EST, [email protected] (John P. Rouillard)
said:
Maybe there should be an option to cvs admin that allows a user to
change the Repository file with some degree of error checking?
Something like "cvs admin reposmv /old/path /new/pretty/path". Before
it does the replace it check to see that the files
/new/pretty/path/<dir>/<files> exist.
The obvious cases are where one moves the repository to another
machine or directory. But there are other cases, like where the
user might want to change from :pserver: to :ext:, use a different
server (if there are two server machines which share the
repository using a networked file system), etc.
The status quo is a bit of a mess (as of, say, CVS 1.9). It is
that the -d global option has two moderately different uses. One
is to use a totally different repository (in which case we'd
probably want to give an error if it disagreed with CVS/Root, as
CVS 1.8 and earlier did). The other is the "reposmv"
functionality above (in which the two repositories really are the
same, and we want to update the CVS/Root files). A related issue
is that the fact that CVS only sets and looks at the CVS/Root
file in the directory where CVS is run; it doesn't do anything
about CVS/Root files in subdirectories.
Note also RELATIVE_REPOS in options.h; it needs to be set for
changing CVS/Root (not CVS/Repository) to be sufficient in the
case where the directory has changed.
This whole area is a rather bad pile of individual decisions which
accumulated over time, some of them probably bad decisions with
hindsight. But we didn't get into this mess overnight, and we're
not going to get out of it overnight (that is, we need to come up
with a replacement behavior, document what parts of the status
quo are deprecated, probably circulate some unofficial patches, &c).
(this item originally added 2 Feb 1992 but revised since).
150. I have a customer request for a way to specify log message per
file, non-interactively before the commit, such that a single, fully
recursive commit prompts for one commit message, and concatenates the
@@ -293,9 +256,8 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
message specified at commit time. Easy enough. (having cvs
commit be non-interactive takes care of various issues like
whether to connect to the server before or after prompting for a
message (see comment in commit.c at call to start_server). Also
would clean up the kludge for what to do with the message from
do_editor if the up-to-date check fails (see commit.c client code).
message (see comment in commit.c at call to start_server)
-kingdon, June 1996)
I'm not sure about the part above about having commit prompt
for an overall message--part of the point is having commit
@@ -308,41 +270,30 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
incompatibility between client/server (per-tree) and
non-client/server (per-directory).
A few interesting issues with this: (1) if you do a cvs update or
some other operation which changes the working directory, do you
need to run "cvs message" again (it would, of course, bring up
the old message which you could accept)? Probably yes, after all
merging in some conflicts might change the situation. (2) How do
you change the stored messages if you change your mind before the
commit (probably run "cvs message" again, as hinted in (1))?
151. Also, is there a flag I am missing that allows replacing Ulrtx_Build
by Ultrix_build? I.E. I would like a tag replacement to be a one step
operation rather than a two step "cvs rtag -r Ulrtx_Build Ultrix_Build"
followed by "cvs rtag -d Ulrtx_Build"
followed by "cvs trag -d Ulrtx_Build"
152. The "cvs -n" option does not work as one would expect for all the
commands. In particular, for "commit" and "import", where one would
also like to see what it would do, without actually doing anything.
153. There should be some command (maybe I just haven't figured out
which one...) to import a source directory which is already
RCS-administered without losing all prior RCS gathered data.
Thus, it would have to examine the RCS files and choose a
starting version and branch higher than previous ones used.
(Check out rcs-to-cvs and see if it addresses this issue.)
153. There should be some command (maybe I just haven't figured
out which one...) to import a source directory which is already
RCS-administered without losing all prior RCS gathered data. Thus, it
would have to examine the RCS files and choose a starting version and
branch higher than previous ones used.
154. When committing the modules file, a pre-commit check should be done to
verify the validity of the new modules file before allowing it to be
committed.
155. The options for "cvs history" are mutually exclusive, even though
useful queries can be done if they are not, as in specifying both
a module and a tag. A workaround is to specify the module, then
run the output through grep to only display lines that begin with
T, which are tag lines. (Better perhaps if we redesign the whole
"history" business -- check out doc/cvs.texinfo for the entire
rant.)
useful queries can be done if they are not, as in specifying both a
module and a tag. A workaround is to specify the module, then run the
output through grep to only display lines that begin with T, which are
tag lines.
156. Also, how hard would it be to allow continuation lines in the
{commit,rcs,log}info files? It would probably be useful with all of
@@ -362,6 +313,9 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
revision was already locked by the user as well, thus moving the lock
forward after the commit.
161. The date parser included with CVS (lib/getdate.y) does not support
such RCS-supported dates as "1992/03/07". It probably should.
163. The rtag/tag commands should have an option that removes the specified
tag from any file that is in the attic. This allows one to re-use a
tag (like "Mon", "Tue", ...) all the time and still have it tag the
@@ -431,12 +385,10 @@ trying to accomplish and what the best way is -kingdon, Jul 1997).
is down!).
182. There should be a way to show log entries corresponding to
changes from tag "foo" to tag "bar". "cvs log -rfoo:bar" doesn't cut
it, because it erroneously shows the changes associated with the
change from the revision before foo to foo. I'm not sure that is ever
a useful or logical behavior ("cvs diff -r foo -r bar" gets this
right), but is compatibility an issue? See
http://www.cyclic.com/cvs/unoff-log.txt for an unofficial patch.
changes from tag "foo" to tag "bar". "cvs log -rfoo -rbar" doesn't
cut it, because it is inclusive on the bar end. I'm not sure that is
ever a useful or logical behavior ("cvs diff -r foo -r bar" is not
similarly inclusive), but is compatibility an issue?
183. "cvs status" should report on Entries.Static flag and CVS/Tag (how?
maybe a "cvs status -d" to give directory status?). There should also
@@ -468,323 +420,3 @@ modifying it), but even as to the general idea, I don't have a clear
idea about whether it would be good (see what I mean about the need
for better documentation? I work on CVS full-time, and even I don't
understand the state of the art on this subject).
186. There is a frequent discussion of multisite features.
* There may be some overlap with the client/server CVS, which is good
especially when there is a single developer at each location. But by
"multisite" I mean something in which each site is more autonomous, to
one extent or another.
* Vendor branches are the closest thing that CVS currently has for
multisite features. They have fixable drawbacks (such as poor
handling of added and removed files), and more fundamental drawbacks
(when you import a vendor branch, you are importing a set of files,
not importing any knowledge of their version history outside the
current repository).
* One approach would be to require checkins (or other modifications to
the repository) to succeed at a write quorum of sites (51%) before
they are allowed to complete. To work well, the network should be
reliable enough that one can typically get to that many sites. When a
server which has been out of touch reconnects, it would want to update
its data before doing anything else. Any of the servers can service
all requests locally, except perhaps for a check that they are
up-to-date. The way this differs from a run-of-the-mill distributed
database is that if one only allows reversible operations via this
mechanism (exclude "cvs admin -o", "cvs tag -d", &c), then each site
can back up the others, such that failures at one site, including
something like deleting all the sources, can be recovered from. Thus
the sites need not trust each other as much as for many shared
databases, and the system may be resilient to many types of
organizational failures. Sometimes I call this design the
"CVScluster" design.
* Another approach is a master/slave one. Checkins happen at the
master site, and slave sites need to check whether their local
repository is up to date before relying on its information.
* Another approach is to have each site own a particular branch. This
one is the most tolerant of flaky networks; if checkins happen at each
site independently there is no particular problem. The big question
is whether merges happen only manually, as with existing CVS branches,
or whether there is a feature whereby there are circumstances in which
merges from one branch to the other happen automatically (for example,
the case in which the branches have not diverged). This might be a
legitimate question to ask even quite aside from multisite features.
One additional random tidbit is to note that Eric Raymond has some
interest in this sort of thing. The item "Cooperative distributed
freeware development" on http://www.ccil.org/~esr/ has a very brief
introduction to what he is thinking about.
187. Might want to separate out usage error messages and help
messages. The problem now is that if you specify an invalid option,
for example, the error message is lost among all the help text. In
the new regime, the error message would be followed by a one-line
message directing people to the appropriate help option ("cvs -H
<command>" or "cvs --help-commands" or whatever, according to the
situation). I'm not sure whether this change would be controversial
(as defined in HACKING), so there might be a need for further
discussion or other actions other than just coding.
188. Option parsing and .cvsrc has at least one notable limitation.
If you want to set a global option only for some CVS commands, there
is no way to do it (for example, if one wants to set -q only for
"rdiff"). I am told that the "popt" package from RPM
(http://www.rpm.org) could solve this and other problems (for example,
if the syntax of option stuff in .cvsrc is similar to RPM, that would
be great from a user point of view). It would at least be worth a
look (it also provides a cleaner API than getopt_long).
Another issue which may or may not be related is the issue of
overriding .cvsrc from the command line. The cleanest solution might
be to have options in mutually exclusive sets (-l/-R being a current
example, but --foo/--no-foo is a better way to name such options). Or
perhaps there is some better solution.
189. Renaming files and directories is a frequently discussed topic.
Some of the problems with the status quo:
a. "cvs annotate" cannot operate on both the old and new files in a
single run. You need to run it twice, once for the new name and once
for the old name.
b. "cvs diff" (or "cvs diff -N") shows a rename as a removal of the
old file and an addition of the new one. Some people would like to
see the differences between the file contents (but then how would we
indicate the fact that the file has been renamed? Certainly the
notion that "patch(1)" has of renames is as a removal and addition).
c. "cvs log" should be able to show the changes between two
tags/dates, even in the presence of adds/removes/renames (I'm not sure
what the status quo is on this; see also item #182).
d. Renaming directories is way too hard.
Implementations:
It is perhaps premature to try to design implementation details
without answering some of the above questions about desired behaviors
but several general implementations get mentioned.
i. No fundamental changes (for example, a "cvs rename" command which
operated on directories could still implement the current recommended
practice for renaming directories, which is to rename each of the
files contained therein via an add and a remove). One thing to note
that the status quo gets right is proper merges, even with adds and
removals (Well, mostly right at least. There are a *LOT* of different
cases; see the testsuite for some of them).
ii. Rename database. In this scheme the files in the repository
would have some arbitrary name, and then a separate rename database
would indicate the current correspondence between the filename in the
working directory and the actual storage. As far as I know this has
never been designed in detail for CVS.
iii. A modest change in which the RCS files would contain some
information such as "renamed from X" or "renamed to Y". That is, this
would be generally similar to the log messages which are suggested
when one renames via an add and a removal, but would be
computer-parseable. I don't think anyone has tried to flesh out any
details here either.
It is interesting to note that in solution ii. version numbers in the
"new file" start where the "old file" left off, while in solutions
i. and iii., version numbers restart from 1.1 each time a file is
renamed. Except perhaps in the case where we rename a file from foo
to bar and then back to foo. I'll shut up now.
Regardless of the method we choose, we need to address how renames
affect existing CVS behaviors. For example, what happens when you
rename a file on a branch but not the trunk and then try to merge the
two? What happens when you rename a file on one branch and delete it
on another and try to merge the two?
Ideally, we'd come up with a way to parameterize the problem and
simply write up a lookup table to determine the correct behavior.
190. The meaning of the -q and -Q global options is very ad hoc;
there is no clear definition of which messages are suppressed by them
and which are not. Here is a classification of the current meanings
of -q; I don't know whether anyone has done a similar investigation of
-Q:
a. The "warm fuzzies" printed upon entering each directory (for
example, "cvs update: Updating sdir"). The need for these messages
may be decreased now that most of CVS uses ->fullname instead of
->file in messages (a project which is *still* not 100% complete,
alas). However, the issue of whether CVS can offer status as it
runs is an important one. Of course from the command line it is
hard to do this well and one ends up with options like -q. But
think about emacs, jCVS, or other environments which could flash you
the latest status line so you can see whether the system is working
or stuck.
b. Other cases where the message just offers information (rather
than an error) and might be considered unnecessarily verbose. These
have a certain point to them, although it isn't really clear whether
it should be the same option as the warm fuzzies or whether it is
worth the conceptual hair:
add.c: scheduling %s `%s' for addition (may be an issue)
modules.c: %s %s: Executing '%s' (I can see how that might be noise,
but...)
remove.c: scheduling `%s' for removal (analogous to the add.c one)
update.c: Checking out %s (hmm, that message is a bit on the noisy side...)
(but the similar message in annotate is not affected by -q).
c. Suppressing various error messages. This is almost surely
bogus.
commit.c: failed to remove tag `%s' from `%s' (Questionable.
Rationale might be that we already printed another message
elsewhere but why would it be necessary to avoid
the extra message in such an uncommon case?)
commit.c: failed to commit dead revision for `%s' (likewise)
remove.c: file `%s' still in working directory (see below about rm
-f analogy)
remove.c: nothing known about `%s' (looks dubious to me, especially in
the case where the user specified it explicitly).
remove.c: removed `%s' (seems like an obscure enough case that I fail
to see the appeal of being cryptically concise here).
remove.c: file `%s' already scheduled for removal (now it is starting
to look analogous to the infamous rm -f option).
rtag.c: cannot find tag `%s' in `%s' (more rm -f like behavior)
rtag.c: failed to remove tag `%s' from `%s' (ditto)
tag.c: failed to remove tag %s from %s (see above about whether RCS_*
has already printed an error message).
tag.c: couldn't tag added but un-commited file `%s' (more rm -f
like behavior)
tag.c: skipping removed but un-commited file `%s' (ditto)
tag.c: cannot find revision control file for `%s' (ditto, but at first
glance seems even worse, as this would seem to be a "can't happen"
condition)
191. Storing RCS files, especially binary files, takes rather more
space than it could, typically.
- The virtue of the status quo is that it is simple to implement.
Of course it is also simplest in terms of dealing with compatibility.
- Just storing the revisions as separate gzipped files is a common
technique. It also is pretty simple (no new algorithms, CVS
already has zlib around). Of course for some files (such as files
which are already compressed) the gzip step won't help, but
something which can at least sometimes avoid rewriting the entire
RCS file for each new revision would, I would think, be a big
speedup for large files.
- Josh MacDonald has written a tool called xdelta which produces
differences (that is, sufficient information to transform the old
to the new) which looks for common sequences of bytes, like RCS
currently does, but which is not based on lines. This seems to do
quite well for some kinds of files (e.g. FrameMaker documents,
text files), and not as well for others (anything which is already
compressed, executables). xdelta 1.10 also is faster than GNU diff.
- Karl Fogel has thought some about using a difference technique
analogous to fractal compression (see the comp.compression FAQ for
more on fractal compression, including at least one patent to
watch for; I don't know how analogous Karl's ideas are to the
techniques described there).
- Quite possibly want some documented interface by which a site can
plug in their choice of external difference programs (with the
ability to choose the program based on filename, magic numbers,
or some such).
192. "cvs update" using an absolute pathname does not work if the
working directory is not a CVS-controlled directory with the correct
CVSROOT. For example, the following will fail:
cd /tmp
cvs -d /repos co foo
cd /
cvs update /tmp/foo
It is possible to read the CVSROOT from the administrative files in
the directory specified by the absolute pathname argument to update.
In that case, the last command above would be equivalent to:
cd /tmp/foo
cvs update .
This can be problematic, however, if we ask CVS to update two
directories with different CVSROOTs. Currently, CVS has no way of
changing CVSROOT mid-stream. Consider the following:
cd /tmp
cvs -d /repos1 co foo
cvs -d /repos2 co bar
cd /
cvs update /tmp/foo /tmp/bar
To make that example work, we need to think hard about:
- where and when CVSROOT-related variables get set
- who caches said variables for later use
- how the remote protocol should be extended to handle sending a new
repository mid-stream
- how the client should maintain connections to a variety of servers
in a single invocation.
Because those issues are hairy, I suspect that having a change in
CVSROOT be an error would be a better move.
193. The client relies on timestamps to figure out whether a file is
(maybe) modified. If something goes awry, then it ends up sending
entire files to the server to be checked, and this can be quite slow
especially over a slow network. A couple of things that can happen:
(a) other programs, like make, use timestamps, so one ends up needing
to do "touch foo" and otherwise messing with timestamps, (b) changing
the timezone offset (e.g. summer vs. winter or moving a machine)
should work on unix, but there may be problems with non-unix.
Possible solutions:
a. Store a checksum for each file in CVS/Entries or some such
place. What to do about hash collisions is interesting: using a
checksum, like MD5, large enough to "never" have collisions
probably works in practice (of course, if there is a collision then
all hell breaks loose because that code path was not tested, but
given the tiny, tiny probability of that I suppose this is only an
aesthetic issue).
b. I'm not thinking of others, except storing the whole file in
CVS/Base, and I'm sure using twice the disk space would be
unpopular.
194. CVS does not separate the "metadata" from the actual revision
history; it stores them both in the RCS files. Metadata means tags
and header information such as the number of the head revision.
Storing the metadata separately could speed up "cvs tag" enormously,
which is a big problem for large repositories. It could also probably
make CVS's locking much less in the way (see comment in do_recursion
about "two-pass design").
195. Many people using CVS over a slow link are interested in whether
the remote protocol could be any more efficient with network
bandwidth. This item is about one aspect of that--how the server
sends a new version of a file the client has a different version of,
or vice versa.
a. Cases in which the status quo already sends a diff. For most text
files, this is probably already close to optimal. For binary files,
and anomalous text files, it might be worth looking into other
difference algorithms (see item #191).
b. Cases in which the status quo does not send a diff (e.g. "cvs
commit").
b1. With some frequency, people suggest rsync or a similar algorithm
(see ftp://samba.anu.edu.au/pub/rsync/). This could speed things up,
and in some ways involves the most minimal changes to the default CVS
paradigm. There are some downsides though: (1) there is an extra
network turnaround, (2) the algorithm is not as efficient with network
bandwidth as difference type programs (it transmits a fair bit of data
to discover what a difference program discovers locally).
b2. If one is willing to require that users use "cvs edit" before
editing a file on the client side (in some cases, a development
environment like emacs can make this fairly easy), then the Modified
request in the protocol could be extended to allow the client to just
send differences instead of entire files. In the degenerate case
(e.g. "cvs diff" without arguments) the required network traffic is
reduced to zero, and the client need not even contact the server.
-23
View File
@@ -1,9 +1,6 @@
/* Define if you have MIT Kerberos version 4 available. */
#undef HAVE_KERBEROS
/* Define if you have GSSAPI with MIT Kerberos version 5 available. */
#undef HAVE_GSSAPI
/* Define if you want CVS to be able to be a remote repository client. */
#undef CLIENT_SUPPORT
@@ -19,23 +16,3 @@
/* Define if you have the connect function. */
#undef HAVE_CONNECT
/* Define if this system supports chown(), link(), and friends. */
#undef PRESERVE_PERMISSIONS_SUPPORT
/* Define if you have memchr (always for CVS). */
#undef HAVE_MEMCHR
/* Define if you have strchr (always for CVS). */
#undef HAVE_STRCHR
/* Define if utime requires write access to the file (true on Windows,
but not Unix). */
#undef UTIME_EXPECTS_WRITABLE
/* Define if setmode is required when writing binary data to stdout. */
#undef USE_SETMODE_STDOUT
/* Define if the diff library should use setmode for binary files.
FIXME: Why two different macros for setmode? */
#undef HAVE_SETMODE
+3 -44
View File
@@ -7,9 +7,6 @@
#undef _ALL_SOURCE
#endif
/* Define if the closedir function returns void instead of int. */
#undef CLOSEDIR_VOID
/* Define to empty if the keyword does not work. */
#undef const
@@ -19,18 +16,12 @@
/* Define if you support file names longer than 14 characters. */
#undef HAVE_LONG_FILE_NAMES
/* Define if your struct stat has st_blksize. */
#undef HAVE_ST_BLKSIZE
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define if utime(file, NULL) sets file's timestamp to the present. */
#undef HAVE_UTIME_NULL
/* Define if you have <vfork.h>. */
#undef HAVE_VFORK_H
/* Define if on MINIX. */
#undef _MINIX
@@ -65,15 +56,9 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
/* Define vfork as fork if vfork does not work. */
#undef vfork
/* Define if you have MIT Kerberos version 4 available. */
#undef HAVE_KERBEROS
/* Define if you have GSSAPI with MIT Kerberos version 5 available. */
#undef HAVE_GSSAPI
/* Define if you want CVS to be able to be a remote repository client. */
#undef CLIENT_SUPPORT
@@ -90,26 +75,6 @@
/* Define if you have the connect function. */
#undef HAVE_CONNECT
/* Define if this system supports chown(), link(), and friends. */
#undef PRESERVE_PERMISSIONS_SUPPORT
/* Define if you have memchr (always for CVS). */
#undef HAVE_MEMCHR
/* Define if you have strchr (always for CVS). */
#undef HAVE_STRCHR
/* Define if utime requires write access to the file (true on Windows,
but not Unix). */
#undef UTIME_EXPECTS_WRITABLE
/* Define if setmode is required when writing binary data to stdout. */
#undef USE_SETMODE_STDOUT
/* Define if the diff library should use setmode for binary files.
FIXME: Why two different macros for setmode? */
#undef HAVE_SETMODE
/* Define if you have the crypt function. */
#undef HAVE_CRYPT
@@ -173,6 +138,9 @@
/* Define if you have the tzset function. */
#undef HAVE_TZSET
/* Define if you have the vfork function. */
#undef HAVE_VFORK
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
@@ -194,9 +162,6 @@
/* Define if you have the <io.h> header file. */
#undef HAVE_IO_H
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
@@ -215,9 +180,6 @@
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define if you have the <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
@@ -245,9 +207,6 @@
/* Define if you have the crypt library (-lcrypt). */
#undef HAVE_LIBCRYPT
/* Define if you have the gen library (-lgen). */
#undef HAVE_LIBGEN
/* Define if you have the inet library (-linet). */
#undef HAVE_LIBINET
+153 -627
View File
File diff suppressed because it is too large. Load diff
+20 -134
View File
@@ -10,8 +10,8 @@ dnl It is possible that we should just change the above required version
dnl to 2.10; it seems like everyone is using 2.10 anyway, and there is
dnl at least some sentiment that we should be using a version which has
dnl --bindir (and correspondingly, using @bindir@ and friends in our
dnl Makefile.in files. Rumor has it that autoconf 2.7
dnl introduced --bindir but the point is that 2.10 has it.
dnl Makefile.in files. I'm not sure exactly what version of autoconf
dnl introduced --bindir but I know 2.10 has it.
AC_CONFIG_HEADER(config.h src/options.h)
AC_PROG_CC
@@ -50,7 +50,6 @@ fi
AC_HEADER_STDC
AC_CHECK_HEADERS(errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \
limits.h sys/file.h \
sys/param.h sys/select.h sys/time.h sys/timeb.h \
io.h direct.h sys/bsdtypes.h sys/resource.h)
AC_HEADER_SYS_WAIT
@@ -62,33 +61,8 @@ AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_STRUCT_ST_BLKSIZE
AC_REPLACE_FUNCS(mkdir rename strstr dup2 strerror valloc waitpid memmove vasprintf strtoul)
AC_CHECK_FUNCS(fchmod fsync ftime mktemp putenv vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tempnam tzset readlink wait3)
dnl
dnl The CVS coding standard (as specified in HACKING) is that if it exists
dnl in SunOS4 and ANSI, we use it. CVS itself, of course, therefore doesn't
dnl need HAVE_* defines for such functions, but diff wants them.
dnl
AC_DEFINE(HAVE_STRCHR)
AC_DEFINE(HAVE_MEMCHR)
dnl
dnl AC_FUNC_VFORK is rather baroque. It seems to be rather more picky
dnl than, say, the Single Unix Specification (version 2), which simplifies
dnl a lot of cases by saying that the child process can't set any variables
dnl (thus avoiding problems with register allocation) or call any functions
dnl (thus avoiding problems with whether file descriptors are shared).
dnl It would be nice if we could just write to the Single Unix Specification.
dnl I think the only way to do redirection this way is by doing it in the
dnl parent, and then undoing it afterwards (analogous to windows-NT/run.c).
dnl That would appear to have a race condition if the user hits ^C (or
dnl some other signal) at the wrong time, as main_cleanup will try to use
dnl stdout/stderr. So maybe we are stuck with AC_FUNC_VFORK.
dnl
AC_FUNC_VFORK
AC_FUNC_CLOSEDIR_VOID
AC_REPLACE_FUNCS(getwd mkdir rename strdup strstr dup2 strerror valloc waitpid vasprintf strtoul)
AC_CHECK_FUNCS(fchmod fsync ftime mktemp putenv vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tempnam tzset readlink wait3)
dnl
dnl Look for shadow password files before we go ahead and set getspnam.
@@ -110,24 +84,7 @@ else
fi
AC_MSG_RESULT([$found])
dnl We always use CVS's regular expression matcher.
dnl This is because:
dnl (1) If memory serves, the syntax of the regular expressions
dnl handled by re_exec is not consistent from system to system, which
dnl is a Bad Thing because CVS passes this syntax out to the user.
dnl We might have better luck with the POSIX interface, if we really
dnl want to look for a system-supplied matcher.
dnl (2) It is necessary to make _sure_ that we get a regex.h and regex.c
dnl that match each other. In particular, rx and the CVS/emacs
dnl regex.c have a different "struct re_pattern_buffer" and so using
dnl the system regex.h and our regex.c, or vice versa, will tend to
dnl cause a core dump.
dnl (3) Just as a random data point, CVS uses re_exec (a BSD interface);
dnl libdiff uses re_compile_pattern (a GNU interface, I think). Diff
dnl should probably be fixed to have the caller (CVS) supply the regexp
dnl matching.
dnl
dnl AC_CHECK_FUNC(re_exec, :, LIBOBJS="$LIBOBJS regex.o")
AC_CHECK_FUNC(re_exec, :, LIBOBJS="$LIBOBJS regex.o")
AC_FUNC_UTIME_NULL
AC_SYS_LONG_FILE_NAMES
@@ -182,10 +139,6 @@ fi])
dnl
dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4
dnl
dnl If you change this, keep in mind that some systems have a bogus
dnl libkrb in the system libraries, so --with-krb4=value needs to
dnl override the system -lkrb.
dnl
KRB4=/usr/kerberos
define(WITH_KRB4,[
AC_ARG_WITH([krb4],
@@ -198,19 +151,15 @@ WITH_KRB4
krb_h=
AC_MSG_CHECKING([for krb.h])
if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -I$KRB4/include"
AC_TRY_LINK([#include <krb.h>],[int i;],
[krb_h=yes krb_incdir=$KRB4/include],
[CFLAGS=$hold_cflags
AC_TRY_LINK([#include <krb.h>],[int i;],
[krb_h=yes krb_incdir=])])
CFLAGS=$hold_cflags
else
AC_TRY_LINK([#include <krb.h>],[int i;],
[krb_h=yes krb_incdir=])
fi
AC_TRY_LINK([#include <krb.h>],[int i;],
[krb_h=yes krb_incdir=],
[if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -I$KRB4/include"
AC_TRY_LINK([#include <krb.h>],[int i;],
[krb_h=yes krb_incdir=$KRB4/include])
CFLAGS=$hold_cflags
fi])
if test -z "$krb_h"; then
AC_TRY_LINK([#include <krb.h>],[int i;],
[krb_h=yes krb_incdir=],
@@ -224,22 +173,12 @@ if test -z "$krb_h"; then
fi
AC_MSG_RESULT($krb_h)
includeopt=
AC_SUBST(includeopt)
if test -n "$krb_h"; then
krb_lib=
if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
hold_ldflags=$LDFLAGS
LDFLAGS="-L${KRB4}/lib $LDFLAGS"
AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=${KRB4}/lib],
[LDFLAGS=$hold_ldflags
# Using open here instead of printf so we don't
# get confused by the cached value for printf from above.
AC_CHECK_LIB(krb,open,[krb_lib=yes krb_libdir=])])
LDFLAGS=$hold_ldflags
else
AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=])
fi
AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=],
[if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
krb_lib=yes krb_libdir=$KRB4/lib
fi])
if test -n "$krb_lib"; then
AC_DEFINE(HAVE_KERBEROS)
test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}"
@@ -253,36 +192,12 @@ if test -n "$krb_h"; then
LDFLAGS=$hold_ldflags
if test -n "$krb_incdir"; then
includeopt="${includeopt} -I$krb_incdir"
AC_SUBST(includeopt)
fi
fi
fi
AC_CHECK_FUNCS(krb_get_err_text)
dnl
dnl Use --with-gssapi=DIR to enable GSSAPI support.
dnl
GSSAPI=/usr/cygnus/kerbnet
define(WITH_GSSAPI,[
AC_ARG_WITH([gssapi],
[ --with-gssapi=value GSSAPI directory],
[GSSAPI=$withval],
)dnl
echo "default place for GSSAPI is $GSSAPI"
AC_SUBST(GSSAPI)])dnl
WITH_GSSAPI
AC_MSG_CHECKING([for gssapi.h])
hold_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$GSSAPI/include "
AC_CHECK_HEADER(gssapi/gssapi.h,
[AC_DEFINE(HAVE_GSSAPI)
LIBS="$LIBS -L$GSSAPI/lib -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err"
includeopt="${includeopt} -I$GSSAPI/include"
# This is necessary on Irix 5.3, in order to link against libkrb5 --
# there, an_to_ln.o refers to things defined only in -lgen.
AC_CHECK_LIB(gen, compile)])
CPPFLAGS=$hold_cppflags
dnl
dnl Use --with-encryption to turn on encryption support
dnl
@@ -340,35 +255,6 @@ if test "$ac_cv_func_crypt" = yes; then
fi
fi # enable_server
dnl For the moment we will assume that all systems which have
dnl the unixyness to run configure are unixy enough to do the
dnl PreservePermissions stuff. I have this sinking feeling that
dnl things won't be that simple, before long.
AC_DEFINE(PRESERVE_PERMISSIONS_SUPPORT)
dnl On cygwin32, we configure like a Unix system, but we use the
dnl Windows support code in lib/fncase.c to handle the case
dnl insensitive file system. We also need some support libraries. We
dnl do this at the end so that the new libraries are added at the end
dnl of LIBS.
AC_CACHE_CHECK(for cygwin32, ccvs_cv_sys_cygwin32,
[AC_TRY_COMPILE([], [return __CYGWIN32__;],
ccvs_cv_sys_cygwin32=yes, ccvs_cv_sys_cygwin32=no)])
if test $ccvs_cv_sys_cygwin32 = yes; then
LIBOBJS="$LIBOBJS fncase.o"
LIBS="$LIBS -ladvapi32"
dnl On Windows you can only change file times if you can write to
dnl the file. cygwin32 should really handle this for us, but as of
dnl January 1998 it doesn't.
AC_DEFINE(UTIME_EXPECTS_WRITABLE)
dnl On Windows we must use setmode to change between binary and text
dnl mode.
AC_DEFINE(USE_SETMODE_STDOUT)
AC_DEFINE(HAVE_SETMODE)
fi
test -f src/options.h && (
AC_MSG_WARN(saving ./src/options.h in ./src/options.h-SAVED)
AC_MSG_WARN(You may wish to check that local options have not been lost.)
@@ -376,7 +262,7 @@ test -f src/options.h && (
cp ./src/options.h ./src/options.h-SAVED
)
AC_OUTPUT(Makefile lib/Makefile src/Makefile zlib/Makefile diff/Makefile doc/Makefile \
AC_OUTPUT(Makefile lib/Makefile src/Makefile zlib/Makefile doc/Makefile \
man/Makefile tools/Makefile tools/pcl-cvs/Makefile \
contrib/Makefile contrib/elib/Makefile \
windows-NT/Makefile windows-NT/SCC/Makefile \
-40
View File
@@ -1,43 +1,3 @@
Sat Feb 21 21:59:45 1998 Ian Lance Taylor <[email protected]>
* Makefile.in (clean): Change "/bin/rm" to "rm".
Thu Aug 7 22:42:23 1997 Jim Kingdon <[email protected]>
* pvcs_to_rcs: Remove RCS keywords. Remove $Log and move the data
to this ChangeLog (below). Add paragraph that David Martin
emailed along with the script.
Revision 1.6 1997/03/07 16:21:28 divad
Need to explicitly state archive name in PVCS get command for
those cases where the case of the workfile and the case of the
archive file are different (OS/2)
Revision 1.5 1997/03/07 00:31:04 divad
Added capitalized extensions and framemaker files as binaries;
also overriding any path specification for workfiles at PVCS
checkout (most annoying).
Revision 1.4 1997/03/06 21:04:55 divad
Added \n to the end of each comment line to prevent multi-line
comments for a single revision from "merging"
Revision 1.3 1997/03/06 19:50:25 divad
Corrected bug in binary extensions; correcting processing
comment strings with double quotes
Revision 1.2 1997/03/06 17:29:10 divad
Provided list of extensions (rather than using Unix file
command) to determine which files are binary; also printing
version label as they are applied
Revision 1.1 1997/02/26 00:04:29 divad
Perl script to convert pvcs archives to rcs archives
* README: mention pvcs_to_rcs.
* pvcs_to_rcs: New file. This is the file as I got it from David
Martin. Will be checking in the tweaks shortly.
17 May 1997 Jim Kingdon
* listen2.c: Failed attempt at making this do what it was
+1 -1
View File
@@ -106,7 +106,7 @@ ls:
.PHONY: ls
clean:
rm -f *.o core
/bin/rm -f *.o core
.PHONY: clean
distclean: clean
-4
View File
@@ -86,10 +86,6 @@ An attempt at a table of Contents for this directory:
into RCS files, retaining the info contained in the
SCCS file (like dates, author, and log message).
Contributed by Ken Cox <[email protected]>.
pvcs_to_rcs A perl script that can convert (some) PVCS histories
into RCS files, retaining the info contained in the
PVCS history. See the comments at the start of the
file for more details.
intro.doc A user's view of what you need to know to get
started with CVS.
Contributed by <[email protected]>.
-97
View File
@@ -1,97 +0,0 @@
#!/usr/bin/perl
# The version of the remote shell program on some Linuxes, at least,
# misuses GNU getopt in such a way that it plucks arguments to rsh
# that look like command-line switches from anywhere in rsh's
# arguments. This is the Wrong Thing to do, and causes older versions
# of CCVS to break.
# In addition, if we live behind a firewall and have to construct a
# "pipeline" of rshes through different machines in order to get to
# the outside world, each rshd along the way undoes the hard work CCVS
# does to put the command to be executed at the far end into a single
# argument. Sigh.
# This script is a very minimal wrapper to rsh which makes sure that
# the commands to be executed remotely are packed into a single
# argument before we call exec(). It works on the idea of a "proxy
# chain", which is a set of machines you go through to get to the CCVS
# server machine.
# Each host you go through before you reach the CCVS server machine
# should have a copy of this script somewhere (preferably accessible
# directly from your PATH envariable). In addition, each host you go
# through before you reach the firewall should have the CVS_PROXY_HOST
# envariable set to the next machine in the chain, and CVS_PROXY_USER
# set if necessary.
# This really isn't as complex as it sounds. Honest.
# Bryan O'Sullivan <[email protected]> April 1995
$usage = "usage: ccvs-rsh hostname [-l username] command [...]\n";
if ($#ARGV < 1) {
print STDERR $usage;
exit 1;
}
# Try to pick a sane version of the remote shell command to run. This
# only understands BSD and Linux machines; if your remote shell is
# called "remsh" under some System V (e.g. HP-SUX), you should edit
# the line manually to suit yourself.
$rsh = (-x "/usr/ucb/rsh") ? "/usr/ucb/rsh" : "/usr/bin/rsh";
# If you are not rshing directly to the CCVS server machine, make the
# following variable point at ccvs-rsh on the next machine in the
# proxy chain. If it's accessible through the PATH envariable, you
# can just set this to "ccvs-rsh".
$ccvs_rsh = "ccvs-rsh";
# There shouldn't be any user-serviceable parts beyond this point.
$host = $ARGV[0];
if ($ARGV[1] eq "-l") {
if ($#ARGV < 3) {
print STDERR $usage;
exit 1;
}
$user = $ARGV[2];
$cbase = 3;
} else {
$cbase = 1;
}
# You might think you shoul be able to do something like
# $command = join(' ', $ARGV[$cbase..$#ARGV]);
# to achieve the effect of the following block of code, but it doesn't
# work under Perl 4 on Linux, at least. Sigh.
$command = $ARGV[$cbase];
for ($cbase++; $cbase <= $#ARGV; $cbase++) {
$command .= " " . $ARGV[$cbase];
}
if (defined $ENV{"CVS_PROXY_HOST"}) {
$command = (defined $user)
? "$ccvs_rsh $host -l $user $command"
: "$ccvs_rsh $host $command";
if (defined $ENV{"CVS_PROXY_USER"}) {
exec ($rsh, $ENV{"CVS_PROXY_HOST"}, "-l", $ENV{"CVS_PROXY_USER"},
$command);
} else {
exec ($rsh, $ENV{"CVS_PROXY_HOST"}, $command);
}
} elsif (defined $user) {
exec ($rsh, $host, "-l", $user, $command);
} else {
if (defined $ENV{"CVS_PROXY_USER"}) {
exec ($rsh, $host, "-l", $ENV{"CVS_PROXY_USER"}, $command);
} else {
exec ($rsh, $host, $command);
}
}
-439
View File
@@ -1,439 +0,0 @@
#! /opt/bin/perl5
#
# Beware of the fact that this script was not written to handle
# branches in the PVCS archives, but it might work nontheless. I have
# a specific addition in this latest version that would not be
# globally useful: automatically making Framemaker files binary with
# -kb (regardless of the file extension).
# ---------------------------------
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
###########################################################################
# FUNCTION:
# To recursively walk through a PVCS archive directory tree (archives
# located in VCS/ or vcs/ subdirectories) and convert them to RCS archives.
# The RCS archive name is the PVCS workfile name with ",v" appended.
#
# SYNTAX:
# The calling syntax is:
# pvcs_to_rcs [-l]
#
# where -l indicates the operation is to be performed only in the current
# directory (no recursion)
#
# EXAMPLE:
# pvcs_to_rcs
#
# Would walk through every VCS or vcs subdir starting at the current directory,
# and produce corresponding RCS archives one level above the VCS or vcs subdir.
#
# NOTES:
# * This script does not perform any error checking or logging of any kind
# (i.e. USE AT YOUR OWN RISK)
# * This script was developed using perl-5.003 on a Sun Solaris 2.5 machine
# and executed from a csh
# * PVCS archives in VCS/ or vcs/ subdirectories are left intact
# * RCS archives are processed in the VCS/ or vcs/ subdirectories and
# are moved (forcibly) up one level upon completion of the conversion
# * This script has *not* been tested with PVCS archives with branches,
# although the only thing I believe that might need to be changed
# is the ORDER of revision processing (e.g. you can't checkin 1.2.4.1 if
# you haven't yet checked in 1.2).
# * All revisions are saved with correct "metadata" (i.e. check-in date,
# author, and log message). Any blank log message is replaced with
# "no comment". This is because RCS does not allow non-interactive
# checkin of a new revision without a comment string.
# * Revision numbers are incremented by 1 during the conversion (since
# RCS does not allow revision 1.0).
# * Version labels are assigned to the appropriate (incremented) revision
# numbers. PVCS allows spaces and periods in version labels while RCS
# does not. A global search and replace converts " " and "." to "_"
# There may be other cases that ought to be added.
# * Any workfile within the VCS/ or vcs/ will be deleted (or overwritten)
# since it is used in the checkout of each revision
# * Locks on PVCS archives should be removed (or the workfiles should be
# checked-in) prior to conversion, although the script will blaze through
# the archive nonetheless (But you would lose any checked out revision(s))
# * The -kb option is added to the RCS archive for workfiles with the following
# extensions: .bin .out .btl .rom .a07 .lib .exe .tco .obj .t8u .c8u .o .lku
#########################################################################
require("getcwd.pl");
#NOTE: Each possible binary extension is delimited by '.'
$bin_ext =
".bin.out.btl.rom.a07.lib.exe.tco.obj.t8u.c8u.o.lku.BIN.OUT.BTL.ROM.A07.LIB.EXE.TCO.OBJ
.T8U.C8U.O.LKU.";
# the main procedure that is run once in each directory
sub execdir
{
$curlevel= $curlevel +1;
#local sets the variables directory and prev directory local to the procedure
local($dir,$prevdir)=@_;
#change into the directory to be processed
chdir($dir);
#open the current directory for listing
opendir(CURDIR,".");
#initialize the list of filenames
local(@filenames);
#set filenames equal to directory listing
@filenames = readdir(CURDIR);
#clean up by closing the directory
closedir(CURDIR);
#initialize a list for any subdirectories
local(@subdirs);
#begin a for loop to execute on each filename in the list @filename
for (@filenames)
{
#if the file is a directory...
if (-d $_)
{
#include it in @subdir
push(@subdirs,$_);
}
}
#for loop of subdirs
for (@subdirs)
#if not a parent directory, run execdir on each sub dir
{
if (($_ ne '.') and ($_ ne '..') and ($maxlevel > $curlevel))
{
&execdir($_,$dir);
}
}
#save the current directory
$cd = &getcwd;
#Print output header for each directory
print("Directory: $cd\n");
#determine the last directory in this path (to only process vcs or VCS)
$_ = $cd;
$num_dirs = split /\//;
@dirs = @_;
$last_dir = $dirs[$num_dirs-1];
# print"Last directory is $last_dir\n";
#shell redirection: output from command in @ARGV is put in $output
# $output = `@ARGV`;
#begin a for loop to execute on each filename in the list @filename
for (@filenames)
{
if ( (-f $_) and ($_ ne '.') and ($_ ne '..') and ($maxlevel > $curlevel)
and ( ( $last_dir eq 'vcs' ) or ( $last_dir eq 'VCS' ) ) )
{
$got_archivefile = 0;
$got_workfile = 0;
$got_version_labels = 0;
$got_description = 0;
$got_rev_count = 0;
$file = $_;
$abs_file = $cd . "/" . $file;
print("Converting $abs_file...\n");
$vlog_output = `vlog $_`;
$_ = $vlog_output;
# Split the cvs status output into individual lines
@vlog_strings = split /\n/;
$num_vlog_strings = @vlog_strings;
$_ = $vlog_string[0];
if ( /^vlog: warning/ )
{
print("$abs_file is NOT a valid PVCS archive!!!\n");
}
elsif( $vlog_output )
{
# Collect all vlog output into appropriate variables
$num = 0;
while( $num < $num_vlog_strings )
{
# print("$vlog_strings[$num]\n");
$_ = $vlog_strings[$num];
if( ( /^Workfile:\s*/ ) && (!$got_workfile ) )
{
$got_workfile = 1;
# get the string to the right of the above search (with any path stripped)
$workfile = $';
$_=$workfile;
$num_fields = split /\//;
if ( $num_fields > 1 )
{
$workfile = $_[$num_fields - 1 ];
}
# print"Workfile is $workfile\n";
}
elsif( ( /^Archive:\s*/ ) && (!$got_archivefile ) )
{
$got_archivefile = 1;
# get the string to the right of the above search (with any path stripped)
$archivefile = $';
$_=$archivefile;
$num_fields = split /\//;
if ( $num_fields > 1 )
{
$archivefile = $_[$num_fields - 1 ];
}
# print"Archive is $archivefile\n";
}
elsif ( ( /^Rev count:\s*/ ) && (!$got_rev_count ) )
{
$got_rev_count = 1;
# get the string to the right of the above search
$rev_count = $';
print"Revision count is $rev_count\n";
}
elsif ( ( /^Version labels:\s*/ ) && (!$got_version_labels ) )
{
$got_version_labels = 1;
$first_vl = $num+1;
}
elsif ( ( /^Description:\s*/ ) && (!$got_description ) )
{
$got_description = 1;
$description = "\"" . $vlog_strings[$num+1] . "\"";
# print"Description is $description\n";
$last_vl = $num - 1;
}
elsif ( /^Rev\s*/ ) # get all the revision information at once
{
$rev_index = 0;
while ( $rev_index < $rev_count )
{
$_=$vlog_strings[$num];
/^Rev\s*/;
$rev_num[$rev_index] = $';
$_=$vlog_strings[$num+1];
if ( /^Locked\s*/ )
{
$num += 1;
}
$_=$vlog_strings[$num+1];
/^Checked in:\s*/;
$checked_in[$rev_index] = "\"" . $' . "\"";
$_=$vlog_strings[$num+3];
/^Author id:\s*/;
split;
$author[$rev_index] = "\"" . $_[2] . "\"";
$relative_comment_index = 0;
$comment_string = "";
while( ( $vlog_strings[$num+4+$relative_comment_index] ne
"-----------------------------------" ) &&
( $vlog_strings[$num+4+$relative_comment_index] ne
"===================================" ) )
{
# We need the \n added for multi-line comments. There is no effect for
# single-line comments since RCS inserts the \n if it doesn't exist already
$comment_string = $comment_string .
$vlog_strings[$num+4+$relative_comment_index] . "\n";
$relative_comment_index += 1;
}
# Convert any double quotes to an escaped double quote
$comment_string =~ s/\"/\\\"/g;
$comment[$rev_index] = "\"" . $comment_string . "\"";
$num += ( 5 + $relative_comment_index );
$rev_index += 1;
}
$num -= 1; #although there should be nothing left for this to matter
}
$num += 1;
}
# Loop through each version label, checking for need to relabel ' ' with '_'.
$num_version_labels = $last_vl - $first_vl + 1;
print"Version label count is $num_version_labels\n";
for( $i = $first_vl; $i <= $last_vl; $i += 1 )
{
# print("$vlog_strings[$i]\n");
$label_index = $i - $first_vl;
$_=$vlog_strings[$i];
split /\"/;
$label = @_[1];
$_=@_[2];
split;
$label_revision[$label_index] = @_[1];
# Create RCS revision numbers corresponding to PVCS version numbers by
# adding 1 to the revision number (# after last .)
$rcs_rev = &pvcs_to_rcs_rev_number( $label_revision[$label_index]);
$label_revision[ $label_index ] = $rcs_rev;
# replace ' ' with '_', if needed
$_=$label;
$new_label[$label_index] = $label;
$new_label[$label_index] =~ s/ /_/g;
$new_label[$label_index] =~ s/\./_/g;
$new_label[$label_index] = "\"" . $new_label[$label_index] . "\"";
# print"Label $new_label[$label_index] is for revision
$label_revision[$label_index]\n";
}
# Create RCS revision numbers corresponding to PVCS version numbers by
# adding 1 to the revision number (# after last .)
for( $i = 0; $i < $rev_count; $i += 1 )
{
$rcs_rev_num[ $i ] = &pvcs_to_rcs_rev_number( $rev_num[ $i ] );
# print"PVCS is $rev_num[ $i ]; RCS is $rcs_rev_num[ $i ]\n"
}
# Create RCS archive and check in all revisions, then label.
# PVCS vlog lists revisions last-revision-first; reverse that ordering
$first_time = 1;
for( $i = $rev_count - 1; $i >= 0; $i -= 1 )
{
print "get -r$rev_num[$i] $archivefile\\($workfile\\)\n";
# $vcs_output = `vcs -u -r$rev_num[$i] $file`;
$get_output = `get -r$rev_num[$i] $archivefile\\($workfile\\)`;
if( $first_time )
{
$first_time = 0;
$file_output = `file $workfile`;
# If an empty comment is specified, RCS will not check in the file;
# check for this case. (but an empty -t- description is fine - go figure!)
# Since RCS will pause and ask for a comment if one is not given,
# substitute a dummy comment "no comment".
if ( $comment[$i] eq "\"\"" )
{
$ci_command = "ci -f -r$rcs_rev_num[$i] -d$checked_in[$i] -w$author[$i]
-t-$description -m\"no comment\" $workfile";
}
else
{
$ci_command = "ci -f -r$rcs_rev_num[$i] -d$checked_in[$i] -w$author[$i]
-t-$description -m$comment[$i] $workfile";
}
print "$ci_command\n";
$ci_output = `$ci_command`;
# Also check here whether this file ought to be "binary"
$_=$file_output;
split;
if( $_[1] eq "Frame" )
{
print"Binary attribute -kb added (file type is Frame)\n";
$rcs_output = `rcs -kb $workfile,v`;
}
else
{
$_=$workfile;
$num_fields = split /\./;
if ( $num_fields > 1 )
{
$ext = "." . $_[$num_fields - 1] . ".";
if ( ( index $bin_ext, $ext ) > - 1 )
{
print"Binary attribute -kb added (file type is $ext)\n";
$rcs_output = `rcs -kb $workfile,v`;
}
}
}
}
else
{
$rcs_output = `rcs -l $workfile`;
# If an empty comment is specified, RCS will not check in the file;
# check for this case. (but an empty -t- description is fine - go figure!)
if ( $comment[$i] eq "\"\"" )
{
$ci_command = "ci -f -r$rcs_rev_num[$i] -d$checked_in[$i] -w$author[$i]
-m\"no comment\" $workfile";
}
else
{
$ci_command = "ci -f -r$rcs_rev_num[$i] -d$checked_in[$i] -w$author[$i]
-m$comment[$i] $workfile";
}
print "$ci_command\n";
$ci_output = `$ci_command`;
}
}
# Attach version labels
for( $i = $num_version_labels - 1; $i >= 0; $i -= 1 )
{
# print "rcs -n$new_label[$i]:$label_revision[$i] $workfile\n";
$rcs_output = `rcs -n$new_label[$i]:$label_revision[$i] $workfile`;
print "Version label $new_label[$i] added to revision $label_revision[$i]\n";
}
# Move archive file up one directory level (above vcs/ or VCS/)
$mv_output = `mv -f $workfile",v" ..`;
}
}
}
#print the output to STDOUT
# print("$output");
$curlevel=$curlevel - 1;
if ($dir ne $prevdir)
{
chdir('..');
}
}
sub pvcs_to_rcs_rev_number
{
local($input, $num_fields, @rev_string, $return_rev_num, $i);
$input = @_[0];
$_ = $input;
$num_fields = split /\./;
@rev_string = @_;
@rev_string[$num_fields-1] += 1;
$return_rev_num = @rev_string[ 0 ];
for( $i = 1; $i < $num_fields; $i += 1 )
{
$return_rev_num = $return_rev_num . "." . @rev_string[ $i ];
}
return $return_rev_num;
}
##MAIN program: checks to see if there are command line parameters
if ($#ARGV > 2) {
#if not then end and print help message
die "Usage: pvcsns [-l]\n"};
$curlevel=0-1;$maxlevel=10000;
if (@ARGV[0] eq "-l") {$maxlevel=1;shift @ARGV;}
#start the whole thing
&execdir(".",".");
-202
View File
@@ -1,202 +0,0 @@
Fri Jan 16 14:58:19 1998 Larry Jones <[email protected]>
* diff.c, diff3.c: Plug memory leaks.
Thu Jan 15 13:36:46 1998 Jim Kingdon <[email protected]>
* Makefile.in (installdirs): New rule, for when ../Makefile
recurses into this directory (bug reported by W. L. Estes).
Tue Nov 11 10:48:19 1997 Jim Kingdon <[email protected]>
* diff.c (diff_run): Change #ifdef on HAVE_SETMODE to #if to match
the other uses (fixes compilation error on unix).
* diff.c (diff_run): Don't set stdout to binary mode.
Mon, 10 Nov 1997 Jim Kingdon
* diff.c (run_diff): Open outfile in binary mode if --binary.
Thu Nov 6 12:42:12 1997 Karl Fogel <[email protected]>
and Paul Eggert <[email protected]>
* analyze.c: applied Paul Eggert's patch to fix the diff3 merge
bug described in ccvs/doc/DIFFUTILS-2.7-BUG:
(shift_boundaries): new var `inhibit_hunk_merge'; use it to
control something important that I don't quite understand, but
Paul apparently does, so that's okay.
Sat Nov 1 14:17:57 1997 Michael L.H. Brouwer <[email protected]>
* Makefile.in: Add call to ranlib to build a table of contents for
the library since some systems seem to require this.
1997-10-28 Jim Kingdon
* .cvsignore: Add files du jour for Visual C++, vc50.pdb and vc50.idb.
* system.h: Define HAVE_TIME_H.
* dir.c [_WIN32]: Define CLOSEDIR_VOID.
1997-10-18 Jim Kingdon
* build_diff.com: Add diff3.c
Fri Sep 26 14:24:42 1997 Tim Pierce <[email protected]>
* diff.c (diff_run): Save old value of optind before calling
getopt_long, then restore before returning. Eventually it would
be nice if diff_run were fully reentrant.
New diff3 library for CVS.
* Makefile.in (SOURCES): Add diff3.c.
(OBJECTS): Add diff3.o.
* diff3.c: New file, copied from diffutils-2.7. See diffutils for
earlier ChangeLogs. Undefine initialize_main macro. Remove <signal.h>.
(diff3_run): Renamed from main(). Add `outfile' argument. Remove
SIGCLD handling; we do not fork. Save optind and reset to 0
before calling getopt_long; restore after option processing done.
(read_diff): Use diff_run with a temporary output file,
instead of forking a diff subprocess and reading from a pipe.
Change DIFF_PROGRAM to "diff"; this argument is now used only for
diagnostic reporting.
(xmalloc, xrealloc): Removed.
(diff_program): Removed.
(diff_program_name): Made extern, so it may be used in other
library calls like `error'.
(initialize_main): New function.
Namespace munging. util.c defines both fatal() and
perror_with_exit(), but these cannot be used to abort diff3: both
attempt to longjmp() to a buffer set in diff.c, used only by
diff_run. This is an awful solution, but necessary until the code
can be cleaned up. (These functions do not *have* to be renamed,
since both are declared static to diff3.c and should not clash
with libdiff.a, but it reduces potential confusion.)
* diff3.c (diff3_fatal): Renamed from fatal.
(diff3_perror_with_exit): Renamed from perror_with_exit.
Eliminate exit calls.
(try_help): Change from `void' to `int'. Return, do not exit.
(diff3_fatal, diff3_perror_with_exit, process_diff): Change `exit'
to DIFF3_ABORT.
(diff3_run): Initialize jump buffer for nonlocal exits. Change
exit calls to returns. Change `perror_with_exit' to
`perror_with_name' and add a return. Change `fatal' to
`diff_error' and add a return. The reasoning is that we shouldn't
rely on setjmp/longjmp any more than necessary.
Redirect stdout.
(check_output): Renamed from check_stdout. Take stream argument
instead of blindly checking stdout. Do not close stream, but
merely fflush it.
(diff3_run): Initialize outstream, and close when done. Pass this
stream (instead of stdout) to output_diff3_edscript,
output_diff3_merge, and output_diff3.
Thu Sep 25 14:34:22 1997 Jim Kingdon <[email protected]>
* util.c (begin_output, finish_output): If PR_PROGRAM is not
defined (VMS), just give a fatal error if --paginate specified.
* Makefile.in (DISTFILES): Add ChangeLog build_diff.com
Makefile.in.
* build_diff.com: New file.
Wed Sep 24 10:27:00 1997 Jim Kingdon <[email protected]>
* Makefile.in: Also set top_srcdir. Needed to make today's other
Makefile.in change work.
* .cvsignore: New file.
* Makefile.in (COMPILE): Add -I options for srcdir (perhaps
unneeded) and change -I option for lib to use top_srcdir (needed
to avoid mixups with CVS's regex.h vs. the system one).
Sun Sep 21 19:44:42 1997 Jim Kingdon <[email protected]>
* Makefile.in (util.o): Change util.c to $<, needed for srcdir.
Sat Sep 20 12:06:41 1997 Tim Pierce <[email protected]>
New diff library for CVS, based on diffutils-2.7. See diffutils
for earlier ChangeLogs.
* Makefile.in, analyze.c, cmpbuf.c, cmpbuf.h, config.hin,
context.c, diagmeet.note, diff.c, diff.h, dir.c, ed.c, ifdef.c,
io.c, normal.c, side.c, stamp-h.in, system.h, util.c, version.c:
New files.
(COMPILE): Add -I../lib, so we can get getopt.h.
* Makefile.in: Removed anything not related to libdiff.a.
(dist-dir): New target, copied from ../lib/Makefile.in.
(DISTFILES): New variable.
(SOURCES): Renamed from `srcs'.
(OBJECTS): Renamed from `libdiff_o'.
(Makefile): Changed dependencies to reflect
new, shallow config directory structure.
(stamp-h.in, config.h.in, config.h, stamp-h): Removed.
* stamp-h.in, config.h.in: Removed.
* system.h: Remove dup2 macro (provided by ../lib/dup2.c).
Include stdlib.h if STDC_HEADERS is defined (not just
HAVE_STDLIB_H).
Sat Sep 20 05:32:18 1997 Tim Pierce <[email protected]>
Diff librarification.
* diff.c (diff_run): New function, renamed from `main'.
Initialize `outfile' based on the value of the new `out' filename
argument.
(initialize_main): New function.
* system.h: Removed initialize_main macro.
* diffmain.c: New file.
* Makefile.in (diff): Added diffmain.o.
(libdiff): New target.
(AR, libdiff_o): New variables. libdiff_o does not include
xmalloc.o, fnmatch.o, getopt.o, getopt1.o, regex.o or error.o,
because these functions are already present in CVS. It will take
some work to make this more general-purpose.
Redirect standard output.
* util.c: Redirect stdout to outfile: change all naked `printf'
and `putchar' statements to `fprintf (outfile)' and `putc (...,
outfile)' throughout. This should permit redirecting diff output
by changing `outfile' just once in `diff_run'.
(output_in_progress): New variable.
(begin_output, finish_output): Use `output_in_progress', rather than
`outfile', as a semaphore to avoid reentrancy problems.
(finish_output): Close `outfile' only if paginate_flag is set.
* diff.c (check_output): New function, was check_stdout. Take a
`file' argument, and flush it instead of closing it.
(diff_run): Change check_stdout to check_output.
(compare_files): Fflush outfile, not stdout.
Eliminate exit statements.
* diff.h: Include setjmp.h.
(diff_abort_buf): New variable.
(DIFF_ABORT): New macro.
* diff.c (diff_run): Change all `exit' statements to `return'.
Set up diff_abort_buf, so we can abort diff without
terminating (for libdiff.a).
(try_help): Return int instead of void; do not exit.
* util.c (fatal): Use DIFF_ABORT instead of exit.
(pfatal_with_name): Use DIFF_ABORT instead of exit.
Namespace cleanup (rudimentary). Strictly speaking, this is not
necessary to make diff into a library. However, namespace
clashes between diff and CVS must be resolved immediately, since
CVS is the first application targeted for use with difflib.
* analyze.c, diff.c, diff.h, util.c (diff_error): Renamed from `error'.
* version.c, diff.c, diff.h, cmp.c, diff3.c, sdiff.c
(diff_version_string): Renamed from version_string.
* diff.c, util.c, diff.h, diff3.c, error.c (diff_program_name):
Renamed from program_name.
* util.c (xmalloc, xrealloc): Removed.
* Makefile.in (diff_o): Added error.o and xmalloc.o.
-104
View File
@@ -1,104 +0,0 @@
# Makefile for GNU DIFF
# Copyright (C) 1988,1989,1991,1992,1993,1994,1997 Free Software Foundation, Inc.
#
# This file is part of GNU DIFF.
#
# GNU DIFF is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU DIFF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU DIFF; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#### Start of system configuration section. ####
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
subdir = diff
CC = @CC@
AR = ar
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
RANLIB = @RANLIB@
CFLAGS = @CFLAGS@
prefix = @prefix@
exec_prefix = @exec_prefix@
PR_PROGRAM = /bin/pr
#### End of system configuration section. ####
SHELL = /bin/sh
# The source files for all of the programs.
SOURCES = diff.c diff3.c analyze.c cmpbuf.c cmpbuf.h io.c context.c ed.c \
normal.c ifdef.c util.c dir.c version.c diff.h side.c system.h
OBJECTS = diff.o diff3.o analyze.o cmpbuf.o dir.o io.o util.o \
context.o ed.o ifdef.o normal.o side.o version.o
DISTFILES = $(SOURCES) ChangeLog build_diff.com Makefile.in
all: libdiff.a
# $(top_srcdir)/lib is so we don't get the system-supplied headers for
# functions that we supply ourselves in lib. $(srcdir) is perhaps not
# necessary if we assume the unix compiler behavior whereby "" looks
# in the directory containing the .c file first.
# -I. is probably unnecessary (I don't think we generate any .h files).
# -I.. is for config.h.
COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) \
-I. -I.. -I$(srcdir) -I$(top_srcdir)/lib $(CFLAGS)
.c.o:
$(COMPILE) $<
libdiff libdiff.a: $(OBJECTS)
$(AR) cr libdiff.a $(OBJECTS)
-$(RANLIB) libdiff.a
$(OBJECTS): diff.h system.h
analyze.o cmpbuf.o: cmpbuf.h
util.o: util.c
$(COMPILE) -DPR_PROGRAM=\"$(PR_PROGRAM)\" $<
install: all
installdirs:
@: nothing to do for installdirs
.PHONY: installdirs
TAGS: $(SOURCES)
etags $(SOURCES)
clean:
rm -f *.o *.a core
mostlyclean: clean
distclean: clean
rm -f TAGS tags Makefile
realclean: distclean
Makefile: Makefile.in ../config.status
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
dist-dir:
mkdir ${DISTDIR}
for i in ${DISTFILES}; do \
ln $(srcdir)/$${i} ${DISTDIR}; \
done
# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
File diff suppressed because it is too large. Load diff
Loaded 100 of 1347 files, more files were not shown because too many files have changed in this diff. Show more