Commit Graph

1860 Commits

Author SHA1 Message Date
junyoung
272e959468 Remove '\n' at the end of dbg strings. 2002-09-24 08:56:30 +00:00
junyoung
61e1361da6 END_SYM is no longer used. 2002-09-24 06:43:14 +00:00
mycroft
97aed9957d -I${.CURDIR} is done at the top-level, so there's no need to do it here. 2002-09-24 01:59:44 +00:00
mycroft
b59c269424 Nuke reference to RTLD_RELOCATE_SELF. 2002-09-24 01:58:44 +00:00
mycroft
c3ece2a45f Use/require AT_PAGESZ on all platforms. (The kernel has exported it for ~3
years now.)  Use _rtld_pagesz instead of getpagesize() to determine the page
size in our local malloc().  Saves a system call.

Also, since we're now relocated early, we don't need to be careful to avoid
globals, so most of the VARPSZ hacks are eliminated.
2002-09-24 01:24:44 +00:00
mycroft
d1351c627c Um, a little bit of sanity here:
l_addr is always supposed to be obj->relocbase -- or so says the GDB code that
uses it.  So, set it to this on all platforms.  It already was on VAX
explicitly, and on everything else except MIPS implicitly (because
mapbase==relocbase for all existing shlibs).  For some silly/stupid reason, a
new field was created that the MIPS GDB currently uses.
Another MD #ifdef bites it.
2002-09-24 00:33:39 +00:00
mycroft
f1184d192e Very minor cleanup of the previous. 2002-09-24 00:02:46 +00:00
mycroft
86103e2f0e Several small changes that shave 7-8% off the simple-exec-loop test:
* Rename _rtld_find_library() to _rtld_load_library().  It now calls
  _rtld_load_object() if necessary to actually load the object, rather
  than having the caller do it.  To do this, it also takes the `mode'
  argument that gets passed to _rtld_load_object().

* On a related note, remove _rtld_check_library(), and instead call
  _rtld_load_object() to instead try actually loading the object.  We
  save two extra namei's and a bunch of redundant work (almost
  literally the same code) this way.

* In _rtld_map_object(), mmap(2) the first page read-only, rather than
  read(2)ing it.

* In _rtld_symlook_obj(), compare the *second* character of the symbol
  name before calling strcmp().  (This first character is too
  frequently `_', and turns out to not be helpful, in libc.)

* Also in _rtld_symlook_obj(), remove the bogus STT_FUNC special case
  -- this also allows removing the `in_plt' argument to
  _rtld_symlook_list() and _rtld_symlook_obj().

Also:

* In _rtld_obj_from_addr(), rather than trying to look up `_end' in
  the each object, instead use obj->mapsize as the upper bound.
2002-09-23 23:56:46 +00:00
mycroft
aae6c28cf9 null commit 2002-09-23 12:44:34 +00:00
itojun
a9fc5f306a poll.h, not sys/poll.h 2002-09-23 03:32:34 +00:00
mycroft
c3a2d8b7ba Add combreloc code here too. 2002-09-21 17:51:44 +00:00
junyoung
930998f892 Print the name of dynamic linker actually loaded. 2002-09-21 05:24:17 +00:00
mycroft
9a36a8340f Use the argument to stilloob() for the poll... 2002-09-20 19:13:24 +00:00
mycroft
e62e5a8b1a Remove dead code. 2002-09-20 19:11:17 +00:00
mycroft
49ac051d58 Remove a small piece of dead code. 2002-09-20 19:07:34 +00:00
junyoung
48910dcfc1 Cosmetic changes (long lines). 2002-09-20 03:39:22 +00:00
itojun
89b1e287f7 find_user() in process.c does an unbounded copy into a destination
buffer that is smaller in size than the source buffer.

also, there is no guarantee that any of the string components of
the request packet are null terminated.

in some cases, not all elements of the response buffer are
explicitly set. specifically pad and addr. a talk client can spy to
see which host is talking to which host by sending out regular
packets, to which talkd responds without clearing the addr element.

from xs@kittenz.org
2002-09-19 14:39:51 +00:00
junyoung
18139870a5 Cosmetic changes. 2002-09-19 14:05:37 +00:00
christos
6d0f752a65 don't core dump setting progname if argv[0] == NULL. From xs@kittenz.org 2002-09-19 13:59:46 +00:00
lukem
e3b1a0e70b use NETBSDSRCDIR as appropriate 2002-09-19 03:17:50 +00:00
mycroft
720a68f0ca select() -> poll() 2002-09-18 20:58:56 +00:00
mycroft
51581bcb01 select() -> poll() 2002-09-18 20:37:11 +00:00
mycroft
015ea63be5 Fix an error message. 2002-09-18 20:20:28 +00:00
mycroft
315144beb5 select() -> poll() 2002-09-18 20:17:55 +00:00
mycroft
5580adb284 select() -> poll() and nanosleep() 2002-09-18 20:04:51 +00:00
junyoung
a5390eb121 _rtld_setup_pltgot() belongs to reloc.c. 2002-09-18 07:35:40 +00:00
lukem
bafe5da620 use bsd.own.mk instead of the (obvious typo of) bsd.obj.mk 2002-09-18 06:24:33 +00:00
lukem
99fe9d3e76 minor makefile delint 2002-09-18 06:17:38 +00:00
junyoung
9754fa4d8e Make immediate binding work again by actually implementing
_rtld_relocate_plt_objects(). Note that this is for i386 only;
any efforts to make it work on other platforms are left to
those who are using them...
2002-09-17 07:29:46 +00:00
thorpej
7e6d181789 No PC24 relocs will ever be unaligned. Pointed out by mycroft. 2002-09-15 01:08:04 +00:00
thorpej
672853f217 It is possible for reloc entries to point to unaligned locations; handle
this.
2002-09-15 00:52:08 +00:00
thorpej
a2130a3a09 It is possible for reloc entries to point to unaligned locations; handle
this.
2002-09-14 23:53:21 +00:00
thorpej
b01748bb26 It is possible for reloc entries to point to unaligned locations; handle
this.
2002-09-14 23:21:13 +00:00
mycroft
a95d62a38e In _rtld_bind_mips(), if the symbol is undefined, die. 2002-09-13 20:32:24 +00:00
mycroft
712b838f43 Kill the extra newline in assert messages. 2002-09-13 19:50:00 +00:00
mycroft
cc2b1e9844 Add an explanatory comment. 2002-09-13 19:27:19 +00:00
mycroft
e3db70741f Turn DEBUG back on by default. It doesn't take much space. 2002-09-13 18:28:58 +00:00
mycroft
60330f4a69 The sense of the SHN_ABS test has always been reversed. Fortunately nobody
ever tried to reference stuff like _DYNAMIC_LINK and _gp_disp in C code...
2002-09-13 17:36:00 +00:00
mycroft
8f7fa0cfde Put back the lazy binding. For some bizarre reason, the linker occasionally
does not create a PLT entry for a symbol, so we test st_value!=0 to see
whether we can do a PLT fixup.
2002-09-13 17:07:12 +00:00
mycroft
a8dd8878cf Er, turn off lazy binding for the moment. It doesn't seem to be fully working. 2002-09-13 16:54:14 +00:00
mycroft
c1cf8538ec Simplify the GOT relocation code somewhat. 2002-09-13 16:31:28 +00:00
mycroft
e8b2fe1d2a Actually do lazy binding on this platform. 2002-09-13 16:03:20 +00:00
thorpej
7c96dd1581 Rename man/config.{c,h} to man/manconf.{c,h}, so we don't have to
worry about problems including "config.h" when building as a host
tool.
2002-09-13 15:56:37 +00:00
mycroft
89a39bb54e The textrel special case is only needed for MIPS (due to a bug in BFD). 2002-09-13 15:27:30 +00:00
mycroft
7a962f974a Kill the sparc64 argc conversion hack. 2002-09-13 14:23:07 +00:00
mycroft
a18c524897 Figure out obj->pltrel(a) after the dynamic section is parsed, so the relative
order of DT_PLTREL and DT_JMPREL is irrelevant.  Removes the need for yet
another weird #ifdef.
Also, be slightly more careful with the rel(a)lim trimming.
2002-09-13 13:28:43 +00:00
mycroft
c74fdd7069 Use the addend on GLOB_DAT relocs (same as ABS32). 2002-09-13 05:45:46 +00:00
mycroft
c65330320a Do not use the implicit addend on REFQUAD relocs (same as GLOB_DAT). 2002-09-13 05:45:13 +00:00
mycroft
daf8118731 Remove an old comment. 2002-09-13 04:09:49 +00:00
mycroft
2f59687514 Almost all of the items in here are done. 2002-09-13 04:05:00 +00:00
mycroft
777a2b8bb0 If we match a symbol name, but it's undefined, do not continue searching the
hash chain.
2002-09-13 03:40:40 +00:00
mycroft
bbe45a0623 Remove a dumb #ifdef -- if VARPSZ is not defined on sparc, the build will
bomb anyway.
2002-09-13 03:22:08 +00:00
mycroft
4de09f873b Nuke an unneeded hack for the Alpha. 2002-09-13 03:17:21 +00:00
mycroft
807a6ace45 Nuke two frivolous assert()s. 2002-09-13 03:12:40 +00:00
mycroft
4b55da479c _rtld_bind() is not used on MIPS. Should probably move it to MD code. 2002-09-13 03:09:38 +00:00
itojun
a05a73b5b6 revert previous. wtmp{,x} entries need not be \0-terminated, so
strncpy is more proper.
2002-09-13 02:58:54 +00:00
mycroft
f64e457cee Remove one more `dodebug' argument. 2002-09-12 23:11:37 +00:00
mycroft
a3b892d178 Nuke -DRTLD_RELOCATE_SELF and `dodebug' from orbit. 2002-09-12 22:56:28 +00:00
mycroft
f13bdd9850 Add some consts. 2002-09-12 21:06:38 +00:00
mycroft
5ad776fbd2 Move another declaration that doesn't belong in MI source. 2002-09-12 20:27:34 +00:00
mycroft
de4565ee93 Prototype different functions. 2002-09-12 20:24:03 +00:00
mycroft
547bc13b97 _rtld_bind_start() is not used in MI code, so declare it in the MD code. 2002-09-12 20:20:58 +00:00
mycroft
bf04efbfda ld.elf_so has no textrels on arm, i386 or vax -- and shouldn't on any platform,
but that's beside the point.
2002-09-12 19:43:03 +00:00
mycroft
6530c89689 Slight tweak. 2002-09-12 18:43:17 +00:00
mycroft
326f270bfb The GOT is Elf_Addr[], not Elf_Word[]... 2002-09-12 18:36:43 +00:00
mycroft
6f0bda739f This ld script is now unnecessary. 2002-09-12 18:33:39 +00:00
mycroft
1165ce6f38 Clean up a little. 2002-09-12 18:28:53 +00:00
mycroft
2346aaad04 Move GOT relocation code from _rtld_setup_pltgot() to
_rtld_relocate_nonplt_objects().  Add GOT self-relocation in
_rtld_relocate_nonplt_self().
MIPS ld.elf_so can now relocate itself.
2002-09-12 18:21:18 +00:00
mycroft
2b2534febf Add a `relocbase' argument to _rtld() and _rtld_init(), which is passed in
from the glue code in _rtld_start().  This is used to set objself.relocbase,
rather than assuming that it's the same as objself.mapbase (or 0 on MIPS).
Now -- with a bug fix to the kernel -- ld.elf_so can be linked at any VMA.
2002-09-12 17:45:41 +00:00
mycroft
d04429c6a7 Figure out the relocation offset and pass it to _rtld(). 2002-09-12 17:43:30 +00:00
mycroft
ebf50cdfbc Update comments. 2002-09-12 17:18:37 +00:00
mycroft
ac81e3266b Snapshot of work to make MIPS ld.elf_so relocatable. 2002-09-12 17:08:32 +00:00
mycroft
5ee0e5e1c4 Pass the calculated relocation offset down to _rtld(). 2002-09-12 17:07:25 +00:00
wiz
c4de963fb8 Bump date for -8. 2002-09-12 10:06:51 +00:00
wiz
d5d10ab7d3 Sort options. 2002-09-12 09:34:24 +00:00
itojun
57afbee27d use strl*, not strn*. 2002-09-12 08:55:31 +00:00
lukem
38a05c7450 Use LOGIN_NAME_MAX instead of `10' for the size of the curname[] buffer.
Allows /etc/ftpchroot to work correctly for usernames > 9 characters.

Noted by Max Khon in the freebsd-stable mailing list, via Thomas Vogt in
private email.
2002-09-12 06:40:43 +00:00
kim
968e6be5e6 Replace -i with -8, which enables new 8-bit pass-through on the client. 2002-09-12 01:40:54 +00:00
bjh21
3cc5ae01bc Correct somewhere where, in rev 1.3, two new sentences had been dropped
into the middle of an existing sentence, and put them after it instead.
2002-09-11 23:11:41 +00:00
mycroft
1da1ca49f2 Do the _rtld_relocate_nonplt_self() thing here, and nuke the ld script. 2002-09-11 22:28:32 +00:00
mycroft
fb69b8bec4 Implement _rtld_relocate_nonplt_self() here. 2002-09-11 21:14:08 +00:00
mycroft
a57ae642a3 We don't use _GLOBAL_OFFSET_TABLE_ any more, so don't .global it. 2002-09-11 20:56:09 +00:00
mycroft
fa0b5c37b2 This is a gratuitous null commit to force rtld.o to be rebuilt. 2002-09-11 20:48:21 +00:00
mycroft
f1725abea5 Add a _rtld_relocate_nonplt_self() here too. 2002-09-11 20:45:52 +00:00
mycroft
403e42f619 Do self-relocation similar to sparc. 2002-09-11 19:46:40 +00:00
mycroft
e46eb805f1 This ld script is no longer necessary. 2002-09-11 19:46:04 +00:00
mycroft
aa1330ce71 Do the _rtld_relocate_nonplt_self() thing for SPARC. 2002-09-11 19:11:05 +00:00
mycroft
82148aec74 The ld script is no longer necessary. 2002-09-11 18:20:47 +00:00
mycroft
d603bed369 Implement _rtld_relocate_nonplt_self() on Alpha. 2002-09-11 18:18:37 +00:00
mycroft
735f9f38c0 Split the `self' case out of _rtld_relocate_nonplt_objects, into a new function
_rtld_relocate_nonplt_self(), which is called from _rtld_start.
Now we're completely relocated before main() is called.
We also no longer need _GOT_END_, so junk the ld script.

This code assumes that ld.elf_so only contains RELATIVE relocs, but that's
supposed to be the case for -Bsymbolic anyway.
2002-09-11 17:23:23 +00:00
junyoung
b240241362 Add $NetBSD$. 2002-09-11 14:19:30 +00:00
joda
a55a6f7fef now gone 2002-09-10 22:44:28 +00:00
joda
7d3aba796f don't build kfd; there are security issues with heimdal 0.4e, and we
don't actually need it
2002-09-10 22:17:04 +00:00
mycroft
db439ed878 Only one linker script is needed. 2002-09-10 14:19:18 +00:00
itojun
6c581a525d tabify 2002-09-10 04:06:26 +00:00
kim
5d2f386289 Add a switch for easy enabling of single-byte 8-bit output.
This is somewhat of a hack, but I find it better than having
to run env(1) from inetd(8), or changing the environment for
inetd(8) itself (and thus all daemons started by it).
2002-09-10 03:29:01 +00:00
mycroft
289d4ac1a5 Remove unneeded cruft from _rtld_start. 2002-09-10 02:52:33 +00:00
mycroft
d048e19122 Shorten the startup sequence by a few instructions. 2002-09-10 02:24:51 +00:00
mycroft
9f0e145106 Nuke RTLD_RELOCATE_SELF on ARM. 2002-09-09 19:28:36 +00:00
mycroft
d22977bb61 Indent branch delay instructions. 2002-09-09 19:01:52 +00:00
mycroft
c127ff08fb Nuke RTLD_RELOCATE_SELF for SPARC. 2002-09-09 18:10:20 +00:00
mycroft
89520a5f6e Sync with current binutils. 2002-09-09 14:41:25 +00:00
mycroft
ae0c8dfbc2 Get rid of RTLD_RELOCATE_SELF on i386.
* Add a ld.so.script that exports _GOT_END_.
* Prebind the GOT in _rtld_start.
* Skip over GOT relocs in _rtld_relocate_nonplt_objects().
This makes debugging work better at least.
2002-09-09 14:08:07 +00:00
wiz
221d594f18 Mention that -DDEBUG compilation is needed to get LD_DEBUG support.
Noted by Julio Merino in misc/18231.
2002-09-08 23:44:09 +00:00
thorpej
6a37882ec7 Fix a serious performance problem for large programs on the Alpha.
Large programs need multiple GOTs.  The lazy binding stub in the PLT
can be reached from any of these GOTs, but the dynamic linker only
has enough information to fix up the first GOT entry.  Thus, calls
through the other GOTs went through the time-consuming lazy binding
process on every call.

This fix rewrites the PLT entries themselves to bypass the lazy binding
for those GOT entries that the dynamic linker can't fixup.

Fix from FreeBSD.

Note that now that we patch up the PLT, we need to put back the "imb"
that was removed from the binder exit path.
2002-09-08 02:48:28 +00:00
mycroft
492895a9f9 Expand the comment about the R_TYPE(RELATIVE) special-case, as it's not quite
obvious from the code.  Also, just do it all the time, as an optimization.
2002-09-06 15:51:23 +00:00
mycroft
3eee01c5b9 Make the reloc tables const. 2002-09-06 15:32:56 +00:00
mycroft
6f0fac5efa Pass down an additional flag to _rtld_relocate_nonplt_objects() which
indicates whether we're relocating ld.elf_so itself.  Use this in some places
rather than hackish tests on `dodebug'.  (The Alpha and HPPA `dodebug' tests
were actually noops, because RTLD_RELOCATE_SELF is not set, and therefore
dodebug is always true.)
2002-09-06 15:17:53 +00:00
junyoung
3ffe941c3a Remove typedef which was never used. Meaningless comment as well. 2002-09-06 13:27:48 +00:00
mycroft
0df8d18100 Introduce a new flag, `isdynamic', which is used to remember whether the
executable was of type ET_DYN.  Use this instead of `mainprog' to determine
whether we need to do base-relative fixups of the PLT.  (This allows loading
non-relocatable objects, should we desire to do that at some point...)
2002-09-06 13:20:29 +00:00
mycroft
69b9a24021 More const poisoning. Now the entire _rtld_bind() path useds a const Obj_Entry. 2002-09-06 12:00:40 +00:00
mycroft
b97e4047b7 Re-poison a lot of consts, now that the mark shite is gone. 2002-09-06 03:12:04 +00:00
mycroft
a04012e731 Split _rtld_relocate_plt_object() into two MD functions:
* _rtld_relocate_plt_lazy() fixes up all the relocs pointing to the PLT.  (On
  most platforms it just does a simple base-relative fixup; on SPARC it does
  nothing.)
* _rtld_relocate_plt_object() does immediate binding for a PLT entry.
The basic gist is that this saves a bit of time on SPARC (where the iteration
through the pltrela table was gratuitous), and a little less time on all other
platforms.  A whole lot of #ifdef'ed crap is moved out of reloc.c, too.

NOT tested on: hppa sh x86_64
2002-09-06 03:05:35 +00:00
mycroft
5f016a11ef Repair a slight biff I made earlier -- do not exit the loop in
_rtld_relocate_nonplt_objects() early.
2002-09-06 02:01:39 +00:00
mycroft
c59ffb0cc4 Remove all of the mark' code. This is responsible for the undefined PLT
symbol' errors, probably because the increment gets interrupted occasionally by
a signal.  In general, _rtld_bind() should not modify ANY internal state.
2002-09-05 21:57:09 +00:00
mycroft
ac191986f3 Partially fix up some debug printf()s that don't need to use defobj. 2002-09-05 21:31:30 +00:00
mycroft
bdc2ac1520 A few things:
* Pass a symbol number to _rtld_find_symdef(), not a r_info.
* Don't try to do a symbol lookup when we find an unsupported relocation;
  instead get the symbol name from the referencing object's strtab.
* Add preliminary support for `-z combreloc'-style startup optimization on
  i386, `#ifdef COMBRELOC'.
2002-09-05 21:21:06 +00:00
mycroft
1fa950d044 Fix one indentation error. 2002-09-05 20:12:43 +00:00
mycroft
74444a2ddb Rename _rtld_relocate_nonplt_object() to _rtld_relocate_nonplt_objects(),
and push the outer loop into it.  This actually shaves a couple % off startup
time at least on PCs.
2002-09-05 20:08:14 +00:00
mycroft
00c3ad1f56 Split _rtld_relocate_nonplt_object() into separate MD files. 2002-09-05 18:25:45 +00:00
mycroft
b4a8cd2dbf Split MIPS relocation goo into mips_reloc.c. 2002-09-05 17:58:02 +00:00
mycroft
ae16986458 Simplify a couple of tests to !__mips__. 2002-09-05 17:06:11 +00:00
mycroft
9e3442dc47 Combine the code that skips COPY relocs on most platforms (other than MIPS).
Remove the code that skips JMP_SLOT relocs (thus making ld.elf_so bomb if it
hits one in the non-PLT relocation table).
2002-09-05 17:01:13 +00:00
mycroft
cf2d41da85 If REL(A)SZ extends into .rel(a).plt, trim rel(a)lim. This is actually due to
what is arguably a bug in BFD on some platforms (at least PPC and SPARC), but
I can't fix old binaries.
2002-09-05 16:58:16 +00:00
junyoung
515622e6db Remove unused arguments of _rtld_find_symdef(). 2002-09-05 16:33:57 +00:00
mycroft
1ea7e8253b Remove support for PowerPC static relocations, which are not present in shared
objects, and in any case are implemented WRONG.  (They're symbol-relative, not
base-relative.)
2002-09-05 15:47:52 +00:00
mycroft
f4cbd3d6e2 Remove unused prototypes (including one for a non-existant function!). 2002-09-05 15:45:54 +00:00
mycroft
2635aa544a Make _rtld_setup_pltgot() a consistent interface on all platforms. 2002-09-05 15:38:22 +00:00
mycroft
1e06edb63b There is no need to do an imb after each call to the binder, because we only
patch the GOT, not the PLT.  However, do an imb when setting up the PLT thunk,
just in case.
2002-09-04 19:13:00 +00:00
junyoung
937e5f4f83 Previous commit broke the normal build; this should really fix the
problem, toolchain/18020. From Frederick Bruckman <fredb@immanent.net>.
2002-09-04 16:57:47 +00:00
junyoung
9cc71f17e2 Fix a problem that 'make obj' doesn't work within tools/makewhatis. 2002-09-04 06:39:58 +00:00
mycroft
1b6aaa02a2 Turn off DEBUG by default, and compile with -O3. (Tested on Alpha, ARM,
x86 and PowerPC.)
2002-08-31 18:18:14 +00:00
lukem
3b473ec283 xerrx() needs to output a trailing newline as well 2002-08-27 10:37:33 +00:00
christos
23c8380404 save 4 system calls by using AT_{R,E}{U,G}ID. 2002-08-26 21:09:55 +00:00
itojun
b46a0ef5ae use strlcpy. minor style fixes 2002-08-22 07:23:27 +00:00
christos
d5935a17be enable utmpx support. this doesn't work correctly for chrooted ftpd's, but
I am leaving it to luke to fix.
2002-08-22 00:09:38 +00:00
christos
7c266e1884 support utmpx 2002-08-20 14:01:49 +00:00
christos
9d7f515ba2 add some more ifdefs, so that we don't define variables we don't use. 2002-08-20 13:58:22 +00:00
christos
7d62d2a173 utmpx support 2002-08-20 13:56:50 +00:00
christos
c0b21fbbf7 Disable UTMPX support for now, because ftpd might chroot and we need
to keep files open.
2002-08-20 13:55:58 +00:00
christos
4b476b1883 utmpx support 2002-08-20 13:51:09 +00:00
christos
6c99012e39 PR/17999: FUKAUMI Naoki: Support wtmpx entries. 2002-08-20 13:12:00 +00:00
lukem
f794aa60bb Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path 2002-08-19 13:54:34 +00:00
itojun
2abe377059 defend against malicious line in ut_line, which could cause unwanted
writes to anything under /dev.  revoke setuid/gid privs earlier.
From: xs@kittenz.org
2002-08-16 20:21:48 +00:00
abs
d88a5fe209 If the peer closes the connection in ttloop()
syslog(LOG_ERR, "ttloop:  peer died: %m");
is a little console spammingly excessive. Switch to LOG_INFO.
2002-08-12 09:19:00 +00:00
thorpej
9c104401d1 Build for "armeb". 2002-08-10 01:59:33 +00:00
soren
642c31b4a3 Remove extraneous \n's in {err,warn}{,x}. 2002-08-09 10:01:53 +00:00
soren
236006d5dc Remove extraneous \n's in {err,warn}{,x} that used to be printfs. 2002-08-08 13:24:12 +00:00
jmcneill
00a0bebf72 Include string.h so this application compiles. 2002-08-05 15:36:51 +00:00
christos
f660736fac It is pointless to limit the login name for utmp's purposes here. 2002-08-01 18:52:06 +00:00
christos
5ba367f315 err, fix arg to warn. 2002-07-29 00:36:44 +00:00
christos
5e254dfcd4 jeez, this program included almost everything in /usr/include! 2002-07-29 00:35:49 +00:00
christos
aa3ec0641b Add utmp_update 2002-07-28 22:38:50 +00:00
grant
6742cb1812 sweep of errx/warnx, remove unnecessary trailing \n 2002-07-20 08:36:17 +00:00
abs
c2fcad8607 If /etc/ld.so.conf contains an invalid sysctl name any dynamically
executable that uses the library on that line has the rather cryptic
"sysctl" printed when it starts executing.

Switch to (_PATH_LD_HINTS": unknown sysctl for %s", name);

Discovered after someone copied /etc from an i386 to a sparc64 box.
2002-07-18 14:46:11 +00:00
wiz
7b9b4ac6f7 'environment', not 'enviroment' 2002-07-11 10:53:19 +00:00
fredette
e4526bd9fa Add support for dynamic linking on HP PA-RISC. 2002-07-10 15:12:33 +00:00
itojun
373383a4ab typo in message. PR 17528 2002-07-08 23:01:57 +00:00
lukem
a4449882c6 - Change lexer to support numbers > 2^31-1 (stored in an off_t), and allow
RESTart to use the larger numbers.
  Fix from Maxim Konovalov <maxim@freebsd.org>
- Update version
- Minor whitespace changes
2002-07-02 02:18:01 +00:00
tv
bfa5cd6608 We really, actually, positively want to apply the ftpd.conf "passive"
option to all possible *PSV commands.  Some ftp servers are simply not
capable of passive connections, hence the option....
2002-06-30 04:54:43 +00:00
aidan
ec6387d504 Added CONF_LL macro, which understands raw 'strsuftoll' conf variables. 2002-06-18 09:59:47 +00:00
lukem
e6e31891a4 crank copyright 2002-06-15 03:40:28 +00:00
lukem
bd1b663668 Implement "SITE UMASK" `enabled command' check with (modified)
check_write(), so that a user who has modify disabled gets an error
message rather than a hung connection.
Noted by M.J. Rutter <mjr19@cus.cam.ac.uk> in private email.
2002-06-15 03:36:47 +00:00
perseant
f4fea25c9f Note each type of failure in clean_inode and provide statistics on
failures as well as successes when a run of clean_all_inodes completes.

Explicitly cast to off_t in get_dinode and get_rawblock, to make sure we
read the right block.
2002-06-14 05:21:21 +00:00
perseant
d6e1fa2b25 Don't try to coalesce files that have fewer than NDADDR blocks, due to
a potential problem with cleaning fragments at all.

Better sanity checks when selecting files to coalesce; in particular don't
shift too far left when comparing the number of discontinuities to the log2
of the number of total blocks.

Better log messages: note beginning of coalescing correctly; also take
the log message from add_segment out of "if (debug)" for symmetry with the
"finished segment" message.

Use lfs_bmapv to find the inode, rather than looking it up manually in
the ifile; this should give more up-to-date information, since trolling
through every inode in the fs could take some time.
2002-06-14 00:58:39 +00:00
tron
97f197cc4e Adapt to lastest changes of configuration handling in man(1). 2002-06-11 09:58:50 +00:00
bouyer
d6d2a9ea4a Make this file explicitely public domain. 2002-06-09 17:10:44 +00:00
martin
a3ffe0312f Make scanf parameters and variable types match. This helps archs
where sizeof(int) != sizeof(long).
2002-06-06 09:29:31 +00:00
perseant
a558d1ec81 update lfs_cleanerd manual page for new -c option 2002-06-06 01:03:12 +00:00
perseant
8abab7cfc8 First stab at file coalescing. When the cleaner detects that it might
be digging itself deeper into a hole, it forks off a subprocess
that locates files with too many discontinuities and rewrites them, if
there is enough room.

Optionally the user can manually coaleasce files by running with "-c".

The recent change to lfs_markv is required for the coalescer to do anything.

All of "digging itself deeper", "too many discontinuities", and "enough room"
need to be better defined.
2002-06-06 00:56:49 +00:00
itojun
a63c3e28d9 g/c unused function, which uses TS RPC. 2002-06-05 23:22:38 +00:00
itojun
abec56361f make it AF independent as much as possible 2002-06-05 23:05:34 +00:00
lukem
06de426449 SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field).  whilst it's O(n),
  this mirrors the functionality of SLIST_REMOVE() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
  this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
2002-06-01 23:50:52 +00:00
wiz
c1194e1947 Grammar fixes in last. 2002-05-31 09:56:12 +00:00
enami
260e9f55a7 Add optional mmap(2)/write(2) support for binary file transfer.
The default is read(2)/write(2).  Note that the sosend_loan needs
some more work for better performance when a file isn't cached.
2002-05-30 00:24:47 +00:00
wiz
bf840df2cd __STDC__ is always defined on NetBSD. 2002-05-26 00:02:06 +00:00
thorpej
0eaaac19bf Add .register directives to appease newer gas. 2002-05-06 18:53:30 +00:00
yamt
b146f5d7f4 fix a reversed condition. 2002-05-03 04:43:57 +00:00
agc
b86348d33b Cast arg to long, and print with %ld, so that this compiles on some of
the more esoteric architectures.
2002-04-30 15:21:55 +00:00
perseant
da431b0f6d Correct my previous lfs_cleanerd commit so that it works properly on
v1 filesystems as well (use segtod instead of lfs_ssize / lfs_fsize).

Tested on i386.
2002-04-30 00:28:58 +00:00
yamt
1ea132ca5f remove one of duplicated "bfree" from debug message. 2002-04-29 19:50:05 +00:00
yamt
3c9c3c1b83 use errx instead of err in some places
in order to avoid "Undefined error: 0"
2002-04-29 19:03:15 +00:00
perseant
c5f5fa476f Fix error in how much memory needed to be allocated to check data cksum
to proceed with adding segments.

Use fixed-width types to compute checksum, so LP64 machines can do it too.

Tested on alpha; test-compiled on arm32.
2002-04-26 04:34:41 +00:00
lukem
2c1cfc8e8c - in <bsd.files.mk>, don't clear FILES after using it, as that prevents
make -V FILES
  from being useful (and given that every other variable can be
  extracted using make -V, the behaviour was unusually inconsistent
  given that the original reason for clearing it doesn't seem to be
  relevant anymore)
- use <bsd.prog.mk> instead of directly including <bsd.files.mk>
  (and possibly <bsd.man.mk> or <bsd.own.mk>)
- remove obsolete NOPROG
2002-04-24 08:18:45 +00:00
thorpej
050c3a4205 Use __COPYRIGHT() and __RCSID() macros. 2002-04-09 00:55:15 +00:00
matt
272882ae69 Add support for a VAX ld.so when VAX is ELF 2002-03-29 09:48:49 +00:00
sommerfeld
eac46437d4 Truth in advertising. 2002-03-28 15:09:14 +00:00
thorpej
9c33b55e7c Split the notion of building Hesiod, Kerberos, S/key, and YP
infrastructure and using that infrastructure in programs.

	* MKHESIOD, MKKERBEROS, MKSKEY, and MKYP control building
	  of the infratsructure (libraries, support programs, etc.)

	* USE_HESIOD, USE_KERBEROS, USE_SKEY, and USE_YP control
	  building of support for using the corresponding API
	  in various libraries/programs that can use it.

As discussed on tech-toolchain.
2002-03-22 18:10:19 +00:00
mjl
7385725727 ANSIfy.
Lose \n from syslog messages.
strncpy() -> strlcpy().
Correct last arg to execl (NULL, not 0).
(From OpenBSD)
2002-03-18 23:59:57 +00:00
mjl
f60ca83e0c strncpy() -> strlcpy() 2002-03-18 23:34:21 +00:00
jdolecek
5147204191 remove - the C version diverged enough for this to not be
full-featured replacement
2002-03-10 20:46:42 +00:00
jdolecek
f004775535 fix behaviour if exactly one directory is specified (off-by-one error)
this caused makewhatis behave as if called without arguments at all

Problem reported by Xavier HUMBERT on current-users.
2002-03-10 20:36:10 +00:00
wiz
d367bf3547 Grammar and mdoc fixes. 2002-03-08 22:10:00 +00:00
jdolecek
534dd161ea If called without arguments, parse /etc/man.conf and regenerate the whatis
databases specified there. By default, the individual databases
are actually generated by forked children in this case, for
performance reasons. This feature can be switched off by new -f flag.
If the configuration file can't be parsed or doesn't contain any
_whatdb entries, the code falls back to /usr/share/man as before.

Added -C, which allows to specify alternate configuration file. This
  is compatible with apropos(1) and whatis(1) flag of same name.

Update manpage accordingly and document behaviour a bit better.
Also add a HISTORY section, hopefully correct (done using CVS logs).

This solves toolchain/5231 by Tim Rightnour and bin/7696 by Allen Briggs.
2002-03-08 21:59:07 +00:00
jdolecek
1b5e3d16f0 improve description of options - particularily, avoid repeating the option
in the description, and use 'print' instead of 'returns' or 'determines'
2002-03-08 20:59:08 +00:00
jdolecek
16510c2b02 makewhatis(8) doesn't use getNAME(8) nowadays 2002-03-08 20:40:00 +00:00
jdolecek
c8c145f7da Make the whatis enties prefixed with man subdirectory the manpage
appears in, as commonly used for architecture-specific manpages.
The subdirectory is deliberately printed such that the entry is suitable
for cut&paste for man(1).

Fixes bin/9744 by John Hawkinson and misc/14997 by Hiramatsu Yoshifumi.
2002-03-07 20:37:14 +00:00
thorpej
547d71b6c7 Use ${PRINTOBJDIR}. 2002-03-05 21:53:56 +00:00
enami
96924d78ee Lineup comment and remove unnecessary whitespaces. 2002-03-04 01:40:56 +00:00
enami
71706b65e7 Use \a instead of embedding raw control-G character. 2002-03-04 01:37:52 +00:00
tv
7cfc131b50 Don't bomb if the ${DPADD} files are missing -- we want at least one of
them, where the other may not exist, and the linker will fail for us if
both don't exist.
2002-03-01 20:15:16 +00:00
matt
0ce5ca145f Change to use a register prefix. 2002-02-24 01:06:18 +00:00
lukem
ef36a8ddea Fixes for mlsd/mlst standards conformance issues (noted by Robert Elz):
- mlst shouldn't return cdir or pdir for type, only dir
- mlst should always provide a full path name
- mlsd should provide a full path name for the cdir entry.  (providing a
  full path name for the pdir entry is optional, and i punted on that).
2002-02-13 15:15:23 +00:00
lukem
9616ee612a Don't log an xferlog-style entry if bytes == -1.
Per suggestion by Kimmo Suominen and observation of wu-ftpd in similar
circumstances.
2002-02-11 11:45:07 +00:00
wiz
f78eb76cbe achive is not a good word. 2002-02-11 10:57:57 +00:00
ross
dc5571b22e Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:21:55 +00:00
ross
8bd7cb6a69 Edit -mdoc usage.
* There is no -indent option to .Bd or .Bl, although you would
  never know that from its frequent use in this tree. There is a
  "-offset indent" combination that makes sense, and you can certainly
  say "-width indent".

* Also, you can't markup the -width option argument, tho you CAN
  use a callable macro. So "-width Ar filename" doesn't make sense,
  but either "-width Ar" or "-width filename" does, as might something
  like "-width xxfilename" for a little extra space.

* There are a lot of needlessly complex hanging tag macros in man4 used
  to create simple item lists. Those should be simplified one of these
  days before someone copies and edits yet another man4 page.
2002-02-07 03:15:06 +00:00
thorpej
886eff9ae7 Rename to reflect the MACHINE_ARCH that will be used on ARM ELF
platforms.
2002-02-06 20:39:00 +00:00
thorpej
535e775dd5 MACHINE_ARCH for ELF ARM platforms is "arm", not "arm32". 2002-02-06 20:36:18 +00:00
thorpej
cb2e377d4c Whitespace cleanup. 2002-02-04 18:18:51 +00:00
thorpej
2685463c0e Use ${MACHINE_CPU} to assign ARCHSUBDIR. 2002-02-04 00:24:14 +00:00
thorpej
67b1884571 Add support for dynamic linking on the SuperH. From Marcus Comstedt,
with some bug fixes (namely, don't forget to consider the addend when
processing relocations) from me.
2002-02-03 23:34:42 +00:00
lukem
f65c7d5689 fix previous, and ensure that closedataconn() is only called after dataconn()
and with a non-NULL file pointer.  active transfers now work correctly again,
passive transfers work, and the data stream is only closed after a PASV or
EPSV if a successful connection was initiated with dataconn().
2002-02-01 04:35:30 +00:00
tv
9fbd88883c Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
  sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
2002-01-31 22:43:33 +00:00
tv
805ab35e68 Make it possible for uudecode to be a host tool. 2002-01-31 19:15:23 +00:00
christos
f71c29c50a More sanity checks to avoid looking at unitialized memory. 2002-01-31 17:37:25 +00:00
itojun
80c664d730 implement -u <len>. PR 13676 2002-01-31 07:54:50 +00:00
tv
a328e34106 Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)
2002-01-29 10:20:28 +00:00
augustss
d904dc6dd8 Make it compile again (vmstat change fallout). 2002-01-28 13:10:01 +00:00
skrll
04206c0a21 Install the man page on a.out systems as well so that the man set is the
same for all.
2002-01-23 15:10:24 +00:00
skrll
43a1bb37fd Add a uuencoded binary of a.out arm32 ld.so and update Makefile to extract
on ELF platforms.

This file was created using the following revisions:

	ld.h,v 1.2 1998/12/17 23:36:38 pk
	malloc.c,v 1.7 2000/11/28 06:01:34 mycroft
	rtld.c,v 1.82 2001/09/20 20:55:29 wiz
	shlib.c,v 1.18 2000/05/27 06:53:30 matt
	shlib.h,v 1.1 1998/12/15 23:16:14 pk

arm32 specific files:

	md-static-funcs.c,v 1.1 1997/10/17 21:25:42 mark
	md.c,v 1.11 1999/02/27 03:34:05 tv
	md.h,v 1.4 2000/05/28 01:53:05 matt
	mdprologue.S,v 1.1 1997/10/17 21:25:59 mark
2002-01-22 16:27:51 +00:00
tron
ace258d3b2 Handle ".Xr" commands with text after the section number probably.
This fixes PR bin/15253 by Thomas Klausner.
2002-01-21 12:21:31 +00:00
lukem
0d1261454e in closedataconn(), only close the passive data fd if the main data
descriptor was set by dataconn().  this fixes a problem for clients (such
as lynx and netscape) that only sent PASV/EPSV after a transfer (RETR, LIST,
STOR) started and returned 150.  certain command sequences could return 550
(etc) before setting up the dataconn(), and would run into this bug. netbsd's
ftp didn't hit this bug because it always sends PASV/EPSV before a new
transfer command.
2002-01-21 11:25:20 +00:00
itojun
9a09fa34fb reject SIZE request for ascii file if it exceeds 10k. 2002-01-17 05:21:47 +00:00
wiz
ec571c2b63 Sort sections, drop effectively empty section. 2002-01-15 02:29:01 +00:00
wiz
4a62f5dc2d Drop an unnecessary .Pp. 2002-01-15 02:28:41 +00:00
wiz
65eb66d185 Whitespace and punctuation nits, comment out an option that does not concern NetBSD. 2002-01-15 02:28:22 +00:00
wiz
7642cb7ddf Whitespace nits. 2002-01-15 02:27:15 +00:00
wiz
888bbaf308 Whitespace nits, sort SEE ALSO. 2002-01-15 02:27:03 +00:00
wiz
c0196b8ad0 Whitespace nits. 2002-01-15 02:26:48 +00:00
wiz
42f6cf520c Whitespace nits, sort sections. 2002-01-15 02:25:49 +00:00
wiz
35f640eded Punctuation nit. 2002-01-15 02:25:08 +00:00
wiz
110806f773 Sort sections. 2002-01-15 02:24:28 +00:00
wiz
02dda53455 Whitespace nit, mark up AUTHORS section, use standard headers, sort sections, end sentences with dots. 2002-01-15 02:24:15 +00:00
wiz
b519c70ad7 Whitespace nit. 2002-01-15 02:23:28 +00:00
wiz
0e2b950705 Whitespace nits, sort SEE ALSO. 2002-01-15 02:23:17 +00:00
wiz
3b66e5c46d Drop some unnecessary .Pps. 2002-01-15 02:22:54 +00:00
wiz
a493296832 Whitespace nits and fix xref section. 2002-01-15 02:22:28 +00:00
wiz
93b02fcb18 Sort sections and fix punctuation nit. 2002-01-15 02:22:11 +00:00
wiz
b5fd5ad5b4 Sort sections and SEE ALSO. 2002-01-15 02:21:49 +00:00
wiz
ec1b82e5ef Whitespace nits, sort sections. 2002-01-15 02:21:30 +00:00
wiz
e705d08049 Whitespace nits, sort sections, end sentences with dots. 2002-01-15 02:21:13 +00:00
wiz
9a07d0cef5 Whitespace nits. 2002-01-15 02:20:50 +00:00
wiz
d62151d8f4 Drop some unnecessary .Pps, sort SEE ALSO, whitespace nits. 2002-01-15 02:20:37 +00:00
wiz
f427fba7da Sort sections. 2002-01-15 02:19:36 +00:00
wiz
e83c534de9 Formatting improvements, sort SEE ALSO and sections. 2002-01-15 02:19:26 +00:00
christos
94faea123b - fix whitespace nits.
- change error checking philosophy: instead of returning errors to the
  upper layer only to fail silently and exit there, or die of unexpected
  NULL pointers bail out and print an error immediately. Add emalloc/estrdup
  to simplify. This change removed a bunch of code.
- fix size_t/int confusion
- cast argument to isspace(3) to unsigned char
- ? : statement is not an lvalue, so don't take its address.
- unlink the file before we open it, because we chmod it to readonly.
- misc KNF
2002-01-11 18:33:03 +00:00
itojun
da4f6b8247 daemon(3) should be used prior to file descriptor setups. 2002-01-11 05:18:11 +00:00
eeh
0edae4622b Do not attempt to relocate any pltrela entries that are not JMP_SLOT on sparc64. 2002-01-06 03:54:42 +00:00
tv
f8e3b0e1e5 Revert rev. 1.30 (partly). If MKPICINSTALL=no in mk.conf, libc_pic.a will
NOT be installed by the time we build here.

However, allow the link to look in both src/lib/libc and $DESTDIR/usr/lib.
2002-01-04 19:08:04 +00:00