Commit Graph

400 Commits

Author SHA1 Message Date
Jordan K. Hubbard
fe7283fc23 Choose more paranoid modes for the temporary directory so the user can't
easily browse its contents.

Noted by:	Antoine
2001-11-22 01:54:33 +00:00
Maxim Sobolev
0a811cbf0c Improve recently committed fix for -t bug.
Submitted by:	"Andrew L. Neporada" <andr@dgap.mipt.ru>
MFC after:	3 days
2001-11-15 15:13:24 +00:00
Maxim Sobolev
f4dfe934d1 Make `-b' option actually work as advertised. 2001-10-25 07:56:20 +00:00
David E. O'Brien
150e0ea706 Increase the number of packages that can be installed by an order of
magnitude.  Geez, this is Unix, what is with the arbitrary needless
constants.
2001-10-16 06:42:06 +00:00
Maxim Sobolev
181a5b5a6e Fix "off by 1" error introduced in the previous commit by replacing strncpy(3)
with strlcpy(3).

MFC after:	2 weeks
2001-10-16 03:04:15 +00:00
Maxim Sobolev
be5780f384 Use strncpy(3) instead of strcpy(3) to copy optarg into a fixed-sized buffer.
Prompted by:	dd
MFC after:	2 weeks
2001-10-15 18:21:08 +00:00
Dima Dorfman
f06c683e47 The user wants to ensure, not insure, that the package isn't going to
damage their system.
2001-10-15 13:49:51 +00:00
Maxim Sobolev
77b90d2a0e Make `-t' flag in pkg_*(1) tools actually working.
PR:		30843
Submitted by:	Vladimir B. Grebenschikov <vova@express.ru>
MFC after:	2 weeks
2001-10-11 11:29:12 +00:00
Maxim Sobolev
f3fa78b0b5 - Introduce a notion of `packing list format version'. This allows making
non-backward compatible changes in the format of packing list and handle
  them gracefully;
- fix a longstanding issue with symlinks handling. Instead of recording
  checksum for the file symlink points to, record checksum for the value
  returned by readlink(2). For backward compatibility increase packing list
  format minor version number and provide a fallback to a previous behaviour,
  if package in question was created with older version of pkg_* tools;

Submitted by:	Alec Wolman <wolman@cs.washington.edu>, sobomax

- don't record MD5 checksum for device nodes, fifo's and other non-regular
  files.

Submitted by:	nbm
MFC in:		2 weeks
2001-10-10 08:21:41 +00:00
Maxim Sobolev
d100deb8cc WARNS=2 cleanup.
Tested on:	i386, alpha
MFC after:	2 weeks
2001-10-10 06:58:42 +00:00
Maxim Sobolev
c5471e323b OOPS, delete some commented out debugging code committed along with r.1.25.
MFC after:	2 weeks
2001-10-08 17:09:08 +00:00
Maxim Sobolev
4bbe1f1cd4 - Allow package archive to be created from a locally installed package. This
allows for an easy way to backup old version of port prior to installing
  a new one;
- silence compiler warnings by killing some unused variables and adding
  all includes necessary.

MFC after:	2 weeks
2001-10-08 17:01:35 +00:00
Maxim Sobolev
a09c8e438b Various fixes and improvements:
- fix harmless compiler's warnings (unused variables and missed prototype);
- before refusing to delete package because "there are packages installed
  that require this package" check that packages in question is actually
  installed;
- add new `-r' option to pkg_delete(8), which instructs it to delete not only
  packages specified at command line, but all packages that depend on
  specified packages as well.

MFC after:	2 weeks
2001-09-19 08:06:48 +00:00
Bruce A. Mah
a953848c04 Drop maintainership. 2001-09-18 17:58:10 +00:00
Bruce A. Mah
9cc1dc75e7 Support the use of ${PORTSDIR} to find a ports tree INDEX file in
an other-than-default location.

PR:		bin/30350
Submitted by:	"NINOMIYA Hideyuki <NINOMIYA Hideyuki" <nin@jp.FreeBSD.org>
MFC after:	3 days
2001-09-18 17:56:44 +00:00
Maxim Sobolev
9ad4f43281 Fix segfault introduced in previous commit (when adding local packages). 2001-09-17 13:37:50 +00:00
Dima Dorfman
e7254b02b2 Use a colon to separate the user and group when executing chown(1).
Periods aren't supported anymore.

PR:		30507
Submitted by:	Georg-W. Koltermann <gwk@sgi.com>
2001-09-11 11:11:38 +00:00
Bill Swingle
0fe2f8cb85 Fixes problem with pkg_add -r when adding multiple pkgs.
Reviewed by:	chris
2001-09-07 22:32:37 +00:00
Brian Somers
2313781df2 Handle snprintf() returning < 0 (not just -1)
MFC after:	2 weeks
2001-08-20 15:09:34 +00:00
Brian Somers
36c1612b5e Handle snprintf() returning -1.
MFC after:	2 weeks
2001-08-20 13:24:39 +00:00
Maxim Sobolev
89a0be2e4f Remove duplicate umask(2) call.
PR:             dusty/7998
Submitted by:   Stefan Eggers <seggers@semyam.dinoco.de>
MFC after:	2 weeks
2001-08-15 14:22:01 +00:00
Ruslan Ermilov
c5e7e03a14 Spell "FreeBSD" with "F" and "BSD" in uppercase. 2001-08-13 16:33:00 +00:00
David E. O'Brien
0dd1c79320 Reduce private "lesser known" function redirection to improve clarity.
Approved by:	jkh
2001-08-13 04:18:30 +00:00
Ruslan Ermilov
57e4378bf6 mdoc(7) police: protect trailing full stops of abbreviations
with a trailing zero-width space: `e.g.\&'.
2001-08-10 13:45:36 +00:00
Kris Kennaway
1e1bbe0f97 Recognise @option directives instead of falling through to the default
"unknown command" clause.

PR:	29262
2001-08-06 20:09:26 +00:00
Maxim Sobolev
ea0cdbc8ac exists(../../crypto) --> exists(${.CURDIR}/../../crypto)
MFC after:	1 month
2001-08-02 18:21:48 +00:00
Jonathan Chen
f0b8b1fccb fix for pkg_add to symlinked prefix directories that are more than 1 link deep.
PR:	bin/28274
Submitted by:	John Hein <jhein@timing.com>
MFC after:	1 month
2001-08-02 18:20:27 +00:00
Maxim Sobolev
3d02d34c75 Cosmetics: replace dozen instances of "(tmp = getenv(PKG_DBDIR) ? tmp : DEF_LOG_DIR)"
with macro.

MFC after:	1 month
2001-08-02 13:13:06 +00:00
Maxim Sobolev
a48179c2fa Cosmetics: kill blank lines at the end of file.
MFC after:	1 month
2001-08-02 13:08:43 +00:00
Maxim Sobolev
2d800f2bd9 Usability tweak:
Use '' quotes instead of `' to delimit names of files and packages in
  warning and error messages, because it is easier to cut-n-paste name in
  question that way (single click) without confusing the shell. And yes,
  I know that it is less eye-candy...

MFC after:	1 month
2001-08-02 12:38:29 +00:00
Maxim Sobolev
94d81832dd When there is a file that can't be deleted due to checksum mismatch print name
of that file to stdout to simplify debugging. IMO it was a mistake to print
this warning only when `verbose' mode is on.

MFC after:	1 month
2001-08-02 12:19:32 +00:00
David E. O'Brien
43b866b0ed The security officer requested this be backed out for discussion. 2001-07-28 04:44:09 +00:00
David E. O'Brien
2bae1ab6a5 Remove s_strl*(). I am not sure what was thought they accomplished.
When reading the code I had to stop, say "ok, what does *these*
modifications of strl*() do?  Pull out grep.  Oh, not in add/, maybe above
in ../lib/?  Yep.  So what do they do?  Comments above them are misleading,
guess I'll have to read the code.  Oh, they just test strl* against the
size and return the result of the test.  Now I can continue to read the
code I was.

The uses of s_strl*() then test that result and errx()'s.
Lets think about the "optimized" code I am removing:

In general the compiler pushes the three args to strl* onto the stack and calls
s_strl*.  s_strl* has to indirectly access 3 args from the stack.  Then push
them on the stack a 2nd time for the real strl* call.  s_strl* then pops the
return from strl* off the stack; or moves it from the register it was returned
in, to the register where tests can happen.  s_strl* then pops the three
arguments to strl*.  Perform the test, push the result of the test, or move it
from the result register to the return value register.  The caller to s_strl*
now has to either pop the return value of s_strl* or move it from the return
value register to the test register.  The caller then pops the three args to
s_strl* off the stack (the same args that s_strl* itself had to pop off after
the real call to strl*).  The s_strl* caller then performs a simular test to
what has already been done, and conditionally jumps.  By doing things this way, we've given the compiler optimizer less to work with.

Also, please don't forget the that call to s_strl* has possibly jumped to code
not in the cache due to being far away from the calling code, thus causing a
pipeline stall.

So where is the "optimization" from s_strl*?
It isn't code clarity.
It isn't code execution speed.  It isn't code size either.
2001-07-28 01:59:58 +00:00
Kris Kennaway
371af8a555 Only match the first osreldate date range for constructing the FTP URL,
not all of them.

Noticed by:	obrien
2001-07-26 20:25:50 +00:00
Maxim Sobolev
a153062b97 Use reallocf(3) to increase size of malloc'ed buffer instead of
malloc()+memcpy()+free().
2001-07-20 13:20:32 +00:00
David E. O'Brien
90e655ea4e Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.
2001-07-20 06:20:32 +00:00
Kris Kennaway
1da665ef09 Correct a reversion in r1.39 which introduced a new instance of strcpy()
after r1.38 had attempted to remove them all.
2001-07-19 06:01:23 +00:00
Dima Dorfman
f247324df7 Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
Ruslan Ermilov
a4c37c816b mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 15:12:08 +00:00
Maxim Sobolev
0add99417d bzip2(1) is in the base system - we don't need /usr/local/bin in the PATH
anymore.
2001-07-10 15:10:47 +00:00
Dima Dorfman
70d51341bf mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
Brian Somers
7bc6d0158f Fix the type of the NULL arg to execl()
Idea from: Theo de Raadt <deraadt@openbsd.org>
2001-07-09 09:24:06 +00:00
Bruce A. Mah
50ed42ac07 Fix usage bogon (-d doesn't take any arguments).
MFC after:	3 days
2001-06-13 21:34:12 +00:00
Bruce A. Mah
607dba5ff6 Add a -s option to pkg_version, which limits output to packages
matching a given string.

PR:		26114
Submitted by:	edwin@mavetju.org (with modifications and manpage update)
MFC after:	3 days
2001-06-13 20:38:46 +00:00
Dag-Erling Smørgrav
5333a1958c Use getdtablesize() instead of OPEN_MAX.
Submitted by:	bde
2001-06-13 11:55:40 +00:00
Jordan K. Hubbard
11fed5e2e0 Properly quote recursive pkg_add operations so that filenames with
spaces or special characters in them won't barf.
2001-06-11 23:27:42 +00:00
Anton Berezin
1f38377a7b Check for the existence of the Makefile in the port skeleton directory
before running make.  If the package origin points to a non-existent or
stale port, report this package as orphaned, instead of producing more
general `unknown in index' message.

PR:             27707
Submitted by:   myself, roamer
Approved by:    bmah, markm
2001-06-11 21:31:04 +00:00
Dag-Erling Smørgrav
2b67592fad Pass on the verbose option to fetchGetURL().
In the child that's set up to run tar(1), close all file descriptors except
stdin, stdout and stderr.

PR:		bin/27760
2001-06-11 14:18:26 +00:00
Jim Pirzyk
d316920f0c Fixed pkg_add so when it does not find a package, it returns != 0.
PR:		bin/23083
Submitted by:	Patch submitted by Maxime Henrion <mux@qualys.com>
MFC after:	2 weeks
2001-06-04 21:35:08 +00:00
Eric Melville
80cbb3c13a Cross reference pkg_update(1).
Approved by:	murray
2001-05-31 19:15:25 +00:00