Commit Graph

1294 Commits

Author SHA1 Message Date
marcel
f5de8effa1 Don't fail if we encounter a relocation of type "none". Just ignore
it. It's a no-op relocation.

Trigger case: ports/x11-toolkits/pango
2003-06-07 07:52:17 +00:00
yar
ed74f4db3d Fix some minor bugs, namely:
- Initialize "rval", which would be used uninitialized
  if al or pl options were set.

- Don't pass an empty string to login(1) as a user name
  (this could be triggered by entering a name and then killing it
  with backspace or ^U.)

- Don't loop endlessly if the al option specifies a bogus (i.e.,
  not alphanumeric) auto-login name.

- Don't pass a bogus user name to login(1) if a good name were
  entered and then killed with ^U.

- Exit with status 0, not 1, on receiving an EOF character,
  since it's not a error condition.

MFC after:	1 week
2003-06-06 14:36:41 +00:00
markm
96556bceb3 Drop MAINTAINER Bit. Not needed any more. 2003-06-04 15:59:13 +00:00
obrien
1646a714c5 Set CSTD to gnu99. We can only use on of the gnu?9 C languages.
We can't use c89 due to use of 'inline', and c99 produces bad code.
2003-06-04 05:42:04 +00:00
ru
29f9643911 Assorted mdoc(7) fixes. 2003-06-02 15:02:06 +00:00
obrien
e6934e172e Best we can do with this is c89. 2003-06-02 02:35:58 +00:00
obrien
60184b4b7e Include stdlib.h to get exit()'s prototype. 2003-06-02 02:35:18 +00:00
obrien
f40f81aa0c Add the variable's type to the declaration. 2003-06-02 02:34:36 +00:00
ru
d727dda421 Assorted mdoc(7) fixes. 2003-06-01 19:52:36 +00:00
mdodd
73a7f529f4 - use issetugid()
- be paranoid about honoring LD_LIBMAP_DISABLE.

Suggested by:	 rwatson
2003-05-31 15:24:29 +00:00
mdodd
49fb693df9 Simplify map_object() by breaking out the ELF header validation bits
into a separate function.
2003-05-31 14:48:59 +00:00
mdodd
59d2c4e02e Provide function entry debugging messages. 2003-05-31 14:46:38 +00:00
mdodd
f365a266e1 Use the environment variable LD_LIBMAP_DISABLE to disable
libmap.conf(5) functionality.
2003-05-31 14:45:11 +00:00
mdodd
de8f54e71e Don't post-increment pointers inside a loop conditional.
While I'm here:
- Let lm_add() call strdup() on its own behalf.
- Use a temporary pointer when parsing constraints; only set the
  constraint pointer on a totally successful match.

PR:		 bin/52783
Submitted by:	 David P. Reese Jr. <daver@gomerbud.com>
Approved by:	 re (rwatson)
2003-05-30 00:49:16 +00:00
kan
949c40c5fd Allow threading libraries to register their own locking
implementation in case default one provided by rtld is
not suitable.

Consolidate various identical MD lock implementation into
a single file using appropriate machine/atomic.h.

Approved by:	re (scottl)
2003-05-29 22:58:26 +00:00
peter
469c0a1ad7 Do not exclude amd64 from rtld-elf builds.
Approved by:  re  (safe amd64 support commits)
2003-05-24 17:38:45 +00:00
peter
0c9262fefa Initial pass at supporting shared libraries on amd64. There are still
a few missing relocation types in amd64/reloc.c, but I have not found
any of them in use yet. :-)

Approved by:  re (amd64/* blanket)
2003-05-24 17:37:51 +00:00
des
e5d2d778eb Retire the useless NOSECURE knob.
Approved by:	re (scottl)
2003-05-19 15:52:01 +00:00
mdodd
221bfcf450 - Use xmalloc() and xstrdup() instead of malloc() and strdup().
- Add a global mapping if we have a successful constrained match.

Approved by:	re
2003-05-19 07:10:12 +00:00
rwatson
320fc630d4 Since libmap.conf is referenced in rtld.1, include it in the references
section.

Approved by:	re (scottl)
2003-05-17 19:46:49 +00:00
ru
d51b17e639 mdoc(7) police: Properly markup the previous revision.
Approved by:	re (blanket)
2003-05-16 21:36:10 +00:00
ru
d09772e6f4 mdoc(7) police: Normalize the FILES section.
Approved by:	re (blanket)
2003-05-16 21:34:21 +00:00
markm
64cd7ea15d Allow a NOPIC "make world" to complete.
OK'ed by:	re(scottl)
2003-05-11 18:48:29 +00:00
markm
fc4822f39a Mrege from crypto telnet with "make unifdef". This gets a bunch of
$FreeBSD$ tags and some debug variable safety belts.
2003-05-11 18:27:49 +00:00
peter
10cba42d09 Exclude rtld-elf for amd64. More porting is still needed.
Approved by:  re (scottl)
2003-05-08 06:37:12 +00:00
kan
c47ebbd98f Rethink the way we count module references. Simply following
DT_NEEDED links is not flexible enough for cases where dynamically
loaded modules form a dependency cycle.

This should fix an infinite recursion problem encountered by Yahoo.

Approved by:	re (jhb)
2003-05-08 01:31:36 +00:00
markm
ee63e7dc15 Turn MAKE_KERBEROS5 into NO_KERBEROS by negating the logic. Some extra
cleanups were necessary in release/Makefile, and the tinderbox code
was syntax checked, not run checked.
2003-05-05 07:58:44 +00:00
obrien
e6de895e83 Use __FBSDID vs. rcsid[]. 2003-05-04 00:59:13 +00:00
obrien
43ecc39077 Fix signed/unsigned comparison warnings. 2003-05-04 00:56:00 +00:00
obrien
bef29d279b Fix a sign/unsigned comparison. 2003-05-04 00:43:39 +00:00
ru
0deec148ba Build non-crypto telnet(1) and telnetd(8) if NO_OPENSSL is defined.
Submitted by:	Marius Strobl <marius@alchemy.franken.de>
2003-05-01 19:38:15 +00:00
peter
c03c53916e Remove 80386 bandaids from code repocopied from i386. rtld_start.S still
todo.
2003-04-30 21:09:06 +00:00
kan
75fd435e27 Remove redundant strlen checks, do not check the same
symbol twice.
2003-04-30 19:05:53 +00:00
ru
13592a9888 Don't clobber Kerberos5 telnet(1) and telnetd(8) with non-crypto versions. 2003-04-30 07:24:35 +00:00
imp
2bde9db9c2 Add back # accidentally deleted in 1.54 2003-04-27 06:16:52 +00:00
imp
733bde7ebe This is no longer needed after tw is gone.
Approved by: re@ (scottl)
2003-04-27 05:43:42 +00:00
billf
614e371cc3 properly refuse a connection in the -c case if the client ip's subdirectory
does not exist.

PR:		bin/38303
Submitted by:	Woei-Luen, Shyu <m8535@cn.ee.ccu.edu.tw>
the committed patch differs from the submitted one, any inaccuracies are mine.
2003-04-19 10:14:43 +00:00
mdodd
55f9c171d4 Code cleanups and sanity checking for config file parser. 2003-04-10 01:44:19 +00:00
mdodd
5ce5797f85 Dynamic object dependency mapping: libmap.
This is an optional feature, disabled by default.

This will be useful to people testing the various POSIX threading
libraries under -CURRENT but can easily serve other needs.
2003-04-07 16:21:26 +00:00
jmallett
eba71bcf69 MFp4 @27667: WARNS=5 cleanup on i386.
Remove the unused FILE\ *tf from print_mesg args, and the
    bogus passing in of an uninitialised FILE* for it.

    Call a timeval 'now' instead of 'clock' due to shadowing.

    Remove a nested localtime declaration.

    Make the delete invite argument match the ID type, u_int32_t.

    Use const for pointers to const items.

    Cast to long where printing as such.

    Include netinet/in.h for htonl/htons.

Reviewed by:	imp
2003-04-03 05:13:27 +00:00
ru
6b0e3863ff Mark bits that do not require an object directory as such. 2003-04-01 12:37:54 +00:00
silby
dc7f6e718f Update the description of the -u option to mention that IP_PORTRANGE_HIGH
and _DEFAULT are the same for 5.x.

Committed under threat of action from:	The mdoc police
2003-03-25 22:20:02 +00:00
dwmalone
a3529ba22b Clean up some warnings that don't result in a change in the object file:
Constness, missing prototypes, non-ansi prototypes, missing
initialisers, unnecessary declarations, shadowing.

Reviewed by:	md5
2003-03-20 22:42:22 +00:00
arun
59b094fe43 Fix for ia64/48024 - ensure function pointer equality across elf
objects.

Programs such as sshd depend on two pointers to the same function being
equal in a given process. However, the current ia64 implementation
ensures that they're equal when both the pointers are instantiated in
the same ELF object. The attached patch ensures that they're equal
irrespective of where they're instantiated.

Reviewed by marcel@ (mentor) and kan@
2003-03-19 21:38:27 +00:00
phk
f432014308 Run a revision of the devstat interface:
Kernel:

Change statistics to use the *uptime() timescale (ie: relative to
boottime) rather than the UTC aligned timescale.  This makes the
device statistics code oblivious to clock steps.

Change timestamps to bintime format, they are cheaper.

Remove the "busy_count", and replace it with two counter fields:
"start_count" and "end_count", which are updated in the down and
up paths respectively.  This removes the locking constraint on
devstat.

Add a timestamp argument to devstat_start_transaction(), this will
normally be a timestamp set by the *_bio() function in bp->bio_t0.
Use this field to calculate duration of I/O operations.

Add two timestamp arguments to devstat_end_transaction(), one is
the current time, a NULL pointer means "take timestamp yourself",
the other is the timestamp of when this transaction started (see
above).

Change calculation of busy_time to operate on "the salami principle":
Only when we are idle, which we can determine by the start+end
counts being identical, do we update the "busy_from" field in the
down path.  In the up path we accumulate the timeslice in busy_time
and update busy_from.

Change the byte_* and num_* fields into two arrays: bytes[] and
operations[].

Userland:

Change the misleading "busy_time" name to be called "snap_time" and
make the time long double since that is what most users need anyway,
fill it using clock_gettime(CLOCK_MONOTONIC) to put it on the same
timescale as the kernel fields.

Change devstat_compute_etime() to operate on struct bintime.

Remove the version 2 legacy interface: the change to bintime makes
compatibility far too expensive.

Fix a bug in systat's "vm" page where boot relative busy times would
be bogus.

Bump __FreeBSD_version to 500107

Review & Collaboration by:	ken
2003-03-15 21:59:06 +00:00
phk
fe4be9d4fc Update to current devstat API. 2003-03-15 21:04:50 +00:00
kan
74e308b959 Free obj->priv field in obj_free functions. This field is NULL
on all architectures except ia64, which uses it to keep function
description table.
2003-03-14 21:11:28 +00:00
kan
64afb9f4ca No need to zero fill memory, mmapped anonymously. Kernel will
return pre-zeroed pages itself.

Noticed by:     jake
2003-03-14 21:10:13 +00:00
ru
0dea541567 mdoc(7) police: Scheduled sweep. 2003-02-24 22:53:26 +00:00
ru
02bba10246 mdoc(7) police: expand contraction. 2003-02-23 01:45:51 +00:00
kan
80e27851f2 Do not remove object from the lists at the unref_dag() stage.
Introduce a new unlink_object() function and call it in
unload_object() instead. Removing the object in unref_dag() is
too early, rtld calls _fini() function after that and shared
objects might fail resolve their own symbols.
2003-02-17 20:58:27 +00:00
phk
b13e5a7950 Add #include <sys/resource.h> 2003-02-16 15:21:26 +00:00
phk
016baafb55 Remove <sys/dkstat.h> #include 2003-02-16 14:09:16 +00:00
phantom
2c40bad85c Advertize rtld(1) as ld.so(1) in manual pages world 2003-02-13 23:07:28 +00:00
kan
fc08397161 Fix a typo in rtld_dirname. 2003-02-13 22:47:41 +00:00
kan
ff89904c5f Implement dlinfo() function.
Introdice RTLD_SELF special handle and properly process it within
dlsym() and dlinfo() functions.

The intention is to improve our compatibility with Solaris and
to make a Java port easier.

Partially submitted by:	phantom
2003-02-13 17:47:44 +00:00
kan
3d24733b3f Add missing include files I forgot about in previous commit. 2003-02-13 17:35:00 +00:00
kan
debc727d4e Remove /usr/lib/elf from a default search path.
Move xprintf to malloc.c, it is only used there. Make static.

Submitted by:	phantom
2003-02-13 17:05:10 +00:00
yar
cd7b1c298a Kill unnecessary vertical whitespace. 2003-02-11 14:10:48 +00:00
yar
f6108273cb Use LOG_AUTHPRIV to hide the username attempted during an invalid login
from everyone but sysadmins.

PR:		bin/29487
MFC after:	3 days
2003-02-11 11:58:33 +00:00
kan
76b4e9c51c When unloading dependencies make sure they are removed from all the
associated lists:
   remove RTLD_GLOBAL objects from global objects list;
   remove the parent object from dldags list of its children.

Previosly we were doing that only to the top-level object OF the DAG
being unloaded and all its dependencies were ignored, leading to
mysterious crashes later.

Submitted by:	peter (partially)
2003-02-10 23:15:07 +00:00
charnier
6e45bdfe12 Add FBSDID. udp/bootps -> bootps/udp. Use err(3). 2003-02-05 13:45:25 +00:00
yar
5d11fbeaec Allow "~/" in pathnames to work for a chrooted user. 2003-02-05 11:11:32 +00:00
yar
92b68c7646 Let tilde expansion be done even if a file/directory doesn't exist yet.
This makes such natural commands as "MKD ~user/newdir" or "STOR ~/newfile"
do what they are supposed to instead of failing miserably with the
"File not found" error.

This involves a bit of code reorganization.  Namely, the code doing
glob(3) expansion has been separated to a function; a new function
has been introduced to do tilde expansion; the latter function is
invoked on a pathname before the former one.  Thus behaviour mimicing
that of the Bourne shell has been achieved.
2003-02-04 17:50:38 +00:00
yar
b1a2e9acb4 RFC 959 doesn't list reply code 550 as a valid responce to STOR/STOU,
so return reply code 553 to indicate a error from open(2) for consistency,
as long as the code is used in the rest of the STOR/STOU handler.
2003-02-04 03:33:25 +00:00
obrien
c3523316fa Add OPIE and PAM libs to the mix. 2003-02-02 21:11:15 +00:00
obrien
001be11d96 OPIE and PAM bits to agument LukeMftpd.
Submitted by:	mikeh (reworked by me)
2003-02-02 21:06:10 +00:00
yar
02d8e2b208 Let real users access special files through FTP
if allowed by their filesystem permissions.

This doesn't break anything since using sendfile(2)
is triggered later by a separate S_ISREG conditional.

PR:		bin/20824
MFC after:	1 week
2003-01-31 13:18:55 +00:00
yar
6962d02957 When searching for a unique file name in guniquefd(),
distinguish between the cases of an existing file and
a real system error, such as I/O failure, no access etc.

MFC after:	3 days
2003-01-29 17:04:07 +00:00
yar
6284753cac Add a new option to ftpd(8), "-h", to disable printing any
host-specific information in FTP server messages (so paranoid
admins can sleep at night :-)

PR:		bin/16705
MFC after:	1 week
2003-01-29 10:58:58 +00:00
yar
e6e9500985 Give the code around chroot(2)/chdir(2) a major overhaul by
separating its part around chroot(2) from that around initial
chdir(2).  This makes the below changes really easy.

Move seteuid(to user's uid) to before calling chdir(2).  There are
two goals to achieve by that.  First, NFS mounted home directories
with restrictive permissions become accessible (local superuser
can't access them if not mapped to uid 0 on the remote side
explicitly.)  Second, all the permissions to the home directory
pathname components become effective; previously a user could be
carried to any local directory despite its permissions since the
chdir(2) was done with euid 0.  This reduces possible impact from
FTP server misconfiguration, e.g., assigning a wrong home directory
to a user.

Implement the "/./" feature.  Now a guest or user subject to chrooting
may have "/./" in his login directory, which separates his chroot
directory from his home directory inside the chrooted environment.
This works for ftpchroot(5) as well.

PR:		bin/17843 bin/23944
2003-01-29 10:07:27 +00:00
yar
a322ce3682 Actually extract the second field from a line in ftpchroot(5)
instead of just using the rest of the line behind the first field.
2003-01-27 15:34:22 +00:00
yar
704ec7b02a Allow more than one separator character between fields in ftpchroot(5). 2003-01-27 14:41:08 +00:00
yar
411365f15d Extend the format of /etc/ftpchroot so an alternative chroot
directory can be specified for a user or a group.

Add the manpage ftpchroot(5) since the file's format has grown
complex enough.

PR:			bin/45327
Portions submitted by:	Hideki SAKAMOTO <sakamoto@hlla.is.tsukuba.ac.jp>
MFC after:		1 week
2003-01-26 19:02:56 +00:00
yar
e67bf5e192 GLOB_MAXPATH has been deprecated in favour of GLOB_LIMIT. 2003-01-25 14:59:48 +00:00
yar
3d2488fff7 - Add a new option, ``-P port'', to specify the port for ftpd(8)
to listen at in daemon mode.
- Use the port by 1 less than the control port as the default
  data port instead of always using hard-coded port 20.

Submitted by:	roam
MFC after:	1 week
2003-01-23 18:39:48 +00:00
yar
f5eff04464 Prevent server-side glob(3) patterns from expanding
to a pathname that contains '\r' or '\n'.

Together with the earlier STAT bugfix, this must solve
the problem of such pathnames appearing in the FTP control
stream.
2003-01-22 16:25:22 +00:00
cjc
29a813efb6 The FTP daemon was vulnerable to a DoS where an attacker could bind()
up port 20 for an extended period of time and thus lock out all other
users from establishing PORT data connections. Don't hold on to the
bind() while we loop around waiting to see if we can make our
connection.

Being a DoS, it has security implications, giving it a short MFC
time.

MFC after:	1 day
2003-01-21 05:13:02 +00:00
sobomax
b5161aafed Fix a typo (missed &&).
Submitted by:	marcus
2003-01-20 10:33:35 +00:00
sobomax
2435c6cf8e Add a new gettytab(5) option - `pl', which if set tells getty that the line
in question is PPP-only line, i.e. no PPP-sequence detection is necessary and
PPP login program referenced by `pp' should be started automatically instead of
login(1)

Feature suggested and sponsored by:     United Networks of Ukraine
No reply from:  re
MFC after:	2 weeks
2003-01-19 20:59:52 +00:00
yar
65804c6d3c Prepend a space character if a line begins with a digit
in the output to the "STAT file" request.

This closes one discrepancy with RFC 959 (page 36.)

See also http://www.kb.cert.org/vuls/id/328867

Obtained from:	OpenBSD
2003-01-16 14:25:32 +00:00
yar
999cc66112 Replace the instances of literal "/bin/ls"
with the _PATH_LS macro to be consistent
with the rest of the ftpd(8) source.
2003-01-16 13:27:58 +00:00
obrien
1d7140c9c9 We have a usable 'LOGIN_NAME_MAX' now. 2003-01-06 04:42:20 +00:00
obrien
245822d35f Need to prototype strsuftollx() to quiet a warning. 2003-01-06 04:09:20 +00:00
obrien
c5fa1fb790 Make the "nbsd_20030105" import build. 2003-01-06 03:03:53 +00:00
jmallett
a33543dd92 Implement POSIX grantpt(3) functionality, and add a pt_chown utility (akin
to Solaris, it is in /usr/libexec) to perform the handing over of tty nodes
to the user being granted the pty.

Submitted by:	Ryan Younce <ryany@pobox.com>
Reviewed by:	security-officer@, standards@, mike@
2003-01-02 20:44:41 +00:00
schweikh
d3367c5f5d Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
schweikh
86f7487fb6 Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
schweikh
fec6546e12 english(4) police. 2002-12-27 12:15:40 +00:00
ru
4979ab8d81 mdoc(7) police: Deal with self-xrefs. 2002-12-24 13:41:48 +00:00
ru
301b96498b Fixed the abuses of .Ql visible on stderr in troff mode.
PR:		docs/37176
2002-12-23 16:04:51 +00:00
dillon
be3db49c80 Change the way ELF coredumps are handled. Instead of unconditionally
skipping read-only pages, which can result in valuable non-text-related
data not getting dumped, the ELF loader and the dynamic loader now mark
read-only text pages NOCORE and the coredump code only checks (primarily) for
complete inaccessibility of the page or NOCORE being set.

Certain applications which map large amounts of read-only data will
produce much larger cores.  A new sysctl has been added,
debug.elf_legacy_coredump, which will revert to the old behavior.

This commit represents collaborative work by all parties involved.
The PR contains a program demonstrating the problem.

PR:		kern/45994
Submitted by:	"Peter Edwards" <pmedwards@eircom.net>, Archie Cobbs <archie@dellroad.org>
Reviewed by:	jdp, dillon
MFC after:	7 days
2002-12-16 19:24:43 +00:00
ru
041d1287e8 Uniformly refer to a file system as "file system".
Approved by:	re
2002-12-12 17:26:04 +00:00
kan
f7319be8e1 Fix rtld to handle SPARC_R_UA{16,64} relocations correctly.
Approved by:	re (rwatson)
2002-12-05 16:58:31 +00:00
grehan
fdd44c57ca rtld support for PowerPC. Mostly obtained from NetBSD, with mods
for binutils 2.13

Reviewed by:  benno

Approved by:  re (blanket)
2002-12-04 07:32:20 +00:00
kan
7edfa0142f Put back a test for binaries with no PT_LOAD entries I over-jealosly
removed in r1.69.

Apploved by:	re (rwatson)
2002-11-29 16:41:31 +00:00
ru
146b294736 mdoc(7) police:
Properly sort options, spell "file system" correctly, expand contraction.

Catch up to the src/etc/syslog.conf,v 1.23 change: ftpd(8) session logs
are now by default get logged to /var/log/xferlog.

Approved by:	re
2002-11-25 15:20:06 +00:00
tmm
bd3dff9a70 Fix the handling of high PLT entries (> 32764) on sparc64. This requires
additional arguments to reloc_jmpslot(), which is why MI code and MD code
of other platforms had to be changed.

Reviewed by:	jake
Approved by:	re
2002-11-18 22:08:50 +00:00
peter
570525a6c7 Oops. Some ut_time stuff slipped through the cracks. These turned out
to be non-fatal due to stack alignment roundups.
2002-11-17 23:46:45 +00:00
obrien
5a20d2febf [DAIVD O'BRIEN's OPINION]
Head off what I think is an abuse of the TRB, and disable lukemftpd.
2002-11-12 17:31:12 +00:00
maxim
c8298592e9 o Fix usage().
o Explicitly initialize domain pointer.
o Fix passwd file parsing.

PR:		bin/39671 (3)
MFC after:	2 weeks
2002-11-12 14:15:59 +00:00
obrien
e4a311f35f We don't use libpam, libopie, or libmd. 2002-11-12 07:41:59 +00:00
obrien
252278ff5d We have fparseln(3). Also libskey on RELENG_4. 2002-11-12 07:37:15 +00:00
obrien
b3245bbb2f Update for version 1.2 Beta 2. 2002-11-12 06:48:35 +00:00
yar
e2616c6490 Don't free the current addrinfo list, or else a pointer to a freed
memory area would arise.  Only an addrinfo list from an earlier
call to getaddrinfo() should be freed there because it will be
substituted by the current list referenced by "res".

Reported by:	John Long <fbsd1@pruam.com>
MFC after:	5 days
2002-11-11 07:31:48 +00:00
rwatson
71edd02c55 Have ftpd specify the LOGIN_SETMAC flag to setlogincontext() so that
MAC labels are set if MAC is enabled and configured for the user
logging in.

Note that lukemftpd is not considered a supported application when
MAC is enabled, as it does not use the standard system interfaces for
managing user contexts; if lukemftpd is used with labeled MAC policies,
it will not properly give up privileges when switching to the user
account.

Approved by:	re
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-24 16:19:52 +00:00
kuriyama
1a4ad6f685 Unbreak by merging the change in r1.51 of src/libexec/ftpd/Makefile. 2002-10-24 04:55:25 +00:00
rwatson
a20ce31a58 Teach "ls -Z" to use the policy-agnostic MAC label interfaces rather
than the LOMAC-specific interfaces for listing MAC labels.  This permits
ls to view MAC labels in a manner similar to getfmac, when ls is used
with the -l argument.  Next generation LOMAC will use the MAC Framework
so should "just" work with this and other policies.  Not the prettiest
code in the world, but then, neither is ls(1).

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-24 00:07:30 +00:00
kan
dca183b31a Add support for binaries with arbitrary number of PT_LOAD sections.
Reviewed by:	peter
2002-10-23 01:43:29 +00:00
kan
d675c525c1 Change the symbol lookup order to search RTLD_GLOBAL objects
before referencing object's DAG. This makes it possible for
C++ exceptions to work across shared libraries and brings
us closer to the search order used by Solaris/Linux.

Reviewed by:	jdp
Approved by:	obrien
MFC after:	1 month
2002-10-19 23:03:35 +00:00
sobomax
62ac3ba58f Fix a problem with RTLD_TRACE flag to dlopen(3), which sometimes can return
even if there was no error occured (when trying to dlopen(3) object that
already linked into executable which does dlopen(3) call). This is more
proper fix for `ldd /usr/lib/libc.so' problem, because the new behaviour
conforms to documentation.

Remove workaround from ldd.c (rev.1.32).

PR:		35099
Submitted by:	Nathan Hawkins <utsl@quic.net>
MFC after:	1 week
2002-10-19 10:18:29 +00:00
kris
10962700eb Don't call report() without a format string.
MFC after:	3 days
2002-10-13 11:27:36 +00:00
kris
2e6c3a2849 Mark the logerr() function __printflike().
MFC after:	3 days
2002-10-13 11:26:37 +00:00
kris
5b0c1af47d Use strlcpy instead of incorrectly using strncpy.
MFC after:	2 weeks
2002-10-13 11:25:31 +00:00
obrien
4c25a7d612 Use the new freebsd output format from Binutils 2.13.1. 2002-10-12 02:30:53 +00:00
alfred
4c4e655234 de-__P() 2002-10-09 23:22:11 +00:00
ru
908ae3fbf2 <machine/atomic.h> requires <sys/types.h>.
Reviewed by:	jake, mike
2002-10-09 20:20:43 +00:00
mike
f7bc6d5b05 Hook rpc.rstatd back up to the build now that it compiles. 2002-10-02 18:37:11 +00:00
mike
6a502b16ae Rename local function havedisk() to haveadisk() to avoid conflict a
with another function by the same name in a system header.
2002-10-02 18:29:50 +00:00
jhb
0f8f579414 Unhook rpc.rstatd from the build until it actually compiles. 2002-10-02 16:14:16 +00:00
mike
86a758e51b Use the standardized CHAR_BIT constant instead of NBBY in userland. 2002-09-25 04:06:37 +00:00
peter
a51c9b6627 Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00
tmm
208c1cb767 Return an error if a symbol is not found in reloc_jmpslots() instead of
crashing.
2002-09-14 12:14:24 +00:00
obrien
3b8e2fbae0 Was mising ftpchroot.5
PR:		40717
Submitted by:	Andrew <andrew@ugh.net.au>
2002-08-30 06:50:08 +00:00
yar
f8c5ceb68d The mode can be "r+" as well on PUT, but only "a" on APPE. 2002-08-29 09:53:51 +00:00
yar
c4deb81f31 Fix lexer jam on unimplemented commands.
Submitted by:	maxim
MFC after:	5 days
2002-08-29 09:23:08 +00:00
yar
906476b28e Remove variables no longer used. 2002-08-27 09:05:03 +00:00
yar
9841ff7102 More inithosts() fixes:
o Don't free(3) memory occupied by host structures
  already in the host list.
o Set hrp->hostinfo to NULL if a host record has to stay in
  the host list, but is to be ignored.  Selecthost() knows that.
o Reduce the pollution with excessive NULL checks.
o Close a couple of memory leaks.

MFC after:	1 week
2002-08-27 09:02:52 +00:00
yar
57e404b3cd Fix an inconsistency between a printf-like format and its argument list.
Submitted by:	kris
MFC after:	3 days
2002-08-27 07:38:55 +00:00
charnier
4966efff7b Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:10:45 +00:00
yar
8edf222b9e Add option '-W': don't log FTP sessions to wtmp.
Submitted by:	maxim
MFC after:	1 week
2002-08-23 09:06:28 +00:00
marcel
68f14f0597 Fix a nasty memory corruption bug caused by having a bogus pointer
for the DT_IA64_PLT_RESERVE dynamic table entry. When a shared object
does not have any PLT relocations, the linker apparently doesn't find
it necessary to actually reserve the space for the BOR (Bind On
Reference) entries as pointed to by the DTE. As a result, relocatable
data in the PLT was overwritten, causing some unexpected control flow
with annoyingly predictable outcome: coredump.
To reproduce:
	% echo 'int main() { return 0; }' > foo.c
	% cc -o foo foo.c -lxpg4
2002-08-22 03:56:57 +00:00
imp
eb79b6a23b Include stddef.h for NULL definition, rather than rolling our own here.
Reviewed by: jdp
2002-08-21 19:03:26 +00:00
yar
a5929f9a88 Clean up hostname and hostinfo handling in inithosts():
o check getaddrinfo(3) return value, not result pointer
o getaddrinfo(3) returns int, not pointer
o don't leak memory allocated for hostnames and hostinfo structures
o initialize pointers that will be checked for NULL somewhere

MFC after:	1 week
2002-08-20 14:56:06 +00:00
marcel
1e66a9327a Add support for the R_IA64_IPLTLSB relocation in non-PLT context.
This relocation creates a function descriptor at the specified
address and is commonly used for C++ to create virtual function
tables.
2002-08-20 00:24:33 +00:00
bde
a8e6e41c88 Include <nlist.h> for nlist interfaces instead of depending on namespace
pollution in <kvm.h>.
2002-08-18 17:57:08 +00:00
johan
3fcc723a46 Bump document date for the 'beep only' change. 2002-08-16 03:08:25 +00:00
ru
ce971426f4 mdoc(7) police: Removed redundant .Ns calls. 2002-08-13 16:07:28 +00:00
yar
2a6f0e09d3 Fix a wrong comment on (hopefully) right code.
MFC after:	3 days
2002-08-13 14:08:38 +00:00
dwmalone
374c5261af Add tcpd to the build - though we don't need to for inetd, someone might
want it for some other service-running program.

Approved by:	markm
MFC after:	1 week
2002-08-13 14:03:40 +00:00
yar
6c62e6d106 Fix command help lines:
o PORT takes six byte values, not five.
o TYPE argument is mandatory.

Submitted by:	demon (the 1st part)
MFC after:	3 days
2002-08-13 13:56:42 +00:00
ru
5727268ab3 mdoc(7) police: nits. 2002-08-13 11:11:32 +00:00
ru
cef88805d9 mdoc(7) police: tidy up. 2002-08-13 11:05:04 +00:00
schweikh
b2bb39b1eb Fix typos; each file has at least one s/seperat/separat/
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.

Suggested by:	bde
MFC after:	3 days
2002-08-11 13:05:30 +00:00
yar
1402e3c762 Rework storing files thoroughly. This includes:
o Remove the race between stat(2) & fopen(3) when creating
  a unique file.

o Improve bound checking when generating a unique name from
  a given pathname.

o Ignore REST marker on APPE.  No RFC specifies this case,
  but the idea of resuming APPE's implies this.

o By default, deny upload resumes and appends by anonymous users.
  Previously these commands were translated to STOU silently,
  which led to broken files on server without any notification
  to the user.

o Add an option, -m, to allow anonymous users to modify
  existing files (e.g., to resume uploads) if filesystem
  permissions permit.

Portions obrainded from:	OpenBSD
MFC after:			3 weeks
2002-08-08 17:53:52 +00:00
jdp
2f9d7d8897 Don't acquire the writer lock in rtld_exit when clearing the shared
objects' reference counts.  This function is called by the atexit
mechanism at program shutdown.  I don't think the locking is necessary
here.  It caused OpenOffice builds to hang more often than not.
Credit to Martin Blapp and Matt Dillon for helping to diagnose this
problem and for testing the fix.
2002-08-08 15:53:23 +00:00
yar
dbe59dc029 1) Use "pathstring" instead of "STRING" consistently.
2) Remove unneeded "if not NULL" props from "pathstring",
   which will never be NULL by the lexer design.

Inspired by:	OpenBSD
MFC after:	1 week
2002-08-05 17:34:15 +00:00
yar
37e3668bf5 Since GLOB_NOCHECK is set in the glob(3) call,
glob(3) will return at least one pathname unless
a system error has occured.  It's not a "not found"
error otherwise.

MFC after:	3 days
2002-08-05 14:40:38 +00:00
yar
4396de5e38 Spot places where "pathname" hasn't been checked
for NULL.  The "pathname" rule may return NULL
on a glob(3) error.

Obtained from:	OpenBSD
MFC after:	1 week
2002-08-05 14:26:40 +00:00
yar
09fb3e817b Disallow invalid numeric mode values for SITE CHMOD.
Earlier, a decimal number (e.g., 890) could be passed
for mode, leading to dangerous permissions set:
-1, that is, 07777.

Obtained from:	OpenBSD
MFC after:	1 week
2002-08-05 14:10:57 +00:00