Compare commits

...
Author SHA1 Message Date
cvs2svn 7d5bc63209 This commit was manufactured by cvs2svn to create tag
'RELENG_4_7_0_RELEASE'.
2002-10-08 05:39:08 +00:00
Bruce A. Mah 18d96317a1 MFS: Teach pkg_add -r how to find 4.7-RELEASE packages with an appropriate
osreldate.

Approved by:	re
2002-10-08 05:39:07 +00:00
Murray Stokely 68a0a8fbec MFC: Add FreeBSD 4.7.
Approved by:	 re
2002-10-08 05:32:52 +00:00
Bruce A. Mah 43837e2288 Update BASE for 4.7.
Approved by:	re
2002-10-08 05:09:48 +00:00
Murray Stokely 62d02dc863 Bump __FreeBSD_version for 4.7-RELEASE. 2002-10-08 04:59:24 +00:00
Murray Stokely 909c082ec1 Enter 4.7-RELEASE. 2002-10-08 04:48:46 +00:00
Bruce A. Mah 86c7ef7872 MFS: Fix smrsh bypass bug.
Obtained from:	sendmail.org
Approved by:	security-officer (jedgar), re (murray)
2002-10-08 00:57:20 +00:00
John Baldwin ac88a0a707 MFS: Range check fix and handle SMP races in i386_set_ldt().
Approved by:	re
2002-10-07 17:37:39 +00:00
John Baldwin e0fb848ab2 MFS: Unsigned start/num args for i386_set_ldt().
Approved by:	re
2002-10-07 17:36:04 +00:00
Bruce A. Mah 5c2f5d6243 Remove footer implying that readers (for this RELEASE) need to read
stable@.

Bump FreeBSD version number for manpage entities.
2002-10-06 21:37:39 +00:00
Bruce A. Mah 2bc4e74f3a Use an appropriate directory when updating RELNOTESng snapshot site.
Approved by:	re (implicitly)
2002-10-06 21:00:19 +00:00
Bruce A. Mah 4026f294fb Bump version number (and related) entities for 4.7-RELEASE.
Approved by:	re (implicitly)
2002-10-06 20:58:46 +00:00
Murray Stokely 0b909877cf Track RELENG_4_7 rather than RELENG_4_6.
Approved by:	 re
2002-10-06 19:27:08 +00:00
Murray Stokely 37cdba40e6 Update default .Os value for man pages.
Approved by:   re
2002-10-06 19:24:53 +00:00
Murray Stokely 22381f1a11 The "update" target should track RELENG_4_7 here.
Approved by: re
2002-10-06 19:22:15 +00:00
cvs2svn 727591c126 This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-10-05 19:53:19 +00:00
Orion Hodson f1b796bf01 Revert to 1.8.2.10. Suspend with device open caused panic with 1.8.2.11.
Approved by: re
2002-10-05 19:53:18 +00:00
Scott Long 710115ffa2 "<matcd> Help! Help, scottl is trying to *BANG* *BANG* *BANG*"
"<CVS>    Hello?  Hello?  Are you still there?"

Approved by:	re (rwatson)
2002-10-05 18:31:49 +00:00
Ruslan Ermilov 563546642e MFC: 1.61: Reincarnate HTTP authentication code.
Approved by:	re (jhb)
2002-10-04 08:11:59 +00:00
Bruce A. Mah 2b17a020b8 Update sysinstall text for the number and size of ports in the ports
collection (see ports/INDEX 1.366).

Approved by:	re
2002-10-02 16:25:04 +00:00
Søren Schmidt d9fe40cfe2 MFC:
Add yet another Promise chip id.

Approved by: re@
2002-10-02 14:13:38 +00:00
Justin T. Gibbs 034d80aacc MFC: Don't panic while probing the 2842
Approved by:	RE
2002-10-01 16:41:29 +00:00
Bruce Evans 1dc8e58608 MFC (1.85: round up instead of towards 0 in clock_getres()).
PR:		41781
Approved by:	re (jhb)
2002-10-01 08:00:41 +00:00
Warner Losh 7d32c7e4a6 MFC: A whole boatload of cards from -current.
This brings us up through 1.252.

Approved by:	re@
2002-09-30 23:17:31 +00:00
Sebastien Gioria 5e3690f270 - Remove installation dir from build because, he doesn't build well (Makefile)
- Adding build relnotes/alpha (he must be in build for a long time, but
       for some obscur reasons, it does'nt) (relnotes/Makefile)
- MFen 1.22.2.297-> 1.22.2.300 (relnotes/common/new.sgml)
- Some minors typos and grammars fixs (errata/article.sgml, relnotes/common/new.sgml)

Approved by:  re@(bmah)
2002-09-30 21:24:21 +00:00
Marc Fonvieille b5ee61fc4c MFC: 1.112 (it was forgotten in previous MFC)
Typo fix s/o packet/on packet/

Approved by:	re (jhb)
2002-09-30 20:57:05 +00:00
Bruce A. Mah 649a01d8d4 Make sysinstall's desktop configuration menu install the real kde and
gnome metaports, rather than the less-featureful kdebase and gnomecore.

The general consensus seems to be that sysinstall and the disc 1 package
list were pruned down due to space considerations.  Those don't appear
to be a factor; in fact, we've been shipping the metaports on
disc 1 since 4.6.  This commit gets sysinstall caught up.

Approved by:	re
Discussed with:	portmgr (will)
2002-09-30 20:18:47 +00:00
Dima Dorfman 253df96c73 MFC: lock(1) -v, vidcontrol(1) -S
Approved by:	bmah
2002-09-30 19:03:49 +00:00
Wilko Bulte d1b07af47c Note TurboLaser Alpha's support is broken.
Approved by:	re
2002-09-30 18:48:58 +00:00
Wilko Bulte f4a0789aad Note that one better disable isp-driven Qlogic fiberchannel cards when
installing on Alpha.

Submitted by:	mjacob
Approved by:	re
2002-09-30 18:44:18 +00:00
Sebastien Gioria e7a3173a83 MFen 1.22.2.297
Approved by: re@(bmah)
2002-09-30 17:18:48 +00:00
David E. O'Brien 9545a56c96 Restore sudo's ability to offer S/Key authentication.
Approved by:	jhb(re)
Reviewed by:	markm
2002-09-30 15:32:01 +00:00
Jacques Vidrine 0b449c2699 MFC 1.1.1.8: Fix spurious error message when changing passwords.
Approved by:	re (murray)
2002-09-30 14:12:42 +00:00
Sheldon Hearn 10522f2e51 MFC rev 1.21: regen
Approved by:	re
2002-09-30 14:09:52 +00:00
Masafumi Max NAKANE f191ebcf55 Typo fix MFC.
Approved by:	murray
2002-09-30 08:19:41 +00:00
Wilko Bulte 7efb0443a1 MFC: Document 1Gbyte max memory limitation on Miata.
Approved by:	re
2002-09-29 11:42:03 +00:00
Wilko Bulte 0acc63cefc Floppy drive on AlphaStation DS10 will remain broken in 4.7R
Approved by:	re
2002-09-29 11:34:45 +00:00
Kris Kennaway 341e0586b4 MFC: Add some extra directories created by recent versions of XFree86-4
Approved by:	re (several times)
2002-09-29 02:49:52 +00:00
Mark Murray 881ae9a56f MFC: don't document the totally bitrotted kerberos support.
Approved by:	re (murray)
2002-09-28 16:31:45 +00:00
Søren Schmidt 26434e889b MFC:
Add manpage for pst driver (Promise Supertrak SX6000)

Approved by: re@
2002-09-28 11:19:07 +00:00
Brian Somers 736fc9be30 MFC: If the peer gives us 0.0.0.0 as his IP number, NAK it rather than accepting
it as being in range.

       set ifaddr 1.2.3.4/0 5.6.7.8/0

     no longer allows 0.0.0.0 as a valid IP.

Approved by:	re (jhb)
2002-09-28 10:16:25 +00:00
Andrey A. Chernov e1ea49a732 MFC part of 1.132 - add "su" alias for "dumb"
Approved by:	re
2002-09-28 05:14:53 +00:00
Justin T. Gibbs f8feb060cf MFC: Add braces around debugging statement.
Approved by: RE
2002-09-28 03:51:32 +00:00
cvs2svn 3b234f84b6 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-09-27 17:44:13 +00:00
Justin T. Gibbs e554ada9f5 MFC: Bring aic79xx driver up to the latest in -current.
Approved by:	RE (jhb)
2002-09-27 16:29:35 +00:00
Justin T. Gibbs 11c84bd2a0 MFC: Sync Perforce IDs and correct a spelling error.
Approved by:	RE (jhb)
2002-09-27 16:29:06 +00:00
Justin T. Gibbs f3e00f04a7 MFC: Sync Perforce Ids.
Approved by:	RE (jhb)
2002-09-27 16:28:33 +00:00
Justin T. Gibbs 01df96a90a MFC: Add support for move with immediate of 0. Use inttypes.h.
Approved by:	RE (jhb)
2002-09-27 15:46:28 +00:00
Sebastien Gioria 0d7c5d3598 MFen 1.22.2.294->1.22.2.296
Approved by: re@(bmah)
2002-09-27 07:03:50 +00:00
Mike Silbersack 014c4b26f8 MFC rev 1.175
Fix issue where shutdown(socket, SHUT_RD) was effectively
  ignored for TCP sockets.

  NetBSD PR:      18185
  Submitted by:   Sean Boudreau <[email protected]>

Approved by:	re
2002-09-27 02:06:25 +00:00
Matthew N. Dodd eabad3cb57 MFC: 1.268
Modify vm_map_clean() (and thus the msync(2) system call) to support
invalidation of cached pages for objects of type OBJT_DEVICE.

Submitted by:	 Christian Zander <[email protected]>
Reviewed by:	 alc
Approved by:	 re (jhb)
2002-09-26 17:32:01 +00:00
Prafulla Deuskar 4c6b5a04e3 MFC:
Corrected license in the source files. It should say "MUST" instead of "MAY".

Approved by:	re (jhb)
2002-09-26 16:34:41 +00:00
Maxim Konovalov 87ec7a3156 MFC a part of rev. 1.122: do not miss 'not' in '... to not me'.
PR:		bin/43319
Approved by:	re (jhb)

MFC rev. 1.124: do not dump core on 'ipfw add unreach'.

Approved by:	re (jhb)
2002-09-26 07:19:05 +00:00
Bruce A. Mah 80eae1f0ad Partial revert of previous commit: tgz is once again the default
suffix for 4-STABLE packages.

Approved by:	re (implicit)
2002-09-26 03:38:30 +00:00
Bruce A. Mah 039547dbca Removed release note: bzip2 package default.
Approved by:	re (implicitly)
2002-09-26 02:31:36 +00:00
cvs2svn c826cdb249 This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-09-25 23:22:15 +00:00
Bruce A. Mah 3cd4a69c91 Revert to gzip as the default compression scheme used by the
pkg_* utilities.

While the idea of bzip2 compression is a good one, our support for
this feature isn't mature enough for the impending release.

Reviewed by:	obrien
Approved by:	re (bmah)
2002-09-25 23:22:14 +00:00
Bruce A. Mah 0f591ffd30 Bring the aac driver back into the install kernel. Take out the amr
and mly drivers and make them available as modules (which are automatically
loaded by sysinstall).

This fixes an error seen on 4.7-RC1/i386 when sysinstall tried to load
the aac module, but failed because it couldn't fulfill a dependency
on the linux module.

Approved by:	re (jhb)
2002-09-25 15:40:49 +00:00
John Polstra 98ff43f8ad MFC 1.20: Set up the DMA Read/Write Control register more correctly.
(A fix for the transmit watchdog timeouts on Dell 2650 and possibly
other PCI-X systems.)

Approved by:	re
2002-09-25 15:23:03 +00:00
Scott Long c93d632184 MFC: Use one devclass for the ahc device rather than one per bus.
Approved by:	re (jhb)
2002-09-25 14:50:03 +00:00
Maxim Konovalov 39b71d2b18 MFC rev. 1.113: fix a typo, remove EOL spaces.
Approved by:	re (bmah)
2002-09-25 07:03:24 +00:00
Bruce A. Mah e2b02502ce MFC: Track ports/Mk/bsd.ports.mk rev. 1.424.
print-cdrom-packages.sh	1.30->1.31
2002-09-25 04:46:21 +00:00
Paul Saab 997b18fff2 MFC: rev 1.140 Add some new PCI device ID's
Approved by:	re
2002-09-24 23:45:16 +00:00
Matt Jacob b4b269d04b MFC: Fix CAM usage, parameterized max request; check for interrupt
before trying to pop a reply; add Ack Event stuff; Parameterized
max requests, cleaned up locking macros

Approved by:	[email protected] (jhb)
2002-09-24 21:37:25 +00:00
Matthew Dillon 8d7717c8f8 MFC 1.174
Approved by:	re
2002-09-24 16:28:34 +00:00
Stephen McKay 2ddeca5af8 MFC(1.42): cp -p could report success even if a file copy failed. Worst case
this could cause mv(1) to delete files during a failed cross-device move.

PR:		42789
Approved by:	jhb (re)
2002-09-24 12:41:04 +00:00
Matthew N. Dodd fbfa3f052c MFC: 1.16
Enable MTRR support on Intel Pentium 4/XEON processors.

Submitted by:	 Christian Zander <[email protected]>
Approved by:	 re (jhb)
2002-09-24 08:12:51 +00:00
Matthew N. Dodd abfb961fad MFC: 1.537, 1.538
Reset pc->pcb_gs and %gs before possibly invalidating it.

Submitted by:	 Christian Zander <[email protected]>
Approved by:	 re (jhb)
2002-09-24 08:12:21 +00:00
Matthew N. Dodd 16e6e7379a MFC: 1.129
Pass flags to msync() accounting for differences in the definition of
MS_SYNC on FreeBSD and Linux.

Submitted by:	 Christian Zander <[email protected]>
Approved by:	 re (jhb)
2002-09-24 08:11:41 +00:00
Bruce A. Mah 118f3eb101 Clarify what exactly our "gcc 2.95.4" is. Not applicable to -CURRENT.
Approved by:	re (implicitly)
2002-09-23 16:59:15 +00:00
Jacques Vidrine 96aace0670 MFC src/kerberos5/libexec/ipropd-master/Makefile 1.8, 1.9;
src/kerberos5/libexec/ipropd-slave/Makefile 1.8, 1.9;
    src/kerberos5/libexec/k5admind/Makefile 1.9:
Drop libkadm5clnt from set of libraries included when building
these daemons so that they actually work.

Approved by:	re (jhb)
2002-09-23 14:00:48 +00:00
Maxim Konovalov 77a5659f07 MFC rev. 1.21: fix vsnprintf(3) memory leak for size == 0.
Approved by:	re (jhb)
2002-09-23 06:58:17 +00:00
Kelly Yancey 9bec5b4849 MFC 1.146: Add MLINKS for sbuf_trim() and sbuf_vprintf().
Approved by:	re
2002-09-23 04:54:02 +00:00
Kelly Yancey dcbeae29d4 MFC rev 1.17 and 1.18: document sbuf_trim(), sbuf_vprintf() and
auto-extend functionality.

Approved by:	re
2002-09-23 04:51:53 +00:00
Warner Losh b4d3679465 MFC: Merge the new shorter PCIC ID names.
Approved by:	re@
Pointy Hat to: imp for forgetting them on last commit.
2002-09-22 21:09:13 +00:00
Warner Losh 06e3a92959 MFC: Lots of stuff:
1) Provide slots to pass the CIS Vendor, CIS Version, OEM ID, Product ID,
     and Product EXT by taking space from the largely unused misc field.
  2) Cardbus voltages now work, so use them for cardbus bridges.  This
     should fix toshiba bridges and 3.3V cards.
  3) Add support for CardBus bridges mapping PC Card memory into high
     memory (> 16M).
  4) Attempt to sanely setup the TI MFUNC register on those bridges that
     have it.
  5) Maybe support routing 6729 bridges via PCI bus.
  6) ID name length reduction.
  7) Better verbage in the sysctl doc strings.
  8) Add ability for 6722 users to specify how, if at all, they want to
     try to detect 3.3V cards.
  9) Minor formatting nits

Approved by:	re@
2002-09-22 20:26:58 +00:00
Hiroki Sato ae577b4100 Catch up with the English version:
1.22.2.278 -> 1.22.2.294	relnotes/common/new.sgml

	(Note: an uncertain item is not activated yet.)

Approved by:	re(bmah)
2002-09-22 18:20:46 +00:00
Jacques Vidrine 3e9ac6c2f7 Fix a typo in previous MFC.
Reported by:	many folks
Not exactly approved by:	re
2002-09-22 12:20:23 +00:00
Peter Wemm a470520b27 MFC: rev 1.40 (without cosmetic changes). Fix scsi device wiring.
Approved by:	re
Prompted by:	scottl/ken
2002-09-22 07:15:32 +00:00
Sebastien Gioria 21be3f39bf - MFen 1.22.2.294
- Minors cleanings

Approved by: [email protected] (bmah)
2002-09-22 02:38:48 +00:00
Jacques Vidrine 56ed46a4de MFC: Update Heimdal Kerberos to 0.5 around 2002/09/16.
Approved by:	re (jhb)
2002-09-20 10:50:58 +00:00
Jacques Vidrine 09bed63737 MFC 1.19: Limit UDP payload size for EDNS0 to 0xffff.
Approved by:	re (jhb)
2002-09-20 10:45:35 +00:00
Bruce A. Mah 6b69b77bb0 MFC: AMD Elan 520 support, new ata(4) chipset support.
Approved by:	re (implicitly)
2002-09-19 23:01:28 +00:00
Bruce A. Mah 9d0e40e914 MFC: Document AMD Elan SC-520 support.
This completes the MFC of 1.2->1.3.

Approved by:	re (implicitly)
2002-09-19 23:00:36 +00:00
Bruce A. Mah f00fa6d98b MFC: Update ata(4) chipset list.
Approved by:	re (implicitly)
2002-09-19 22:56:09 +00:00
Andrew Gallatin ad5c494342 MFC rev 1.8: recovery from new binutils part II: fix the alpha kernel so that
it handles R_ALPHA_RELATIVE relocs with addends properly.

This should fix the recently reported problems with loading modules on
alpha on -stable.

Approved by: re (jhb)
2002-09-19 15:37:08 +00:00
Jacques Vidrine e2345374a7 MFC getaddrinfo.c 1.32, 1.33;
gethostbydns.c 1.39;
    getnetbydns.c 1.24, 1.25;
    name6.c 1.27, 1.28;
    res_update.c 1.7:
Check for truncation in calls to res_send/res_query/res_search.
Increase resolver buffer size.

Approved by:	re (jhb)
2002-09-19 13:45:23 +00:00
Tom Rhodes cb71be7a4b Back out recent commit. Incorrect impression that 'h' was already
MFC'ed, but it was not.

Discussed with:	bde, johan, ru, jhb
Approved by:	re (jhb)
2002-09-18 23:40:35 +00:00
Mike Barcroft d29d80199c MFC Rev 1.31:
ARIN has annoyingly started using caps when referencing
whois.apnic.net.  To properly receive hints for recursive IP searches,
we convert a buffer to lowercase before searching for magic words.
2002-09-18 23:14:15 +00:00
Doug Ambrisko c9d6f50827 MFC: Only probe one PHY on the D-Link 580 and fix fragment issue
on TX.

Approved by:	re (jhb)
2002-09-18 21:38:28 +00:00
Søren Schmidt 0f2d75a949 MFC:
update with latest chipset support

Approved by: re@
2002-09-18 17:35:20 +00:00
Søren Schmidt 7d111a9847 MFC:
Add yet another VIA chip.

Approved by: re@
2002-09-18 17:34:26 +00:00
Mike Heffner b9f8d5948d MFC: POSIX compatability, fixes sftp
glob.h		  1.7
     glob.3		  1.21
     glob.c		  1.19-1.20

PR:		bin/42275
Approved by:	re
2002-09-18 14:13:31 +00:00
Sam Leffler 021890eb4e sigh, fix last commit; don't touch code and talk to lawyers at the same time 2002-09-18 05:42:55 +00:00
Sam Leffler df24b68717 MFC: elan-mmcr device
Approved by:	re (jhb)
2002-09-18 05:34:31 +00:00
Mike Heffner 366205f667 MFC: 1.44-1.47, 1.50-1.51, 1.58-1.61
C99 and POSIX compatability

Reviewed by:	mike, bde
Approved by:	re
2002-09-18 04:05:13 +00:00
Tom Rhodes 037532d2d9 MFC: 'h' missing in getopt() call
PR:		41926
Submitted by:	Andre Albsmeier <[email protected]>
Reviewed by:	johan, bde, jhb
Approved by:	re (jhb)
2002-09-17 23:38:33 +00:00
Sam Leffler fd512253f3 MFC: Elan support;
o Recognize AMD Elan SC520 hostbridge.
o Add initialization code for the AMD Elan sc520 which maps the MMCR
  into KVM and sets the i8254 frequency to the correct value.
o MAKEDEV entry for elan-mmcr device

Reviewed by:	phk, jhb
Approved by:	re(jhb)
2002-09-17 22:39:57 +00:00
John Polstra 02d6988fe0 MFC pciconf.c revision 1.18: usage message fixes. Sync the man page
with -current.

Approved by:	re
2002-09-17 22:09:15 +00:00
Maxim Sobolev 5ecb043295 MFC: assume that autoinstalled dependencies have the same format (.tbz, tgz or
.tar) as the main one. This resolves one of the main problems with .tbz
switchover.

Approved by:	re
2002-09-17 18:51:16 +00:00
Sam Leffler cee17461ed add interface for 3rd party h/w RNG drivers to inject "pure entropy"
Approved by:	re(jhb)
2002-09-17 17:11:57 +00:00
Jacques Vidrine a17f66db29 MFC 1.18: Check for FD_SET overruns.
Approved by:	re (jhb)
2002-09-17 16:53:55 +00:00
Sebastien Gioria 10f6e8c649 MFen 1.22.2.293
Approved by: re(bmah)
2002-09-17 15:49:38 +00:00
Jacques Vidrine c55fa51a43 MFC 1.30: Check for FD_SET overruns.
Approved by:	re (jhb)
2002-09-17 15:34:41 +00:00
Jacques Vidrine a550f7f356 MFC 1.71, 1.72: Check for FD_SET overruns.
Approved by:	re (jhb)
2002-09-17 15:33:49 +00:00
cvs2svn 86b99f13a2 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-09-17 12:50:44 +00:00
Sheldon Hearn 3eaf155c95 MFC rev 1.20: regen
Approved by:	re (blanket)
2002-09-17 11:50:40 +00:00
cvs2svn 38d3020be4 This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-09-17 02:59:26 +00:00
cvs2svn cd741eae0a This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-09-17 02:59:25 +00:00
John Baldwin bc8c7cefd4 Bump to 4.7-RC. 2002-09-17 02:59:24 +00:00
Ian Dowse 3862c067d2 MFC: 1.326,1.327; permit the creation of just cd0 if desired, and
remove unnecessary sanity checks.

Approved by:	re (jhb)
2002-09-16 23:23:34 +00:00
Bruce A. Mah bcd1db1348 New errata: SA-02:39.
Approved by:	re (implicitly)
2002-09-16 23:08:45 +00:00
Bruce A. Mah 1e984d2a60 MFC: SA-02:39.
Approved by:	re (implicitly)
2002-09-16 23:05:28 +00:00
David Malone 0fbbdc1de2 MFC: Don't change MTRRs unless we understand the old values - should
help with some people using X and apm on Athlon machines with unusual
BIOSs.

Approved by:	re (jhb)
2002-09-16 21:58:41 +00:00
Scott Long 326ab7dbb1 MFC rev 1.18. Fix suspend.resume correctly.
Approved by:	re (jhb)
2002-09-16 19:52:33 +00:00
Søren Schmidt 705e27f151 MFC:
Wait for drive to become ready if its in progress of loading..

Approved by: re@
2002-09-16 19:38:37 +00:00
Søren Schmidt bbef2e163d MFC:
Dont hang in atprq on poll_dsc command.

Approved by: re@
2002-09-16 19:37:53 +00:00
Søren Schmidt 4cb5ea0648 MFC:
Add support for Sil 0680
	Add yet another Promise chip
2002-09-16 19:36:48 +00:00
Søren Schmidt d32fdf350a MFC:
Rearrange where to get the ATAPI magic sequence.

Approved by: re@
2002-09-16 19:35:30 +00:00
Brian Somers 145fa4bcc8 MFC: Unbreak things when NOINET6 is defined
Approved by: re (jhb)
2002-09-16 01:41:04 +00:00
Dima Dorfman 6a2638324e MFC: -v option that prevents switching virtual terminals while this
terminal is locked and some fixes before that to make merging easier.

Approved by:	jhb (re)
2002-09-15 22:32:56 +00:00
Dima Dorfman 89800c9b01 MFC: -S option that allows the user to disable vty switching and
resulting wording fixes.

Approved by:	jhb (re)
2002-09-15 22:31:50 +00:00
Dima Dorfman 622906f1f3 MFC: VT_LOCKSWITCH
Approved by:	jhb (re)
2002-09-15 22:30:46 +00:00
Eric Anholt be94235213 MFC: Fix i810 after i830 commit.
Approved by:	re@
2002-09-15 08:45:41 +00:00
Archie Cobbs 1bed24fbfc MFC: (rev. 1.14) Update to reflect reality.
Approved by:	re
2002-09-15 00:33:23 +00:00
Archie Cobbs e1b4b68e63 MFC: (rev. 1.19) Adjust to reflect reality: sigaltstack() takes stack_t *'s.
Approved by:	re
2002-09-15 00:32:41 +00:00
Archie Cobbs 6506718d4f MFC: (rev. 1.38) Update to reflect reality.
Approved by:	re
2002-09-15 00:31:48 +00:00
Archie Cobbs 8857adacf4 MFC: Add ucontext(3) man page.
Approved by:	re
2002-09-15 00:30:45 +00:00
Hajimu UMEMOTO 91b0a912c7 MFC: sshd didn't handle actual size of struct sockaddr correctly,
and did copy it as long as just size of struct sockaddr.  So,
If connection is via IPv6, sshd didn't log hostname into utmp
correctly.

	crypto/openssh/monitor.c:	1.9
	crypto/openssh/session.c:	1.37
	crypto/openssh/sshlogin.c:	1.7
	crypto/openssh/sshlogin.h:	1.2

Approved by:	re
2002-09-14 14:29:55 +00:00
Tim J. Robbins d2188905ba MFC rev 1.58: Correctly set the close-on-exec bit on the tty file descriptor
to avoid leaking it to child processes.

Approved by:	re (jhb)
2002-09-14 03:08:47 +00:00
Eric Anholt 14db04edce MFC: i830 and i845 AGP support.
Approved by:	re@
2002-09-13 18:16:12 +00:00
Mitsuru IWASAKI 7b0c18a9e0 MFC: Add an entry for corega WL PCCL-11(1.241 -> 1.242).
PR:             conf/42481
Submitted by:   NINOMIYA Hideyuki <[email protected]>
Approved by:    re
2002-09-13 16:44:35 +00:00
Joerg Wunsch 6e20fbb752 MFC mountd.c/1.67 and exports.5/1.20:
Give a more explanatory error message for the frequent pilot error of
attempting to export the non-root of a filesystem with the -alldirs
option.

Also merge the -quiet option that completely discards this error
message upon requesting so, so you can export some mount point with
-alldirs without getting complaints if there's nothing mounted at it
(e. g. like /cdrom).

Approved by:	re
2002-09-13 15:57:43 +00:00
Sebastien Gioria 20d2fd5f04 MFen 1.22.2.292
Approved by: [email protected] (bmah)
2002-09-13 15:36:18 +00:00
Jacques Vidrine 665e307511 MFC 1.23: mark file descriptors close-on-exec.
Approved by:	re (jhb)
2002-09-13 14:53:43 +00:00
Jacques Vidrine 8c82ecd75f MFC 1.6: prefix -> /usr, update version number.
Approved by:	re (jhb)
2002-09-13 14:51:53 +00:00
John Baldwin 2c9291c6d5 MFC: Finish merge of ICH4 support by recognizing ICH4 ata controller in
attach and setting appropriate description string.  The rest of the ICH4
support including all the DMA support was merged earlier.

Approved by:	re (bmah)
2002-09-13 14:08:01 +00:00
cvs2svn 4a3cc125bd This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-09-13 12:31:57 +00:00
Bruce A. Mah 11942be157 MFC: sendfile(2) bugfix.
Move two TCP release notes from the general kernel section to the
networking section.  Minor tweaks for style and one correction, in the
process.
2002-09-13 03:58:13 +00:00
Bruce A. Mah 6d7a1ca174 MFC: Update to use *.tbz suffix, update example URL, fix a gramm-o.
PR:		42576
Approved by:	re (implicitly)
2002-09-12 22:38:45 +00:00
Tom Rhodes ee0c53086c MFC: Fix a bug where large msdos partitions were not handled correctly, along
with a few fsck_msdosfs related 'issues'.  This also includes the style(9)
corrections committed in rev 1.95

PR:		28536, 30168
Submitted by:	Jiangyi Lui <[email protected]> && NetBSD
Approved by:	re (jhb)
2002-09-12 21:33:38 +00:00
Jacques Vidrine 1c53544c52 MFC main.c 1.20, mapper.c 1.16, mrinfo.c 1.18, mtrace.c 1.20:
Check for FD_SET overruns.

Approved by:	re (jhb)
2002-09-12 16:27:49 +00:00
Maxim Konovalov 480fadb7b1 MFC rev. 1.51:
o backout rev. 1.40 (rev. 1.29.2.4 in RELENG_4),
o add argv[] boundary check.

Note rev. 1.49 has been never MFCed so there is no need to backout it.

Approved by:	re (jhb)
2002-09-10 09:10:57 +00:00
Bruce A. Mah c39e106692 MFC: Fix minor off-by-one-error.
Submitted by:	jhb
Approved by:	re (jhb)
2002-09-09 21:22:56 +00:00
Bruce A. Mah 0f6ef27384 MFC: Make pkg_install go to the right place for 4.6-RELEASE and
4.6.2-RELEASE packages.

Approved by:	re
2002-09-09 19:50:37 +00:00
Sam Leffler 859f01321a MFC kern_sysctlbyname needed by forthcoming CPU_ELAN changes
Reviewed by:	phk, jhb
Approved by:	re@
2002-09-09 19:27:58 +00:00
Archie Cobbs 84b47b0830 MFC: (rev. 1.58) Say that ":C" expects an extended regular expression.
Approved by:	re
2002-09-09 19:06:16 +00:00
Sebastien Gioria 2c1218d904 MFen ->1.22.2.291
Approved by:    re (bmah)
2002-09-09 18:02:05 +00:00
Akinori MUSHA 37c9115227 MFC: Add tcl81 that was missing. 2002-09-09 17:56:54 +00:00
Matthew Dillon 3a96f13943 MFC partial reversion of previous commit, based on problems reported by
Alpha users and a long discussion with Peter Wemm.  The jist of it is
that we can't trust any of the elf flags to determine what is data and
what is text so we use the old 'entry point in segment' method to
detect text vs data, and we can't calculate the actual data_size for
vmspace because break() depends on data_start + data_size pointing to
the end of the address space, so we use the last data segment (as before).
However, we were able to retain partial checking for RLIMIT_TEXT,
RLIMIT_DATA, and full checking for RLIMIT_VMEM.

Approved by:	re
2002-09-09 17:38:47 +00:00
Marc Fonvieille 06ef838c9a MFC: 1.12
It will fix the tzsetup problem.

PR:		misc/42482
Submitted by:	davidc
Approved by:	re
2002-09-09 17:15:46 +00:00
Warner Losh 96af8ca352 A minimalistic version of sys/endian.h from current that supports only
little endian machines (which is all the architectures that 4.x
supports).

Submitted by:	mike@
Approved by:	re@
2002-09-09 05:45:04 +00:00
Bruce A. Mah 66717bdf0f MFC: Add some more AMD processors to the supported hardware list.
proc-i386.sgml	1.2->1.3 (partial)

PR:		40712
Approved by:	re (implicitly)
2002-09-07 19:08:48 +00:00
Guido van Rooij f973bff275 MFC 1.52: 1) Fix a debug statement by filling in its data before the printf in
stead of after
2) Honour NO_TEST_UNIT_READY quirk for atapi devices as well
3) Actually support FujiFilm FinePix 6800 camera's. Will very likely also
work for other FinePix models.
4) Enable ATAPI support for umass devices.

Reviewed by:	[email protected]
Approved by:	[email protected]
2002-09-06 06:51:41 +00:00
Bruce A. Mah f3bd8f3189 Fix Binutils snapshot date.
MFC:  linux_base 7.1, XFree86.4.2.1.

Approved by:	re (implicitly)
2002-09-05 23:59:24 +00:00
Crist J. Clark 61c70187d6 Backout previous commit. In code freeze for 4.7. Yes, I am an idiot. 2002-09-05 18:36:11 +00:00
Crist J. Clark b6f58c8d70 MFC: 1.105. Don't give up on a remote log host when we get a
EHOSTUNREACH or EHOSTDOWN. These are often transient errors.

PR:		bin/31029
2002-09-05 17:54:32 +00:00
Murray Stokely 1eee4d5ac7 Move drivers to mfsroot.
Submitted by:	jhay
Approved by:	re
2002-09-05 16:25:52 +00:00
Bruce A. Mah 4a8984e082 Add an errata entry for the problem of pkg_add -r going off to the
wrong directory on 4.6 and 4.6.2.

Pointed out by:	obrien
Approved by:	re (implicitly)
2002-09-05 15:35:57 +00:00
Murray Stokely c31ceffe07 MFC: r1.57 - Remove AH[CD]_REG_PRETTY_PRINT from boot floppies.
Approved by:	re
2002-09-05 11:14:21 +00:00
Murray Stokely ba91099bd3 MFC: 1.62 - Remove AH[CD]_REG_PRETTY_PRINT from boot
floppies. (unbreak "make release")

Approved by:	re
2002-09-05 11:12:07 +00:00
Dag-Erling Smørgrav e4a480ece8 s/strchr/strrchr/ (typo in previous commit)
PR:		i386/42315
Submitted by:	Mike Makonnen <[email protected]>
2002-09-04 15:28:10 +00:00
Sebastien Gioria 9b59f30765 MFen 1.22.2.289->1.22.2.290
Approved by:    [email protected] (bmah)
2002-09-04 15:19:00 +00:00
Juli Mallett 1695353f62 CVS wasn't at fault for this part of the mismerge, gratuitous differences
between CURRENT and STABLE were:  isipv6 isn't existant in the non-INET6
case, so conditionalise large parts on this.  Yuck.  Yuck.

Submitted by:	lioux
Approbed by:	re (original commit)
2002-09-03 22:32:47 +00:00
Juli Mallett b842f47f5c Fix mis-merge.
Submitted by:	lioux
2002-09-03 22:01:04 +00:00
Juli Mallett 246eb89cb8 MFC: When printing IPv6 addresses with a TCP/UDP port seperated by a colon,
for the log_in_vain facility, surround them in brackets.

Pointed out by:	Edward J. M. Brocklesby
Reviewed by:	ume
Approved by:	murray (re)
2002-09-03 19:53:04 +00:00
Sebastien Gioria 6a74cae102 MFen 1.22.285->1.22.2.289
Approved by:    [email protected] (bmah)
2002-09-03 18:51:09 +00:00
Eric Melville f0db17addb MFC: use the default pager if the environment variable is blank
Approved by:	murray
2002-09-03 17:41:54 +00:00
Yaroslav Tykhiy f32edd72b7 MFC: ftpd(8)
Approved by:	bmah
2002-09-03 16:57:15 +00:00
Justin T. Gibbs 100bfcd1a9 MFC: Remove aic7xxx from the module build framework until all bootstrapping
issues are resolved.
2002-09-03 16:55:23 +00:00
cvs2svn e647b9b1e2 This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-09-03 01:50:24 +00:00
Gregory Neil Shapiro 258c91a9a8 MFC: Import sendmail 8.12.6
Approved by:	re
2002-09-03 01:50:23 +00:00
Bruce A. Mah b1dd2deb2b MFC: Binutils 2.12.1 20020622 snapshot.
Approved by:	re (implicitly)
2002-09-03 01:09:18 +00:00
Bruce A. Mah 6c18e2687a MCF: ng_l2tp(4), uaudio, daemon(8), ifconfig(8) promisc, inetd(8)
service limits, tcpd(8).
2002-09-03 00:27:37 +00:00
Matthew Dillon ff2355e11f MFC stage-2 RLIMIT_VMEM support. Add support to the elf loader.
Approved by:	re
2002-09-02 21:22:54 +00:00
Murray Stokely dd2945ee27 Update for 4.7-PRERELEASE. 2002-09-02 07:59:53 +00:00
Murray Stokely 917964aa9d Welcome to FreeBSD 4.7-PRERELEASE.
Approved by:	re
2002-09-02 07:56:48 +00:00
Scott Long 2c6f262b2d MFC: Hook aic7xxx up to the build 2002-09-02 05:48:19 +00:00
Scott Long 35b672cbbe MFC the aic7xxx module framework 2002-09-02 05:47:45 +00:00
David E. O'Brien f9498d3b9e MFC: ld-elf.so.1 assumed a few too many things about the ordering of sections
produced by ld(8) (ie: that _DYNAMIC immediately follows the _GOT).
Update ld.so to deal with the new (faster) PLT format that gcc-3.1 and
binutils can produce.
2002-09-02 02:10:20 +00:00
David E. O'Brien c467132cb1 Upgrade to binutils 2.12.1. 2002-09-01 23:44:26 +00:00
David E. O'Brien 55b3d7e976 MFC: remove these bits for platforms FreeBSD 4.x does not run on
(some are ancient, back to the time of 2.9.1)
2002-09-01 23:37:48 +00:00
David E. O'Brien e9df0e9107 MFC: remove these ancient 2.9.1 bits for platforms FreeBSD does not run on 2002-09-01 23:32:09 +00:00
David E. O'Brien 1752c99f31 MFC: rev 1.2: use xmalloc and friends from libiberty 2002-09-01 23:30:00 +00:00
Matt Jacob f4f0aa9cd1 MFC:
a) we don't believe what the board tells us all the time (if the BIOS
hasn't run, port page 2 and port page 0 tend to be garbage)

b) add the missing code to set parameters for the SPI cards.

c) Fix copyrights in mpilib in concordance with LSI and other
freebsd developers.
2002-09-01 23:08:06 +00:00
Bruce A. Mah 28d8877972 MFC: ahd(4) hardware. 2002-09-01 22:59:19 +00:00
Scott Long 3572adb867 Update LINT for the ahd driver 2002-09-01 22:51:58 +00:00
Bruce A. Mah ebc9e121e2 MFC: ahd(4), IPFilter 3.4.29, Heimdal pre-0.5, bzip2 packages. 2002-09-01 22:47:22 +00:00
Scott Long 4325a53a13 MFC the ahd manual page. 2002-09-01 22:35:34 +00:00
cvs2svn 3daf4d6ef1 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-09-01 22:07:25 +00:00
Brian Somers 53de306886 MFC: The latest examples from current 2002-09-01 08:01:18 +00:00
Scott Long 97548cbaa9 MFC: Remove non-existant options 2002-09-01 07:18:21 +00:00
Scott Long 038d4d9e5c MFC: correct debug bit position 2002-09-01 07:17:37 +00:00
Alan Cox bd9966eef7 MFC
o Add some comments and eliminate some unnecessary white space
   to reduce the differences relative to -CURRENT.

Reviewed by:	md5
2002-09-01 06:37:31 +00:00
cvs2svn 8e57c3cfe9 This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-09-01 06:32:48 +00:00
Maxim Sobolev 4e13174564 Bump __FreeBSD_version to reflect multiple changes and new features in
pkg_install tools (pkg_info -o, pkg_create -P, .tbz2->tbz etc.)
2002-09-01 06:32:47 +00:00
Warner Losh f58825edc0 MFC: New pccard ivars. These changes won't impact a thing, but will
make it easier to MFC the rest of the stuff.
2002-09-01 05:45:51 +00:00
Jacques Vidrine 6aa216abc5 MFC: Update Heimdal Kerberos to pre-0.5 around 2002/08/29. 2002-09-01 04:22:02 +00:00
Matt Jacob 3aa267a213 MFC 1.694- fix it so aicasm has a good dependency again. 2002-09-01 02:21:04 +00:00
Brian Somers 5b27174689 MFC: Everything
Notably, this includes the following:

o  IPv6 support
o  Better RADIUS support (including MS-CHAP)
o  Improved handling of bad negotiation options
o  Improved negotiation diagnostics
o  Improved sockaddr (RTAX) parsing
o  More consistent compile time options (NOXXX to compile something out)
o  More available macros
o  Firewall punching
o  Improved ``proxy'' and ``proxyall'' handling
o  Handle connected UDP sockets on descriptor 0 in -direct mode
o  Fix a load of typos
o  Update to internal version 3.1
2002-09-01 02:12:32 +00:00
Archie Cobbs 159298ed57 Fix screwup in previous MFC that broke the build.
Pointy hat to:	me
2002-09-01 01:40:37 +00:00
Garance A Drosehn d9faeb23db MFC *: lpr-related pieces of 'The .Nm utility' changes.
[* = 1.7 chkprintcap.8, 1.19 lpc.8, 1.25 lpd.8, 1.7 pac.8]
2002-09-01 00:37:36 +00:00
David Malone c0aa8f3a98 MFC 1.22: Use a union to access the words of a double.
PR:		40209
2002-08-31 22:26:35 +00:00
Archie Cobbs e8db720003 MFC: (rev. 1.130) Make accept(2) on a socket that has been shutdown(2)
return ECONNABORTED in the non-blocking case.
2002-08-31 22:11:56 +00:00
Archie Cobbs 7ef062dd03 MFC: Remove much of the dereferencing of the fd table entries to look at
file flags and replace it with functions that will avoid null pointer checks.
2002-08-31 22:02:16 +00:00
Archie Cobbs 09dbd3b14f MFC: (rev. 1.42) Check for POLLERR, POLLHUP, and POLLNVAL from poll(2). 2002-08-31 21:59:00 +00:00
Archie Cobbs caf3a087b5 MFC: (rev. 1.21) Make select() set the readable/writable bits when poll()
returns POLLERR, POLLHUP, or POLLNVAL.
2002-08-31 21:57:39 +00:00
Matthew Dillon de5fea70d1 Reduce the maximum KVA reserved for swap meta structures from 70 to 32 MB.
Reduce the swap meta calculation by a factor of 2, it's still massive overkill.
2002-08-31 21:15:55 +00:00
David E. O'Brien 55663c360a Fix style nit. 2002-08-31 20:28:26 +00:00
David E. O'Brien 41726a2e21 MFC: use '' quotes instead of `' to delimit names of files and packages 2002-08-31 19:38:55 +00:00
David E. O'Brien b7c875d82a sync style with -current 2002-08-31 19:33:55 +00:00
David E. O'Brien eee9007e1f Sync style with -current. 2002-08-31 19:31:44 +00:00
David E. O'Brien 22da2d1b3c MFC: rev 1.18 (handle snprintf() returning <0)
Forgotten by:	brian (for 1 year)
2002-08-31 19:31:02 +00:00
Ian Dowse d6df6e2659 MFC: 1.70; fix usage line. 2002-08-31 19:30:16 +00:00
David E. O'Brien 66079f4d83 MFC: convert our compression method to bzip2 from gzip. 2002-08-31 19:25:55 +00:00
David Malone a410b1371a MFC 1.99: If a socket is disconnected for some reason then drop
any data on the outgoing queue in soisdisconnected.
2002-08-31 19:04:55 +00:00
David E. O'Brien a42d47530f MFC: Reduce private "lesser known" function redirection to improve clarity. 2002-08-31 18:54:28 +00:00
David E. O'Brien bc8118e19d MFC: rev 1.29 (snprintf can return <0) 2002-08-31 18:45:32 +00:00
David Malone 54074ba978 MFC: Add tcpd to the build - though we don't need to for inetd, someone might
want it for some other service-running program.
2002-08-31 18:43:41 +00:00
David E. O'Brien d3688b48bb Sync style with -current to reduce diffs. 2002-08-31 18:41:10 +00:00
David E. O'Brien 4c018912a9 MFC: style 2002-08-31 18:39:08 +00:00
David Malone 9ea9730dfa MFC 1.59: Fix conjugation of exists, add full stops to the messages I changed. 2002-08-31 18:29:04 +00:00
David Malone 75b2fa00c2 MFC 1.87: Make kern.log_console_output a tuneable aswell as a sysctl. 2002-08-31 18:22:08 +00:00
David Malone 08c1ba9c19 MFC: Constify, inet_aton returns 0 on failure, spell compatibility correctly. 2002-08-31 18:16:01 +00:00
Alan Cox 3f986a9508 MFC
o Add extensive sysctl documentation.
2002-08-31 17:54:11 +00:00
Jens Schweikhardt bd311b45dc MFC: Use "kbytes" instead of "blocks" in messages as this is really
what is calculated.

PR:             41936
2002-08-31 16:35:17 +00:00
Darren Reed 9185dcabf5 Merge IPFilter 3.4.29 into RELENG_4 from -current 2002-08-31 16:26:50 +00:00
Darren Reed 8789a3976e Merge IPFilter 3.4.29 onto RELENG_4 2002-08-31 16:24:52 +00:00
Yaroslav Tykhiy c7f6239892 MFC rev. 1.42: Fix lexer jam on unimplemented commands. 2002-08-31 13:17:23 +00:00
Yaroslav Tykhiy d09e917d3d MFC rev. 1.126: Fix more aspects of dynamic memory handling
in inithosts().
2002-08-31 13:12:29 +00:00
Justin T. Gibbs 7255f7f01f MFC: Add PCI and PCIX register and bit definitions required by ahd(4) 2002-08-31 10:06:51 +00:00
Justin T. Gibbs 01f8a8b2ec Hook ahd into the build and take advantage of register pretty printing
in both the ahd and ahc drivers.
2002-08-31 07:26:59 +00:00
Justin T. Gibbs 601c33b80f MFC: The latest aicasm from -current. 2002-08-31 07:26:06 +00:00
Justin T. Gibbs 8aef5981c0 MFC: The latest ahc and ahd drivers from -current. 2002-08-31 07:25:53 +00:00
cvs2svn 8c561b8cc3 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-08-31 06:57:51 +00:00
Alan Cox 3460818194 MFC
o Remove dead or unused code.
 o Apply style fixes.
2002-08-31 03:18:23 +00:00
Alan Cox f8bc8ec409 MFC [revision 1.109 and part of revision 1.110]
o Correctly initialize aiol_zone and the aiolio_zone.
2002-08-30 22:44:44 +00:00
Justin T. Gibbs e0f6361748 MFC: Allow DB_SET() to set all fields in the ddb command structure.
This allows external ddb commands to do anyting an internal command
     can do, including non-standard argument parsing if desired.
2002-08-30 22:27:49 +00:00
cvs2svn 893abf9888 This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-08-30 21:40:59 +00:00
Bruce A. Mah 5ebd407bca MFC: Unbreak manpage hypertext references and add support for
vendor attribute in manpage entities.
2002-08-30 21:40:58 +00:00
Justin T. Gibbs 0b82ab5ebc MFC: Fix async notifications for listners registered to wildcard nodes. For
example, a client registered to receive specific events for bus 0,
     target *, lun *, was not receiving notifications.
2002-08-30 19:38:16 +00:00
Justin T. Gibbs 152472d957 MFC: Add IDs for upcoming LSI U320 products that use the MegaRAID interface.
Submitted by:	"Moore, Eric Dean" <[email protected]>
2002-08-30 18:28:54 +00:00
cvs2svn 3d71b01065 This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-08-30 18:26:50 +00:00
Johan Karlsson e816850295 MFC rev 1.303: Similar to bsd.subdir.mk, echo the name of the dir before
doing the cd.

Approved by:	sheldonh (mentor)
2002-08-30 18:26:49 +00:00
Justin T. Gibbs fb24796b58 MFC: Update syncrate exception table to include U320 speeds. 2002-08-30 17:21:41 +00:00
Justin T. Gibbs 7aac573a14 MFC: SPI4 PPR message definitions. 2002-08-30 17:18:06 +00:00
Justin T. Gibbs 3f3cb126c4 MFC: "Information Unit Transfer" structure definitions 2002-08-30 17:14:04 +00:00
Justin T. Gibbs b7a1b6a176 MFC "mide" and "mided" major numbers.
Submitted by:	"Moore, Eric Dean" <[email protected]>
2002-08-30 16:58:31 +00:00
Maxim Sobolev f7bade96a9 MFC: don't hang up machine when there is radio-only fm801 pci card, such as
SF64-PCR.

Approved by:	orion
2002-08-30 14:52:45 +00:00
Maxim Sobolev 71ed8ca70b MFC: user-setable promisc mode. The code is slightly diffrent (and uglier)
than in HEAD, because we have had to preserve kernel ABI, so that increasing
if_flags to 32 bits was not an option.

Tested by:	Anton Turygin <[email protected]>
2002-08-30 14:23:39 +00:00
Orion Hodson eb5d8b1314 MFC: r.157 simplified dsp_open.
Approved by: cg
PR:	     kern/35004
2002-08-30 13:53:03 +00:00
Yaroslav Tykhiy dcd98572fd MFC rev.1.9, 1.10: Update NIC support status. Improve style. 2002-08-30 11:53:56 +00:00
Yaroslav Tykhiy d5eb10d4fc MFC rev.1.122, 1.125:
Fix printf-like argument list to correspond to the format.
Fix comment inconsistent with code.
2002-08-30 11:26:51 +00:00
Sebastien Gioria 93defd8682 MFen 1.22.2.285 2002-08-30 10:57:02 +00:00
Yaroslav Tykhiy b2bacd00f5 MFC: Add the "-W" option: Don't log every FTP session to wtmp(5). 2002-08-30 10:24:31 +00:00
David E. O'Brien 3850f7b9d7 MFC: rev 1.6 (mising ftpchroot.5) 2002-08-30 06:50:58 +00:00
Archie Cobbs 8813f2eb10 MFC: (rev. 1.20, 1.21) Remove (int) file descriptor locking.
PR:	bin/42100
2002-08-30 04:22:53 +00:00
Matthew Dillon cad25b5062 MFC 1.27 2002-08-29 21:29:10 +00:00
Matthew Dillon 1a01aa5b43 MFC 1.414 2002-08-29 21:27:53 +00:00
Matthew Dillon 50239d81eb MFC 1.50, 1.51, 1.52 2002-08-29 20:34:44 +00:00
Nate Lawson 055c7b64eb MFC:
Add \n to various printfs.  grep shows these should be the last ones.
2002-08-29 16:28:44 +00:00
Scott Long ab7919da83 MFC: Fix a silly off my one error that caused crashes on resume in certain
circumstances.

Submitted by:	[email protected]
2002-08-29 15:08:41 +00:00
Yaroslav Tykhiy b32dbf8423 MFC: Add the "-M" option: prevent anonymous users
from creating directories.
2002-08-29 12:52:06 +00:00
Yaroslav Tykhiy 2a70a80fac MFC rev.1.105: Reset the "transfer in progress" flag after
a successful sendfile(2) download.
2002-08-29 12:18:59 +00:00
Sebastien Gioria 4bd668b383 Typo + Grammar fix 2002-08-29 11:41:25 +00:00
Sebastien Gioria c7a1738c94 MFen 1.22.2.284 2002-08-29 11:36:11 +00:00
Yaroslav Tykhiy 77fc9f9396 New release note: ftp(1) "epsv4" command.
Not applicable to -CURRENT since it has lukemftp in that role
(which has this command already.)

Reviewed by:	bmah
2002-08-29 11:25:27 +00:00
Yaroslav Tykhiy 2a835e8424 MFC: Rework and improve the file upload function. 2002-08-29 10:01:15 +00:00
Sebastien Gioria a98770255e Fix HREF generation. 2002-08-29 08:13:18 +00:00
Josef Karthauser a84e239788 MFC: Reduce some redundant code. 2002-08-28 20:51:56 +00:00
Sheldon Hearn 56ec22cf65 MFC the daemon(8) utility and hook it up to the build.
Requested by:	mike
2002-08-28 17:25:54 +00:00
Sebastien Gioria ce88eae706 MFen 1.22.2.283 2002-08-28 12:37:11 +00:00
Josef Karthauser f13ad78dcd MFC: Add some more ethernet adapters. (Elecom LDUSBLTX + Iodata USBETTXS)
PR:	kern/42098
2002-08-28 12:08:13 +00:00
Crist J. Clark 569e0d7f3c MFC: 1.11. Check if a host argument is a IPv6 presentation format
address before going to gethostbyname2(3).

PR:		bin/31632
2002-08-28 05:32:03 +00:00
Crist J. Clark ace69c98df MFC: Only create a temporary file if we are actually going to do
something in the script. Eliminates a bug where we create a temp file,
but don't delete it since the rm(1) is only done if the check is
enabled.

PR:		bin/40960
Submitted by:	frf <[email protected]>
2002-08-28 05:13:53 +00:00
Brooks Davis cc76f06685 MFC: 1.9: spelling
1.10: document cloning
2002-08-28 04:46:25 +00:00
Brooks Davis 23b30a5917 MFC: document cloning 2002-08-28 04:44:23 +00:00
Greg Lehey ea3c68ab01 launch_requests: Protect launch loop with splbio()
Not in -CURRENT due to different locking strategies.

Submitted by:	Doug Swarin <[email protected]>

PR:	41740 (not completely solved)
	37675 (probably)
2002-08-28 04:30:56 +00:00
Tom Rhodes c3dda797a1 MFC: Whitespace fix from recent commit. 2002-08-27 16:42:10 +00:00
Tom Rhodes 6813e0318b MFC: Grammar tweaks for loader.conf.5
PR:		40237
Submitted by:	Chris Pepper <[email protected]>
2002-08-27 16:40:23 +00:00
Tom Rhodes 3f43094c5f MFC: Grammar cleanup
PR:	40909
2002-08-27 16:19:13 +00:00
Josef Karthauser 738be7ff05 Regen 2002-08-27 13:49:04 +00:00
Josef Karthauser e3a6e5a327 MFC: add support for the Palm m515. 2002-08-27 13:46:28 +00:00
Josef Karthauser 3ce8c2d66a MFC: Introduce the -d flag to show which drivers are bound to a device. 2002-08-27 12:25:41 +00:00
Yaroslav Tykhiy 55a27f6ecd Implement the "epsv4" command for those users who wish to stay
with -STABLE for now, yet need to run ftp(1) through IPFilter
or a similar firewall with no EPSV support.  The automatic
detection of EPSV capability didn't work with such firewalls
since it expected a 5xx reply to turn off EPSV, but was getting
a mere timeout.

Suggested, reviewed, and tested by:	sheldonh
2002-08-27 09:55:08 +00:00
Yaroslav Tykhiy a77b9f2d3f MFC rev. 1.107, 1.111, 1.123: Virtual hosting function fixes. 2002-08-27 08:52:29 +00:00
Tim J. Robbins 2d11746790 MFC:
- Avoid duplicate error messages when invalid options are used with the
  cd, pwd, fc, and export builtins.
- Handle window size changes when line editing is enabled.
- Don't access memory after it is free()'d, fixing strange job control
  problems when the J (junk) malloc() option was enabled.
- Read libedit options from ~/.editrc if present.
- Change the `command' builtin to be what POSIX.2 requires, create a
  `builtin' command to execute builtin commands.
- Add a `bind' builtin command to modify key bindings.
- Store process ID's in pid_t's instead of short's.
- Removed unused #ifdef'd code.
- -P (-o physical) option to make -P the default for the cd and pwd builtins
2002-08-27 01:36:28 +00:00
Orion Hodson 400e4f66e2 MFC determination of AC'97 codec's AUX_OUT function. 2002-08-27 00:25:55 +00:00
Orion Hodson abf2253635 MFC r1.17: getptr fix. 2002-08-27 00:17:34 +00:00
Brian Somers 75ed5dcc5c MFC: Correct the FAQ URL 2002-08-26 23:24:44 +00:00
Ian Dowse 4f5bf5d6d3 MFC: 1.29; if a timeout is specified, make sure that rcmd() completes
within the specified time.
2002-08-26 19:51:15 +00:00
Ian Dowse 14dec6302e MFC: 1.53; fix brain damage in the default block/frag/cpg parameters
that are used if none at all are specified for a partition.
2002-08-26 19:43:04 +00:00
Ian Dowse 61bfe792ed MFC: 1.52, 1.55; split the parsing code into a separate function
to avoid long lines.
2002-08-26 19:37:27 +00:00
Ian Dowse 374bb95f89 MFC the following revisions to reduce the diffs against -CURRENT:
1.40	add __printflike()
 1.44	remove __P, register keywords, ansify
 1.45	remove register keyword
 1.49	WARNS=2 changes, use c-partition definition from sys/disklabel.h
2002-08-26 19:30:53 +00:00
Prafulla Deuskar 91e1a5025c MFC:
Back out TX/RX descriptor/buffer management changes from earier commit.
  We are having panics with the driver under stress with jumbo frames.
  Unfortunately we didnot catch it during our regular test cycle.
2002-08-26 19:10:25 +00:00
Ian Dowse d3c0a5eb42 MFC: 1.17; respect the invoker's umask instead of always creating
files with mode 0600.
2002-08-26 18:58:53 +00:00
John Polstra 1c757fb757 MFC 1.37: Don't fail needlessly on unsuccessful hostname lookups. 2002-08-26 16:17:49 +00:00
John Hay 20092ff107 Make kern.flp fit again by moving MSDOSFS out of the kernel and onto
mfsroot.flp as a klm.
2002-08-26 12:17:35 +00:00
Juli Mallett c4bf962ea2 MFC: Search the include path for the argument to -f. 2002-08-26 00:32:46 +00:00
Jens Schweikhardt a1755a6851 MFC: Provide an iso8859 table similar to share/misc/ascii.
PR:		misc/11553
Submitted by:	Oliver Fromme <[email protected]>
2002-08-25 14:31:26 +00:00
Hajimu UMEMOTO b7b4bf1425 MFC 1.14: check packet length before fetching ESP crypto checksum. 2002-08-25 07:59:56 +00:00
Chris Costello 0497cf6ccd MFC (1.5): Remove a repeated word.
Submitted by:	horikawa
2002-08-25 07:15:56 +00:00
Tim J. Robbins 35a0fe04ef MFC: -m option for dealing with multibyte characters, style changes.
PR:		13364
2002-08-25 02:47:04 +00:00
Prafulla Deuskar 9f90cb462d MFC:
TX/RX descriptor/buffer management changes.
    Use array based scheme instead of queueing macros.

Submitted by:	Luigi Rizzo ([email protected])
2002-08-25 01:54:53 +00:00
Bruce A. Mah 3b2580e8d8 MFC: Really add new fxp(4) adapter names.
fxp.4	1.25->1.26
2002-08-24 22:27:32 +00:00
Mario Sergio Fujikawa Ferreira 266ba32995 MFC from rev 1.57: Preserve suid/gid permissions when extracting
packages remotelly fetched with -r option

Reviewed by:	will
Approved by:	will
2002-08-24 20:09:15 +00:00
Nate Lawson c103f2bf23 MFC from -CURRENT
Updates to cmd6workaround:
* Only update cdb in place if not CDB_POINTER
* Correctly check for QFRZ before restarting CCB
* More accurate printf message
* style(9) changes at end
2002-08-24 19:03:58 +00:00
Matthew Dillon b475649b62 MFC the TCP bandwidth-based window limiting code. Default operation is
to not limit the window (feature disabled).  Setting
net.inet.tcp.inflight_enable to 1 will enable the feature.

Differences from current:  debugging defaults to off, and the window
minimum is set to a production value of 6144 bytes rather then a debugging
value of 1024 bytes.  See 'man tcp' and 'man tuning' for more information.
2002-08-24 18:40:26 +00:00
Bruce A. Mah 3ee7fb9e9b MFC: Microcode description and chip/adapter updates.
fxp.4	1.20->1.21, 1.24->1.25

Based heavily on patches contained in:

PR:		41759
Submitted by:	David "Siebörger" <[email protected]>
2002-08-24 17:02:43 +00:00
Nick Sayer 094b31bc72 Revert last. You get uaudio with 'device pcm' and 'device usb' 2002-08-24 14:17:03 +00:00
Sebastien Gioria 0b7a86ba45 MFen from 1.22.2.267 2002-08-24 13:33:29 +00:00
Jens Schweikhardt 713ffef6ab MFC: 1.77 s/builtin/built-in/ and 1.78 s/filesystem/file system/ 2002-08-24 09:46:17 +00:00
Jens Schweikhardt 3349930f4c MFC: Fix typo and ispell while I'm here.
PR:		bin/41819
Submitted by:	Christophe Juniet <[email protected]>
2002-08-24 09:35:49 +00:00
Nick Sayer f827afa7e7 MFC: Hook up uaudio driver module 2002-08-24 08:34:20 +00:00
Nick Sayer 824368768d MFC uaudio device 2002-08-24 08:09:39 +00:00
Nick Sayer fce7e6f534 MFC: uaudio driver 2002-08-24 08:07:39 +00:00
Nick Sayer 299e6dd0f7 MFC: uaudio module Makefile 2002-08-24 08:06:13 +00:00
Nick Sayer 44687310e1 Partial MFC: Update quirk tags to -current to pave the way for uaudio. 2002-08-24 08:00:32 +00:00
Nick Sayer 7917974044 MFC: v1.10 - Don't interpret null bytes in encrypted data as
terminators.

PR:		bin/40266
2002-08-24 07:28:35 +00:00
Kris Kennaway 0d13835831 MFC: &x is not a format string 2002-08-24 07:27:46 +00:00
Luigi Rizzo afcaad2532 Use IPFW2 by default.
Usual removal of some options to save space and fit in 1.44MB again
2002-08-24 03:58:21 +00:00
Giorgos Keramidas 0815d30b9f MFC: 1.35 - ^Z suspends systat, like any other program. 2002-08-24 00:33:48 +00:00
Giorgos Keramidas e354c6fc0b MFC: 1.161 - Document savecore_flags. 2002-08-24 00:22:04 +00:00
Bruce A. Mah 9b27d8b934 MFC: smbfs-1.4.5.
Use manpage entity for uvisor(4).
2002-08-23 22:33:55 +00:00
Bruce A. Mah bfd6029615 General sync to -CURRENT.
Does not include pc98 changes.

PR:		41103, 41587, 41760
2002-08-23 19:25:20 +00:00
Bruce A. Mah 3a04ce0179 MFC: mpt driver, pst driver, via8233 driver, ich4 support in ich
driver, sh(1) syntax changes.
2002-08-23 18:06:12 +00:00
Nate Lawson ab3558402c Set f_mntonname so unmount(2) can succeed. This is taken care of by common
VFS code in -CURRENT so this change is only needed in -STABLE.

PR:		kern/41527
Reviewed by:	Alfred "If it works, commit it. :)" Perlstein
2002-08-23 17:42:39 +00:00
Jens Schweikhardt 4550b0c06d MFC: Fix grammar bogon. 2002-08-23 16:57:42 +00:00
Julian Elischer 5e7b94c16a Start of an MFC of this node...
not yet complete...  do not try use yet.
2002-08-23 07:15:44 +00:00
Matt Jacob d99452b672 MFC MPT/Fusion driver 2002-08-23 07:02:08 +00:00
Matt Jacob 579ff8dba6 MFC MPT/Fusion driver. 2002-08-23 06:59:05 +00:00
cvs2svn dee37f52de This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-08-23 06:56:32 +00:00
Archie Cobbs fb23fbac0d Fix compiler warnings when compiling with '-D_THREAD_SAFE -Wnested-externs'.
Reviewed by:	freebsd-stable
2002-08-22 22:08:38 +00:00
Alexander Kabaev d4f61155bf Fix the forward compatibility problem with older 4.x releases,
introduced by me in rev. 1.7.2.1.

Binaries compiled on fresh STABLE would not run on older versions
due to malloc always returning NULL. Make sure that we provide
'end' symbol in generated binaries because sbrk in older libc
depends on its existence to work properly.

Reported by:	Ian West  <[email protected]>
Reviewed by:	jdp
Approved by:	obrien
2002-08-22 20:21:17 +00:00
Orion Hodson f3145b18e5 MFC: VT8233 audio driver.
PR:		kern/38792
2002-08-22 17:32:49 +00:00
Orion Hodson f9d30c6106 MFC: Removal of VT8233 from this code. Soon to have own driver.
PR:		kern/38792
2002-08-22 16:56:38 +00:00
Orion Hodson 67737a3703 MFC: ich4 support. 2002-08-22 16:38:21 +00:00
Tom Rhodes 6da4c5d94a MFC: When a cluster entry for ``.'' is set to 0 msdosfs fails to handle
it correctly.
2002-08-22 16:20:15 +00:00
Juli Mallett 52d0c84baa MFC -not and -false as equivalents for !, but which are slightly more happy for
shells and people who like words.

	find expression false
	and proceed as if normal
	cherry blossoms fall

Obtained from:	OpenDarwin (-not)
2002-08-22 16:17:02 +00:00
Tom Rhodes f2d4589a8e MFC: Attach uvisor(4) to the build. 2002-08-22 15:19:55 +00:00
Tom Rhodes 8503fab82c MFC: Add a bugs section originally added by joe. 2002-08-22 15:13:11 +00:00
Tom Rhodes 5cc704a2b9 MFC: Add the uvisor(4) manual page. 2002-08-22 14:57:16 +00:00
John Hay 10f1f49952 MFC: rev 1.9 and 1.10.
Add an entry for VScom PCI-200L 2 port serial card.
Add an entry for Avlab's low profile 4 serial port card.

PR:		41142,41146
Submitted by:	Shinsuke Matsui <[email protected]>
2002-08-22 10:50:58 +00:00
Sebastien Gioria 1f61e6a8de SGML-ise accents 2002-08-22 10:39:31 +00:00
Sebastien Gioria d7cb927423 Typo fix 2002-08-22 09:33:04 +00:00
Tom Rhodes c64eb155c5 MFC: The .Nm utility and file system. 2002-08-22 03:11:06 +00:00
Tom Rhodes 818b76dca4 MFC: Reduce diffs to current. This includes several mdoc(7) fixes, minor
spelling and grammar fixes, along with 'the .Nm utility'
2002-08-21 18:58:24 +00:00
Hajimu UMEMOTO 8ba9a8277a MFC 1.126: Previous commit of adding ut to xterm entry broke
kterm-color entry.  3 bytes (ut:) seems too long for kterm-color.
There is a limitation of buffer size within 1024 bytes in our ncurses.
2002-08-21 16:58:45 +00:00
Doug Ambrisko c76d93d537 MFC: Only detect the first built-in PHY on the DFE-580TX. 2002-08-21 15:26:01 +00:00
Søren Schmidt ebb7e2f798 MFC:
Also print the device serial number.
2002-08-21 13:18:17 +00:00
Hajimu UMEMOTO 6834d5c4af MFC: Add capability for limiting the maximum number of simultaneous
invocations of each service from a single IP address.

	usr.sbin/inetd/inetd.8:	1.74
	usr.sbin/inetd/inetd.c:	1.107
	usr.sbin/inetd/inetd.h:	1.13
2002-08-21 10:00:24 +00:00
Luigi Rizzo 03429c1bb6 Sync ipfw2 with the version in -current:
some changes in the syntax of ipfw2 extensions (ipfw1 syntax
is not modified), add rule options to match IP addresses and
ports, and MAC header fields.
Make the parser more robust.

Manpage updated and cleaned up to reflect the new syntax, and give
examples.

This commit closes all ipfw2 bug/feature reports I have received so far
(hardly any of them were related to the kernel part, as you can tell
from the commit logs), so i would seriously consider evaluating ipfw2
for production use, especially if your firewall is running out of
steam because you have complex rulesets handling sparse host sets.

Have a look at the manpage, IPFW2 FEATURES and EXAMPLES Sections,
to know about the new features.
2002-08-21 05:46:14 +00:00
Luigi Rizzo 6fe698c3ca Sync the file with the one in -current:
allow up to 30 ports/ranges in port specifications, clean
up formatting of the boot string.
No functional or ABI changes.
2002-08-21 05:34:07 +00:00
Archie Cobbs 6567782c34 MFC: New L2TP netgraph node type. 2002-08-20 23:48:53 +00:00
cvs2svn 8767eb4ee6 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-08-20 23:04:09 +00:00
Alfred Perlstein f508faf974 MFC: 1.10 (fix url)
PR: docs/41830
2002-08-20 21:42:32 +00:00
Matthew Dillon 55a408a913 correct comment next to RLIMIT_VMEM definition.
Submitted by:	 Andrey Alekseyev <[email protected]>
2002-08-20 18:42:20 +00:00
Yaroslav Tykhiy c714364bf4 MFC rev. 1.41: Fix help lines. 2002-08-20 15:07:14 +00:00
Yaroslav Tykhiy 966b8fcfc3 MFC rev. 1.52: Document ASCII SIZE limitation. 2002-08-20 15:01:31 +00:00
Søren Schmidt 1c68c2b2cb MFC:
Byteswap the serial string:
2002-08-20 12:24:20 +00:00
David E. O'Brien 77dbc216d6 MFC: don't use the GCC'ism __FUNCTION__, but rather than ISO __func__'ism. 2002-08-20 06:35:08 +00:00
David E. O'Brien 60e87e827a MFC: rev 1.49 (increase the number of packages that can be installed by an
order of magnitude)
2002-08-20 03:27:37 +00:00
Søren Schmidt 78c04ea9a5 Fix a type in the 48bit handling code use >> not << for the upper
32bits. However this is only cosmetical since the -stable kernel
only has 32 bit block numbers...
2002-08-19 18:59:04 +00:00
Søren Schmidt 5c22470396 MFC:
close PR 41063
2002-08-19 18:53:59 +00:00
John Polstra 442a034ab0 MFC 1.12: Fix the "almost clone" semantics of the md device. This
also fixes problems with using more than one preloaded md_image
module.

Reviewed by:	phk
2002-08-19 17:43:34 +00:00
Bruce A. Mah 7449021331 New errata entry: SA-02:38. 2002-08-19 17:39:41 +00:00
Bruce A. Mah f64b373013 MFC: SA-02:38. 2002-08-19 17:32:08 +00:00
Doug Ambrisko f03949e349 MFC: Revert only checking for one PHY. The fix for the DFE-580 card
will be done in the driver.
2002-08-19 16:56:33 +00:00
Matthew Dillon af88c09155 MFC 1.168 (an obvious and trivial bug fix) to get it out of the way.
Approved by:	hsu
2002-08-19 16:33:17 +00:00
Ruslan Ermilov 8e1b66ae74 MFC: Bootstrapping aid for pre-getprogname(3) systems. 2002-08-19 16:10:22 +00:00
Maxim Sobolev 6a7d026980 MFC: prevent `pkg_info(1) -o' from dumping core on packages without origin
recorded.
2002-08-19 15:44:09 +00:00
Maxim Sobolev 6e7e727660 MFC: preserve s*id bits of files being extracted. 2002-08-19 15:39:56 +00:00
Maxim Sobolev 19e3e2ff25 MFC: add support for line1 mixer device (rev.1.76). 2002-08-19 15:28:19 +00:00
Tim J. Robbins 7398989f81 MFC: Claim conformance to 1003.2-1992 instead of 1003.1-2001 due to doubts
raised over symbolic link handling.

PR:		41576
2002-08-19 08:14:22 +00:00
Johan Karlsson c0144b8dcb MFC: biff(1) b; cp(1) -n; mv(1) -n; od(1) -A, -N, -j, -s, -t
Reviewed by: bmah
2002-08-19 00:39:13 +00:00
Johan Karlsson 55ee423324 MFC: Add the -n option, which automatically answers "no" to the overwrite
question.
        mv.1: 1.19, 1.20, 1.22, part of 1.23
        mv.c: 1.35, 1.39

Approved by: obrien, sheldonh (mentor)
2002-08-19 00:26:41 +00:00
Mike Silbersack 00e5ed0584 MFC:
Handle IP TTL and DF bits on syn-ack packets the same as is done with
all other packets.

PR:		39141
2002-08-18 22:04:47 +00:00
Mike Silbersack b17cbfa587 MFC:
if_vr.c revs 1.50 - 1.52
if_vrreg.h revs 1.12 - 1.13

A slew of changes which help reduce the number of driver lockups
greatly.  (See individual cvs logs for more detail.)

Submitted by:	Thomas Nystrom <[email protected]>
2002-08-18 21:44:19 +00:00
John Polstra 137319041b MFC 1.31: Clarify setuid behavior.
PR:		misc/41180
2002-08-18 18:12:59 +00:00
Johan Karlsson 9d693d3457 Bump document date for the 'beep only' change.
Approved by:	sheldonh (mentor)
2002-08-18 17:30:54 +00:00
Boris Popov 3fcc1612e6 MFC: smbfs-1.4.5
NB: 1.4.4 wasn't MFCed.
2002-08-18 13:41:02 +00:00
Søren Schmidt fd2abeee06 Driver for the Promise SuperTrak SX6000 ATA RAID controller.
RAID's has to be setup with the SuperTrak BIOS.
The driver supports the SuperTrak doing rebuilds etc on the fly.

Development sponsored by: Advanis
Hardware sponsored by: Promise Inc.
2002-08-18 12:33:18 +00:00
Søren Schmidt cfdd60be45 Driver for the Promise SuperTrak SX6000 ATA RAID controller.
RAID's has to be setup with the SuperTrak BIOS.
The driver supports the SuperTrak doing rebuilds etc on the fly.

Development sponsored by: Advanis
Hardware sponsored by: Promise Inc.
2002-08-18 12:32:36 +00:00
Søren Schmidt 52011e008e Add pst device for Promise SuperTrak
Sponsored by: Advanis
2002-08-18 12:28:57 +00:00
cvs2svn 27306130d8 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-08-18 12:20:34 +00:00
Marc Fonvieille d4e4d3a724 MFC: 1.9, 1.10
1.9: Note changes to country codes in ISO 3166-1 newsletters V-4 and V-5.
Update URL for ISO 3166/MA.
1.10: Fix typos: s/Ths/This, s/counties/countries

PR:		docs/39060 for 1.10
Submitted by:	Nicola Vitale <[email protected]>
2002-08-18 09:06:33 +00:00
David Greenman a85266ac8e MFC: rev 1.103: improved performance of sbreserve() by removing the 64bit
multiply and divide.
2002-08-18 08:43:31 +00:00
John W. De Boskey 0f3db5354d MFC 1.97 2002-08-18 06:05:08 +00:00
Bruce A. Mah b288519a3b MFC: OpenSSL-0.9.6g, tcsh-6.12, top 3.5b12. 2002-08-18 04:02:21 +00:00
Bruce A. Mah 7c4488b70a Get the point release version number in the document title, to try to
head off one potential source of confusion.
2002-08-17 22:53:44 +00:00
Bruce A. Mah e23f4b7279 Note a small typo in the release notes. Several people called for a
revision to the release notes; I'm fixing it by noting it in the
errata instead.

PR:		41745
Submitted by:	Christopher Holden <[email protected]>,
		Otterr" <[email protected]>
2002-08-17 22:42:23 +00:00
Bruce A. Mah 9f2e387eca Update the 4.6-RELEASE errata to include 4.6.2-RELEASE. Mostly this
consists of mentioning that a number of security advisories and other
issues in 4.6 were fixed in 4.6.2.  Until 4.7-RELEASE, we'll have one
errata document covering both releases.  Maintaining separate errata
documents for 4.6 and 4.6.2 is not possible.

There's a little bit of hackery that will need to be taken out of the
boilerplate during the 4.7 release cycle.  This is perhaps a good
argument for doing errata updates on the release/security branches,
rather than the STABLE branch.
2002-08-17 22:35:19 +00:00
Hiroki Sato 6e77b86ce2 Merge the following from the English version:
1.22.2.277 -> 1.22.2.278	relnotes/common/new.sgml
2002-08-17 20:27:52 +00:00
Matthew Dillon d3cfc4cf46 Describe the net.inet.tcp.inflight_{enable,debug,min,max} sysctls.
MFC after:	7 days
2002-08-17 19:52:14 +00:00
Andrey A. Chernov 9bd8f2d4b4 MFC: add hi_IN, pt_BR, ja_JP.SJIS 2002-08-17 19:38:08 +00:00
Andrey A. Chernov 8dcad812ce MFC: add hi_IN, pt_BR, ja_JP.SJIS. fr_BE fix 2002-08-17 19:34:11 +00:00
Andrey A. Chernov 735a1ab7d5 MFC: pt_BR, hi_IN, ja_JP.SJIS added, fr_BE fix 2002-08-17 19:30:37 +00:00
Andrey A. Chernov 0beeeb3440 MFC: hi_IN, pt_BR, format fixes 2002-08-17 19:25:45 +00:00
Andrey A. Chernov 9cebedd66b MFC: pt_BR, hi_IN 2002-08-17 19:17:50 +00:00
Andrey A. Chernov 7f0e5599d8 MFC: pt_BR, pl_PL, hi_IN 2002-08-17 19:14:44 +00:00
Andrey A. Chernov e1dc2b78f0 MFC: add hi_IN.ISCII-DEV, pt_BR.ISO8859-1 2002-08-17 19:11:15 +00:00
Andrey A. Chernov ceb18ab0f5 MFC: up to Makefile 1.12, common.h 1.2, parse.y 1.26, scan.l 1.18
(big buffer for symbol name, more checks, reflect static buffer eliminate,
cosmetiq changes)
2002-08-17 18:57:10 +00:00
Andrey A. Chernov 1cada36c56 MFC: collate.c 1.28, collate.h 1.13 - eliminate static buffer 2002-08-17 18:48:10 +00:00
Andrey A. Chernov 73d4073137 MFC: 1.125, add ut to xterm 2002-08-17 18:39:40 +00:00
Tim J. Robbins 7c3566be9f MFC: Skip %pN in ncurses capability strings.
PR:		15418
2002-08-17 14:52:50 +00:00
Tim J. Robbins 9637e5f688 MFC: Allow redirections by themselves between "&&" and "||" operators. 2002-08-17 12:11:21 +00:00
Tim J. Robbins b6c8ec6096 MFC: Correct boundary condition error in D' and P' commands when last line
of pattern space is empty. Ignore leading semicolons on commands.
Style changes to keep in sync with HEAD.
2002-08-17 05:47:06 +00:00
Mike Heffner cbb344d6d6 MFC: r1.26: Add break's to case blocks. 2002-08-17 00:59:03 +00:00
Matthew Dillon c355670229 MFC sysctls to control the TCP retransmit timer. Temporarily default
net.inet.tcp_rexmit_min to 1000ms (1 second) to maintain prior -stable
behavior.  The default net.inet.tcp_rexmit_slop (extra time always added to
the timeout calculation) is 200ms, but effectively obscured by the 1000ms
minimum.  Setting net.inet.tcp_rexmit_min to a low value such as 12 will
get you -current's behavior.

This can be somewhat confusing.  The minimum is an unconditional lower bound
on the retransmit timeout calculation.  The slop is unconditionally added
to the retransmit timeout calculation PRIOR to the minimum being enforced.
On faster networks the SRTT calculation becomes less dependable as a means
of preventing unnecessary retransmissions.  The best protection against this
is to use the slop parameter to control your nominal interactive
responsiveness/recovery-base in the face of non-congestion related packet
loss (e.g. on a wireless network).

Generally speaking current RFCs regarding TCP retransmit behavior want
a 1 second minimum, but they are so focused on streaming behavior that they
completely ignore the disaster this causes on faster ( < 500ms ping )
connections operating interactively, such as when typing in a remote shell
over a wireless network.  Linux uses a far more reasonable 200ms minimum
and our -current now does the equivalent (or better) by using 200ms of slop.
Hopefully -stable will follow with a change to 200ms of slop in the
near future.  For the moment, if you care, please set net.inet.tcp.rexmit_min
to a low value (such as 12) in your /etc/sysctl.conf.
2002-08-16 22:16:39 +00:00
Hajimu UMEMOTO 002d6f2455 MFC: IPv6 support for rcp.
You cannot specify a raw IPv6 address for now.

	bin/rcp/rcp.1:	1.15
	bin/rcp/rcp.c:	1.35
2002-08-16 20:06:34 +00:00
Sheldon Hearn e6b2ae4638 MFC rev 1.19: regen 2002-08-16 14:57:16 +00:00
Luigi Rizzo 1b2c889e00 Sync the manpage with the version in -current.
This version has both ipfw2 and ipfw1 commands, highlights the
differences between the two, and gives a more detailed list of
sysctl variables and examples.

Even if you are still using ipfw1, hopefully you will find this new
version more useful than the previous one.

-doc team and mdoc police, your turn now...
2002-08-16 14:30:53 +00:00
Luigi Rizzo 473b8522dd Synchronize ipfw2 with the version in -current (adding sets of rules,
prevention of loops in keepalive generation, better defaults on
size of dynamic rule table).

For documentation, please refer to the ipfw manpage in -current
(which I am going to MFC as soon as I have completed the
section listing differences between ipfw1-stable and ipfw2).
In particular have a look at the sections "PACKET FLOW",
"IPFW2 ENHANCEMENTS" and "EXAMPLES" to see if your ruleset
can be simplified with the new commands.
2002-08-16 11:03:11 +00:00
Luigi Rizzo f0d8aa68bd MFC: kernel support for "noerror" attribute in dummynet pipes. 2002-08-16 10:53:44 +00:00
Marc Fonvieille ef1059a64e MFC: 1.14
Add PowerPC category.
2002-08-16 07:43:13 +00:00
Tom Rhodes 5de07a177a MFC: Remove usbhidaction(1) SEE ALSO referance. 2002-08-16 05:02:25 +00:00
Mitsuru IWASAKI c2ce8018e4 MFC: Add suspend/resume code.
if_dc.c		1.72 -> 1.73
	if_dcreg.h	1.24 -> 1.25
I've forgotten this MFC for a long time.
2002-08-16 04:45:39 +00:00
Tom Rhodes 84eb730aec MFC: Several mdoc(7) fixes including spelling, markup, punctuation, and
.Nm utility.

While I'm here MFC: 1.13:  Correct History, applied by tjr
2002-08-16 04:34:05 +00:00
Sean Chittenden 5c03781863 Edge Maxim out by at least two hours by having the closest birthday to
Christmas.

Reviewed by:	knu (mentor)
Approved by:	knu (mentor)
2002-08-15 22:26:57 +00:00
Jens Schweikhardt 5e5ed8f948 MFC: fix assorted typos. 2002-08-15 18:53:18 +00:00
Jens Schweikhardt 4243c8ac8f MFC: fix typos; add FreeBSD ID. 2002-08-15 18:11:08 +00:00
Doug Ambrisko 0073d44add MFC: Netgear GA621 fiber support. 2002-08-15 16:38:55 +00:00
Doug Ambrisko c985376284 MFC: Add Netgear GA621 fiber card support. 2002-08-15 16:35:37 +00:00
Yaroslav Tykhiy 1ef681d32d MFC rev. 1.36: Deny ASCII SIZE requests on large files. 2002-08-15 14:41:01 +00:00
Ruslan Ermilov b383708ec3 MFC: handle the escaped colon \: in a capability.
PR:		bin/30778
2002-08-15 08:30:27 +00:00
David Greenman 7b6927aac0 MFC: moved sf_buf_* function prototypes to socketvar.h. 2002-08-14 22:23:10 +00:00
Peter Wemm 0338784d5d MFC: Add defines for option negotiation, needed for TSize support. 2002-08-14 21:59:26 +00:00
cvs2svn 5a490f9a9a This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-08-14 16:58:51 +00:00
Ruslan Ermilov 1ccde44a16 MFC: 1.16: removed the (never-released) FreeBSD 4.6.1. 2002-08-14 16:58:50 +00:00
Doug Ambrisko ef5c33cb93 MFC: Fixes for the D-Link DFE-580 card. 2002-08-14 15:03:16 +00:00
Doug Ambrisko c838baec19 MFC: Only attach one PHY per NIC. The DLink DFE-580 probes 2 per NIC. 2002-08-14 14:59:16 +00:00
Murray Stokely ea5b15849b MFC: r1.15 - definition for FreeBSD 4.6.2. 2002-08-14 06:35:41 +00:00
David Greenman bad07f937a MFC: make sf_buf_* functions non-static, fixup comment. I need access to
these functions for a third-party kernel module that I'm developing.
2002-08-13 18:26:30 +00:00
cvs2svn 3b376d0478 This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-08-13 17:02:59 +00:00
Ruslan Ermilov 10f048a7b4 MFC: 1.702: Export KERNELS and AUTO_KEYBOARD_DETECT to chroot. 2002-08-13 17:02:58 +00:00
John Polstra 8c7580241e MFC 1.66: Fix OpenOffice build problems by not acquiring the
writer lock in rtld_exit().
2002-08-13 16:54:07 +00:00
Doug Ambrisko 50405dc2d6 Bring in suspend/resume patch so sound atleast works after a resume.
Reviewed by:	sound (silence)
2002-08-13 16:18:33 +00:00
Bosko Milekic df924d72db MFC: 1.31: Fix fd leak.
Additional note: fstat() call in RELENG_4 isn't underscored. In HEAD
  it is.  Threads people/maintainer should glance this way.

PR: bin/37717
Submitted by: Fred Clift <[email protected]>
2002-08-13 16:08:07 +00:00
Yaroslav Tykhiy da637a8791 MFC rev. 1.{37,38,40}: Parser fixes:
o "pathname" may be NULL; "pathstring" will never be.
o SITE CHMOD mode argument should be a valid _octal_ number.
2002-08-13 13:21:48 +00:00
Søren Schmidt 0647794dd1 Claim a major for the Promise SuperTrak (pst) driver 2002-08-13 13:01:19 +00:00
Yoshihiro Takahashi 9382f4409c Merged from sys/isa/sio.c revision 1.291.2.33. 2002-08-13 11:58:14 +00:00
Semen Ustimenko 65bba05fcc MFC: rev 1.53: Fix -o ac(reg|dir)(min|max) options. They were just ignored
by kernel because ALTF_* to NFSMNT_* translation didn't happen.

PR:		bin/30334
2002-08-13 11:25:11 +00:00
Alan Cox ce7c71931c MFC
o In aio_cancel(2), make sure that p->p_aioinfo isn't NULL before
   dereferencing it.
2002-08-13 08:57:03 +00:00
Robert Watson 2df6b9f88a MFC of uipc_syscalls.c:1.123,1.124 and vesa.c:1.37.
Submitted by:	Silvio Cesare <[email protected]> (1.123, 1.37)
2002-08-13 02:42:33 +00:00
Ian Dowse 9ea8028ff4 Unconditionally initialise z->znext, and remove the zone from the
list of all zones if we fail to allocate KVA for it in zinitna().
Apparently this fixes panics while running sysctl on large-memory
machines. This code is not present in -current.

PR:		kern/36605
Submitted by:	Brian Buchanan <[email protected]>
2002-08-12 23:39:08 +00:00
Luigi Rizzo 45325d7b91 Proper fix for the mcl_pool handling -- initialize m_flags,
m_pkthdr.rcvif and m_pkthdr.csum_flags in the same way as
MGETHDR does.

Add a comment in m_freem() to note that the other fields are already
set properly.

I am leaving mcl_pool_max = 0 as default, but i have reports from
many of the people who submitted the initial bug reports that now
their systems work fine with mcl_pool_max > 0.
2002-08-12 22:09:12 +00:00
Josef Karthauser 697c38e52c Update for the recent changes to usb. 2002-08-12 21:38:54 +00:00
Mark Peek d1f833b568 MFC: v1.38: Add PCI IDs for the A, B, and C UHCI controllers in the ICH4. 2002-08-12 20:39:14 +00:00
Mark Peek 2381d88084 MFC: v1.100: Add PCI ID for the ICH4 ATA100 controller. 2002-08-12 20:37:12 +00:00
Josef Karthauser f66270acfb MFC: /dev/tty -> /dev/ucom 2002-08-12 20:32:05 +00:00
Ian Dowse 4d042c9d8b When testing if a user is in a group, check the user's primary group
too. This is not an MFC, as the code is no longer present in -current.

PR:		bin/22212
Submitted by:	Cyrille Lefevre <[email protected]>
Approved by:	markm (in principle)
2002-08-12 19:42:24 +00:00
Yaroslav Tykhiy 0d1bc927b1 MFC rev. 1.106: Use fgetln(3) to read lines from configuration files,
thus allowing unlimited line length.
2002-08-12 15:07:37 +00:00
Alexander Kabaev 7e955da543 MFC 1.11: Use '_end' symbol instead of 'end' to initialize minbrk
and curbrk variables.

Approved by:	obrien
2002-08-12 14:23:29 +00:00
Josef Karthauser 1c22ec3f1f MFC: Make debugging the usb stack easier. Introduce a hw.usb sysctl
tree and populate it with the debug variables for the different usb
drivers when USB_DEBUG is defined as a kernel option.
2002-08-12 14:19:49 +00:00
Josef Karthauser 40d3441ba5 MFC: It's useful to have the tools for reconstructing cvs commits
in -stable too.
2002-08-12 13:37:46 +00:00
Maxim Sobolev 1f0a929314 MFC: add ID for Luwen EasyDisk USB flash memory drive. 2002-08-12 12:12:38 +00:00
Maxim Sobolev a000a1155c MFC: Don't dump apm information when only asked to enable/disable features. 2002-08-12 11:59:58 +00:00
Maxim Sobolev 2319d8d62b MFC: add support for Netmos Nm9845 multiport serial card. 2002-08-12 11:57:09 +00:00
Andrey A. Chernov e8e6fe203e MFC: 1.43, close descriptor on loading error, errno fixes 2002-08-12 11:23:54 +00:00
Andrey A. Chernov f550457f2e MFC: 1.24, style 2002-08-12 11:20:24 +00:00
Andrey A. Chernov 4148f241b1 MFC: properly implement locale cache, eliminate memory leak, versions up to
collate.c: 1.26, collate.h 1.12, euc.c 1.11, ldpart.c 1.11, ldpart.h 1.5,
lmessages.c 1.12, lmonetary.c 1.15, lnumeric.c 1.13, rune.c 1.10, setlocale.c
1.41, setrunelocale.c 1.25
2002-08-12 11:17:38 +00:00
David Malone ae8bd88a6e MFC:
Another Askey/Dynalink ISA modem ID.

PR:		35813
Submitted by:	Chris Knight <[email protected]>
2002-08-12 10:20:42 +00:00
Josef Karthauser 516807fb91 Add KMODDEPS for ucom.
Submitted by:	nsayer
2002-08-11 20:05:20 +00:00
Alan Cox b87265eb3b MFC
o If the page returned by vm_page_grab(VM_ALLOC_ZERO) isn't prezeroed,
   zero it.
2002-08-11 19:58:12 +00:00
David Malone 8165daa6b8 Tell top that we know about strerror. 2002-08-11 17:09:54 +00:00
David Malone 585a11b37a MFC: top 3.5beta12
This fixes a few minor bugs and brings us up the the last version
William LeFebvre released.
2002-08-11 17:09:25 +00:00
David Malone e92188b4c7 MFC: Print something we've cast to a long with %ld not %d.
PR:		39741
Submitted by:	Dan Lukes <[email protected]>
2002-08-11 14:27:31 +00:00
David Malone 4ef5177d18 MFC:
Make usage message match the man page. (Missing -o, -h doesn't depend on -d).

PR:		36470
Submitted by:	Gary W. Swearingen <[email protected]>
2002-08-11 14:16:42 +00:00
Jacques Vidrine f6af5de691 MFC: OpenSSL 0.9.6g. 2002-08-11 14:14:00 +00:00
David Malone e0cfaf398a MFC:
Make test check the tv_nsec part of a struct stat when comparing
the mtimes of a file. (This is probably only useful if you have
vfs.timestamp_precision set to something nonzero).

PR:		39163
Submitted by:	Hal Burch <[email protected]>
2002-08-11 13:40:44 +00:00
Ruslan Ermilov e8a404ed89 MFC: 1.7: Translation of the .Ex -std macro. 2002-08-11 11:22:37 +00:00
Ruslan Ermilov a3eae6b2e5 MFC: 1.12->1.14: miscellaneous fixes. 2002-08-11 11:20:54 +00:00
Ruslan Ermilov 099870f366 MFC: ``man -k'' search expression should be an extended regexp. 2002-08-11 11:18:51 +00:00
Luigi Rizzo b47975d1ae Bring back mcl_pool_max to 0 as default, while i investigate
on some problems people were having with it (likely
some missing initialization of mbuf header fields in the
handling of the free list).
2002-08-11 10:17:57 +00:00
Akinori MUSHA cb949d9472 MFC: rev. 1.74-1.75
For bzip2'd packages, use the '.tbz' suffix instead of '.tbz2'.
2002-08-11 09:36:55 +00:00
Max Khon e26cad8b90 MFC: sync with HEAD (make driver portable, other minor fixes) 2002-08-11 09:32:00 +00:00
Alan Cox e6449073ea MFC
o Misc. synchronization fixes: Add a missing splnet(), remove an
   unnecessary splnet(), and move a rarely used label inside of a
   critical section so that the splnet() isn't repeated.
2002-08-11 04:12:31 +00:00
Mark Peek 65de826f7a MFC: update to version 6.12
(change list from 6.11 -> 6.12 can be found in src/contrib/tcsh/Fixes)
2002-08-10 18:14:54 +00:00
Hiroki Sato 2fd585f0ae Catch up with the English version:
1.22.2.275 -> 1.22.2.277	relnotes/common/new.sgml
2002-08-10 17:34:55 +00:00
Hiroki Sato 22454bd776 Add missing ";". General entities should always have &foo; form. 2002-08-10 17:34:49 +00:00
Johan Karlsson 183cefca97 MFC: add -n option, which automatically answers "no" to the overwrite question.
Including grammarfix in cp.1 rev 1.24.

Approved by:	sheldonh (mentor)
2002-08-10 13:20:19 +00:00
Ian Dowse 6fc4d230ec Don't dereference a NULL mbuf in m_freem(). It is a long-standing
(though maybe not ideal) feature of m_freem() that calling m_freem(NULL)
is permitted. Revision 1.51.2.17 exposed an unchecked dereference
added in revision 1.51.2.16.

This bug is specific to RELENG_4.

PR:		kern/41492
2002-08-10 12:34:31 +00:00
Bruce A. Mah 879c4c23c8 MFC: Cross-release, cross-architecture release builds. 2002-08-10 03:39:47 +00:00
Bruce A. Mah 63365483db MFC: ucom(4)/uplcom(4)/uvscom(4), uvisor, ipfw2, texinfo 4.2. 2002-08-09 21:27:51 +00:00
Tony Finch c27b88c784 MFC 1.20: remove trailing whitespace. 2002-08-09 20:59:23 +00:00
Tony Finch 72d36c9ceb Sync with -CURRENT. 2002-08-09 20:40:29 +00:00
Jens Schweikhardt 3288a4d803 MFC: Typo: s/seperately/separately
PR:             misc/41235
Submitted by:   Fesskat Tudeer <[email protected]>
2002-08-09 20:34:23 +00:00
Archie Cobbs 3e1cf3ca51 MFC: (rev. 1.12) Correct an inaccuracy regarding detecting empty fields. 2002-08-09 16:58:28 +00:00
Yaroslav Tykhiy 82e47923d6 MFC: Sort options, document undocumented ones. 2002-08-09 15:36:26 +00:00
Ruslan Ermilov 3976147b35 MFC: in_rmx.c,v 1.39, ip_input.c,v 1.165, and ip_var.h,v 1.54:
Invalidate cached forwarding route (ipforward_rt) whenever a new
route is added to the routing table, otherwise we may end up using
the wrong route when forwarding.

PR:		kern/10778
Spotted by:	Sergey Starosek <[email protected]>,
		Andrew Rukavishnikov <[email protected]>
2002-08-09 14:49:23 +00:00
Josef Karthauser caa62c0e0d Correctly port this from -current! 2002-08-09 11:06:44 +00:00
Hiroki Sato 68e65c4a0c Merge the following from the English version:
1.22.2.274 -> 1.22.2.275	relnotes/common/new.sgml
2002-08-09 07:13:31 +00:00
Ruslan Ermilov c42be62cde MFC: Mark as PROG_CXX.
This broke downgrading from -CURRENT to -STABLE early in bootstrap-tools.
2002-08-09 06:52:41 +00:00
Johan Karlsson 864cea0b1d MFC: Add ability to only beep when mail arrives.
src/libexec/comsat/comsat.8	1.10
	src/libexec/comsat/comsat.c	1.16
	src/usr.bin/biff/biff.1		1.15
	src/usr.bin/biff/biff.c		1.14, 1.15

Approved by:	sheldonh (mentor)
2002-08-09 02:56:31 +00:00
Gregory Neil Shapiro 173860d382 MFC: Apply the envp fix to the other call to main() as well.
(Immediate MFC as this fixes builds using crunchgen.)

     Revision  Changes    Path
     1.8       +2 -2      src/usr.sbin/crunch/crunchgen/crunched_main.c
2002-08-09 02:42:02 +00:00
Luigi Rizzo 4df0a4835c MFC: use m_getcl() to get buffers for the receive ring, remove
the sysctl variable sis_quick, use the new interface to
     ether_input().
2002-08-09 02:40:21 +00:00
Luigi Rizzo 504384b90f Now that we start having clients for m_getcl(), set the default max
pool size for mbuf+clusters to 10 instead of 0, so we can enjoy the
performance improvements.
2002-08-09 02:11:08 +00:00
Luigi Rizzo 41e37dd0c0 MFC 1.136 and 1.137
+ (1.136) fix handling of RNR conditions when using polling
  + (1.137) use m_getcl() to allocate buffers for the receive ring.
2002-08-09 02:04:20 +00:00
Josef Karthauser 05b305feee Regen 2002-08-08 18:51:07 +00:00
Josef Karthauser 84253df1c9 MFC: Bring usb serial support into -stable. 2002-08-08 18:45:06 +00:00
Josef Karthauser 4a7a8ecf99 MFC: Bring usb serial support into -stable. 2002-08-08 17:59:26 +00:00
Hajimu UMEMOTO b378bc813d MFC 1.78: make setsockopt(IPV6_V6ONLY, 0) actuall work for tcp6. 2002-08-08 16:47:27 +00:00
Hajimu UMEMOTO 154425bc36 MFC: cleanup usage of ip6_mapped_addr_on and ip6_v6only. now,
ip6_mapped_addr_on is unified into ip6_v6only.

	sys/netinet/in_pcb.c:		1.109
	sys/netinet/tcp_usrreq.c:	1.77
	sys/netinet6/ip6_var.h:		1.9
	sys/netinet6/udp6_usrreq.c:	1.30
2002-08-08 16:44:57 +00:00
Hajimu UMEMOTO 5e0e27483e MFC: fixed a bug that we can't send a packet to ipv4mapped ipv6 address
using a udp6 socket without bind(2)ing.

	sys/netinet6/ip6_output.c:	1.39
	sys/netinet6/udp6_usrreq.c:	1.29
2002-08-08 16:31:13 +00:00
Yaroslav Tykhiy 621071fdae MFC rev. 1.39: Report true error of glob(3). 2002-08-08 13:36:39 +00:00
Yaroslav Tykhiy 825535ae02 MFC rev. 1.117: Set SO_REUSEADDR on passive data ports,
as it should be done on all listening ports.
2002-08-08 13:30:34 +00:00
Yaroslav Tykhiy 231666d419 MFC: Remove the casts to (char*), which have become incorrect
and unneeded.

src/libexec/ftpd/ftpd.c		1.116
src/libexec/ftpd/logwtmp.c	1.11
2002-08-08 12:24:54 +00:00
Yaroslav Tykhiy 8ea1b170a4 MFC rev. 1.120: conform to RFC 959, Appendix II, in MKD reply. 2002-08-08 12:12:20 +00:00
cvs2svn 2491fcd123 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-08-08 12:05:52 +00:00
Ruslan Ermilov 1d2e203758 MFC: 1.40: Sort MAN. 2002-08-08 10:42:04 +00:00
Ruslan Ermilov 2c107ed769 MFC: 1.264: Removed no longer used share/examples/diskless/*
and never used share/examples/kld/dyn_sysctl/module.
2002-08-08 10:38:48 +00:00
Ruslan Ermilov e431bc73f9 MFC: 1.288 (whitespace), 1.289 (removed the `etc' target). 2002-08-08 10:35:38 +00:00
Ruslan Ermilov 893101bc06 MFC: 1.286: Make NO_OPENSSL imply NO_OPENSSH, as documented in make.conf(5). 2002-08-08 10:14:26 +00:00
Ruslan Ermilov d51b8c0f06 MFC: tidying. 2002-08-08 10:05:55 +00:00
Ruslan Ermilov fce352de6e MFC: 1.10: Added missing DPADD. 2002-08-08 10:03:47 +00:00
Ruslan Ermilov 78fc1cff98 MFC: 1.3: Do not overwrite mm locale files. 2002-08-08 10:00:50 +00:00
Ruslan Ermilov 3a3b50cbe6 MFC: 1.10: mark manpage as MD. 2002-08-08 09:54:44 +00:00
Ruslan Ermilov 1d5a72e2bb MFC: Reminder to keep hier(7) updated. 2002-08-08 09:50:20 +00:00
Ruslan Ermilov 3e821f41a9 MFC: 1.6: Use the SCRIPTS knob. 2002-08-08 09:47:50 +00:00
Ruslan Ermilov 302f36a3be MFC: 1.7: Fixed mdoc(7) warnings visible in troff mode. 2002-08-08 09:45:32 +00:00
Ruslan Ermilov a633a565e4 Assorted MFC: make ``make checkdpadd'' happy in lib/libpam/modules. 2002-08-08 09:33:28 +00:00
Marc Fonvieille 1c877ab24b Correct links to the FAQ and the Handbook 2002-08-08 09:11:37 +00:00
Ruslan Ermilov 348a782a99 MFC: NO_IPFILTER make.conf(5) knob. 2002-08-08 09:03:47 +00:00
Ruslan Ermilov f102ba214b MFC: Install manpage for the old -me macro package. 2002-08-08 08:47:58 +00:00
Ruslan Ermilov 6360b2b95c MFC: 1.289: Added uudecode(1) to the list of bootstrap tools,
now that we have *.bz2.uu files under lib/compat/compat22.
2002-08-08 08:44:24 +00:00
Ruslan Ermilov e3380831aa MFC: Convert perl(1) scripts to awk(1). 2002-08-08 08:38:18 +00:00
Ruslan Ermilov ca9047f101 MFC: Added $FreeBSD$ tags. 2002-08-08 08:23:53 +00:00
Ruslan Ermilov bb6f685be0 MFC: 1.697: ``env -i'' side effect fix.
MFC: 1.698: Endless recursion fix.
2002-08-08 07:55:00 +00:00
Warner Losh a705529fd6 MFC: #ifdef wchar_t on __cplusplus not being defined.
Forgotten by: imp
2002-08-08 02:42:29 +00:00
Tom Rhodes ddd3c7e90b MFC: Markup fixes 2002-08-08 02:25:27 +00:00
Jens Schweikhardt adb722de3a MFC: typo fix (apparently forgotten by dwmalone?)
PR:		41416 and 40695
2002-08-07 21:24:33 +00:00
Gregory Neil Shapiro 2ca61fc79a MFC: Pass envp to crunched program's main() routines as some depend on it.
Note that crunchgen's stub .c programs already have the code to use it:

              "int _crunched_%s_stub(int argc, char **argv, char **envp)"
              "{return main(argc,argv,envp);}\" >%s_stub.c\n",

     Add $FreeBSD$ to allow the commit.

     Revision  Changes    Path
     1.7       +4 -2      src/usr.sbin/crunch/crunchgen/crunched_main.c
2002-08-07 18:12:38 +00:00
Ruslan Ermilov cc7cba7a7c MFC: GNU texinfo 4.2. 2002-08-07 16:53:40 +00:00
Ruslan Ermilov eb49bf350f MFC: Back out addition of a plus sign in DPADD and LDADD assignments. 2002-08-07 16:53:39 +00:00
Ruslan Ermilov 4e917b201a MFC: Drop support for COPY. 2002-08-07 16:32:02 +00:00
cvs2svn 5f7643cd64 This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-08-07 16:29:49 +00:00
Ruslan Ermilov e08b9eb2dc MFC.
Ignore -C, -p, and -S options of install(1) when used with the -d
option.  Warn about COPY being phased out.  Restore the old method
of always comparing before installing: INSTALL="install -C".
2002-08-07 16:29:48 +00:00
Luigi Rizzo 1cdca79d6b MFC: bugfix: move check for udp_blackhole before the one for icmp_bandlim. 2002-08-07 16:14:47 +00:00
Luigi Rizzo 0fbf048a71 MFC: implement a new interface for ether_input(): passing a null eh
means that the header is at the beginning of the mbuf.
The old interface is (and will be) still supported so drivers do
not need to be updated all at once, and binary-only drivers will keep
working.
2002-08-07 16:13:14 +00:00
Warner Losh f24f873d37 MFC stdlib 1.37 and stddef 1.7: don't define wchar_t if C++ 2002-08-07 15:49:32 +00:00
Marc Fonvieille 16bdbd2613 MFC: 1.23, 1.24
1.23: The .Nm utility
1.24: Correct links to docs
2002-08-07 10:58:24 +00:00
Marc Fonvieille c25dd826c8 MFC: 1.30, 1.31 and 1.32
1.30: Point readers to the Porter's Handbook instead of the non-existant
"Porting Applications" section of the FreeBSD Handbook.
1.31: mdoc(7) police: tidy up.
1.32: Correct links to docs
2002-08-07 10:54:39 +00:00
Marc Fonvieille facf36bbb1 MFC: 1.11, 1.12
1.11: sysctl -w -> sysctl
1.12: correct links to docs
2002-08-07 10:47:48 +00:00
Marc Fonvieille 241f9df57c MFC: 1.6
Correct link to the FAQ
2002-08-07 10:37:34 +00:00
Marc Fonvieille 1faeb4ee90 MFC: 1.12
Correct links to doc.
2002-08-07 10:33:39 +00:00
Tim J. Robbins 2fd867102c Correct syntax error detected by src/bin/sh/parser.c 1.29.2.7.
Submitted by:	The Anarcat <[email protected]>
2002-08-07 09:21:00 +00:00
Andrey A. Chernov 27d9ff5af0 MFC: msgcat.c 1.40
Better "lang" check as path component, errno fixes, style reformatting.
2002-08-07 06:42:52 +00:00
Andrey A. Chernov ac70628eeb MFC: setlocale.c up to 1.39, setrunelocale.c up to 1.22, ldpart.c up to 1.9
setlocale.3 up to 1.23, rune.3 1.17

Better checks for "encoding" validity as pathname component.
Errno fixes. Fallback fixes. Remove macro, style, whitespace.
2002-08-07 06:24:14 +00:00
Alan Cox 6a858cb676 MFC
o Change jobref and *ijoblist from int to long in order to avoid
   a catastrophe after the 2^32nd AIO operation on 64-bit architectures.
 o Remove unused or unnecessary variables and fields.
2002-08-07 06:03:10 +00:00
Alan Cox 84012a0d99 MFC two changes in _aio_aqueue():
o Set struct kevent's ident field to the address of the user's aiocb
   rather than the kernel's.
 o Unbreak lio_listio() by recognizing LIO_READ and LIO_WRITE as opcodes
   rather than requests for notification through kevent().

PR:		kern/39556
2002-08-07 03:24:22 +00:00
Tom Rhodes 2d936868bd MFC: Markup fixes
Noticed by:	ru
2002-08-07 02:59:23 +00:00
Tom Rhodes fca314d159 MFC: Markup fixes
Noticed by:	ru
2002-08-07 02:49:56 +00:00
Semen Ustimenko 27b6f02dba MFC: rev 1.31: Fix sendfile() by always doing I/O through bread() for data
to get into VM in case of UIO_NOCOPY.

PR:		bin/34072, bin/36189
2002-08-06 19:35:18 +00:00
Gregory Neil Shapiro 1dcddbc473 MFC: If all file systems are marked nosuid, the line:
MP=`mount -t ufs | grep -v " nosuid" | awk '{ print $3 }' | sort`

     sets ${MP} to an empty string so the next line:

          set ${MP}

     actually just dumps all of the shells variables to stdout (and therefore
     the security report).  Fixed by surrounding the code which goes through the
     mounts with a test for an empty string before using ${MP}.

     Revision  Changes    Path
     1.4       +12 -9     src/etc/periodic/security/100.chksetuid
2002-08-06 17:53:12 +00:00
Bruce A. Mah 2d4618ec28 New errata notes: SA-02:35, SA-02:36, SA-02:37. 2002-08-06 16:52:39 +00:00
Bruce A. Mah 9591b8104b MFC: SA-02:35, SA-02:36, SA-02:37. 2002-08-06 16:06:28 +00:00
Matthew N. Dodd 986ed32207 Add ext2fs module. 2002-08-06 14:14:25 +00:00
Tony Finch 33ecb0955c MFC 1.27 (in-place fixes). 2002-08-06 10:03:29 +00:00
Murray Stokely d670700247 MFC r1.30: Specifically include 'docproj-jadetex' instead of 'docproj'
on disc #3.
2002-08-06 08:26:55 +00:00
cvs2svn b67739b62d This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-08-06 08:24:48 +00:00
Marc Fonvieille 04b4508f97 Forced commit, Forgot to add logs for all files :(
MFC:
Correct links to docs
README: 1.18
cvs-supfile: 1.34
doc-supfile: 1.7
gnats-supfile: 1.4
ports-supfile: 1.25
stable-supfile: 1.25 (note that the doc collection is not branched), 1.26
standard-supfile: 1.21
www-supfile: 1.4

Large Pointy Hat: blackend
2002-08-06 08:24:46 +00:00
Marc Fonvieille bf97ca1417 MFC: 1.18
Correct links to doc.
2002-08-06 08:13:14 +00:00
Andrey A. Chernov 99ab062b9d MFC: 1.19, don't use "term" if TERM env variable present 2002-08-06 07:07:52 +00:00
Andrey A. Chernov 296326a3ba MFC: 1.36, don't call login cap after descriptors are closed 2002-08-06 06:51:43 +00:00
Bill Fenner b338c46775 MFC traceroute.c revs 1.20-1.22:
- Use gen_prep() and gen_check() instead of udp_*() for unknown protocols.
- Add an ICMP protocol handler.

The full traceroute 1.4a12 merge will wait for more testing.
2002-08-05 23:37:16 +00:00
Akinori MUSHA 9049958242 MFC: Another .tbz2 -> .tbz leftover. Properly look for pkgname.tbz. 2002-08-05 18:04:50 +00:00
Max Khon 9a1bdebc18 MFC: rename a variable that might accidentally be duplicated elsewhere
(headlist -> sbni_headlist)
2002-08-05 17:40:26 +00:00
Max Khon 7182dfc269 MFC: style fixes
Verified by:	md5
2002-08-05 17:36:56 +00:00
Jacques Vidrine 5fc63c802c MFC src/crypto/openssl/crypto/asn1/asn1_lib.c rev 1.1.1.6:
Correct a bug in the ASN.1 decoder.
2002-08-05 16:28:58 +00:00
Dag-Erling Smørgrav cd4d880cc9 MFC: check far end of pipe. 2002-08-05 15:05:15 +00:00
Maxim Sobolev 4f63a7efef MFC: when extracting archive pass `-p' flag to the tar(1) (rev.1.34). 2002-08-05 13:48:38 +00:00
Doug Barton a8c3477e21 Remove the references to clean'ing in src/usr.sbin/mergemaster, since
numerous users have sent me questions, and/or problem reports about
their installworld failing after running 'make clean' here.
2002-08-05 07:47:06 +00:00
cvs2svn aa9dbec26b This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2002-08-04 20:43:23 +00:00
Wolfram Schneider bd323137f8 MFC up to rev 1.60 2002-08-04 20:43:22 +00:00
Tim J. Robbins 4db4a2640f MFC: Don't allow "||" or "&&" to be the first tokens of a command.
PR:		40386
2002-08-04 08:25:01 +00:00
David E. O'Brien 403e724619 Updated a.out libc/libc_r that fixes the FreeBSD-SA-02:28.resolv resolver bug.
Submitted by:	Trevor Johnson <[email protected]>
2002-08-04 05:54:11 +00:00
cvs2svn c11262004d This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-08-04 05:51:06 +00:00
Luigi Rizzo 5e523b2b3e MFC: add m_getcl() as a preferred way to get an mbuf with an
attached cluster.

Now that we have this interface both in -current and -stable, each
network device driver can replace the call to MGETHDR/MCLGET with
calls to m_getcl(), saving (on -stable) about 400 bytes and the
associated cache pollution.

Also, slightly modify m_freem() so that it keeps a small free list
(controlled by kern.ipc.mcl_pool_max) of such buffers for use in m_getcl().
Even a small size such as 10 elements gives about 10% improvement
in the peak forwarding performance in bridges and routers.
2002-08-04 05:36:22 +00:00
Luigi Rizzo 05205c4621 MFC: fix generation of check-state rules which i broke in last commit. 2002-08-04 05:16:56 +00:00
Luigi Rizzo 34547fdc5e Include "opt_ipfw.h" so we can tell whether we are being
compiled for the old ipfw or for ipfw2. The absence of this
caused surprising "divide by zero" panics in "pipe" rules.

-current does not have this problem.

Problem analysis courtesy of Valentine Zaretsky.
2002-08-03 16:56:39 +00:00
Hiroki Sato 2e077bab76 Merge the following from the English version:
1.22.2.272 -> 1.22.2.274	relnotes/common/new.sgml
2002-08-03 13:36:24 +00:00
Jens Schweikhardt 56e5055f75 MFC: correct a few grammar bogons. 2002-08-03 12:04:15 +00:00
Marc Fonvieille df51fa9b6b MFC: 1.3
Remove the word IPSec to respect RFCs (for example
http://www.ietf.org/rfc/rfc2401.txt), IPsec is the right word and
already in the dictionary.

PR:		in part docs/38668
2002-08-03 08:31:42 +00:00
Warner Losh 9c9f814d37 MFC: Improved wicontrol and man page. 2002-08-03 07:24:17 +00:00
Warner Losh 0f6afc7bc7 MFC: cap bits 2002-08-03 07:17:09 +00:00
Luigi Rizzo fe513d0e21 Bugfix: pass IPFORWARD info to ip_output when a packet matches a
"fwd" ipfw action on the input side.

Reported-by: Matthew Reimer
2002-08-03 04:04:52 +00:00
Tim J. Robbins 9d03ad9aaf MFC: Avoid buffer overflow with -H option (1.11), style changes (1.9-1.10). 2002-08-03 00:48:43 +00:00
Bruce A. Mah 38f87826ed Be a little more specific about when a couple of bugs were fixed in
4.6-STABLE.
2002-08-02 22:40:25 +00:00
Andrey A. Chernov 43da46a08f MFC: v1.36 (strncpy -> strlcpy, fix out of bounds indexing) 2002-08-02 19:04:04 +00:00
Ruslan Ermilov 1e00230d2f MFC: 1.696: Added forgotten WITHOUT_X11. 2002-08-02 16:27:15 +00:00
Maxim Sobolev 6d3cd09423 MFC: all latest changes, fixes and new features. This pretty much brings code
in stable on par with -current.
2002-08-02 11:09:06 +00:00
Dag-Erling Smørgrav c8697a811b Fix an inverted test that, instead of checking for a null password, checked
for a null response.  This caused pam_sm_authenticate() to always succeed
if the user's password was null (which in itself isn't so bad, except it
didn't honor the PAM_DISALLOW_NULL_AUTHTOK flag).

Merge some more code from -CURRENT that adds the "nullok" option and checks
both that and the PAM_DISALLOW_NULL_AUTHTOK flag before allowing a user
with a null password to log in.
2002-08-02 10:14:18 +00:00
Jonathan Mini 109c80fb73 Forced commit to note that revision 1.9.2.3 fixes a botch in rev
1.9.2.2 (that is, the previous revision fixes a botch in the version
before that), not 1.6.2.2.

Requested by:	obrien
2002-08-02 08:00:22 +00:00
Marc Fonvieille d1719bf6e9 MFC: 1.20 and 1.21
1.20: The .Nm utility
1.21: s/IPSEC/IPsec according to RFCs

PR:		in part docs/38668 for 1.21
2002-08-02 07:36:33 +00:00
Warner Losh a350b08936 MFC: All the latest fixes for wihostap mode, the ifconfig
enhancements, crc32 movement to libkern, removal of compat cruft, and
maybe a few other things not obvious from the diff.
2002-08-02 07:11:34 +00:00
Matt Jacob f3b7228434 MFC (1.78)- lots of fixes for EOT handling. 2002-08-02 06:25:56 +00:00
Jonathan Mini b65601bc12 Fix botched MFC (rev 1.6.2.2): __sys_close -> _thread_sys_close
PR:		kern/41251
2002-08-02 04:19:43 +00:00
Andrey A. Chernov f0a1add67a MFC rev. 1.35 (login-like fixes, remove double "Last login") 2002-08-02 01:56:04 +00:00
Hajimu UMEMOTO 1fd3ede1b6 MFC 1.22: correct comment for setsockopt arg size. 2002-08-01 19:38:50 +00:00
Hajimu UMEMOTO ff997a9a34 MFC 1.6: sysctl(NET_RT_IFLIST) up to several (currently 5) times.
This will make the behavior robuster if many addresses are added
after the size estimation of storage at the first sysctl.
2002-08-01 19:31:06 +00:00
Bruce A. Mah 2e81d62ff5 New entries for the errata: SA-02:23 update, SA-02:32, SA-02:33,
SA-02:34, mention that the READ_BIG ata(4) problems are fixed in
4-STABLE.
2002-08-01 17:36:26 +00:00
Tony Finch e7862b327f MFC 1.11:
Use login_getpwclass() instead of login_getclass() so that the root
  vs. default login class distinction is made correctly.
2002-08-01 17:29:41 +00:00
Marc Fonvieille 9527f33ecb Fix the link to the Handbook 2002-08-01 17:26:31 +00:00
Bruce A. Mah 4fd361af66 MFC: SA-02:34. 2002-08-01 15:59:40 +00:00
John Baldwin 93e8564ab4 MFC: Add PREFETCHDISTFILES support. 2002-08-01 13:30:20 +00:00
Jacques Vidrine 5b48dfe193 The fix applied to the XDR decoder in revision 1.8.2.1 was incorrect. 2002-08-01 12:23:20 +00:00
Robert Drehmel b058d7bdf2 MFC: Duplicate file descriptors with the correct flags, when
the destination is a standard file descriptor.

PR:		misc/39377
2002-08-01 11:22:16 +00:00
Yaroslav Tykhiy 1b703e998a MFC rev. 1.35: Avoid introducing a non-portable constant. 2002-08-01 10:53:04 +00:00
Ruslan Ermilov 5d25136190 MFC: Split scripts/dokern.sh into MD parts.
The old version used ``uname -m'' to choose the appropriate
sed(1) filter, and this did not obviously work in the case
of cross release.  I've been getting kern.flp overflows on
i386 attempting to cross-release Alpha.

Many thanks to Wilko for providing me with an account on
his Alpha box.  Comparing generated BOOTMFS configs helped
fix this problem almost immediately.
2002-08-01 10:05:30 +00:00
Luigi Rizzo 53f1b2476b Make net.link.ether.ipfw read-write so users of ipfw2 can
set it to 1 to try MAC filtering of layer2 packets.

It also works with ipfw, but 1) you are not supposed to know,
and 2) ipfw does not have instructions to match MAC fields.

See the commit log for rev.1.111 of this file to understand
when the firewall is invoked. We do not have separate firewall
chains yet so if you are not careful the same packet can be
processed by ipfw up to 4 times.
2002-07-31 23:44:26 +00:00
Luigi Rizzo caf1396611 MFC: sync with the version in -current. 2002-07-31 23:35:46 +00:00
Hiroki Sato e7a6e480af Merge the following from the English version:
1.22.2.269 -> 1.22.2.272	relnotes/common/new.sgml
2002-07-31 21:35:28 +00:00
Bruce A. Mah 19c5ed5a6a New release note: SA-02:23 update.
MFC:  SA-02:33.
2002-07-31 20:15:20 +00:00
Warner Losh db1382652e Shouldn't have backed this out, rwatson fixed things in the right place. 2002-07-31 17:30:48 +00:00
Bruce A. Mah 685867d16d New release note: ata(4) READ_BIG fix.
MFC:  SA-02:32.
2002-07-31 16:19:25 +00:00
Prafulla Deuskar 99ee25ffe9 MFC:
Add support for 82546 based adapters.
Fix markup issues with the man page.
2002-07-31 16:11:43 +00:00
Warner Losh 347dc175e9 effectivelt back out my last change. There's a conflict I need to
resolve first.
2002-07-31 15:17:42 +00:00
Hajimu UMEMOTO 209b920d67 MFC: include file of SASLv1 was changed to /usr/local/include/sasl1. 2002-07-31 15:08:10 +00:00
Jacques Vidrine 1a44bfc42e Add missing header <limits.h> for UINT_MAX introduced
in previous commit.

Noticed by:	bsd
2002-07-31 14:40:32 +00:00
Robert Watson c0d3bc09e4 Fix -STABLE kernel build due to possibly missed file in MFC.
Reported by:	Jan Schlesner <[email protected]>, [email protected]
(et al)
Hopefully not objected to by:	imp
2002-07-31 14:13:05 +00:00
Darren Reed 106240e3f7 Patch to fix bounds checking/overflow
Obtained From:	OpenBSD
2002-07-31 12:52:05 +00:00
Søren Schmidt b9a85c25dc MFC:
Dont rely on the upper layers handling iosize_max correctly,
	instead rely on ATAPI devices ability to do the work instead.

This should fix the READ_BIG and related errors.

Requested by: RE@
2002-07-31 11:19:26 +00:00
Yaroslav Tykhiy 3a362ccc9e MFC rev. 1.115: Clean up the syslog(3) messages on the setsockopt(2) errors. 2002-07-31 11:04:42 +00:00
Hajimu UMEMOTO 85aed53917 MFC 1.12:
- ntohs() returns unsigned value.
 - use strlcpy.
 - snprintf can return negative value, so cope with it.
 - tweak interface index on interface locals (ff01::/16).
 - removed unused macros.
 - removed a macro that uses only once (in a trivial context).
 - explicitly say goodbye to ENI_xxx.
 - constify struct afd.
2002-07-31 10:11:09 +00:00
Warner Losh 92e5fa5527 MFC: phk's crc32 stuff + one typo fix. Stuff depending on this will be merged
shortly.
2002-07-31 09:08:34 +00:00
Maxim Konovalov a1535419ab MFC rev. 1.102: move 'byte_count' calculation just before 'recvurg' check.
It is a global variable and used in myoob().
2002-07-31 07:44:14 +00:00
Bruce A. Mah 7febae28eb MFC: OpenSSL-0.9.6e. 2002-07-31 02:50:14 +00:00
Semen Ustimenko ae635f086a MFC: rev 1.53: Fix null_lock() not unlocking vp->v_interlock if
LK_THISLAYER.
2002-07-31 00:32:28 +00:00
Jacques Vidrine 91d8bea2b4 MFC: OpenSSL 0.9.6e 2002-07-30 22:06:11 +00:00
Mike Silbersack 42db7aed42 MFC:
Update docs to reflect change in count of procs reserved for root
  from 1 to 10.

  PR:             kern/40515
  Submitted by:   David Schultz <[email protected]>
  MFC after:      1 day

  Revision  Changes    Path
  1.156     +1 -1      src/sys/kern/kern_fork.c
2002-07-30 19:05:00 +00:00
Mike Silbersack 2f77ab6502 MFC:
Update docs to reflect change in count of procs reserved for root
  from 1 to 10.

  PR:             kern/40515
  Submitted by:   David Schultz <[email protected]>
  MFC after:      1 day

  Revision  Changes    Path
  1.16      +1 -1      src/lib/libc/sys/fork.2
  1.24      +1 -1      src/lib/libc/sys/rfork.2
2002-07-30 19:04:25 +00:00
cvs2svn c9ffe36ff1 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-07-30 17:44:29 +00:00
Bruce A. Mah e807048905 For the /usr/share/examples workaround, add the "path" of menu items
in sysinstall(8) to install the sshare distribution.

While I'm here, mention that this problem is fixed in 4-STABLE.

Submitted by:	Ross Lippert <[email protected]>
2002-07-30 16:50:49 +00:00
Jacques Vidrine aedb7baab2 MFC 1.178: Fix ordering of set-(user|group)-ID checks. 2002-07-30 15:40:46 +00:00
cvs2svn 90d2573693 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-07-30 13:38:08 +00:00
Warner Losh addf28cd86 MFC: Merge most of this file from -current to here. All those values
that are the same or have been added have been merged.  All the silly
white space differences were merged.  All the __P removals were
merged.

I didn't merge the changes to the ethernet media types because they
had been renumbered in -current and I didn't want to break binary
compatibility within -stable.

Added: IBSS and IBSSMASTER media types.
2002-07-30 06:22:40 +00:00
Bruce A. Mah 8d7ce752d9 MFC: finger(1) -4/-6, ls(1) -m/-p/-x, sh(1) builtin updates. 2002-07-30 04:54:16 +00:00
Peter Wemm 2dcd742972 MFC: 1.20: use fchmod() to restore tty modes 2002-07-30 03:50:40 +00:00
Hiroki Sato 100659ff9a Merge the following from the English version:
1.22.2.268 -> 1.22.2.269	relnotes/common/new.sgml
2002-07-30 02:16:41 +00:00
Tim J. Robbins f7cf6d689a MFC: Sort sections. 2002-07-30 01:06:31 +00:00
Tim J. Robbins 11e28cdaef MFC: Avoid buffer overflows, sort symbol name with locale collating order
with -x option, style changes.
2002-07-30 00:55:07 +00:00
Archie Cobbs e93a0bdc0b Modification of an mbuf cluster's reference count must either be done
atomically or else protected by splimp(). This fixes a rare race condition
that can cause mbuf cluster leaks and random crashes.

This is already fixed in -current in revision 1.55.

Reviewed by:	freebsd-net
2002-07-29 20:14:09 +00:00
Hajimu UMEMOTO cad5aacadc MFC: do not refer to IN6P_BINDV6ONLY anymore.
sys/netinet/in_pcb.h:		1.51
	sys/netinet6/ip6_output.c:	1.38
2002-07-29 18:56:37 +00:00
Hajimu UMEMOTO b1cbdf0c18 MFC: add -4 and -6 option to be able to specify an address family.
usr.bin/finger/finger.1:	1.25
	usr.bin/finger/finger.c:	1.29
	usr.bin/finger/net.c:		1.20
2002-07-29 18:52:52 +00:00
Hajimu UMEMOTO 5f7bf11316 MFC: use IPV6_V6ONLY instead of non standard IPV6_BINDV6ONLY.
libexec/ftpd/ftpd.c:		1.114
	usr.sbin/inetd/inetd.c:		1.106
	usr.sbin/syslogd/syslogd.c:	1.102
2002-07-29 18:48:09 +00:00
Hajimu UMEMOTO 0d46dccf32 MFC: Use BSDi derived if_nametoindex(), if_indextoname(), if_nameindex()
and if_freenameindex().
2002-07-29 18:33:18 +00:00
Bruce A. Mah dbabd4cc00 MFC: tr(1) equivalence classes, new flags for who(1). 2002-07-29 16:03:52 +00:00
Yaroslav Tykhiy 062085c94e MFC rev. 1.113:
Fix one RFC 959 incompliance:
Double double-quotes in a PWD result
if they appear in the directory pathname.
2002-07-29 15:37:09 +00:00
Yaroslav Tykhiy 0ab23daa07 MFC rev. 1.112:
Allow deleting and renaming stale symlinks and
deleting symlinks pointing to directories.
2002-07-29 15:25:58 +00:00
Tim J. Robbins 35db198509 MFC: Basic equivalence class support, improved parsing of character and
equivalence classes.
2002-07-29 12:59:33 +00:00
Takanori Watanabe 10d5e2fb12 MFC: ALLIED TELESIS,K.K. LA-ISA V2 ISA PnP ID.
Submitted by:   nork
2002-07-29 07:52:57 +00:00
Ruslan Ermilov b287b9bd37 MFC: 1.6: Fixed warning.
PR:		docs/37175
2002-07-29 07:41:24 +00:00
Ruslan Ermilov efd218930a MFC: 1.166: Don't shrink socket buffers in tcp_mss(), application
might have already configured them with setsockopt(SO_*BUF), for
RFC1323's scaled windows.

PR:		kern/11966
2002-07-29 07:30:24 +00:00
Ruslan Ermilov bc68954fe2 Parallel make (-j4) fixes. 2002-07-29 07:24:19 +00:00
Matt Jacob 9df3cfb0ca MFC: fix Makefiles to actually work. 2002-07-29 04:43:57 +00:00
Matt Jacob 43fc07cf06 MFC: bring us up to date with fixed target mode. 2002-07-29 04:25:59 +00:00
Matt Jacob d39851d816 MFC: bring us up to snuff with main development- new ISP_CFG_XXX defines
and a couple new ISPASYNC defines.
2002-07-29 04:25:40 +00:00
Matt Jacob 210b8f077d MFC: add HEARTBEAT commands and FC4_FC_SVC define. 2002-07-29 04:25:02 +00:00
Matt Jacob c4bffcd1a0 MFC (1.82):
Set all 23XX cards as 'touched' (we have trouble, unpredictably, about
running ABOUT FIRMWARE with some that were started by BIOS downloads).

Redo CTIO2 dma mapping- use continuation segments instead of multiple
CTIO2s. Thanks to Veritas for sponsoring this work (in a different
context).

RELENG_4 only: preserve unit numbering for 'disabled' HBAs  by returning
success in attachment (but not connecting the dots to CAM).
2002-07-29 04:24:28 +00:00
Matt Jacob 135d445ab0 MFC (1.7-1.8): add get/set param, ISP_FC_GETHINFO ioctls 2002-07-29 04:21:23 +00:00
Matt Jacob 432d73e704 MFC 1.26:
Go back to *not* fully evaluating loop/fabric state if our role
is ISP_ROLE_NONE.
2002-07-29 04:20:46 +00:00
Matt Jacob a088b43887 MFC (1.62-1.67, as appropriate)
Clean up some internal target mode stuff plus internal flags.

Up MAXISPREQUEST to be 1024 for FC && ULTRA2 or better cards (up fromn 256)

Use real bus_dmamap_sync stuff instead of platform foobs.

Complain if somebody reuses FC scratch area unexpectedly.
2002-07-29 04:20:16 +00:00
Matt Jacob 67198a155e MFC (1.79-1.80, all as sensible):
Add support for ISP_FC_GETHINFO, which returns current connection
topology, speed, loopid, WWPN/WWNN, etc., plus other ioctls.

Coalesece all the freeze simq for loopdown into a isp_freeze_loopdown
inline.

Beef up target mode. Add isp_handle_platform_notify_scsi and
isp_handle_platform_notify_fc platform handlers to handle immediate
notifies (isp_handle_platform_notify_scsi is still stubbed out).

In implementation of isp_handle_platform_notify_fc, for IN_ABORT_TASK,
peel off a pending XPT_IMMED_NOTIFY and call xpt_done on it and hope
that somebody upstream is listening.

Make sure on final CTIO2s that we set residual correctly. These are
absolutely crucial. Make sure we set relative offset for each CTIO2
based upon bytes we've already xferred. This is what the private
adjunct datat to the original ATIO is. Note state of command so
we can figure out where to find it if we get an ABORT from the firmware.

Make sure we *always* set CAM_TAG_ACTION_VALID for ATIO2s. Make sure
we keep track of the original lun.
2002-07-29 04:18:09 +00:00
Matt Jacob f24de6a5ed MFC (1.94, 1.95):
Remove the 'bogus registrant' hack for fabric searches. If we've
overrrides marked, don't set some default values from reading NVRAM.
Switch to using USEC_DELAY rather than USEC_SLEEP at isp_reset time.
If the HBA is already 'touched', still set maxluns. Fix some bugs
in the non-HANDLE_LOOPSTATE_IN_OUTER_LAYERS vase. Clean up some
target mode stuff.
2002-07-29 04:11:47 +00:00
Luigi Rizzo 24874397ad MFC: whitespace commit, fix indentation in fxp_intr_body 2002-07-29 02:50:59 +00:00
Luigi Rizzo e042507974 ipfw1 cannot handle non-IP packets, so just return 0 (and
accept them) when it encounters them.
2002-07-29 02:04:25 +00:00
Tim J. Robbins 17e04d3c90 MFC: Document that only one of the -n and -e options may be specified for
sh(1)'s echo(1) builtin command.

PR:		32935, 40747
2002-07-28 10:24:01 +00:00
Tim J. Robbins b2fa2d5306 MFC: Support "--" end of options marker, style changes. Revisions 1.13-1.15 2002-07-28 10:19:57 +00:00
Eric Melville 9fc78878ce MFC: handle directories correctly 2002-07-28 06:52:15 +00:00
Eric Melville b7f51c9af9 Use ID tag macro. 2002-07-28 06:50:49 +00:00
Hiroki Sato aeec054b18 Merge the following from the English version:
1.22.2.267 -> 1.22.2.268	relnotes/common/new.sgml
2002-07-27 17:54:22 +00:00
Bruce A. Mah c032bc5dc0 New release note: /usr/share/examples fix. 2002-07-27 17:27:06 +00:00
John Polstra 8dda57f9de MFC: Recognize the Altima AC9100 chip used in current versions of
the Netgear GA302-T.  This merges if_bge.c revision 1.18 and
if_bgereg.h revision 1.6.

PR:		kern/38988
2002-07-27 17:00:41 +00:00
Sebastien Gioria 308a970667 MFen to 1.22.2.267 2002-07-27 10:21:41 +00:00
Hiroki Sato a1fa4fcd75 Merge the following from the English version:
1.22.2.249 -> 1.22.2.267	relnotes/common/new.sgml
2002-07-27 07:02:25 +00:00
Jens Schweikhardt 9d860f5bb7 MFC: correct typo. 2002-07-26 20:16:17 +00:00
Ruslan Ermilov e3554945b2 MFC: 1.13: Build ports/textproc/sed_inplace where needed. 2002-07-26 20:02:15 +00:00
Ruslan Ermilov 4b18eee29c MFC: Build FDP ports in a clean environment; gmake(1) doesn't like
our ${TARGET_ARCH}.
2002-07-26 20:00:26 +00:00
Ruslan Ermilov 9f2f526b88 MFC: remnants of 1.589.
Don't throw in extra commands to build sysinstall(8) manually during
release; they don't do anything useful nowadays except delaying the
process and spamming the /usr/src/release/sysinstall with the object
files (executing "make obj all" is always a bug; "make obj; make all"
would be right).
2002-07-26 19:58:14 +00:00
Ruslan Ermilov a4708f4d1a Forgot to remove this in the previous revision. 2002-07-26 19:49:36 +00:00
Tony Finch 737f4fee17 MFC:
FreeBSD doesn't use the host RSA key by default.

  Revision  Changes    Path
  1.24      +2 -4      src/crypto/openssh/sshd.8
  1.28      +0 -1      src/crypto/openssh/sshd_config
  1.6       +0 -2      src/crypto/openssh/sshd_config.5
2002-07-26 15:18:32 +00:00
Yaroslav Tykhiy aa56f2678b The "passive" command effectively toggles passive mode,
not enters it irreversibly.  So reflect such behaviour
in the corresponding help line.

Luke Mewburn has been pointed out at this minuscule bug,
so we stand a chance to have it fixed in -CURRENT as well.
2002-07-26 13:03:46 +00:00
Dag-Erling Smørgrav e6cef3534e MFC: use __BEGIN_DECLS / __END_DECLS + diff reduction against -CURRENT.
PR:		misc/40399
2002-07-26 11:10:54 +00:00
Takanori Watanabe 1bba747548 MFC and Regen. 2002-07-26 05:28:28 +00:00
Takanori Watanabe 0e0fc4595e MFC: sync with 1.94
Submitted by:nsayer
2002-07-26 05:26:06 +00:00
Garance A Drosehn 5ccdb7a972 MFC *: Changes which rewrite 'lpc topq', and which add 'lpc bottomq'.
More details on the new 'lpc topq' are in the log message for
revision 1.2 of lpc/movejobs.c.

The previous implementation of 'lpc topq' is available as 'lpc xtopq',
in case there are any problems noticed in the new implementation.

[* = 1.10 common_source/Makefile, 1.1->1.2 matchjobs.c, 1.1 matchjobs.h,
 1.12 lpc/Makefile, 1.10 cmdtab.c, 1.11 extern.h, 1.20 lpc.8, 1.26 lpc.c,
 1.1 movejobs.c]
2002-07-26 03:12:07 +00:00
Garance A Drosehn cb66f283ad MFC *: Remove the backup-versions ("x*") of various lpc commands that were
recently rewritten.  No problems have been reported with the new versions.

[* = 1.30 cmds.c, 1.9 cmdtab.c, 1.10 extern.h]
2002-07-25 23:29:39 +00:00
David E. O'Brien 38f3284a6c MFC: we haven't used this libg++ header since 1999/04/05 05:36:37. 2002-07-25 16:33:11 +00:00
Tony Finch 825d32569d MFC:
Document the FreeBSD default for CheckHostIP, which was changed in
  rev 1.2 of readconf.c.

  Revision  Changes    Path
  1.17      +1 -1      src/crypto/openssh/ssh_config
  1.5       +1 -1      src/crypto/openssh/ssh_config.5
2002-07-25 16:03:44 +00:00
Hajimu UMEMOTO e9168671e8 Cope with 2292bis-01 getaddrinfo (no NI_WITHSCOPEID, always attach
scope identifier).
(Since 5-CURRENT already switched to use lukemftp, this is for
4-STABLE only.)
2002-07-25 15:29:18 +00:00
Hajimu UMEMOTO 11311ed73d MFC: Cope with 2292bis-01 getaddrinfo (no NI_WITHSCOPEID, always attach
scope identifier).

	lib/libftpio/ftpio.c:	1.42
	libexec/ftpd/ftpd.c:	1.104
2002-07-25 15:25:33 +00:00
Hajimu UMEMOTO 0c0e72adac MFC 1.80: Cope with 2292bis-01 getaddrinfo (no NI_WITHSCOPEID, always attach
scope identifier).
2002-07-25 15:22:37 +00:00
Hajimu UMEMOTO f1155463d4 MFC 1.11: Make NI_WITHSCOPEID a default (always on), to synchronize
with recent 2553bis.
2002-07-25 15:20:46 +00:00
Tim J. Robbins 8d3d480083 MFC: Support larger files, allow "-" as both an operand as well as an option,
avoid buffer overflow, -a option (suffix length), style changes.
2002-07-25 12:46:36 +00:00
Tim J. Robbins b9b099bf1d MFC: Remove -Wall to reduce diffs to -current. 2002-07-25 12:33:01 +00:00
Ruslan Ermilov fce4961c9c MFC: Don't forget to recalculate the IP checksum of the original
IP datagram embedded into ICMP error message.
2002-07-25 12:31:37 +00:00
Ruslan Ermilov e3cd60c3de MFC: cross-release support.
Assorted fixes:

- Changed the way the `catpages' dist is built (all MD catpages
  were missing before).

- Perl manpages now end up in the `manpage' dist.

- Clean up the `dict' dist generation script.

- Diff reduction to -CURRENT.
2002-07-25 09:33:17 +00:00
Johan Karlsson 9fde0e72d4 MFC: acct(2) appends to files.
Reviewed by:	bmah
2002-07-25 02:12:31 +00:00
Johan Karlsson 8617cb2c24 MFC rev 1.45
Open accounting file for appending, not general writing.
  This allows accton(8) to be used with an append-only file.

  PR:             7169
  Reported by:    Joao Carlos Mendes Luis <[email protected]>

Approved by:	sheldonh (mentor)
2002-07-24 18:33:55 +00:00
Hajimu UMEMOTO 8d48711fd4 MFC: be able to configure to run an IPv6 routing daemon even on
an end node.

	etc/defaults/rc.conf:	1.153
	etc/rc.network6:	1.30
2002-07-24 18:25:42 +00:00
Hajimu UMEMOTO e1fd416643 MFC 1.13: fixed to make mbuf chain. 2002-07-24 18:21:53 +00:00
Hajimu UMEMOTO 3f7a65b366 MFC 1.43:
- fixed the order of searching SA table for packets.
  - comment about deletion of SA that has not been used by reaching
    soft lifetime.
2002-07-24 18:17:40 +00:00
Ruslan Ermilov 6d322ad7e1 MFC: 1.57: Do not reset ${MAKEFILE} when reading ".depend". 2002-07-24 16:50:18 +00:00
Ruslan Ermilov c8758d0039 MFC: Use the terminal bsd.prog.mk instead of intermediate bsd.obj.mk
which is likely to be prohibited for direct inclusion in the future.

Reviewed by:	markm
2002-07-24 14:29:06 +00:00
Yaroslav Tykhiy 3542422e3d MFC rev. 1.110:
Fix setting parameters for getipnodebyaddr(3):
o "struct addrinfo" contains a pointer to "struct sockaddr,"
  not "struct sockaddr" itself
o the function takes a pointer to "struct in*_addr", not to
  "struct sockaddr," so the address length must be corresponding
2002-07-24 14:06:15 +00:00
Ruslan Ermilov 123da19b12 MFC: Respect -q with "add" and "delete". 2002-07-24 12:55:09 +00:00
Ruslan Ermilov e9ebf8eb7d MFC: Check that src/games exists in a less error-prone way. 2002-07-24 12:48:41 +00:00
Ruslan Ermilov f43bd7b4d2 MFC: 1.7: `all-man' has been fixed for the -DNOMANCOMPRESS case,
so this is no longer necessary.
2002-07-24 12:38:44 +00:00
Ruslan Ermilov 5a0c30d610 MFC: Document MODULES_OVERRIDE. 2002-07-24 12:28:39 +00:00
Jun Kuriyama 31c546bc29 Convert spaces to tab. 2002-07-24 07:50:39 +00:00
Luigi Rizzo 489e451968 Bring ipfw2 into the -stable tree. This will give more people a
chance to test it, and hopefully accelerate the transition from the
old to the new ipfw code.

NOTE: THIS COMMIT WILL NOT CHANGE THE FIREWALL YOU USE,
NOR A SINGLE BIT IN YOUR KERNEL AND BINARIES.
YOU WILL KEEP USING YOUR OLD "ipfw" UNLESS YOU:

  + add "options IPFW2" (undocumented) to your kernel config file;

  + compile and install sbin/ipfw and lib/libalias with
        make -DIPFW2

in other words, you must really want it.

On the other hand, i believe you do really want to use this new
code. In addition to being twice as fast in processing individual
rules, you can use more powerful match patterns such as

        ... ip from 1.2.3.0/24{50,6,27,158} to ...
        ... ip from { 1.2.3.4/26 or 5.6.7.8/22 } to ...
        ... ip from any 5-7,9-66,1020-3000,4000-5000 to ...

i.e. match sparse sets of IP addresses in constant time; use "or"
connectives between match patterns; have multiple port ranges; etc.
which I believe will dramatically reduce your ruleset size.

As an additional bonus, "keep-state" rules will now send keepalives
when the rule is about to expire, so you will not have your remote
login sessions die while you are idle.

The syntax is backward compatible with the old ipfw.
A manual page documenting the extensions has yet to be completed.
2002-07-24 03:21:24 +00:00
cvs2svn dd09aa5456 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-07-24 02:41:20 +00:00
John Polstra 2adfc151a2 MFC 1.53: Eliminate overflows that caused some TCP timer sysctls to
be incorrect if hz was higher than the default.
2002-07-23 17:49:12 +00:00
Tom Rhodes a6f3515189 MFC: Reduce diffs to head, some markup and grammar fixes. 2002-07-23 15:13:15 +00:00
Tim J. Robbins af380b74f2 MFC: Un-deprecate od(1), add the P1003.1-2001 -s, -A, -j, -N and -t
options. Correctly print signed single-byte decimal integers. Support
for printing long doubles. Use off_t to handle large files. Handle empty
format strings correctly. Style changes.
2002-07-23 14:27:06 +00:00
Ruslan Ermilov a021136dc3 MFC: Automate building of libraries with the tools/make_libdeps.sh script. 2002-07-23 12:12:30 +00:00
Yaroslav Tykhiy 2bfe6ab8ea MFC rev. 1.108: A style fix.
Rationale: Some people do read our source after installing a release.
Ftpd has enough spots of bad style as it is.
2002-07-23 11:32:49 +00:00
Ruslan Ermilov 149d9d2f65 MFC: There is no actually the termcap library. 2002-07-23 10:20:20 +00:00
Ruslan Ermilov 27c7e4ebd4 MFC: 1.8: Fix broken `checkdpadd'. 2002-07-23 09:29:53 +00:00
Ruslan Ermilov a226707c69 MFC: Replaced .depend generation hacks with a cleaner one. 2002-07-23 09:18:30 +00:00
Ruslan Ermilov 25232cd6bb MFC: Dependencies are delimited by space not tab. 2002-07-23 09:16:07 +00:00
Ruslan Ermilov b5164068f2 MFC: sync style with -CURRENT. 2002-07-23 09:14:38 +00:00
Ruslan Ermilov 633e6eb0ca MFC: Set MAKEOBJDIREPREFIX based on ${TARGET}, not on ${TARGET_ARCH}. 2002-07-23 08:55:14 +00:00
Ruslan Ermilov 6649904d4a MFC: 1.251: Avoid cleaning modules twice in `buildkernel'. 2002-07-23 08:45:20 +00:00
Ruslan Ermilov 5b81c62157 MFC: 1.247: Bootstrap make(1) not supporting the :C modifier
(currently used by sys/dev/aic7xxx/aicasm/Makefile,v 1.8.2.3).
2002-07-23 08:22:49 +00:00
Ruslan Ermilov 74c965153c Sort SUBDIR. 2002-07-23 08:02:25 +00:00
Ruslan Ermilov de63909242 MFC: 1.7: Don't override BINGRP -- this binary is not ``setgid bin''. 2002-07-23 07:48:27 +00:00
Kelly Yancey e960d42a8a MFC 1.18: Add some additional 802.11 media definitions. 2002-07-23 04:34:05 +00:00
Ruslan Ermilov 3e504b9b71 Revert part of the last delta; install compatibility symlinks
<machine/soundcard.h> and <machine/joystick.h> in the default
SHARED=copies case.

Requested by:	sheldonh
2002-07-22 23:04:29 +00:00
Ruslan Ermilov d7cd68d5bd Use the stock (FSF) version of this file. (Revision 1.2 on trunk
was outdated, and file returned back on vendor branch.)

Credit goes to:	anonymous cvs@ member
2002-07-22 19:54:07 +00:00
Bruce Evans 7b288f8ec1 Fixed a missing line in the MFC of rev.1.37 (PR 12723).
Submitted by:	Peter Jeremy <[email protected]>

MFC (1.29 (parts), 1.31, 1.32: fildes -> fd).
2002-07-22 15:15:16 +00:00
Ruslan Ermilov f1307896ba MFC: bsd.incs.mk support and assorted header fixes:
Install sys/<arch>/include/pc/*.h to /usr/include/machine/pc/.

Install sys/netatm/*/*.h to /usr/include/netatm/*/.

Don't install compatibility symlinks for <machine/soundcard.h>
and <machine/joystick.h>.

Don't install IPFILTER headers.  Userland utilities fetch them
directly, and they were not visible in the SHARED=symlinks case.

Resurrect SHARED=symlinks in Makefile.inc1.

PR:		docs/29534, bin/28002
2002-07-22 14:21:52 +00:00
Tony Finch b2e58f96e2 MFC 1.43 (typo) 2002-07-22 14:05:56 +00:00
Peter Wemm 79c3fe9c36 MFC: rev 1.4: Make in_cksum() work on little-endian machines. 2002-07-22 09:28:50 +00:00
Ruslan Ermilov a084711d1d MFC: 1.135: Moved `clean:' below so that it notices CLEANFILES
set by bsd.man.mk and bsd.dep.mk.
2002-07-21 21:24:15 +00:00
Ruslan Ermilov d4b967978c MFC: 1.18 (added missing DPADD and CLEANFILES). 2002-07-21 21:12:38 +00:00
Ruslan Ermilov 3799c13ebe MFC: 1.3: Fixed SCRIPTS that broke `clean'. 2002-07-21 21:04:16 +00:00
Johan Karlsson 90cf12172a MFC rev 1.14
Add DIAGNOSTICS section to describe exit values.

Approved by:    sheldonh (mentor)
2002-07-21 15:31:09 +00:00
Tim J. Robbins fa535f40f6 Restore the note about printf(1) being a shell builtin that was lost in the
previous MFC.
2002-07-21 05:50:14 +00:00
Mark Peek 16be8bb080 MFC: Don't imply that setting the boot_ variables to "NO" will disable them. 2002-07-20 21:11:25 +00:00
Ruslan Ermilov 14c9db2333 MFC: 1.7 (sys.mk no longer includes bsd.own.mk). 2002-07-20 11:02:30 +00:00
Ruslan Ermilov 49c2d376ba MFC: 1.29: Suck in the SHAREMODE definition (sys.mk no longer
includes bsd.own.mk).

Submitted by:	Morten Rodal <[email protected]>
2002-07-20 10:33:52 +00:00
Ruslan Ermilov f614684df9 MFC: 1.262: Upgrade make(1) to at least usr.bin/make/var.c,v 1.16.2.3. 2002-07-20 10:05:53 +00:00
Gordon Tetlow df654026c1 MFC: rev 1.149
Don't use empty variables when the only valid values are YES and NO.
2002-07-20 03:41:23 +00:00
Prafulla Deuskar cefd31e793 MFC
- Use IO mode to reset the controller (82544 and beyond)
- Read the Mac address only once during attach.
  (This fixes the failover issue observed using the bonding driver)
2002-07-20 02:30:27 +00:00
Ruslan Ermilov 3951d2bcfe MFC: new bsd.lib.mk API. 2002-07-19 18:46:30 +00:00
Ruslan Ermilov 5c1185f039 MFC: removed a.out libs. 2002-07-19 18:45:29 +00:00
Garrett Wollman 0f08a5c030 No reason the useless POSIX-compatibility scripts can't also exist in
-STABLE...
2002-07-19 18:20:57 +00:00
Ruslan Ermilov 795ce3d60a MFC fixes to MFCed breakage of -DMAKE_KERBEROS4 buildworld caused
by removal of bin/rcp/pathnames.h.
2002-07-19 18:03:41 +00:00
Matthew Dillon 11a3379d96 MFC 1.78. Fix bug where 0-length RPCs would lock-up a system. recm must
be cleared unconditionally in the loop.
2002-07-19 17:19:53 +00:00
Matthew Dillon 649ccfd7ce MFC 1.111 fix a bug in nfs_write() related to ^Cing during a file
write on an interruptable mount.
2002-07-19 17:12:37 +00:00
John Baldwin 62db771a46 MFC: rev 1.85: Don't try to unlock the send lock in an error case where we
don't hold the lock.
2002-07-19 12:42:10 +00:00
Ruslan Ermilov 03fb078160 MFC: PROG_CXX support for bsd.prog.mk. 2002-07-19 08:34:13 +00:00
Ruslan Ermilov 1decb43aa4 MFC: 1.6 (optimize for i486 better). 2002-07-19 08:09:32 +00:00
Ruslan Ermilov 741e910e63 MFC: 1.60 (removed bogus env(1) commands),
1.65 (removed bogus dependency).
2002-07-19 08:04:30 +00:00
Juli Mallett 83e8ea0efd Synch the rcp(1) utility with that of CURRENT, mostly code cleanups and
removal of local pathnames.h.
2002-07-19 07:54:51 +00:00
Juli Mallett 1ed85dd535 Reduce differences to CURRENT. 2002-07-19 07:53:41 +00:00
Juli Mallett 5da6d41447 MFC:
Use size_t consistently and complete some uncompleted code resulting in a
  memory leak by assigning and freeing a variable appropriately as well as
  keeping track of the amount of allocated ram properly.

  Revision  Changes    Path
  1.8       +1 -1      src/bin/rcp/extern.h
  1.32      +5 -2      src/bin/rcp/rcp.c
2002-07-19 07:41:39 +00:00
Tim J. Robbins b6479dc164 Sync with HEAD, except that printf(1) is still a shell builtin and old
libedit history interface is still used. This gives the following
new features/bug fixes:
 - Quote output of alias, export, readonly builtins
 - -L (logical) and -P (physical) options added to cd and pwd, logical
   behaviour made default.
 - -C (noclobber) option and >>| redirection is implemented
 - hash builtin only shows normal commands, no functions or builtins
 - -u (nounset) option is implemented
 - fc builtin's -e option works correctly again
 - No longer assumes there is a tty on fd 2 (PR 36671)
 - fg/bg command show more info about job being manipulated
 - -l and -s options added to jobs builtin, output closer to POSIX spec.
 - %+ (current job) %- (previous job) and %? (substring) job ID's implemented
 - >&- (and similar) redirection operators close descriptors correctly
 - set +o output corrected
 - Style: __FBSDID, __P removal, ANSI-style function declarations
2002-07-19 04:38:54 +00:00
Max Khon 4a85dbd565 MFC: fix driver name in DRIVER_MODULE 2002-07-18 21:23:35 +00:00
Bruce A. Mah aa80f8ef64 MFC: OpenBSD m4, OPIE 2.4, GNU tar 1.13.25. 2002-07-18 16:15:51 +00:00
Ruslan Ermilov c8526ac4f4 MFC: Update documentation on how to force install to compare
files before installing.

PR:		bin/40724
2002-07-18 13:34:52 +00:00
Ruslan Ermilov d85757e98e MFC: s/${INSTALL} -c/${INSTALL} ${COPY}/ 2002-07-18 13:31:30 +00:00
Ruslan Ermilov 65a7929557 MFC: s/install -c/${INSTALL} ${COPY}/ 2002-07-18 13:22:18 +00:00
Ruslan Ermilov d1a10d3f4d MFC: Install via FILES. 2002-07-18 12:36:07 +00:00
Ruslan Ermilov b0d3556c67 MFC: Moved definitions of FreeBSD 4.6 and 4.6.1 out of contributed material. 2002-07-18 10:10:55 +00:00
Murray Stokely 900fcbced8 MFC: Teach mdoc about FreeBSD 4.6.1. 2002-07-18 08:05:10 +00:00
Ruslan Ermilov c062ce53ea MFC: 1.238, 1.239: Fixed the -DMAKE_KERBEROS5 world breakage in
kerberos5/lib/libroken revealed by recently fixed bug in ld(1).

Reminded by:	Stephen Hilton <[email protected]>
2002-07-18 08:00:43 +00:00
Luigi Rizzo f92d074d99 MFC: remove a bug when using ipfw2 and "pipe N log" actions.
In fact this commit is mostly to keep this file in sync with the
version in -current, because ipfw2 is not in the RELENG_4 tree so
there was no problem here.
2002-07-18 04:43:52 +00:00
Ruslan Ermilov 2644760f2a MFC: bsd.init.mk, don't include bsd.own.mk from sys.mk, assorted fixes. 2002-07-17 19:08:24 +00:00
Marc Fonvieille 2869283261 MFC: 1.11
Typo fix: s/THAI/TAHI
2002-07-17 18:20:32 +00:00
Dag-Erling Smørgrav 688d93796a MFC: use the buffer API, and kill the child when a fatal error occurs. 2002-07-17 17:45:18 +00:00
cvs2svn 70ddb5cb3a This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-07-17 15:35:32 +00:00
Ruslan Ermilov 5218dd0490 MFC: 1.37 (build manuals at appropriate time, collapse their generation). 2002-07-17 15:16:38 +00:00
Ruslan Ermilov 8c8d52967a MFC: 1.17 (don't depend on termcap(5) database to be present). 2002-07-17 15:10:20 +00:00
Ruslan Ermilov b4eb1d7e16 MFC: replaced beforeinstall with FILES. 2002-07-17 15:07:02 +00:00
Ruslan Ermilov b696ae0ab3 MFC: 1.16: Fix CLEANFILES. 2002-07-17 15:04:06 +00:00
Ruslan Ermilov e5eba3d02c MFC: 1.11: Just use ${MACHINE}, it's already special-casing pc98. 2002-07-17 14:23:14 +00:00
Ruslan Ermilov b2a85d3b36 MFC: the directory of the including makefile is tried first for
the "" type of inclusions.
2002-07-17 14:19:30 +00:00
Ruslan Ermilov da570ec817 MFC: Style. 2002-07-17 14:13:53 +00:00
Ruslan Ermilov 1dfadcb55c MFC: 1.3: Garbage collect KLDMOD setting. 2002-07-17 14:10:26 +00:00
Ruslan Ermilov 6ffb3668e2 MFC: bsd.links.mk and diff reduction to -CURRENT. 2002-07-17 13:52:25 +00:00
Ruslan Ermilov bb083b0861 MFC: Fixed style of INSTALLFLAGS assignments. 2002-07-17 13:25:20 +00:00
Yoshihiro Takahashi 769ed4163b MFi386: revision 1.385.2.24. 2002-07-17 12:54:36 +00:00
Ruslan Ermilov 2586fcc3fc MFC: Create backup copies using install(1). 2002-07-17 12:34:17 +00:00
Ruslan Ermilov 644d3210fd MFC: Honour TOOLS_PREFIX. 2002-07-17 10:40:40 +00:00
Ruslan Ermilov 633ef477fc MFC: 1.241 (1-true-AWK has a build-tool target). 2002-07-17 10:37:28 +00:00
Tim J. Robbins 7c78559d2a MFC: Avoid checking whether each line is the last line of the file when we
don't need to know. Instead, check when we are trying to match a "$" address.
This does not change the way sed processes regular files, but makes it behave
more sensibly when used interactively.
+ style changes to sync with HEAD.

PR:		40101
2002-07-17 09:35:56 +00:00
Ruslan Ermilov f40f2866ed MFC: bsd.links.mk. 2002-07-17 07:13:05 +00:00
Kelly Yancey 332e536558 MFC revision 1.67: Fix incorrect cast. 2002-07-17 02:22:22 +00:00
Joerg Wunsch dfcf67535d MFC: revs 1.32 and 1.34 resp., make the industry-standard DLT density
codes known to mt(1).
2002-07-16 20:02:06 +00:00
Ruslan Ermilov 796cf9e3b0 MFC: Update the SUBDIR hacks to work with an updated bsd.subdir.mk. 2002-07-16 18:43:08 +00:00
Ruslan Ermilov e0dc1266b5 MFC: bsd.files.mk. 2002-07-16 18:36:20 +00:00
Ruslan Ermilov 82064108c9 Work around the namespace pollution (group variable) in bsd.files.mk
that will be merged in a minute.
2002-07-16 18:34:34 +00:00
Matthew Dillon 088d3798db MFC i386/i386/machdep.c 1.520 and rearrange the original -stable code a
bit to look more like -current.  Adds support for the 'machdep.cpu_idle_hlt'
sysctl on SMP machines.  The default is still 0 for SMP since -stable has the
same non-fatal run-queue race that current has (a 1-tick run latency if the
race is lost).  Setting the value to 1 will save power.

Tested: my Smart-UPS 1400 reports 81.2% utilization with cpu_idle_hlt
enabled and 81.9% with it disabled on one box, and 83.8% utilization with it
disabled on three boxes.
2002-07-16 17:58:22 +00:00
Tom Rhodes 240b159e39 MFC: Quick grammar fix to signal.3:
PR:			39395
Submitted by:		Rich Neswold <[email protected]>
Not Completed by:	keramida
2002-07-16 16:14:35 +00:00
Yoshihiro Takahashi 251a872d87 Merged from sys/isa/fd.c revisions 1.176.2.7 and 1.176.2.8. 2002-07-16 14:35:50 +00:00
Ruslan Ermilov 1f70bfa6c1 MFC: 1.14 (Do not override the `install' target.) 2002-07-16 14:25:26 +00:00
Ruslan Ermilov 1a18ddc2c1 MFC: Garbage collect bsd.docb.mk and bsd.sgml.mk. 2002-07-16 14:13:25 +00:00
Ruslan Ermilov 49354c11f8 Mega-MFC of share/mk fixes:
Removed the SUBDIR_CHANGE feature: bsd.subdir.mk 1.33.
Neither .depend nor ${DEPENDFILE} depend on _SUBDIR: bsd.obj.mk 1.38.
Finished removal of ${LDDESTDIR}: bsd.obj.mk 1.39, bsd.prog.mk 1.106.
Fixed all-man to propagate into SUBDIR: bsd.man.mk 1.43.
Don't spawn extra make(1) to execute _EXTRADEPEND: bsd.dep.mk 1.32.
Revert to the ordinary `:' operator for maninstall: bsd.man.mk 1.44.
Don't use ${INSTALLFLAGS} to install scripts and files: bsd.prog.mk 1.112.
Fixed _SUBDIR: bsd.obj.mk 1.41.

Merge bsd.obj.mk's version of the _SUBDIR target with bsd.subdir.mk:
bsd.dep.mk 1.34, bsd.doc.mk 1.51, bsd.info.mk 1.62, bsd.lib.mk 1.113,
bsd.man.mk 1.46, bsd.obj.mk 1.42, bsd.prog.mk 1.114, bsd.sgml.mk 1.31,
bsd.subdir.mk 1.35, sys/conf/kmod.mk 1.118, share/man/man4/Makefile 1.154,
share/man/man8/Makefile 1.28.

Abuse bsd.obj.mk for defining default distribute target: bsd.doc.mk 1.52,
bsd.info.mk 1.64, bsd.lib.mk 1.115, bsd.obj.mk 1.43, bsd.prog.mk 1.116.

Assorted bugfixes: bsd.prog.mk 1.117, bsd.lib.mk 1.116, bsd.prog.mk 1.118.

`all-man' and `maninstall' "recursiveness" fixes: bsd.lib.mk 1.117,
bsd.man.mk 1.47, bsd.prog.mk 1.119, bsd.subdir.mk 1.39.

Quiet ``make objlink'' when NOOBJ is defined: bsd.obj.mk 1.44.
Fixed typos: bsd.obj.mk 1.45.
Removed dependencies already in bsd.subdir.mk: bsd.doc.mk 1.153.

Moved checkdpadd target: bsd.dep.mk 1.36, bsd.obj.mk 1.46.
Removed the `afterdistribute' target: src/Makefile 1.251, bsd.subdir.mk 1.38.
Fixed bogus *install dependencies: bsd.subdir.mk 1.43.
`distribute' fixes: bsd.obj.mk 1.47, bsd.subdir.mk 1.44.
2002-07-16 14:05:31 +00:00
Dag-Erling Smørgrav 7bc437b766 Remove unbalanced parenthesis. 2002-07-16 08:49:56 +00:00
Tom Rhodes b722322149 In stable, drainwait still appears to be '0'
PR:	39611
2002-07-16 02:02:29 +00:00
Tom Rhodes 180ec55d00 MFC: ssh is the default, not rsh
PR:		37429
Forgotten by:	keramida
2002-07-16 01:42:18 +00:00
Tom Rhodes e7e717302b MFC: grammar fixes to the gif(4) manual page: 'the administrator'
PR:		39093
Submitted by:	Mike Makonnen <[email protected]>
2002-07-16 01:11:36 +00:00
Tim J. Robbins ec6570ae27 MFC: SUSv3 compatibility:
- Use exit status 2 if the file was not compressed because its size would
   not be reduced.
 - Write diagnostic messages to stderr instead of stdout.
 - A filename of "-" means that standard input is read and (de)compressed to
   standard output.
Revisions 1.17-1.19
2002-07-16 00:56:04 +00:00
Tim J. Robbins c50b59cfd4 MFC: Style changes 2002-07-16 00:52:08 +00:00
Tim J. Robbins f845468336 MFC: Remove CFLAGS+=-Wall 2002-07-16 00:45:05 +00:00
Tim J. Robbins 84118b4a67 MFC: Removed duplicate VCS ID tags, as per style(9). 2002-07-16 00:42:48 +00:00
Marc Fonvieille 7463ff9638 MFC: 1.8, 1.9
1.8: Driver supports CS4280 rather than CS428x.
	1.9: Grammar fix (PR docs/40210)

PR:		docs/40210 for 1.9
2002-07-15 22:15:18 +00:00
Dag-Erling Smørgrav ad1ab15643 MFC: install opieaccess, some further diff reduction. 2002-07-15 15:35:25 +00:00
Dag-Erling Smørgrav c24ffeaa86 Grrr, actually MFC moduli. 2002-07-15 15:13:33 +00:00
Dag-Erling Smørgrav cff46f0369 This file has been replaced by moduli. 2002-07-15 14:55:05 +00:00
Dag-Erling Smørgrav 09a0fd2c7f MFC: OPIE 2.4
Approved by:	markm
2002-07-15 14:48:48 +00:00
Dag-Erling Smørgrav f83d7042a4 MFC: OPIE 2.4
Approved by:	markm
2002-07-15 14:17:10 +00:00
Dag-Erling Smørgrav 7b7892c9f2 MFC: OPIE 2.4.
Approved by:	markm
2002-07-15 14:07:16 +00:00
Ralf S. Engelschall 2c8c4cd9bd MFC 1.26:
s/progname/procname/ to be consistent with the other occurrences
of the option -c argument in SYNOPSIS and DESCRIPTION.
2002-07-15 11:35:31 +00:00
Giorgos Keramidas d95143ef70 Sync with revision 1.5 from HEAD branch. 2002-07-15 08:21:25 +00:00
Giorgos Keramidas c479292e0d MFC: 1.10: The .Nm utility. 2002-07-15 08:18:03 +00:00
Giorgos Keramidas 47823d3ae0 MFC: 1.8: Note that this appeared at least as early as PWB UNIX. 2002-07-15 08:14:59 +00:00
Giorgos Keramidas a914c0fb94 MFC: 1.11,1.13: Note that uniq appeared as early as V3. 2002-07-15 08:11:33 +00:00
Giorgos Keramidas 58b7db9c06 MFC: 1.11 - 1.13: Tidy up markup, update history info and bump
document date for the addition of -p.
2002-07-15 08:06:35 +00:00
Giorgos Keramidas c7d3ae317d MFC: 1.10: Style nit: group together optional flags. 2002-07-15 08:02:19 +00:00
Maxim Konovalov f9ed6e2725 MFC rev. 1.11: fix a typo. 2002-07-15 07:59:53 +00:00
Giorgos Keramidas 89daf6f74f Reduce diffs with HEAD, by fixing sentence breaks. 2002-07-15 07:57:15 +00:00
Giorgos Keramidas 82b93f1cb8 MFC: 1.10: Note that this appeared at least as early as PWB UNIX. 2002-07-15 07:46:27 +00:00
Giorgos Keramidas b6ab1280e3 MFC: Synch with mdoc fixes of revision 1.23 in HEAD. 2002-07-15 07:37:49 +00:00
Giorgos Keramidas 81e53a70fd MFC: 1.19: Add DIAGNOSTICS section. 2002-07-15 07:29:05 +00:00
Giorgos Keramidas 8eb0068059 MFC: 1.14: Correct History: cal(1) appeared in V5, not V6. 2002-07-15 07:22:42 +00:00
Giorgos Keramidas dc25010335 MFC: Sync with CURRENT's revision 1.18. 2002-07-15 07:19:24 +00:00
Giorgos Keramidas c4c15d6b25 MFC: 1.14: mdoc pedantry for arguments and .Ar 2002-07-15 07:13:13 +00:00
Giorgos Keramidas 07ff5741ec Complete MFC of 1.9: Update C example snippet. 2002-07-15 07:10:07 +00:00
Giorgos Keramidas 1cbe338fc6 MFC: 1.13: Avoid starting sentence with lowercase name from .Nm 2002-07-15 06:59:21 +00:00
Giorgos Keramidas e0de049a3f MFC: 1.23: Use .Ar to markup an `limitflags' and fix indentation. 2002-07-15 06:53:59 +00:00
Giorgos Keramidas 425a0f35cd MFC: 1.12: Eliminate troff warnings. 2002-07-15 06:48:02 +00:00
Giorgos Keramidas 851945cca8 Complete MFC of 1.13: Use standard options introduction text
and `The .Nm utility'.
2002-07-15 06:45:36 +00:00
Giorgos Keramidas 5653f265b4 MFC: 1.5: Use standard options introduction text. 2002-07-15 06:39:20 +00:00
Giorgos Keramidas 8bb702e4e6 MFC: 1.11: mdoc pedantry.
1.12: Note that this appeared at least as early as PWB UNIX.
2002-07-15 06:33:12 +00:00
Giorgos Keramidas 5729c7ba22 Complete the MFC of rev: 1.13
s/exec/executable/ in Synopsis, and
	fix the Files section.
2002-07-15 06:25:27 +00:00
Tim J. Robbins 15584c518d MFC: The XCU issue 5 requirement of accepting the file operand intermingled
with options has been withdrawn in issue 6, to which nl(1) now conforms.
Style changes. nl.c revs. 1.3-1.6, nl.1 rev. 1.10.
2002-07-15 06:18:43 +00:00
Giorgos Keramidas 899c049301 MFC: 1.13: Use standard options introduction text.
1.14: Fix last hard sentence break.
2002-07-15 06:17:55 +00:00
Giorgos Keramidas ed5c02ac20 MFC: 1.15: a file argument of "-" causes stdin -> stdout compression
1.16: add a Standards section, and note P1003.1-2001 comformance
     1.17: mdoc fix
2002-07-15 04:41:52 +00:00
Giorgos Keramidas 5d2e8742ae MFC: 1.11: Note SUSv2 conformance.
1.12: Sort options in Description section.
2002-07-15 04:32:27 +00:00
Giorgos Keramidas 13b5076385 MFC: 1.9: Introduce options with well known sentence. 2002-07-15 04:29:39 +00:00
Giorgos Keramidas 31ec2688de Kill eol whitespace 2002-07-15 04:11:27 +00:00
Giorgos Keramidas 5e7c263236 MFC: 1.15: Add .Pp before enumerating options 2002-07-15 04:08:48 +00:00
Giorgos Keramidas 0361811fe1 MFC: 1.14: The .Nm utility. 2002-07-15 04:07:25 +00:00
Juli Mallett e7d59e3da1 MFC: OpenBSD-derived m4(1). 2002-07-15 02:06:15 +00:00
Garance A Drosehn 0d0e00416e MFC 1.31: Call the routine which frees everything obtained when filling
in 'struct printer', thus avoiding a small memory leak in lpc.
2002-07-15 00:01:44 +00:00
Garance A Drosehn b8ff51406b MFC 1.31: Fix set_qstate() so it correctly checks for errors from chmod(). 2002-07-14 23:58:52 +00:00
Garance A Drosehn db3d8728cb MFC *: Add a SQS_QCHANGED option to set_qstate().
[* = 1.30 common.c, 1.23 lp.h]
2002-07-14 23:56:40 +00:00
Garance A Drosehn f6f3450a5b MFC *: Add two variables to struct jobqueue, and change the way that getq()
calculates how much space to get for that struct, so it will get the
right amount when new variables are added.

[* = 1.29 common.c, 1.22 lp.h]
2002-07-14 23:52:12 +00:00
Garance A Drosehn 524be82e34 MFC *: Move prototypes for ctl_readcf and ctl_freeinf from ctlinfo.c to
ctlinfo.h, so the routines can be called by upcoming 'lpc topq/bottomq'.

[* = 1.6 ctlinfo.c, 1.2 ctlinfo.h]
2002-07-14 23:47:09 +00:00
Giorgos Keramidas de9b8f6cdc MFC: 1.17: Use `.Ar mode' for referring to the -m option argument. 2002-07-14 21:42:14 +00:00
Giorgos Keramidas 2ff7b2f394 Sync with CURRENT:
1.16: Markup nits.  Use .Ar to indicate pid and signal_name arguments.
1.15: Add examples and diagnostics sections.
1.14: Correct history.  V3 had a kill command.
1.12: mdoc police.  Use the new features of the Nm macro.
2002-07-14 21:41:26 +00:00
Giorgos Keramidas eee1d1571b MFC: 1.32: various mdoc fixes. 2002-07-14 21:40:34 +00:00
Giorgos Keramidas 356222102f MFC: 1.20: mdoc fixes. 2002-07-14 21:39:26 +00:00
Giorgos Keramidas c88db0b678 MFC: 1.29: Refer to chmod(2) and sticky(8) for sticky bit details. 2002-07-14 21:38:40 +00:00
Hajimu UMEMOTO 48a98e81c3 MFC 1.19: Don't explicit kill of the process' own pid. 2002-07-14 17:36:33 +00:00
Tim J. Robbins 337f1a976b MFC: Add Examples and History sections (revisions 1.10-1.12) 2002-07-14 15:16:53 +00:00
Tim J. Robbins 90f4c3cc05 MFC: SUSv3 exit status, remove line length limit, style changes.
Revisions 1.8-1.13.
2002-07-14 15:16:00 +00:00
cvs2svn 2e9ec0111b This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-07-14 15:12:01 +00:00
Maxim Sobolev a0a5a0dad3 MFC: GNU tar 1.13.25. 2002-07-14 13:19:48 +00:00
Maxim Sobolev 0ad249d7cc MFC: add some more commonly-used directories and files (rev.1.15 and rev.1.17). 2002-07-14 13:15:59 +00:00
Dag-Erling Smørgrav 1606ccf916 Don't terminate the string outside its allocated space, and look out for
truncation.
2002-07-14 13:12:04 +00:00
Søren Schmidt 64ea785090 Fix the hang on atprq problem.
Submitted by: Ian Dowse <[email protected]>
2002-07-14 12:35:28 +00:00
Luigi Rizzo d6c0e4b600 MFC: file not needed anymore. 2002-07-14 12:10:06 +00:00
Luigi Rizzo e1a33e2336 MFC: replace one instance of logverbose with log. 2002-07-14 12:08:48 +00:00
Jesper Skriver 04af6ed94e MFC rev 1.134
Extend the effect of the sysctl net.inet.tcp.icmp_may_rst
so that, if we recieve a ICMP "time to live exceeded in transit",
(type 11, code 0) for a TCP connection on SYN-SENT state, close
the connection.
2002-07-14 11:55:00 +00:00
Dag-Erling Smørgrav 1582395f0b MFC: use realhostname_sa(3). 2002-07-14 09:53:54 +00:00
Luigi Rizzo b4496ff7ee MFC 1.26: fix (cross) building of picobsd using -CURRENT sources. 2002-07-14 09:08:51 +00:00
Bruce A. Mah 3dd96312b5 MFC: s/links/links1/ and fix sorting.
Makefile.inc.docports	1.11->1.12
2002-07-13 17:51:40 +00:00
Bruce A. Mah bf5957fd3e New errata: /usr/share/examples has missing files; advise on a
partial workaround.
2002-07-13 17:37:13 +00:00
Mark Peek 88766ede49 MFC: Change help documentation for bootfile and module_path to reflect
the actual code. Both use a ";" (not a ",") to delimit entries.
2002-07-13 16:40:34 +00:00
Bruce A. Mah 35df281094 New release notes: pam_opie(8) no_fake_prompts.
MFC:  RLIMIT_VMEM, pam_opeiaccess(8), pam_radius(8), pam_ssh(8),
pam_tacplus(8), pam_unix(8), BIND 8.3.3, fix grammar nits.
2002-07-13 16:29:16 +00:00
Mark Peek 1ab33f8e20 MFC: v1.21 Synchronize path with dot.cshrc by adding /usr/local/sbin. 2002-07-13 16:29:10 +00:00
Bruce A. Mah 18041f3f95 New release notes/errata: SA-02:29, SA-02:30. 2002-07-13 16:02:08 +00:00
Darren Reed 9d6e763640 In -current, path_mtu_discovery is already global. Make it the same here. 2002-07-13 05:45:56 +00:00
Luigi Rizzo 56b18b7ac8 Restore check for ro_rt != NULL to prevent dereferencing a NULL pointer.
This has been in since 1.99.2.12 and was lost in 1.99.2.30
2002-07-12 22:14:12 +00:00
Bruce A. Mah 40e581795d MFC: finger(1) .pubkey, finger(1) -g.
Submitted by:	johan
2002-07-12 18:20:17 +00:00
Tom Rhodes c82eea9ff6 MFC: Other IBM drives support TQ.
PR:		39920
2002-07-12 16:11:47 +00:00
Dag-Erling Smørgrav 3ae2eac9fe Don't apply strtok() directly to the option string.
PR:		40463
Submitted by:	OISHI Masakuni <[email protected]>
2002-07-12 09:24:56 +00:00
Dag-Erling Smørgrav 225bbc38ae MFC: do not document the obsolete -v and -i options. 2002-07-12 09:12:49 +00:00
Alfred Perlstein 74064d0748 regen for osendfile. 2002-07-12 08:23:08 +00:00
Alfred Perlstein 75c4a1878e MFC: compat syscall for broken sendfile. 2002-07-12 08:22:46 +00:00
Tim J. Robbins bfa060ab71 MFC: Handle "--" and reject options for link(1), don't truncate destination
pathname when linking into a directory, style changes (revs. 1.23-1.28)
2002-07-12 07:34:38 +00:00
Tim J. Robbins 552976d192 MFC: Update Standards section (1.23), markup fix (1.22), "filesystem" (1.21) 2002-07-12 07:30:58 +00:00
Tim J. Robbins 66f7fe0bc7 MFC: Accept "--", reject options for unlink(1) for SUSv2, and style changes.
Revisions 1.34-1.35, 1.37-1.39, 1.41.
2002-07-12 07:25:48 +00:00
Tim J. Robbins 2010fec15b MFC: New implementation of who(1) with options required by POSIX.
who.c revs. 1.14-1.17, who.1 revs. 1.11-1.14.
2002-07-12 06:56:37 +00:00
Crist J. Clark 92a9d33730 In preventing races in making changes to the password file when the
locking mechanism was relaxed, it was assumed the '-a' option was only
being used to add new entries. The result was '-a' option could not be
used to overwrite an existing entry, but this is a legitimate use. Now
when doing an overwrite, check if the user exists and load the old
entry for later verification. If the user does not exist, there is no
reason to check later.

Note that I this is only fixed in 4-STABLE. When des overhauled the
passwd related commands and functions in 5-CURRENT (thanx!), the logic
of the file was changed and it doesn't have _this_ bug... but it may
have some others with respect to the '-a' option.

PR:		bin/39919
2002-07-12 05:33:34 +00:00
John Polstra 6beb55de6a MFC: Remove nanosleep calls which caused problems for OpenOffice.
This is a merge of the following revisions:

	src/libexec/rtld-elf/alpha/lockdflt.c	1.7
	src/libexec/rtld-elf/i386/lockdflt.c	1.8
2002-07-11 23:52:32 +00:00
Tom Rhodes c577339cff MFC minor spelling and grammar nits in the atacontrol manual page
PR:	39393
2002-07-11 18:38:19 +00:00
Bruce A. Mah f2965d526c MFC: em(4) update. 2002-07-11 17:43:10 +00:00
Bruce A. Mah 637fe16fbd MFC: em(4) updates, dump(8) -S. 2002-07-11 17:42:48 +00:00
Alfred Perlstein 24ff2a5122 MFC: 1.9 (fix return values for monitor service) 2002-07-11 17:41:28 +00:00
Alfred Perlstein 3c36c65426 MFC: bin/16726 (don't leak kvm filedescriptor) 2002-07-11 17:17:56 +00:00
Tim J. Robbins ebf7769062 MFC: Only advance column position on printable characters
fold.c rev. 1.11, fold.1 rev. 1.11
2002-07-11 01:01:44 +00:00
Tim J. Robbins 212afa835f MFC: Use locale collation order (LC_COLLATE), style/warns changes
(revisions 1.14-1.19)
2002-07-11 00:46:37 +00:00
Tim J. Robbins 44cf633b58 MFC: Add History section (rev. 1.9) 2002-07-11 00:43:37 +00:00
Maxim Konovalov 78616dddd3 MFC rev. 1.43 and 1.44: sort includes, remove EOL spaces. 2002-07-10 09:24:01 +00:00
Joerg Wunsch 225f32d2f8 MFC rev 1.13: a more correct rate between USD and EUR 2002-07-10 09:13:42 +00:00
SADA Kenji 335d670aff MFC: 1.28, 1.29: pw useradd' could be used with -w without -D option.
PR:		docs/39770
MFC after:	2 weeks
2002-07-10 08:41:09 +00:00
Josef Karthauser a4cb90da94 Fix a typo in a URL.
PR:	docs/37322
2002-07-10 00:03:43 +00:00
Johan Karlsson 45476447b6 MFC
's/rather then/rather than/'

  PR:           38096
  Submitted by: Chris Pepper <[email protected]>

  While I'm here correct some typos pointed out by ispell.
2002-07-09 21:02:21 +00:00
Robert Watson 0826505bf8 Add AGP to -STABLE LINT.
Submitted by:	Kevin Lo <[email protected]>
2002-07-09 18:04:52 +00:00
Josef Karthauser b3d654a271 Regen for SMC 2206USB/ETH EZ Connect adapter. 2002-07-09 16:51:36 +00:00
Josef Karthauser 85ef821111 MFC: Add support for the SMC 2206USB/ETH EZ Connect adapter (Pegasus II) 2002-07-09 16:50:55 +00:00
Robert Drehmel 51566c9268 Make the SVR4 emulation work again.
PR:		kern/39861
Submitted by:	Willem van Engen <[email protected]>
2002-07-09 14:12:43 +00:00
Sheldon Hearn 200c9f95df MFC rev 1.18: regen 2002-07-09 11:51:05 +00:00
Tim J. Robbins f1091a5ae3 MFC: expand.c revs. 1.12-1.13, expand.1 revs. 1.10-1.11:
Allow <blank>s to be used to separate tab stop positions with the -t
  argument, not just ASCII space characters and commas. Don't count
  non-printing characters when determining column position.
+ manual page cleanup, style changes.
2002-07-09 10:47:59 +00:00
Tim J. Robbins b6bf791ca7 MFC: Remove leaf node WARNS?=2 to reduce diffs to HEAD. 2002-07-09 10:42:30 +00:00
Tim J. Robbins 0ad0944e23 MFC: Revision 1.11:
Allow <blank>s to be used to separate tab stop positions with the -t
  argument, not just ASCII space characters and commas. Don't count
  non-printing characters when determining column position.
2002-07-09 10:36:17 +00:00
Tim J. Robbins 466e7ecd48 MFC: Addition of $FreeBSD$ to keep in sync with HEAD 2002-07-09 10:35:16 +00:00
Luigi Rizzo 539f5f9799 The purpose of this commit is to bring the net/ and netinet/ sources
more in sync with what is in -current, so that mainteinance and
bugfix of the two trees is not a nightmare.

	THERE IS NO FUNCTIONAL OR EXTERNAL API CHANGE IN THIS COMMIT

You should not need to recompile any userland code.

In (some) more detail, this commit does the following:

  * remove a number of static variables from the ip stack that were
    used to support DIVERT, IPFIREWALL_FORWARD and stateful rules/
    dynamic pipes. These are replaced with packet annotations, much
    in the same (ugly for someone, but it is extremely fast and easy
    to extend) way used for ages to support dummynet annotations.

    On passing, fix a bug in the handling of divert for fragmented packets.

  * as part of the removal of static variables, change the (internal)
    interface of ip_fw_chk() to use a single structure to hold arguments.
    Adapt clients of the above (ip_input, ip_output, bridge, ether_output,
    ether_demux) to use the new interface.

  * remove some unused variables.

  * remove some of the __P() macros from some of the files involved

Because of the NO FUNCTIONAL CHANGE you don't get the following features
which are in -current:

  * ipfw on layer-2 packets. All the hooks and the code are there,
    but the controlling variable

	net.link.ether.ipfw: 0

    is readonly because i am only 99% confident on how the old ipfw
    handles these frames. Just edit if_ethersubr.c to make the
    variable RW if you want this feature. I might commit this in
    due time if there is interest.

    these frames. Just edit if_ethersubr.c to make it RW if you want this
    feature. I might commit this in due time if there is interest.

  * ipfw2, the new, faster and more flexible firewall code.

    The code has hooks to make use of ipfw2, and I will make patches
    available to use it (it is basically 3 files, netinet/ip_fw2.[ch],
    sbin/ipfw/ipfw2.c, plus one-line changes in conf/options,
    conf/files and sbin/ipfw/Makefile, plus libalias patches).
2002-07-09 09:11:43 +00:00
SUZUKI Shinsuke bb71e47610 MFC: fixed typo (rev 1.13) 2002-07-09 04:05:20 +00:00
Luigi Rizzo 2dbdf8c5c1 backout previous change, it was not completely correct and
replaced the old bug for a new one.

All what is probably needed to make it correct is a two-line
change in fxp_tick

	    sc->cbl_first = txp;
    +       if (sc->tx_queued == 0)
    +               ifp->if_timer = 0;

as suggested by Mike "Silby" Silbersack, but let's make sure
first that we get it right.
2002-07-09 00:37:42 +00:00
Luigi Rizzo b418fc45b7 MFC 1.27: fix timeout handling logic 2002-07-08 22:30:17 +00:00
Luigi Rizzo 923e20bb7c MFC 1.71: fix timeout handling logic 2002-07-08 21:59:40 +00:00
Luigi Rizzo 6f13dc731a MFC 1.74: fix timeout logic
Yet another RELENG_4_6 candidate (same problem as other net drivers)
2002-07-08 21:57:05 +00:00
Luigi Rizzo c68f59fe5b MFC 1.51: fix timeout handling logic.
This too would be a good RELENG_4_6 candidate.
2002-07-08 21:40:34 +00:00
Tom Rhodes 5acbaaeaf7 MFC: Grammar nits in the locate(1) manual page
PR:	40024
2002-07-08 21:31:28 +00:00
Tom Rhodes ce3d979327 MFC: Typo s/und/and/ 2002-07-08 21:17:44 +00:00
Luigi Rizzo af4db9e6ef MFC 1.131: fix timer logic to make sure that a timeout is always
pending if there are packets queued.
This is a potential candidate for RELENG_4_6
2002-07-08 21:04:46 +00:00
Daniel Harris b934713b98 MFC: s/unavilable/unavailable/ 2002-07-08 13:07:42 +00:00
Robert Drehmel 02dcd7df67 MFC 1.16: Enable interrupts only after the mixer has been initialized. 2002-07-08 11:53:27 +00:00
Robert Drehmel c70f2b8b3b MFC: Fix size of allocation. 2002-07-08 10:58:33 +00:00
Tim J. Robbins 79d5d70c1f MFC: 1.11 and 1.10:
If processing of one file fails, try to process the remaining files and
  exit non-zero instead of immediately exiting (SUSv3).

  remove __P
2002-07-08 07:19:24 +00:00
Tim J. Robbins 2270af8f3e MFC: SUSv3 -m, -p and -x options. SUSv3-style handling of COLUMNS env.
variable. Style and warns changes.
2002-07-08 06:59:27 +00:00
Warner Losh e66140568c MFC: A boatload of changes to power stuff
o On boot, don't enable the power on the slot bogusly.  This caused many
  systems to hang, some with Bad Vcc messages, on boot.
o enable both vcc and vpp as '-1' so that they can both have 5.0 or 3.3
  volts applied.
o Use CardBus power now that I've discovered why it didn't work before
  (we were combining card reset with power, so I had to do the cardreset part
  by hand).
o Add a workaround to try to unwedge things that get into the BadVcc state,
  needed for some BIOSes, and previosuly boggy freebsd code (likely never hit
  on the majority of laptops).
o Add support for X.X and Y.Y volt cards, although no 16-bit versions of these
  cards are expected (why not, I'm here :-).
o Add Ricoh 3.3V support for ISA Ricoh chipsets.
o better boot verbose messages about power!
o minor tweaks to the ToPIC support.
o Added pcic_ignore_pci for some pathological cases that are in the wild that
  some folks want to use.
o change memory default from bogus 0x44000000 to less bogus 0x84000000.
o Add better comments to the code in general.
o Fix some comments in i82365, add some constants to pcic_pci.h
o a number of gratuitous(?) changes from suser_td -> suser().  These are
  cosmetic only.

(I'd love to see this in 4.6.1, but that's likely not an option)
2002-07-07 18:52:29 +00:00
Mark Peek 30611a5e6f MFC: v1.24 Paraphrase a quote to remove year specific references. 2002-07-07 16:17:43 +00:00
Jens Schweikhardt 4f0d5731de MFC: fix assorted typos and grammar bogons. No content changes. 2002-07-07 14:32:16 +00:00
Robert Drehmel dc3490b876 MFC: Return zero instead of the format.
This prevented the AD1816 driver from working.

PR:		kern/40043
Submitted by:	Christian Mueller <[email protected]>
2002-07-07 11:49:03 +00:00
Robert Drehmel ecae0546d3 Fix builds with LIBC_SCCS defined.
PR:	bin/40202
2002-07-07 11:34:42 +00:00
Hellmuth Michaelis 3394c4cea5 conditionalize _IF_QFULL since its now defined in /usr/src/sys/net/if_var.h. 2002-07-07 10:17:10 +00:00
Yoshihiro Takahashi ef99cb34f9 MFi386: revision 1.132.2.16 2002-07-07 10:08:20 +00:00
Dag-Erling Smørgrav 02e3c43b23 Don't use pam_opieaccess, it doesn't seem to work properly in -STABLE. 2002-07-07 10:02:03 +00:00
Doug Barton 8002ec65e5 MFC of version 8.3.3 import 2002-07-07 08:19:19 +00:00
Doug Barton 289348adea Prep for 8.3.3 MFC by adding rfc2317-notes.txt to the build.
Also, reduce diffs to -current including whitespace, and
bogus setting of DOCDIR.
2002-07-07 08:17:07 +00:00
Tim J. Robbins 5f57307856 MFC: Revision 1.24; don't allow the hold space to become null. 2002-07-07 06:44:34 +00:00
Bruce A. Mah bc23b345b5 MFC: OpenSSH 3.4p1, tcpdump-3.7.1, libpcap-0.7.1. 2002-07-06 19:44:41 +00:00
Dag-Erling Smørgrav 265bebf9de Unbreak (use struct options). 2002-07-06 14:14:06 +00:00
Dag-Erling Smørgrav 7a80ed4361 Use NULL rather than an empty struct opttab. 2002-07-06 14:11:26 +00:00
Dag-Erling Smørgrav 640918e8b0 Adjust CFLAGS to pick up config.h from src/lib/libopie. 2002-07-06 13:26:59 +00:00
Dag-Erling Smørgrav 80e8491772 MFC: move config.h out of contrib and disable user locking. 2002-07-06 12:11:03 +00:00
John Polstra 1ed3ad4009 MFC 1.17: Don't claim to support checksum offloading for IP fragments,
because it doesn't seem to work for UDP packets.
2002-07-06 00:15:21 +00:00
Matthew Dillon 8b22f6dc66 MFC 1.44 - fix for quota related panic.
Suggested by:	Andre Albsmeier <[email protected]>
Reviewed by:	mckusick
2002-07-05 22:42:31 +00:00
Darren Reed 49588b7ed1 Do not allow ktrace(2) to attach, as non-root, to programs that were running
as root but are now running as another user.

Obtained from:	OpenBSD
2002-07-05 22:36:38 +00:00
Brian Somers ee469172e3 MFC: Mention that we're checking kernel log messages, even if there's
no output.
2002-07-05 19:48:05 +00:00
Scott Long c20ad688cb MFC: fix funky-mixer-settings-on-bootup problem 2002-07-05 16:28:55 +00:00
Bill Fenner 8ca3ddb8dc MFC: libpcap-0.7.1 2002-07-05 14:40:00 +00:00
Bill Fenner 59971fec63 MFC rev 1.6: bounds checking fix in TTEST2(). 2002-07-05 13:24:57 +00:00
Dag-Erling Smørgrav ad831d544c Mention OpenSSH 3.4p1 and the switch to protovol version 2. 2002-07-05 12:48:52 +00:00
Bill Fenner de4b832e80 MFC: tcpdump 3.7.1 2002-07-05 11:30:32 +00:00
Dag-Erling Smørgrav 4736edcbe3 MFC: install ssh-keysign in /usr/libexec, move setuid bit from ssh(1) to
ssh-keysign(8).
2002-07-05 11:11:02 +00:00
Bill Fenner 3e9b06ba6d MFC: tcpdump 3.7.1 2002-07-05 11:08:51 +00:00
Bill Fenner d9e9925880 MFC: tcpdump 3.7.1 2002-07-05 10:55:42 +00:00
Bill Fenner c1c40e6370 MFC: tcpdump 3.7.1 2002-07-05 10:45:34 +00:00
cvs2svn c1e5098c6a This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2002-07-05 08:39:10 +00:00
Ruslan Ermilov 270c0eb0ce Fix a typo. 2002-07-05 07:56:25 +00:00
Ruslan Ermilov 174ef11047 MFC: 1.131, 1.133, 1.134 (ssh-keygen(8) now requires -t). 2002-07-05 07:48:02 +00:00
Dag-Erling Smørgrav 3ea56be9b2 UsePrivilegeSeparation defaults to no.
Submitted by:	Peter Avalos <[email protected]>
2002-07-04 19:07:11 +00:00
Sheldon Hearn 9cc64d62f1 MFC rev 1.1.1.3: fix mutli-line code loading 2002-07-04 14:26:53 +00:00
Brian S. Dean 0d63067a5a MFC Rev 1.19: Create sendmail required directories if sendmail is
enabled.

PR:	misc/39350
2002-07-04 13:22:35 +00:00
Dag-Erling Smørgrav 272ca57822 Remove debugging code that was accidentally committed. 2002-07-04 13:05:34 +00:00
Maxim Sobolev 8bbd88f7a4 MFC: don't try to decode old-style options if argv[1] begins with `-' and is
an option taking an argument (rev.1.55).
2002-07-04 08:30:37 +00:00
Dag-Erling Smørgrav 7720af6a8c Unbreak .PATH (need to include bsd.lib.mk, which includes ../Makefile.inc,
which defined $PAMDIR, before setting .PATH)
2002-07-03 23:04:11 +00:00
Dag-Erling Smørgrav 0f4a34026d More diff reduction. 2002-07-03 22:20:33 +00:00
Dag-Erling Smørgrav d0e0f2a284 Update Makefiles for OpenSSH 3.4p1. Remove some hacks made superfluous
by an earlier commit to src/Makefile.inc1.  Reduce diffs against -CURRENT.

Sponsored by:	DARPA, NAI Labs
2002-07-03 22:13:26 +00:00
Dag-Erling Smørgrav f17ea500f8 Synch up to OpenSSH 3.4p1 - very nearly the same sources as in -CURRENT,
with a slightly different config.h to account for differences between
-CURRENT and -STABLE.

Privilege separation defaults to off for now as it breaks some aspects
of Kerberos authentication.

Sponsored by:	DARPA, NAI Labs
2002-07-03 22:12:16 +00:00
Dag-Erling Smørgrav 3221318663 Make OpenSSH more useful. Enable OPIE wherever S/Key is enabled. Add
examples of pam_krb5 usage.
2002-07-03 22:11:26 +00:00
Dag-Erling Smørgrav f4c0272f9d Factor out some common portions of the module Makefiles. 2002-07-03 21:47:36 +00:00
Dag-Erling Smørgrav d657c1d143 [forced commit due to CVS bug]
Bring in bits of OpenPAM and some of Mark's additions to Linux-PAM to
support the updated modules.

Sponsored by:	DARPA, NAI Labs
2002-07-03 21:45:44 +00:00
Dag-Erling Smørgrav 51870dccc1 Bring -STABLE's libpam to a somewhat more functional state in preparation
for the OpenSSH upgrade:

 - update pam_opie(8) to not emit fake challenges when the no_fake_prompts
   option was specified, and add a man page.

 - add pam_opieaccess(8) and a man page.

 - synch pam_radius(8), pam_ssh(8) and pam_tacplus(8) with -CURRENT.

 - sync pam_unix(8) with its state in -CURRENT prior to the OpenPAM import.

 - bring in bits of OpenPAM and some of Mark's additions to Linux-PAM to
   support the updated modules.

Sponsored by:   DARPA, NAI Labs
2002-07-03 21:41:31 +00:00
Dag-Erling Smørgrav a1831593d3 Bring -STABLE's libpam to a somewhat more functional state in preparation
for the OpenSSH upgrade:

 - update pam_opie(8) to not emit fake challenges when the no_fake_prompts
   option was specified, and add a man page.

 - add pam_opieaccess(8) and a man page.

 - synch pam_radius(8), pam_ssh(8) and pam_tacplus(8) with -CURRENT.

 - sync pam_unix(8) with its state in -CURRENT prior to the OpenPAM import.

 - bring in bits of OpenPAM and some of Mark's additions to Linux-PAM to
   support the updated modules.

Sponsored by:	DARPA, NAI Labs
2002-07-03 21:35:18 +00:00
John Baldwin 8a47d763a5 MFC: Switch to using 'links' as the text browser package instead of
'lynx'.
2002-07-03 21:19:29 +00:00
Archie Cobbs defaaa0b9b MFC: Update my email address. 2002-07-03 20:51:06 +00:00
Doug Ambrisko 62d7a685fe Fix syntax error noted by mp:
Wlarglist-size-<N> -> Warglist-size-<N>
Make Warglist-size-<N> & Wframe-size-<N> work by only matching to the '<'
in the option.

Okayed by:	mp, obrien (partially)
2002-07-03 17:56:20 +00:00
Dag-Erling Smørgrav a9dc8e21ec Back out previous commit, rev 1.3.2.5 of bsd.sys.mk takes care of it. 2002-07-03 17:00:13 +00:00
Dag-Erling Smørgrav 3005967e0e MFC: make __FBSDID equivalent to __RCSID for bootstrapping purposes.
PR:		bin/36747
Requested by:	ru
2002-07-03 16:59:14 +00:00
Joerg Wunsch 96358fc6af MFC rev 1.75 which accidentally got left out when committing rev 1.59.2.11 2002-07-03 15:44:41 +00:00
Dag-Erling Smørgrav 6a8f6c1df4 Lift openpam_{borrow,restore}_cred.c from OpenPAM. 2002-07-03 15:35:45 +00:00
Dag-Erling Smørgrav a60572f6a5 Apply band-aid to unbreak upgrades from old RELENG_4 systems. 2002-07-03 15:20:37 +00:00
Jonathan Lemon 46c6266b40 Protect the knote() call with splhigh. This routine can apparently
be called both in process and interrupt context, but the kevent code
assumes the caller handles the locking in the event generation case.
In -current, this is protected by asserting we hold the proc lock.

Testing by: Don Bowman <[email protected]>
2002-07-03 14:43:27 +00:00
Makoto Matsushita a98269f0eb MFC 1.687: Set PATH statically, and use 'env -i' to kick chroot(8).
I hope it causes zero problem; but if you find any, please email me.
2002-07-03 14:41:14 +00:00
cvs2svn 75cc813f6c This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2001-09-28 17:50:18 +00:00
cvs2svn 69a4e11c89 This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2000-10-21 01:42:53 +00:00
cvs2svn 40dfd7de5c This commit was manufactured by cvs2svn to create branch 'RELENG_4_7'. 2000-09-30 02:49:38 +00:00
3856 changed files with 297184 additions and 256576 deletions

No files matched your search

+42 -13
View File
@@ -30,9 +30,7 @@
# tree. This makefile executes a child make process, forcing it to use
# the mk files from the source tree which are supposed to DTRT.
#
# The user-driven targets (as listed above) are implemented in Makefile.inc0
# and the private targets are in Makefile.inc1. These are kept separate
# to help the bootstrap build from aout to elf format.
# The user-driven targets (as listed above) are implemented in Makefile.inc1.
#
# If you want to build your system from source be sure that /usr/obj has
# at least 400MB of diskspace available.
@@ -65,6 +63,11 @@
# release of 4.0. You have exactly one major release to move entirely
# to elf.
#
# If TARGET_ARCH=arch (e.g. alpha) is specified you can
# cross build world for other architectures using the buildworld target,
# and once the world is built you can cross build a kernel using the
# buildkernel target.
#
# ----------------------------------------------------------------------------
#
# Upgrading an i386 system from a.out to elf format
@@ -93,11 +96,19 @@
# Define the user-driven targets. These are listed here in alphabetical
# order, but that's not important.
#
TGTS= afterdistribute all all-man buildkernel buildworld checkdpadd clean \
cleandepend cleandir depend distribute everything hierarchy includes \
install installcheck installkernel installmost installworld kernel \
libraries lint maninstall mk most obj objlink regress \
reinstallkernel rerelease tags update
TGTS= all all-man buildkernel buildworld checkdpadd clean \
cleandepend cleandir depend distribute distributeworld everything \
hierarchy install installcheck installkernel \
reinstallkernel installmost installworld libraries lint maninstall \
mk most obj objlink regress rerelease tags update
BITGTS= files includes
BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
.ORDER: buildworld installworld
.ORDER: buildworld distributeworld
.ORDER: buildkernel installkernel
.ORDER: buildkernel reinstallkernel
PATH= /sbin:/bin:/usr/sbin:/usr/bin
MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1
@@ -105,7 +116,7 @@ MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1
#
# Handle the user-driven targets, using the source relative mk files.
#
${TGTS}: upgrade_checks
${TGTS} ${BITGTS}: upgrade_checks
@cd ${.CURDIR}; \
${MAKE} ${.TARGET}
@@ -144,6 +155,13 @@ world: upgrade_checks
@printf ">>> ${OBJFORMAT} make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n"
@echo "--------------------------------------------------------------"
#
# kernel
#
# Short hand for `make buildkernel installkernel'
#
kernel: buildkernel installkernel
#
# Perform a few tests to determine if the installed tools are adequate
# for building the world. These are for older systems (prior to 2.2.5).
@@ -154,15 +172,26 @@ world: upgrade_checks
#
upgrade_checks:
@cd ${.CURDIR}; \
if ! make -m ${.CURDIR}/share/mk test > /dev/null 2>&1; then \
make make; \
fi
if ! make -m ${.CURDIR}/share/mk -Dnotdef test >/dev/null 2>&1; then \
make make; \
fi
@cd ${.CURDIR}; \
if make -V .CURDIR:C/.// 2>&1 >/dev/null | \
grep -q "Unknown modifier 'C'"; then \
make make; \
fi
#
# A simple test target used as part of the test to see if make supports
# the -m argument.
# the -m argument. Also test that make will only evaluate a conditional
# as far as is necessary to determine its value.
#
test:
.if defined(notdef)
.undef notdef
.if defined(notdef) && ${notdef:U}
.endif
.endif
#
# Upgrade the installed make to the current version using the installed
+164 -217
View File
@@ -76,6 +76,9 @@ SUBDIR+= libexec
.if exists(${.CURDIR}/sbin)
SUBDIR+= sbin
.endif
.if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
SUBDIR+= secure
.endif
.if exists(${.CURDIR}/share) && !defined(NOSHARE)
SUBDIR+= share
.endif
@@ -88,9 +91,6 @@ SUBDIR+= usr.bin
.if exists(${.CURDIR}/usr.sbin)
SUBDIR+= usr.sbin
.endif
.if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
SUBDIR+= secure
.endif
# etc must be last for "distribute" to work
.if exists(${.CURDIR}/etc)
@@ -107,6 +107,10 @@ SUBDIR+= ${_DIR}
.endfor
.endif
.if defined(SUBDIR_OVERRIDE)
SUBDIR= ${SUBDIR_OVERRIDE}
.endif
.if defined(NOCLEANDIR)
CLEANDIR= clean cleandepend
.else
@@ -121,17 +125,21 @@ SUPFLAGS+= -h ${SUPHOST}
MAKEOBJDIRPREFIX?= /usr/obj
TARGET_ARCH?= ${MACHINE_ARCH}
.if ${TARGET_ARCH} == ${MACHINE_ARCH}
TARGET?= ${MACHINE}
.else
TARGET?= ${TARGET_ARCH}
.endif
.if make(buildworld)
BUILD_ARCH!= sysctl -n hw.machine_arch
.if ${MACHINE_ARCH} != ${BUILD_ARCH}
.error To cross-build, set TARGET_ARCH.
.endif
.endif
.if ${MACHINE_ARCH} == ${TARGET_ARCH}
.if ${MACHINE} == ${TARGET}
OBJTREE= ${MAKEOBJDIRPREFIX}
.else
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET_ARCH}
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
.endif
WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
# /usr/games added for fortune which depend on strfile
@@ -179,7 +187,8 @@ BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
DESTDIR= \
INSTALL="sh ${.CURDIR}/tools/install.sh"
BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
-DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED
-DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
-DNO_WERROR
# build-tool stage
TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
@@ -225,8 +234,8 @@ USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
usr/share/groff_font/devutf8 \
usr/share/tmac/mdoc usr/share/tmac/mm
INCDIRS= arpa g++/std isc objc protocols readline rpc rpcsvc openssl \
security ss
INCDIRS= arpa dev fs g++/std isc isofs libmilter objc openssl \
protocols readline rpc rpcsvc security ufs
#
# buildworld
@@ -234,13 +243,17 @@ INCDIRS= arpa g++/std isc objc protocols readline rpc rpcsvc openssl \
# Attempt to rebuild the entire system, with reasonable chance of
# success, regardless of how old your existing system is.
#
buildworld:
_worldtmp:
@echo
@echo "--------------------------------------------------------------"
@echo ">>> Rebuilding the temporary build tree"
@echo "--------------------------------------------------------------"
.if !defined(NOCLEAN)
rm -rf ${WORLDTMP}
.else
# XXX - These two can depend on any header file.
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
.endif
.for _dir in ${USRDIRS}
mkdir -p ${WORLDTMP}/${_dir}
@@ -249,11 +262,13 @@ buildworld:
mkdir -p ${WORLDTMP}/usr/include/${_dir}
.endfor
ln -sf ${.CURDIR}/sys ${WORLDTMP}
_bootstrap-tools:
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 1: bootstrap tools"
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${BMAKE} bootstrap-tools
_cleanobj:
.if !defined(NOCLEAN)
@echo
@echo "--------------------------------------------------------------"
@@ -261,47 +276,62 @@ buildworld:
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
.endif
_obj:
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2: rebuilding the object tree"
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} par-obj
_build-tools:
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2: build tools"
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${TMAKE} build-tools
_cross-tools:
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 3: cross tools"
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${XMAKE} cross-tools
_includes:
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} SHARED=copies includes
cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
_libraries:
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 4: building libraries"
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
_depend:
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 4: make dependencies"
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} par-depend
everything:
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 4: building everything.."
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} all
everything:
@echo "--------------------------------------------------------------"
@echo ">>> Building everything.."
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} all
WMAKE_TGTS=
.if !defined(SUBDIR_OVERRIDE)
WMAKE_TGTS+= _worldtmp _bootstrap-tools
.endif
WMAKE_TGTS+= _cleanobj _obj _build-tools
.if !defined(SUBDIR_OVERRIDE)
WMAKE_TGTS+= _cross-tools
.endif
WMAKE_TGTS+= _includes _libraries _depend everything
buildworld: ${WMAKE_TGTS}
.ORDER: ${WMAKE_TGTS}
#
# installcheck
@@ -320,19 +350,23 @@ installcheck:
fi
.endif
#
# distributeworld
#
# Distributes everything compiled by a `buildworld'.
#
# installworld
#
# Installs everything compiled by a 'buildworld'.
#
installworld: installcheck
distributeworld installworld: installcheck
mkdir -p ${INSTALLTMP}
for prog in [ awk cat chflags chmod chown date echo egrep find grep \
ln make makewhatis mtree mv perl rm sed sh sysctl \
ln make makewhatis mtree mv perl pwd_mkdb rm sed sh sysctl \
test true uname wc zic; do \
cp `which $$prog` ${INSTALLTMP}; \
done
cd ${.CURDIR}; ${IMAKE} reinstall
cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
rm -rf ${INSTALLTMP}
#
@@ -352,7 +386,7 @@ reinstall:
@echo ">>> Installing everything.."
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
.if !defined(NOMAN)
.if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
@echo
@echo "--------------------------------------------------------------"
@echo ">>> Rebuilding man page indices"
@@ -360,14 +394,11 @@ reinstall:
cd ${.CURDIR}/share/man; ${MAKE} makedb
.endif
#
# distribworld
#
# Front-end to distribute to make sure the search path contains
# the object directory. Needed for miniperl.
#
distribworld:
cd ${.CURDIR}; PATH=${TMPPATH} ${MAKE} -f Makefile.inc1 distribute
redistribute:
@echo "--------------------------------------------------------------"
@echo ">>> Distributing everything.."
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
#
# buildkernel and installkernel
@@ -391,13 +422,6 @@ KERNCONF?= GENERIC
.endif
INSTKERNNAME?= kernel
# The only exotic TARGET_ARCH/TARGET combination valid at this
# time is i386/pc98. In all other cases set TARGET equal to
# TARGET_ARCH.
.if ${TARGET_ARCH} != "i386" || ${TARGET} != "pc98"
TARGET= ${TARGET_ARCH}
.endif
KRNLSRCDIR= ${.CURDIR}/sys
KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
@@ -442,17 +466,16 @@ buildkernel:
config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} ${_kernel}
.endif
.if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
.if defined(MODULES_WITH_WORLD) || defined(NO_MODULES) || !exists(${KRNLSRCDIR}/modules)
cd ${KRNLOBJDIR}/${_kernel}; \
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} clean
.else
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
cd ${KRNLOBJDIR}/${_kernel}; \
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} clean cleandir
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
.endif
.endif
cd ${KRNLOBJDIR}/${_kernel}; \
MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
.if !defined(NO_KERNELDEPEND)
cd ${KRNLOBJDIR}/${_kernel}; \
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
@@ -469,19 +492,9 @@ buildkernel:
#
# Install the kernel defined by INSTALLKERNEL
#
installkernel:
installkernel reinstallkernel:
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} install
reinstallkernel:
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} reinstall
#
# kernel
#
# Short hand for `make buildkernel installkernel'
#
kernel: buildkernel installkernel
${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
#
# update
@@ -526,14 +539,9 @@ most:
@echo "--------------------------------------------------------------"
@echo ">>> Building programs only"
@echo "--------------------------------------------------------------"
cd ${.CURDIR}/bin; ${MAKE} all
cd ${.CURDIR}/sbin; ${MAKE} all
cd ${.CURDIR}/libexec; ${MAKE} all
cd ${.CURDIR}/usr.bin; ${MAKE} all
cd ${.CURDIR}/usr.sbin; ${MAKE} all
cd ${.CURDIR}/gnu/libexec; ${MAKE} all
cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
.for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
.endfor
#
# installmost
@@ -545,14 +553,9 @@ installmost:
@echo "--------------------------------------------------------------"
@echo ">>> Installing programs only"
@echo "--------------------------------------------------------------"
cd ${.CURDIR}/bin; ${MAKE} install
cd ${.CURDIR}/sbin; ${MAKE} install
cd ${.CURDIR}/libexec; ${MAKE} install
cd ${.CURDIR}/usr.bin; ${MAKE} install
cd ${.CURDIR}/usr.sbin; ${MAKE} install
cd ${.CURDIR}/gnu/libexec; ${MAKE} install
cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
.for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
.endfor
#
# ------------------------------------------------------------------------
@@ -573,14 +576,16 @@ _strfile= games/fortune/strfile
.endif
bootstrap-tools:
.for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef usr.bin/xinstall \
.for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
usr.bin/uudecode usr.bin/xinstall \
usr.sbin/config \
gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
cd ${.CURDIR}/${_tool}; \
${MAKE} obj; \
${MAKE} depend; \
${MAKE} all; \
${MAKE} DESTDIR=${MAKEOBJDIRPREFIX} install
${ECHODIR} "===> ${_tool}"; \
cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ depend; \
${MAKE} DIRPRFX=${_tool}/ all; \
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
.endfor
#
@@ -609,13 +614,20 @@ _libroken4= kerberosIV/lib/libroken
.if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
!defined(NOCRYPT) && defined(MAKE_KERBEROS5)
_libkrb5= kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
_libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
.endif
.if defined(RELEASEDIR)
_sysinstall= release/sysinstall
.endif
build-tools:
.for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
${_perl} ${_libroken4} ${_libkrb5} lib/libncurses ${_share} usr.bin/file
cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
${_perl} ${_libroken4} ${_libkrb5} lib/libncurses ${_share} \
usr.bin/awk usr.bin/file ${_sysinstall}
${ECHODIR} "===> ${_tool}"; \
cd ${.CURDIR}/${_tool}; ${MAKE} DIRPRFX=${_tool}/ build-tools
.endfor
#
@@ -630,13 +642,15 @@ _btxld= usr.sbin/btxld
.endif
cross-tools:
.for _tool in ${_btxld} ${_elf2exe} usr.bin/genassym \
usr.bin/gensetdefs gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc
cd ${.CURDIR}/${_tool}; \
${MAKE} obj; \
${MAKE} depend; \
${MAKE} all; \
${MAKE} DESTDIR=${MAKEOBJDIRPREFIX} install
.for _tool in ${_btxld} ${_elf2exe} usr.bin/genassym usr.bin/gensetdefs \
gnu/usr.bin/binutils usr.bin/objformat usr.sbin/crunch/crunchide \
gnu/usr.bin/cc
${ECHODIR} "===> ${_tool}"; \
cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ depend; \
${MAKE} DIRPRFX=${_tool}/ all; \
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
.endfor
#
@@ -645,163 +659,96 @@ cross-tools:
hierarchy:
cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
#
# includes - possibly generate and install the include files.
#
includes:
cd ${.CURDIR}/include; ${MAKE} -B all install
cd ${.CURDIR}/gnu/include; ${MAKE} install
cd ${.CURDIR}/gnu/lib/libmp; ${MAKE} beforeinstall
cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
cd ${.CURDIR}/gnu/lib/libreadline/readline; ${MAKE} beforeinstall
cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall
cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall
.if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
.if exists(${.CURDIR}/secure/lib/libcrypto)
cd ${.CURDIR}/secure/lib/libcrypto; ${MAKE} beforeinstall
.endif
.if exists(${.CURDIR}/secure/lib/libssl)
cd ${.CURDIR}/secure/lib/libssl; ${MAKE} beforeinstall
.endif
.endif
.if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \
defined(MAKE_KERBEROS4)
cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
.elif exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
cd ${.CURDIR}/secure/lib/libtelnet; ${MAKE} beforeinstall
.else
cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
.endif
.if exists(${.CURDIR}/kerberos5) && !defined(NOCRYPT) && \
defined(MAKE_KERBEROS5)
cd ${.CURDIR}/kerberos5/lib/libasn1; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberos5/lib/libhdb; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberos5/lib/libkadm5clnt; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberos5/lib/libkadm5srv; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberos5/lib/libkafs5; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberos5/lib/libkrb5; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberos5/lib/libsl; ${MAKE} beforeinstall
.endif
.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall
.endif
cd ${.CURDIR}/gnu/lib/csu; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libfetch; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libkvm; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libncp; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libusbhid; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
#
# libraries - build all libraries, and install them under ${DESTDIR}.
#
# The following dependencies exist between the libraries:
# The list of libraries with dependents (${_prebuild_libs}) and their
# interdependencies (__L) are built automatically by the
# ${.CURDIR}/tools/make_libdeps.sh script.
#
# lib*: csu libgcc_pic
# libatm: libmd
# libcrypt: libmd
# libdialog: libncurses
# libedit: libncurses
# libg++: msun
# libkrb: libcrypt
# libopie: libmd
# libpam: libcom_err libcrypt libcrypto libkrb libopie libradius \
# libskey libtacplus libutil libz libssh
# libradius: libmd
# libreadline: libncurses
# libskey: libcrypt libmd
# libssh: libcrypto libz
# libstc++: msun
# libtacplus: libmd
libraries:
cd ${.CURDIR}; \
${MAKE} -f Makefile.inc1 _startup_libs; \
${MAKE} -f Makefile.inc1 _prebuild_libs; \
${MAKE} -f Makefile.inc1 _generic_libs;
# These dependencies are not automatically generated:
#
# Across directories this comes down to (rougly):
# gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
# shared libraries for ELF.
#
# gnu/lib: lib/msun lib/libncurses
# kerberosIV/lib kerberos5/lib: lib/libcrypt
# lib/libpam: secure/lib/libcrypto kerberosIV/lib/libkrb \
# secure/lib/libssh lib/libz
# secure/lib: secure/lib/libcrypto lib/libmd lib/libz
#
.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc)
_csu= lib/csu/${MACHINE_ARCH}.pcc
.elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf"
_csu= lib/csu/i386-elf
_startup_libs= gnu/lib/csu gnu/lib/libgcc
.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-${OBJFORMAT})
_startup_libs+= lib/csu/${MACHINE_ARCH}-${OBJFORMAT}
.else
_csu= lib/csu/${MACHINE_ARCH}
_startup_libs+= lib/csu/${MACHINE_ARCH}
.endif
.if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
_secure_lib= secure/lib
.if exists(${.CURDIR}/secure/lib/libcrypto)
_libcrypto= secure/lib/libcrypto
.endif
.endif
_prebuild_libs=
.if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
_kerberosIV_lib= kerberosIV/lib
_generic_libs= gnu/lib
.if !defined(NOPERL)
_generic_libs+= gnu/usr.bin/perl/libperl
.endif
.if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
_kerberos5_lib= kerberos5/lib
_prebuild_libs+= kerberos5/lib/libasn1
_prebuild_libs+= kerberos5/lib/libgssapi
_prebuild_libs+= kerberos5/lib/libkrb5
_prebuild_libs+= kerberos5/lib/libroken
_generic_libs+= kerberos5/lib
.endif
.if !defined(NOPERL)
_libperl= gnu/usr.bin/perl/libperl
.if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
_prebuild_libs+= kerberosIV/lib/libkrb
kerberosIV/lib/libkrb__L: lib/libcrypt__L
_generic_libs+= kerberosIV/lib
.endif
_prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \
lib/libncurses lib/libopie lib/libradius lib/libskey \
lib/libtacplus lib/libutil \
lib/libz lib/msun
lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
lib/libskey__L: lib/libcrypt__L lib/libmd__L
_generic_libs+= lib
.if !defined(NOCRYPT) && !defined(NOSECURE)
.if !defined(NO_OPENSSL)
_prebuild_libs+= secure/lib/libcrypto
.if !defined(NO_OPENSSH)
_prebuild_libs+= secure/lib/libssh
secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
.endif
.endif
_generic_libs+= secure/lib
.endif
_generic_libs+= usr.bin/lex/lib
.if ${MACHINE_ARCH} == "i386"
_libkeycap= usr.sbin/pcvt/keycap
_generic_libs+= usr.sbin/pcvt/keycap
.endif
libraries:
.for _lib in ${_csu} gnu/lib/csu gnu/lib/libgcc lib/libmd lib/libcrypt \
lib/libz ${_libcrypto} ${_secure_lib} ${_kerberosIV_lib} \
${_kerberos5_lib} lib/libcom_err lib/msun lib/libncurses \
lib/libopie lib/libradius lib/libskey lib/libtacplus lib/libutil \
lib gnu/lib ${_libperl} usr.bin/lex/lib ${_libkeycap}
.for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
${_lib}__L: .PHONY
.if exists(${.CURDIR}/${_lib})
cd ${.CURDIR}/${_lib}; \
${MAKE} depend; \
${MAKE} all; \
${MAKE} install
${ECHODIR} "===> ${_lib}"; \
cd ${.CURDIR}/${_lib}; \
${MAKE} DIRPRFX=${_lib}/ depend; \
${MAKE} DIRPRFX=${_lib}/ all; \
${MAKE} DIRPRFX=${_lib}/ install
.endif
.endfor
.for __target in clean cleandepend cleandir depend obj
_startup_libs: ${_startup_libs:S/$/__L/}
_prebuild_libs: ${_prebuild_libs:S/$/__L/}
_generic_libs: ${_generic_libs:S/$/__L/}
.for __target in clean cleandepend cleandir depend includes obj
.for entry in ${SUBDIR}
${entry}.${__target}__D: .PHONY
@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
+18 -2
View File
@@ -8,6 +8,20 @@ A reverse chronology since 4.0 was released is included, followed by
the common items quick how-tos, followed by entries for versions of
-current prior to 4.0 Release.
20020807:
COPY is being deprecated. The 20020703 change was reverted, as
it causes far more pain than was expected, and to always compare
before installing, please use INSTALL="install -C" again. The
-C option is now silently ignored when used with the -d option.
20020704:
OpenSSH has been upgraded to 3.4p1 and fully PAMified. Note
that the protocol version now defaults to 2 rather than 1,
which means clients might get warnings about unknown host keys
their hostfiles only list the ssh1 RSA key. See ssh_config(5)
and sshd_config(5) for more information on configuring ssh and
sshd.
20020703:
The install(1) utility no longer allows the -d and -C options
to be specified together. "INSTALL=install -C" in make.conf
@@ -45,7 +59,9 @@ the common items quick how-tos, followed by entries for versions of
are very benign, some of them have created a bit of a stir.
Use the new version of mergemaster to update /etc, either by
updating /etc after installworld, or by doing:
cd /usr/src/usr.sbin/mergemaster; make all install [clean]
cd /usr/src/usr.sbin/mergemaster; make all install
before you run installworld.
Then use the new -C option to double-check your rc.conf settings.
You should also double-check settings in [defaults/]rc.conf,
syslog.conf, newsyslog.conf, and anything else important
@@ -81,7 +97,7 @@ the common items quick how-tos, followed by entries for versions of
'mergemaster -p' will do this. You may need to install
mergemaster before this will work if you are updating from a
very old version of stable. This can be done with:
cd /usr/src/usr.sbin/mergemaster; make all install [clean]
cd /usr/src/usr.sbin/mergemaster; make all install
20020325:
sendmail 8.12.2 has been imported. The sendmail binary is no
+19 -19
View File
@@ -83,19 +83,19 @@ Do not display a diagnostic message if
.Nm
could not modify the mode for
.Va file .
.It Fl h
If the file is a symbolic link, change the mode of the link itself
rather than the file that the link points to.
.It Fl v
Cause
.Nm
to be verbose, showing files as the mode is modified.
to be verbose, showing filenames as the mode is modified.
If the
.Fl v
flag is specified more than once, the old and new modes of the file
will also be printed, in both octal and symbolic notation.
.El
.Pp
Symbolic links do not have modes, so unless the
.Fl H
or
.Fl L
option is set,
.Nm
on a symbolic link always succeeds and has no effect.
The
.Fl H ,
.Fl L
@@ -130,37 +130,37 @@ and the
option to
.Xr mount 8 .
.It Li 2000
(the set-group-ID-on-execution bit) Executable files with this bit set
(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.
.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
.Fx ,
the sticky bit is
ignored for executable files and may only be set for directories (see
.Xr sticky 8 ) .
See
.Xr chmod 2
and
.Xr sticky 8 .
.It Li 0400
Allow read by owner.
.It Li 0200
Allow write by owner.
.It Li 0100
For files, allow execution by owner. For directories, allow the owner to
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
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
For files, allow execution by others.
For directories allow others to
search in the directory.
.El
.Pp
+19 -4
View File
@@ -35,7 +35,7 @@
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd April 18, 1994
.Dd August 10, 2002
.Dt CP 1
.Os
.Sh NAME
@@ -47,7 +47,7 @@
.Fl R
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i
.Op Fl f | i | n
.Op Fl pv
.Ar source_file target_file
.Nm
@@ -55,7 +55,7 @@
.Fl R
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i
.Op Fl f | i | n
.Op Fl pv
.Ar source_file ... target_directory
.Sh DESCRIPTION
@@ -121,6 +121,8 @@ regardless of its permissions.
.Fl f
option overrides any previous
.Fl i
or
.Fl n
options.)
.It Fl i
Cause
@@ -136,6 +138,17 @@ the file copy is attempted.
.Fl i
option overrides any previous
.Fl f
or
.Fl n
options.)
.It Fl n
Do not overwrite an existing file.
(The
.Fl n
option overrides any previous
.Fl f
or
.Fl i
options.)
.It Fl p
Cause
@@ -226,7 +239,9 @@ or fifo's.
.Pp
The
.Fl v
option is non-standard and its use in scripts is not recommended.
and
.Fl n
options are non-standard and their use in scripts is not recommended.
.Sh SEE ALSO
.Xr mv 1 ,
.Xr rcp 1 ,
+12 -7
View File
@@ -84,7 +84,7 @@ static const char rcsid[] =
PATH_T to = { to.p_path, "", "" };
int Rflag, iflag, pflag, rflag, fflag, vflag;
int Rflag, fflag, iflag, nflag, pflag, rflag, vflag;
enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
@@ -102,7 +102,7 @@ main(argc, argv)
char *target;
Hflag = Lflag = Pflag = 0;
while ((ch = getopt(argc, argv, "HLPRfiprv")) != -1)
while ((ch = getopt(argc, argv, "HLPRfinprv")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
@@ -121,11 +121,15 @@ main(argc, argv)
break;
case 'f':
fflag = 1;
iflag = 0;
iflag = nflag = 0;
break;
case 'i':
iflag = 1;
fflag = 0;
fflag = nflag = 0;
break;
case 'n':
nflag = 1;
fflag = iflag = 0;
break;
case 'p':
pflag = 1;
@@ -346,9 +350,10 @@ copy(argv, type, fts_options)
* honour setuid, setgid and sticky bits, but we
* normally want to preserve them on directories.
*/
if (pflag)
rval = setfile(curr->fts_statp, 0);
else {
if (pflag) {
if (setfile(curr->fts_statp, 0))
rval = 1;
} else {
mode = curr->fts_statp->st_mode;
if ((mode & (S_ISUID | S_ISGID | S_ISTXT)) ||
((mode | S_IRWXU) & mask) != (mode & mask))
+1 -1
View File
@@ -41,7 +41,7 @@ typedef struct {
} PATH_T;
extern PATH_T to;
extern int iflag, pflag, fflag, vflag;
extern int fflag, iflag, nflag, pflag, vflag;
#include <sys/cdefs.h>
+7 -3
View File
@@ -88,7 +88,11 @@ copy_file(entp, dne)
*/
if (!dne) {
#define YESNO "(y/n [n]) "
if (iflag) {
if (nflag) {
if (vflag)
printf("%s not overwritten\n", to.p_path);
return (0);
} else if (iflag) {
(void)fprintf(stderr, "overwrite %s? %s",
to.p_path, YESNO);
checkch = ch = getchar();
@@ -312,7 +316,7 @@ usage()
{
(void)fprintf(stderr, "%s\n%s\n",
"usage: cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target",
" cp [-R [-H | -L | -P]] [-f | -i] [-pv] src1 ... srcN directory");
"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src target",
" cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src1 ... srcN directory");
exit(EX_USAGE);
}
-2
View File
@@ -13,5 +13,3 @@ CLEANFILES+= tcsh.cat tcsh.msg
all: tcsh.cat
tcsh.cat: tcsh.msg
distribute:
+1 -1
View File
@@ -10,7 +10,7 @@ tcsh.msg: set[0-9]*
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.include <bsd.prog.mk>
+1 -1
View File
@@ -11,7 +11,7 @@ tcsh.msg: set[0-9]*
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.for i in ${LL}
ln -fs ../${DL}/tcsh.cat ${DESTDIR}${NLSDIR}/$i/tcsh.cat
+1 -1
View File
@@ -13,7 +13,7 @@ tcsh.msg: set[0-9]*
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.for i in ${LL}
ln -fs ../${DL}/tcsh.cat ${DESTDIR}${NLSDIR}/$i/tcsh.cat
+1 -1
View File
@@ -12,7 +12,7 @@ tcsh.msg: set[0-9]*
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.for i in ${LL}
ln -fs ../${DL}/tcsh.cat ${DESTDIR}${NLSDIR}/$i/tcsh.cat
+1 -1
View File
@@ -10,7 +10,7 @@ tcsh.msg: set[0-9]*
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.include <bsd.prog.mk>
+1 -1
View File
@@ -11,7 +11,7 @@ tcsh.msg: set[0-9]*
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.for i in ${LL}
ln -fs ../${DL}/tcsh.cat ${DESTDIR}${NLSDIR}/$i/tcsh.cat
+1 -1
View File
@@ -10,7 +10,7 @@ tcsh.msg: set[0-9]*
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.include <bsd.prog.mk>
+1 -1
View File
@@ -10,7 +10,7 @@ tcsh.msg: set[0-9]*
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.include <bsd.prog.mk>
+1 -1
View File
@@ -11,7 +11,7 @@ tcsh.msg: set[0-9]*
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.for i in ${LL}
ln -fs ../${DL}/tcsh.cat ${DESTDIR}${NLSDIR}/$i/tcsh.cat
+1 -1
View File
@@ -10,7 +10,7 @@ tcsh.msg: set[0-9]*
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.include <bsd.prog.mk>
+1 -2
View File
@@ -57,8 +57,7 @@ displays the number of complete and partial input and output blocks
and truncated input records to the standard error output.
.Pp
The following operands are available:
.\" XXX
.Bl -tag -width of=file
.Bl -tag -width ".Cm of Ns = Ns Ar file"
.It Cm bs Ns = Ns Ar n
Set both input and output block size to
.Ar n
+126 -55
View File
@@ -12,7 +12,6 @@
.Op Fl sx
.Op Fl p Ar string
.Op Ar file
.LP
.Nm red
.Op Fl
.Op Fl sx
@@ -32,7 +31,7 @@ mode, in which the only difference is that the editor restricts the
use of filenames which start with
.Ql \&!
(interpreted as shell commands by
.Nm ed )
.Nm )
or contain a
.Ql \&/ .
Note that editing outside of the current directory is only prohibited
@@ -53,7 +52,7 @@ Changes are made to this copy and not directly to
itself.
Upon quitting
.Nm ,
any changes not explicitly saved with a
any changes not explicitly saved with a
.Em w
command are lost.
.Pp
@@ -88,11 +87,13 @@ When an input command, such as
.Em c
(change), is given,
.Nm
enters input mode. This is the primary means
enters input mode.
This is the primary means
of adding text to a file.
In this mode, no commands are available;
instead, the standard input is written
directly to the editor buffer. Lines consist of text up to and
directly to the editor buffer.
Lines consist of text up to and
including a
.Em newline
character.
@@ -110,7 +111,8 @@ command deletes lines; the
.Em m
command moves lines, and so on.
It is possible to modify only a portion of a line by means of replacement,
as in the example above. However even here, the
as in the example above.
However even here, the
.Em s
command is applied to whole lines at a time.
.Pp
@@ -128,7 +130,8 @@ commands have the structure:
.Sm on
.Pp
The address(es) indicate the line or range of lines to be affected by the
command. If fewer addresses are given than the command accepts, then
command.
If fewer addresses are given than the command accepts, then
default addresses are supplied.
.Sh OPTIONS
The following options are available:
@@ -144,14 +147,17 @@ Prompt for an encryption key to be used in subsequent reads and writes
.Em x
command).
.It Fl p Ar string
Specify a command prompt. This may be toggled on and off with the
Specify a command prompt.
This may be toggled on and off with the
.Em P
command.
.It Ar file
Specify the name of a file to read. If
Specify the name of a file to read.
If
.Ar file
is prefixed with a
bang (!), then it is interpreted as a shell command. In this case,
bang (!), then it is interpreted as a shell command.
In this case,
what is read is
the standard output of
.Ar file
@@ -171,13 +177,15 @@ utility maintains a
.Em current address
which is
typically supplied to commands as the default address when none is specified.
When a file is first read, the current address is set to the last line
of the file. In general, the current address is set to the last line
When a file is first read, the current address is set to the last line
of the file.
In general, the current address is set to the last line
affected by a command.
.Pp
A line address is
constructed from one of the bases in the list below, optionally followed
by a numeric offset. The offset may include any combination
by a numeric offset.
The offset may include any combination
of digits, operators (i.e.,
.Em + ,
.Em -
@@ -197,8 +205,10 @@ and is legal wherever it makes sense.
An address range is two addresses separated either by a comma or
semi-colon.
The value of the first address in a range cannot exceed the
value of the second. If only one address is given in a range, then
the second address is set to the given address. If an
value of the second.
If only one address is given in a range, then
the second address is set to the given address.
If an
.Em n Ns -tuple
of addresses is given where
.Em "n\ >\ 2" ,
@@ -208,7 +218,8 @@ the
If only one address is expected, then the last address is used.
.Pp
Each address in a comma-delimited range is interpreted relative to the
current address. In a semi-colon-delimited range, the first address is
current address.
In a semi-colon-delimited range, the first address is
used to set the current address, and the second address is interpreted
relative to the first.
.Pp
@@ -249,11 +260,13 @@ next line, where
.Em n
is a non-negative number.
.It , or %
The first through last lines in the buffer. This is equivalent to
The first through last lines in the buffer.
This is equivalent to
the address range
.Em 1,$ .
.It ;
The current through last lines in the buffer. This is equivalent to
The current through last lines in the buffer.
This is equivalent to
the address range
.Em .,$ .
.It /re/
@@ -296,7 +309,8 @@ command for selecting old text to be replaced with new.
.Pp
In addition to a specifying string literals, regular expressions can
represent
classes of strings. Strings thus represented are said to be matched
classes of strings.
Strings thus represented are said to be matched
by the corresponding regular expression.
If it is possible for a regular expression
to match several strings in a line, then the left-most longest match is
@@ -307,24 +321,43 @@ The following symbols are used in constructing regular expressions:
.It c
Any character
.Em c
not listed below, including `{', '}', `(', `)', `<' and `>',
not listed below, including
.Ql \&{ ,
.Ql \&} ,
.Ql \&( ,
.Ql \&) ,
.Ql <
and
.Ql > ,
matches itself.
.It Pf \e c
Any backslash-escaped character
.Em c ,
except for `{', '}', `(', `)', `<' and `>',
except for
.Ql \&{ ,
.Ql \&} ,
.Ql \&( ,
.Ql \&) ,
.Ql <
and
.Ql > ,
matches itself.
.It .
Match any single character.
.It Op char-class
Match any single character in
.Em char-class .
To include a `]'
To include a
.Ql \&]
in
.Em char-class ,
it must be the first character.
A range of characters may be specified by separating the end characters
of the range with a `-', e.g., `a-z' specifies the lower case characters.
of the range with a
.Ql - ,
e.g.,
.Ql a-z
specifies the lower case characters.
The following literal expressions can also be used in
.Em char-class
to specify sets of characters:
@@ -335,7 +368,9 @@ to specify sets of characters:
.It [:blank:] Ta [:graph:] Ta [:punct:] Ta [:xdigit:]
.El
.Pp
If `-' appears as the first or last
If
.Ql -
appears as the first or last
character of
.Em char-class ,
then it matches itself.
@@ -402,21 +437,31 @@ where
is a number in the range [1,9], expands to the text matched by the
.Em n Ns th
subexpression.
For example, the regular expression `\e(.*\e)\e1' matches any string
For example, the regular expression
.Ql \e(.*\e)\e1
matches any string
consisting of identical adjacent substrings.
Subexpressions are ordered relative to
their left delimiter.
.It *
Match the single character regular expression or subexpression
immediately preceding it zero or more times. If
immediately preceding it zero or more times.
If
.Em *
is the first
character of a regular expression or subexpression, then it matches
itself. The
itself.
The
.Em *
operator sometimes yields unexpected results.
For example, the regular expression `b*' matches the beginning of
the string `abbb' (as opposed to the substring `bbb'), since a null match
For example, the regular expression
.Ql b*
matches the beginning of
the string
.Ql abbb
(as opposed to the substring
.Ql bbb ) ,
since a null match
is the only left-most match.
.It \e{n,m\e} or \e{n,\e} or \e{n\e}
Match the single character regular expression or subexpression
@@ -464,7 +509,8 @@ and returning the editor to command mode.
The
.Nm
utility
recognizes the following commands. The commands are shown together with
recognizes the following commands.
The commands are shown together with
the default address or address range supplied if none is
specified (in parenthesis).
.Bl -tag -width indent
@@ -473,7 +519,8 @@ Append text to the buffer after the addressed line.
Text is entered in input mode.
The current address is set to last line entered.
.It (.,.)c
Change lines in the buffer. The addressed lines are deleted
Change lines in the buffer.
The addressed lines are deleted
from the buffer, and text is appended in their place.
Text is entered in input mode.
The current address is set to last line entered.
@@ -489,7 +536,7 @@ Edit
and sets the default filename.
If
.Ar file
is not specified, then the default filename is used.
is not specified, then the default filename is used.
Any lines in the buffer are deleted before
the new file is read.
The current address is set to the last line read.
@@ -567,8 +614,11 @@ The format of
.Ar command-list
is the same as that of the
.Em g
command. A newline alone acts as a null command list.
A single `&' repeats the last non-null command list.
command.
A newline alone acts as a null command list.
A single
.Ql &
repeats the last non-null command list.
.It H
Toggle the printing of error explanations.
By default, explanations are not printed.
@@ -581,23 +631,26 @@ Insert text in the buffer before the current line.
Text is entered in input mode.
The current address is set to the last line entered.
.It (.,.+1)j
Join the addressed lines. The addressed lines are
Join the addressed lines.
The addressed lines are
deleted from the buffer and replaced by a single
line containing their joined text.
The current address is set to the resultant line.
.It (.)klc
Mark a line with a lower case letter
.Em lc .
The line can then be addressed as
The line can then be addressed as
.Em 'lc
(i.e., a single quote followed by
.Em lc )
in subsequent commands. The mark is not cleared until the line is
in subsequent commands.
The mark is not cleared until the line is
deleted or otherwise modified.
.It (.,.)l
Print the addressed lines unambiguously.
If a single line fills for than one screen (as might be the case
when viewing a binary file, for instance), a `--More--'
when viewing a binary file, for instance), a
.Dq Li --More--
prompt is printed on the last line.
The
.Nm
@@ -606,7 +659,8 @@ before displaying the next screen.
The current address is set to the last line
printed.
.It (.,.)m(.)
Move lines in the buffer. The addressed lines are moved to after the
Move lines in the buffer.
The addressed lines are moved to after the
right-hand destination address, which may be the address
.Em 0
(zero).
@@ -614,7 +668,8 @@ The current address is set to the
last line moved.
.It (.,.)n
Print the addressed lines along with
their line numbers. The current address is set to the last line
their line numbers.
The current address is set to the last line
printed.
.It (.,.)p
Print the addressed lines.
@@ -639,10 +694,12 @@ except that unwritten changes are discarded without warning.
.It ($)r Ar file
Read
.Ar file
to after the addressed line. If
to after the addressed line.
If
.Ar file
is not specified, then the default
filename is used. If there was no default filename prior to the command,
filename is used.
If there was no default filename prior to the command,
then the default filename is set to
.Ar file .
Otherwise, the default filename is unchanged.
@@ -692,7 +749,9 @@ affected is printed as though the print suffix
.Em p
were specified.
.Pp
An unescaped `&' in
An unescaped
.Ql &
in
.Ar replacement
is replaced by the currently matched text.
The character sequence
@@ -704,7 +763,9 @@ is a number in the range [1,9], is replaced by the
backreference expression of the matched text.
If
.Ar replacement
consists of a single `%', then
consists of a single
.Ql % ,
then
.Ar replacement
from the last substitution is used.
Newlines may be embedded in
@@ -779,7 +840,8 @@ Any previous contents of
is lost without warning.
If there is no default filename, then the default filename is set to
.Ar file ,
otherwise it is unchanged. If no filename is specified, then the default
otherwise it is unchanged.
If no filename is specified, then the default
filename is used.
The current address is unchanged.
.It (1,$)wq Ar file
@@ -804,15 +866,18 @@ command, expect that the previous contents of file is not clobbered.
The current address is unchanged.
.It x
Prompt for an encryption key which is used in subsequent reads and
writes. If a newline alone is entered as the key, then encryption is
turned off. Otherwise, echoing is disabled while a key is read.
writes.
If a newline alone is entered as the key, then encryption is
turned off.
Otherwise, echoing is disabled while a key is read.
Encryption/decryption is done using the
.Xr bdes 1
algorithm.
.It Pf (.+1)z n
Scroll
.Ar n
lines at a time starting at addressed line. If
lines at a time starting at addressed line.
If
.Ar n
is not specified, then the current window size is used.
The current address is set to the last line printed.
@@ -823,7 +888,9 @@ via
.Xr sh 1 .
If the first character of
.Ar command
is `!', then it is replaced by text of the
is
.Ql \&! ,
then it is replaced by text of the
previous
.Ar !command .
The
@@ -834,7 +901,8 @@ for backslash (\\) escapes.
However, an unescaped
.Em %
is replaced by the default filename.
When the shell returns from execution, a `!'
When the shell returns from execution, a
.Ql \&!
is printed to the standard output.
The current line is unchanged.
.It ($)=
@@ -850,7 +918,7 @@ buffer file
.It ed.hup
the file to which
.Nm
attempts to write the buffer if the terminal hangs up
attempts to write the buffer if the terminal hangs up
.El
.Sh SEE ALSO
.Xr bdes 1 ,
@@ -872,14 +940,15 @@ The
.Nm
utility processes
.Ar file
arguments for backslash escapes, i.e., in a filename,
arguments for backslash escapes, i.e., in a filename,
any characters preceded by a backslash (\\) are
interpreted literally.
.Pp
If a text (non-binary) file is not terminated by a newline character,
then
.Nm
appends one on reading/writing it. In the case of a binary file,
appends one on reading/writing it.
In the case of a binary file,
.Nm
does not append a newline on reading/writing.
.Pp
@@ -887,7 +956,9 @@ per line overhead: 4 ints
.Sh DIAGNOSTICS
When an error occurs,
.Nm
prints a `?' and either returns to command mode
prints a
.Ql \&?
and either returns to command mode
or exits if its input is from a script.
An explanation of the last error can be
printed with the
@@ -896,7 +967,7 @@ printed with the
.Pp
Since the
.Em g
(global) command masks any errors from failed searches and substitutions,
(global) command masks any errors from failed searches and substitutions,
it can be used to perform conditional operations in scripts; e.g.,
.Pp
.Sm off
+25 -6
View File
@@ -50,17 +50,19 @@
.Fl l
.Op Ar exit_status
.Nm
.Fl signal_name
.Fl Ar signal_name
.Ar pid
\&...
.Nm
.Fl signal_number
.Fl Ar signal_number
.Ar pid
\&...
.Sh DESCRIPTION
The
.Nm
utility sends a signal to the processes specified by the pid operand(s).
utility sends a signal to the processes specified by the
.Ar pid
operand(s).
.Pp
Only the super-user may send signals to other users' processes.
.Pp
@@ -75,11 +77,11 @@ default
If no operand is given, list the signal names; otherwise, write
the signal name corresponding to
.Ar exit_status .
.It Fl signal_name
.It Fl Ar signal_name
A symbolic signal name specifying the signal to be sent instead of the
default
.Dv TERM .
.It Fl signal_number
.It Fl Ar signal_number
A non-negative decimal integer, specifying the signal to be sent instead
of the default
.Dv TERM .
@@ -116,6 +118,23 @@ command which is similar or identical to this utility.
Consult the
.Xr builtin 1
manual page.
.Sh EXAMPLES
Terminate
the processes with pids 142 and 157:
.Pp
.Dl "kill 142 157"
.Pp
Send the hangup signal
.Pq Dv SIGHUP
to the process with pid 507:
.Pp
.Dl "kill -s HUP 507"
.Pp
Terminate the process group with pgid 117:
.Pp
.Dl "kill -- -117"
.Sh DIAGNOSTICS
.Ex -std
.Sh SEE ALSO
.Xr builtin 1 ,
.Xr csh 1 ,
@@ -133,7 +152,7 @@ compatible.
A
.Nm
command appeared in
.At v6 .
.At v3 .
.Sh BUGS
A replacement for the command
.Dq Li kill 0
+15 -18
View File
@@ -41,9 +41,9 @@ static char const copyright[] =
#if 0
static char sccsid[] = "@(#)kill.c 8.4 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <ctype.h>
#include <err.h>
@@ -53,16 +53,13 @@ static const char rcsid[] =
#include <stdlib.h>
#include <string.h>
int main __P((int, char *[]));
void nosig __P((char *));
void printsignals __P((FILE *));
int signame_to_signum __P((char *));
void usage __P((void));
void nosig(char *);
void printsignals(FILE *);
int signame_to_signum(char *);
void usage(void);
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
int errors, numsig, pid;
char *ep;
@@ -106,7 +103,7 @@ main(argc, argv)
} else
numsig = 0;
argc--, argv++;
} else if (**argv == '-') {
} else if (**argv == '-' && *(*argv + 1) != '-') {
++*argv;
if (isalpha(**argv)) {
if ((numsig = signame_to_signum(*argv)) < 0)
@@ -122,6 +119,9 @@ main(argc, argv)
argc--, argv++;
}
if (argc > 0 && strncmp(*argv, "--", 2) == 0)
argc--, argv++;
if (argc == 0)
usage();
@@ -140,8 +140,7 @@ main(argc, argv)
}
int
signame_to_signum(sig)
char *sig;
signame_to_signum(char *sig)
{
int n;
@@ -155,8 +154,7 @@ signame_to_signum(sig)
}
void
nosig(name)
char *name;
nosig(char *name)
{
warnx("unknown signal %s; valid signals:", name);
@@ -165,8 +163,7 @@ nosig(name)
}
void
printsignals(fp)
FILE *fp;
printsignals(FILE *fp)
{
int n;
@@ -180,7 +177,7 @@ printsignals(fp)
}
void
usage()
usage(void)
{
(void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
+4 -4
View File
@@ -46,11 +46,11 @@
.Nm
.Op Fl fhinsv
.Ar source_file
.Op target_file
.Op Ar target_file
.Nm
.Op Fl fhinsv
.Ar source_file ...
.Op target_dir
.Ar target_dir
.Nm link
.Ar source_file Ar target_file
.Sh DESCRIPTION
@@ -124,7 +124,7 @@ links.
A hard link to a file is indistinguishable from the original directory entry;
any changes to a file are effectively independent of the name used to reference
the file.
Hard links may not normally refer to directories and may not span file systems.
Hard links may not normally refer to directories and may not span filesystems.
.Pp
A symbolic link contains the name of the file to
which it is linked. The referenced file is used when an
@@ -138,7 +138,7 @@ must be done to obtain information about the link.
The
.Xr readlink 2
call may be used to read the contents of a symbolic link.
Symbolic links may span file systems and may refer to directories.
Symbolic links may span filesystems and may refer to directories.
.Pp
Given one or two arguments,
.Nm
+23 -18
View File
@@ -41,9 +41,9 @@ static char const copyright[] =
#if 0
static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/stat.h>
@@ -62,17 +62,14 @@ int iflag; /* Interactive mode. */
int sflag; /* Symbolic, not hard, link. */
int vflag; /* Verbose output. */
/* System link call. */
int (*linkf) __P((const char *, const char *));
int (*linkf)(const char *, const char *);
char linkch;
int linkit __P((const char *, const char *, int));
int main __P((int, char *[]));
void usage __P((void));
int linkit(const char *, const char *, int);
void usage(void);
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
struct stat sb;
char *p, *sourcedir;
@@ -88,11 +85,14 @@ main(argc, argv)
else
++p;
if (strcmp(p, "link") == 0) {
if (argc == 3) {
linkf = link;
exit(linkit(argv[1], argv[2], 0));
} else
while (getopt(argc, argv, "") != -1)
usage();
argc -= optind;
argv += optind;
if (argc != 2)
usage();
linkf = link;
exit(linkit(argv[0], argv[1], 0));
}
while ((ch = getopt(argc, argv, "fhinsv")) != -1)
@@ -134,6 +134,8 @@ main(argc, argv)
exit(linkit(argv[0], ".", 1));
case 2: /* ln target source */
exit(linkit(argv[0], argv[1], 0));
default:
;
}
/* ln target1 target2 directory */
sourcedir = argv[argc - 1];
@@ -155,9 +157,7 @@ main(argc, argv)
}
int
linkit(target, source, isdir)
const char *target, *source;
int isdir;
linkit(const char *target, const char *source, int isdir)
{
struct stat sb;
const char *p;
@@ -189,7 +189,12 @@ linkit(target, source, isdir)
p = target;
else
++p;
(void)snprintf(path, sizeof(path), "%s/%s", source, p);
if (snprintf(path, sizeof(path), "%s/%s", source, p) >=
sizeof(path)) {
errno = ENAMETOOLONG;
warn("%s", target);
return (1);
}
source = path;
}
@@ -232,7 +237,7 @@ linkit(target, source, isdir)
}
void
usage()
usage(void)
{
(void)fprintf(stderr, "%s\n%s\n%s\n",
"usage: ln [-fhinsv] file1 file2",
+5 -5
View File
@@ -34,14 +34,14 @@
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
#ifndef lint
static char sccsid[] = "@(#)cmp.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
+1
View File
@@ -46,6 +46,7 @@ int revstatcmp(const FTSENT *, const FTSENT *);
void printcol(DISPLAY *);
void printlong(DISPLAY *);
void printscol(DISPLAY *);
void printstream(DISPLAY *);
void usage(void);
size_t len_octal(const char *, int);
int prn_octal(const char *);
+25 -11
View File
@@ -43,7 +43,7 @@
.Nd list directory contents
.Sh SYNOPSIS
.Nm
.Op Fl ABCFGHLPRTWabcdfghiklnoqrstuw1
.Op Fl ABCFGHLPRTWabcdfghiklmnopqrstuwx1
.Op Ar
.Sh DESCRIPTION
For each operand that names a
@@ -190,6 +190,8 @@ List in long format.
(See below.)
If the output is to a terminal, a total sum for all the file
sizes is output on a line before the long listing.
.It Fl m
Stream output format; list files across the page, separated by commas.
.It Fl n
Display user and group IDs numerically rather than converting to a user
or group name in a long
@@ -199,6 +201,10 @@ output.
Include the file flags in a long
.Pq Fl l
output.
.It Fl p
Write a slash
.Pq Ql /
after each filename if that file is a directory.
.It Fl q
Force printing of non-graphic characters in file names as
the character
@@ -208,7 +214,7 @@ this is the default when output is to a terminal.
Reverse the order of the sort to get reverse
lexicographical order or the oldest entries first.
.It Fl s
Display the number of file system blocks actually used by each file, in units
Display the number of filesystem 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.
@@ -230,6 +236,11 @@ or printing
Force raw printing of non-printable characters.
This is the default
when output is not to a terminal.
.It Fl x
The same as
.Fl C ,
except that the multi-column output is produced with entries sorted
across, rather than down, the columns.
.It Fl 1
(The numeric digit
.Dq one . )
@@ -240,7 +251,7 @@ output is not to a terminal.
.El
.Pp
The
.Fl 1 , C ,
.Fl 1 , C , x ,
and
.Fl l
options all override each other; the last one specified determines
@@ -272,7 +283,9 @@ By default,
lists one entry per line to standard
output; the exceptions are to terminals or when the
.Fl C
option is specified.
or
.Fl x
options are specified.
.Pp
File information is displayed with one or more
.Ao blank Ac Ns s
@@ -478,7 +491,9 @@ utility calculates how
many pathname text columns to display
based on the width provided.
(See
.Fl C . )
.Fl C
and
.Fl x . )
.It Ev LANG
The locale to use when determining the order of day and month in the long
.Fl l
@@ -608,17 +623,16 @@ specification.
.Xr termcap 5 ,
.Xr symlink 7 ,
.Xr sticky 8
.Sh STANDARDS
The
.Nm
utility conforms to
.St -p1003.1-2001 .
.Sh HISTORY
An
.Nm
command appeared in
.At v1 .
.Sh STANDARDS
The
.Nm
utility is expected to be a superset of the
.St -p1003.2
specification.
.Sh BUGS
To maintain backward compatibility, the relationships between the many
options are quite complex.
+40 -15
View File
@@ -40,14 +40,13 @@ static const char copyright[] =
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
#ifndef lint
static char sccsid[] = "@(#)ls.c 8.5 (Berkeley) 4/2/94";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
@@ -111,7 +110,10 @@ static int f_reversesort; /* reverse whatever sort is used */
int f_sectime; /* print the real time for all files */
static int f_singlecol; /* use single column output */
int f_size; /* list size in short listing */
int f_slash; /* similar to f_type, but only for dirs */
int f_sortacross; /* sort across rows, not down columns */
int f_statustime; /* use time of last mode change */
int f_stream; /* stream the output, separate with commas */
static int f_timesort; /* sort by time vice name */
int f_type; /* add type character for non-regular files */
static int f_whiteout; /* show whiteout entries */
@@ -144,11 +146,11 @@ main(int argc, char *argv[])
/* Terminal defaults to -Cq, non-terminal defaults to -1. */
if (isatty(STDOUT_FILENO)) {
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == -1 ||
!win.ws_col) {
if ((p = getenv("COLUMNS")) != NULL)
termwidth = atoi(p);
} else
termwidth = 80;
if ((p = getenv("COLUMNS")) != NULL && *p != '\0')
termwidth = atoi(p);
else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) != -1 &&
win.ws_col > 0)
termwidth = win.ws_col;
f_nonprint = 1;
} else {
@@ -164,15 +166,17 @@ main(int argc, char *argv[])
f_listdot = 1;
fts_options = FTS_PHYSICAL;
while ((ch = getopt(argc, argv, "1ABCFGHLPRTWabcdfghiklnoqrstuw")) != -1) {
while ((ch = getopt(argc, argv, "1ABCFGHLPRTWabcdfghiklmnopqrstuwx"))
!= -1) {
switch (ch) {
/*
* The -1, -C and -l options all override each other so shell
* aliasing works right.
* The -1, -C, -x and -l options all override each other so
* shell aliasing works right.
*/
case '1':
f_singlecol = 1;
f_longform = 0;
f_stream = 0;
break;
case 'B':
f_nonprint = 0;
@@ -180,11 +184,17 @@ main(int argc, char *argv[])
f_octal_escape = 0;
break;
case 'C':
f_longform = f_singlecol = 0;
f_sortacross = f_longform = f_singlecol = 0;
break;
case 'l':
f_longform = 1;
f_singlecol = 0;
f_stream = 0;
break;
case 'x':
f_sortacross = 1;
f_longform = 0;
f_singlecol = 0;
break;
/* The -c and -u options override each other. */
case 'c':
@@ -197,6 +207,7 @@ main(int argc, char *argv[])
break;
case 'F':
f_type = 1;
f_slash = 0;
break;
case 'H':
fts_options |= FTS_COMFOLLOW;
@@ -241,12 +252,21 @@ main(int argc, char *argv[])
case 'k':
f_kblocks = 1;
break;
case 'm':
f_stream = 1;
f_singlecol = 0;
f_longform = 0;
break;
case 'n':
f_numericonly = 1;
break;
case 'o':
f_flags = 1;
break;
case 'p':
f_slash = 1;
f_type = 1;
break;
case 'q':
f_nonprint = 1;
f_octal = 0;
@@ -384,6 +404,8 @@ main(int argc, char *argv[])
printfcn = printscol;
else if (f_longform)
printfcn = printlong;
else if (f_stream)
printfcn = printstream;
else
printfcn = printcol;
@@ -456,6 +478,7 @@ traverse(int argc, char *argv[], int options)
(void)fts_set(ftsp, p, FTS_SKIP);
break;
default:
break;
}
if (errno)
err(1, "fts_read");
@@ -481,7 +504,8 @@ display(FTSENT *p, FTSENT *list)
size_t flen, ulen, glen;
char *initmax;
int entries, needstats;
char *user, *group, *flags;
const char *user, *group;
char *flags;
char buf[STRBUF_SIZEOF(u_quad_t) + 1];
char ngroup[STRBUF_SIZEOF(uid_t) + 1];
char nuser[STRBUF_SIZEOF(gid_t) + 1];
@@ -564,6 +588,7 @@ display(FTSENT *p, FTSENT *list)
f_notabs = 0;
/* fall through */
default:
break;
}
maxinode = makenines(maxinode);
maxblock = makenines(maxblock);
+2
View File
@@ -52,6 +52,8 @@ extern int f_octal_escape; /* like f_octal but use C escapes if possible */
extern int f_nonprint; /* show unprintables as ? */
extern int f_sectime; /* print the real time for all files */
extern int f_size; /* list size in short listing */
extern int f_slash; /* append a '/' if the file is a directory */
extern int f_sortacross; /* sort across rows, not down columns */
extern int f_statustime; /* use time of last mode change */
extern int f_notabs; /* don't use tab-separated multi-col output */
extern int f_type; /* add type character for non-regular files */
+52 -7
View File
@@ -34,14 +34,13 @@
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
#ifndef lint
static char sccsid[] = "@(#)print.c 8.4 (Berkeley) 4/17/94";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/stat.h>
@@ -219,6 +218,31 @@ printlong(DISPLAY *dp)
}
}
void
printstream(DISPLAY *dp)
{
FTSENT *p;
extern int termwidth;
int chcnt;
for (p = dp->list, chcnt = 0; p; p = p->fts_link) {
if (p->fts_number == NO_PRINT)
continue;
if (strlen(p->fts_name) + chcnt +
(p->fts_link ? 2 : 0) >= (unsigned)termwidth) {
putchar('\n');
chcnt = 0;
}
chcnt += printaname(p, dp->s_inode, dp->s_block);
if (p->fts_link) {
printf(", ");
chcnt += 2;
}
}
if (chcnt)
putchar('\n');
}
void
printcol(DISPLAY *dp)
{
@@ -279,15 +303,26 @@ printcol(DISPLAY *dp)
if (dp->list->fts_level != FTS_ROOTLEVEL && (f_longform || f_size))
(void)printf("total %lu\n", howmany(dp->btotal, blocksize));
if (f_sortacross)
base = 0;
for (row = 0; row < numrows; ++row) {
endcol = colwidth;
for (base = row, chcnt = col = 0; col < numcols; ++col) {
if (!f_sortacross)
base = row;
for (col = 0, chcnt = 0; col < numcols; ++col) {
chcnt += printaname(array[base], dp->s_inode,
dp->s_block);
if ((base += numrows) >= num)
if (f_sortacross)
base++;
else
base += numrows;
if (base >= num)
break;
while ((cnt = ((chcnt + tabwidth) & ~(tabwidth - 1)))
<= endcol) {
if (f_sortacross && col + 1 >= numcols)
break;
(void)putchar(f_notabs ? ' ' : '\t');
chcnt = cnt;
}
@@ -361,6 +396,15 @@ printtime(time_t ftime)
static int
printtype(u_int mode)
{
if (f_slash) {
if ((mode & S_IFMT) == S_IFDIR) {
(void)putchar('/');
return (1);
}
return (0);
}
switch (mode & S_IFMT) {
case S_IFDIR:
(void)putchar('/');
@@ -378,6 +422,7 @@ printtype(u_int mode)
(void)putchar('%');
return (1);
default:
break;
}
if (mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
(void)putchar('*');
+4 -5
View File
@@ -34,14 +34,13 @@
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
#ifndef lint
static char sccsid[] = "@(#)util.c 8.3 (Berkeley) 4/2/94";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#endif
#include <sys/types.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
+4 -2
View File
@@ -58,10 +58,12 @@ as modified by the current
The options are as follows:
.Pp
.Bl -tag -width indent
.It Fl m
.It Fl m Ar mode
Set the file permission bits of the final created directory to
the specified mode.
The mode argument can be in any of the formats specified to the
The
.Ar mode
argument can be in any of the formats specified to the
.Xr chmod 1
command.
If a symbolic mode is specified, the operation characters
+19 -4
View File
@@ -35,7 +35,7 @@
.\" @(#)mv.1 8.1 (Berkeley) 5/31/93
.\" $FreeBSD$
.\"
.Dd May 31, 1993
.Dd August 18, 2002
.Dt MV 1
.Os
.Sh NAME
@@ -43,11 +43,11 @@
.Nd move files
.Sh SYNOPSIS
.Nm
.Op Fl f | Fl i
.Op Fl f | i | n
.Op Fl v
.Ar source target
.Nm
.Op Fl f | Fl i
.Op Fl f | i | n
.Op Fl v
.Ar source ... directory
.Sh DESCRIPTION
@@ -81,6 +81,8 @@ path.
.Fl f
option overrides any previous
.Fl i
or
.Fl n
options.)
.It Fl i
Cause
@@ -96,6 +98,17 @@ the move is attempted.
.Fl i
option overrides any previous
.Fl f
or
.Fl n
options.)
.It Fl n
Do not overwrite an existing file.
(The
.Fl n
option overrides any previous
.Fl f
or
.Fl i
options.)
.It Fl v
Cause
@@ -136,8 +149,10 @@ rm -f destination_path && \e
.Xr symlink 7
.Sh COMPATIBILITY
The
.Fl n
and
.Fl v
option is non-standard and its use in scripts is not recommended.
options are non-standard and their use in scripts is not recommended.
.Sh STANDARDS
The
.Nm
+15 -7
View File
@@ -66,7 +66,7 @@ static const char rcsid[] =
#include "pathnames.h"
int fflg, iflg, vflg;
int fflg, iflg, nflg, vflg;
int copy __P((char *, char *));
int do_move __P((char *, char *));
@@ -85,15 +85,19 @@ main(argc, argv)
int ch;
char path[PATH_MAX];
while ((ch = getopt(argc, argv, "fiv")) != -1)
while ((ch = getopt(argc, argv, "finv")) != -1)
switch (ch) {
case 'i':
iflg = 1;
fflg = 0;
fflg = nflg = 0;
break;
case 'f':
fflg = 1;
iflg = 0;
iflg = nflg = 0;
break;
case 'n':
nflg = 1;
fflg = iflg = 0;
break;
case 'v':
vflg = 1;
@@ -173,7 +177,11 @@ do_move(from, to)
#define YESNO "(y/n [n]) "
ask = 0;
if (iflg) {
if (nflg) {
if (vflg)
printf("%s not overwritten\n", to);
return (0);
} else if (iflg) {
(void)fprintf(stderr, "overwrite %s? %s", to, YESNO);
ask = 1;
} else if (access(to, W_OK) && !stat(to, &sb)) {
@@ -375,7 +383,7 @@ usage()
{
(void)fprintf(stderr, "%s\n%s\n",
"usage: mv [-f | -i] [-v] source target",
" mv [-f | -i] [-v] source ... directory");
"usage: mv [-f | -i | -n] [-v] source target",
" mv [-f | -i | -n] [-v] source ... directory");
exit(EX_USAGE);
}
+2 -3
View File
@@ -183,9 +183,8 @@ The
.Nm
utility will read, write, and list the members of an archive file,
and will copy directory hierarchies.
.Nm Pax
operation is independent of the specific archive format,
and supports a wide variety of different archive formats.
These operations are independent of the specific archive format,
and support a wide variety of different archive formats.
A list of supported archive formats can be found under the description of the
.Fl x
option.
+24 -10
View File
@@ -86,8 +86,10 @@ int totwidth; /* calculated width of requested variables */
static int needuser, needcomm, needenv;
#if defined(LAZY_PS)
static int forceuread=0;
#define PS_ARGS "aCcefghjLlM:mN:O:o:p:rSTt:U:uvwx"
#else
static int forceuread=1;
#define PS_ARGS "aCceghjLlM:mN:O:o:p:rSTt:U:uvwx"
#endif
enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT;
@@ -124,9 +126,9 @@ main(argc, argv)
dev_t ttydev;
pid_t pid;
uid_t *uids;
int all, ch, flag, i, fmt, lineno, nentries, dropgid;
int all, ch, flag, i, fmt, lineno, nentries, nocludge, dropgid;
int prtheader, wflag, what, xflg, uid, nuids;
char *nlistf, *memf, errbuf[_POSIX2_LINE_MAX];
char *cp, *nlistf, *memf, errbuf[_POSIX2_LINE_MAX];
(void) setlocale(LC_ALL, "");
@@ -138,8 +140,25 @@ main(argc, argv)
else
termwidth = ws.ws_col - 1;
if (argc > 1)
argv[1] = kludge_oldps_options(argv[1]);
/*
* Don't apply a kludge if the first argument is an option taking an
* argument
*/
if (argc > 1) {
nocludge = 0;
if (argv[1][0] == '-') {
for (cp = PS_ARGS; *cp != '\0'; cp++) {
if (*cp != ':')
continue;
if (*(cp - 1) == argv[1][1]) {
nocludge = 1;
break;
}
}
}
if (nocludge == 0)
argv[1] = kludge_oldps_options(argv[1]);
}
all = fmt = prtheader = wflag = xflg = 0;
pid = -1;
@@ -148,12 +167,7 @@ main(argc, argv)
ttydev = NODEV;
dropgid = 0;
memf = nlistf = _PATH_DEVNULL;
while ((ch = getopt(argc, argv,
#if defined(LAZY_PS)
"aCcefghjLlM:mN:O:o:p:rSTt:U:uvwx")) != -1)
#else
"aCceghjLlM:mN:O:o:p:rSTt:U:uvwx")) != -1)
#endif
while ((ch = getopt(argc, argv, PS_ARGS)) != -1)
switch((char)ch) {
case 'a':
all = 1;
+4 -2
View File
@@ -4,11 +4,13 @@
PROG= rcp
SRCS= rcp.c util.c
CFLAGS+=-DBINDIR=${BINDIR}
WARNS= 0
WFORMAT=0
.if exists(${DESTDIR}${LIBDIR}/libkrb.a) && defined(MAKE_KERBEROS4)
.if defined(MAKE_KERBEROS4) && !defined(NO_OPENSSL) && !defined(NOCRYPT)
SRCS+= krcmd.c kcmd.c rcmd_util.c
DPADD= ${LIBUTIL} ${LIBKRB} ${LIBCRYPTO}
CFLAGS+=-DKERBEROS -DCRYPT -DHAVE_CONFIG_H \
CFLAGS+=-DCRYPT -DHAVE_CONFIG_H \
-I${.CURDIR}/../../kerberosIV/include \
-I${.CURDIR}/../../crypto/kerberosIV/include \
-I${.CURDIR}/../../crypto/kerberosIV/lib/roken \
+9 -9
View File
@@ -35,17 +35,17 @@
*/
typedef struct {
int cnt;
size_t cnt;
char *buf;
} BUF;
extern int iamremote;
BUF *allocbuf __P((BUF *, int, int));
char *colon __P((char *));
void lostconn __P((int));
void nospace __P((void));
int okname __P((char *));
void run_err __P((const char *, ...)) __printflike(1, 2);
int susystem __P((char *, int));
void verifydir __P((char *));
BUF *allocbuf(BUF *, int, int);
char *colon(char *);
void lostconn(int);
void nospace(void);
int okname(char *);
void run_err(const char *, ...) __printflike(1, 2);
int susystem(char *, int);
void verifydir(char *);
-42
View File
@@ -1,42 +0,0 @@
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* 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
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)pathnames.h 8.1 (Berkeley) 5/31/93
* $FreeBSD$
*/
#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"
+6 -2
View File
@@ -40,11 +40,11 @@
.Nd remote file copy
.Sh SYNOPSIS
.Nm
.Op Fl Kpx
.Op Fl 46Kpx
.Op Fl k Ar realm
.Ar file1 file2
.Nm
.Op Fl Kprx
.Op Fl 46Kprx
.Op Fl k Ar realm
.Ar
.Ar directory
@@ -63,6 +63,10 @@ or a `/' before any `:'s).
.Pp
The following options are available:
.Bl -tag -width indent
.It Fl 4
Use IPv4 addresses only.
.It Fl 6
Use IPv6 addresses only.
.It Fl K
Turn off all Kerberos authentication.
.It Fl k
+76 -87
View File
@@ -1,6 +1,13 @@
/*
* Copyright (c) 1983, 1990, 1992, 1993
* The Regents of the University of California. All rights reserved.
* Copyright (c) 2002 Networks Associates Technology, Inc.
* All rights reserved.
*
* Portions of this software were developed for the FreeBSD Project by
* ThinkSec AS and NAI Labs, the Security Research Division of Network
* Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
* ("CBOSS"), as part of the DARPA CHATS research program.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -41,9 +48,9 @@ static char const copyright[] =
#if 0
static char sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/stat.h>
@@ -61,6 +68,7 @@ static const char rcsid[] =
#include <libutil.h>
#include <limits.h>
#include <netdb.h>
#include <paths.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
@@ -69,7 +77,6 @@ static const char rcsid[] =
#include <string.h>
#include <unistd.h>
#include "pathnames.h"
#include "extern.h"
#ifdef KERBEROS
@@ -80,17 +87,17 @@ static const char rcsid[] =
char dst_realm_buf[REALM_SZ];
char *dest_realm = NULL;
int use_kerberos = 1;
CREDENTIALS cred;
CREDENTIALS cred;
Key_schedule schedule;
extern char *krb_realmofhost();
#ifdef CRYPT
int doencrypt = 0;
#define OPTIONS "dfKk:prtx"
#define OPTIONS "46dfKk:prtx"
#else
#define OPTIONS "dfKk:prt"
#define OPTIONS "46dfKk:prt"
#endif
#else
#define OPTIONS "dfprt"
#define OPTIONS "46dfprt"
#endif
struct passwd *pwd;
@@ -98,6 +105,7 @@ u_short port;
uid_t userid;
int errs, rem;
int pflag, iamremote, iamrecursive, targetshouldbedirectory;
int family = PF_UNSPEC;
static int argc_copy;
static char **argv_copy;
@@ -106,22 +114,20 @@ static char **argv_copy;
char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
#ifdef KERBEROS
int kerberos __P((char **, char *, char *, char *));
void oldw __P((const char *, ...)) __printflike(1, 2);
int kerberos(char **, char *, char *, char *);
void oldw(const char *, ...) __printflike(1, 2);
#endif
int response __P((void));
void rsource __P((char *, struct stat *));
void run_err __P((const char *, ...)) __printflike(1, 2);
void sink __P((int, char *[]));
void source __P((int, char *[]));
void tolocal __P((int, char *[]));
void toremote __P((char *, int, char *[]));
void usage __P((void));
int response(void);
void rsource(char *, struct stat *);
void run_err(const char *, ...) __printflike(1, 2);
void sink(int, char *[]);
void source(int, char *[]);
void tolocal(int, char *[]);
void toremote(char *, int, char *[]);
void usage(void);
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
struct servent *sp;
int ch, fflag, i, tflag;
@@ -149,6 +155,14 @@ main(argc, argv)
fflag = tflag = 0;
while ((ch = getopt(argc, argv, OPTIONS)) != -1)
switch(ch) { /* User-visible flags. */
case '4':
family = PF_INET;
break;
case '6':
family = PF_INET6;
break;
case 'K':
#ifdef KERBEROS
use_kerberos = 0;
@@ -269,9 +283,7 @@ main(argc, argv)
}
void
toremote(targ, argc, argv)
char *targ, *argv[];
int argc;
toremote(char *targ, int argc, char *argv[])
{
int i, len, tos;
char *bp, *host, *src, *suser, *thost, *tuser;
@@ -304,7 +316,7 @@ toremote(targ, argc, argv)
strlen(src) + (tuser ? strlen(tuser) : 0) +
strlen(thost) + strlen(targ) + CMDNEEDS + 20;
if (!(bp = malloc(len)))
err(1, NULL);
err(1, "malloc");
if (host) {
*host++ = 0;
suser = argv[i];
@@ -331,7 +343,7 @@ toremote(targ, argc, argv)
if (rem == -1) {
len = strlen(targ) + CMDNEEDS + 20;
if (!(bp = malloc(len)))
err(1, NULL);
err(1, "malloc");
(void)snprintf(bp, len, "%s -t %s", cmd, targ);
host = thost;
#ifdef KERBEROS
@@ -341,15 +353,18 @@ toremote(targ, argc, argv)
tuser ? tuser : pwd->pw_name);
else
#endif
rem = rcmd(&host, port, pwd->pw_name,
rem = rcmd_af(&host, port,
pwd->pw_name,
tuser ? tuser : pwd->pw_name,
bp, 0);
bp, 0, family);
if (rem < 0)
exit(1);
tos = IPTOS_THROUGHPUT;
if (setsockopt(rem, IPPROTO_IP, IP_TOS,
&tos, sizeof(int)) < 0)
warn("TOS (ignored)");
if (family == PF_INET) {
tos = IPTOS_THROUGHPUT;
if (setsockopt(rem, IPPROTO_IP, IP_TOS,
&tos, sizeof(int)) < 0)
warn("TOS (ignored)");
}
if (response() < 0)
exit(1);
(void)free(bp);
@@ -361,9 +376,7 @@ toremote(targ, argc, argv)
}
void
tolocal(argc, argv)
int argc;
char *argv[];
tolocal(int argc, char *argv[])
{
int i, len, tos;
char *bp, *host, *src, *suser;
@@ -373,7 +386,7 @@ tolocal(argc, argv)
len = strlen(_PATH_CP) + strlen(argv[i]) +
strlen(argv[argc - 1]) + 20;
if (!(bp = malloc(len)))
err(1, NULL);
err(1, "malloc");
(void)snprintf(bp, len, "exec %s%s%s %s %s", _PATH_CP,
iamrecursive ? " -PR" : "", pflag ? " -p" : "",
argv[i], argv[argc - 1]);
@@ -400,23 +413,27 @@ tolocal(argc, argv)
}
len = strlen(src) + CMDNEEDS + 20;
if ((bp = malloc(len)) == NULL)
err(1, NULL);
err(1, "malloc");
(void)snprintf(bp, len, "%s -f %s", cmd, src);
rem =
#ifdef KERBEROS
use_kerberos ?
kerberos(&host, bp, pwd->pw_name, suser) :
#endif
rcmd(&host, port, pwd->pw_name, suser, bp, 0);
rcmd_af(&host, port, pwd->pw_name, suser, bp, 0,
family);
(void)free(bp);
if (rem < 0) {
++errs;
continue;
}
(void)seteuid(userid);
tos = IPTOS_THROUGHPUT;
if (setsockopt(rem, IPPROTO_IP, IP_TOS, &tos, sizeof(int)) < 0)
warn("TOS (ignored)");
if (family == PF_INET) {
tos = IPTOS_THROUGHPUT;
if (setsockopt(rem, IPPROTO_IP, IP_TOS, &tos,
sizeof(int)) < 0)
warn("TOS (ignored)");
}
sink(1, argv + argc - 1);
(void)seteuid(0);
(void)close(rem);
@@ -425,9 +442,7 @@ tolocal(argc, argv)
}
void
source(argc, argv)
int argc;
char *argv[];
source(int argc, char *argv[])
{
struct stat stb;
static BUF buffer;
@@ -437,7 +452,7 @@ source(argc, argv)
char *last, *name, buf[BUFSIZ];
for (indx = 0; indx < argc; ++indx) {
name = argv[indx];
name = argv[indx];
if ((fd = open(name, O_RDONLY, 0)) < 0)
goto syserr;
if (fstat(fd, &stb)) {
@@ -513,9 +528,7 @@ next: (void)close(fd);
}
void
rsource(name, statp)
char *name;
struct stat *statp;
rsource(char *name, struct stat *statp)
{
DIR *dirp;
struct dirent *dp;
@@ -566,9 +579,7 @@ rsource(name, statp)
}
void
sink(argc, argv)
int argc;
char *argv[];
sink(int argc, char *argv[])
{
static BUF buffer;
struct stat stb;
@@ -675,14 +686,17 @@ sink(argc, argv)
if (*cp++ != ' ')
SCREWUP("size not delimited");
if (targisdir) {
static char *namebuf;
static int cursize;
static char *namebuf = NULL;
static size_t cursize;
size_t need;
need = strlen(targ) + strlen(cp) + 250;
if (need > cursize) {
if (namebuf != NULL)
free(namebuf);
if (!(namebuf = malloc(need)))
run_err("%s", strerror(errno));
cursize = need;
}
(void)snprintf(namebuf, need, "%s%s%s", targ,
*targ ? "/" : "", cp);
@@ -806,8 +820,7 @@ screwup:
#ifdef KERBEROS
int
kerberos(host, bp, locuser, user)
char **host, *bp, *locuser, *user;
kerberos(char **host, char *bp, char *locuser, char *user)
{
if (use_kerberos) {
setuid(getuid());
@@ -837,14 +850,14 @@ kerberos(host, bp, locuser, user)
errx(1,
"the -x option requires Kerberos authentication");
#endif
rem = rcmd(host, port, locuser, user, bp, 0);
rem = rcmd_af(host, port, locuser, user, bp, 0, family);
}
return (rem);
}
#endif /* KERBEROS */
int
response()
response(void)
{
char ch, *cp, resp, rbuf[BUFSIZ];
@@ -877,48 +890,34 @@ response()
}
void
usage()
usage(void)
{
#ifdef KERBEROS
#ifdef CRYPT
(void)fprintf(stderr, "%s\n%s\n",
"usage: rcp [-Kpx] [-k realm] f1 f2",
" rcp [-Kprx] [-k realm] f1 ... fn directory");
"usage: rcp [-46Kpx] [-k realm] f1 f2",
" rcp [-46Kprx] [-k realm] f1 ... fn directory");
#else
(void)fprintf(stderr, "%s\n%s\n",
"usage: rcp [-Kp] [-k realm] f1 f2",
" rcp [-Kpr] [-k realm] f1 ... fn directory");
"usage: rcp [-46Kp] [-k realm] f1 f2",
" rcp [-46Kpr] [-k realm] f1 ... fn directory");
#endif
#else
(void)fprintf(stderr, "%s\n%s\n",
"usage: rcp [-p] f1 f2",
" rcp [-pr] f1 ... fn directory");
"usage: rcp [-46p] f1 f2",
" rcp [-46pr] f1 ... fn directory");
#endif
exit(1);
}
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#ifdef KERBEROS
void
#if __STDC__
oldw(const char *fmt, ...)
#else
oldw(fmt, va_alist)
char *fmt;
va_dcl
#endif
{
va_list ap;
#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
(void)fprintf(stderr, "rcp: ");
(void)vfprintf(stderr, fmt, ap);
(void)fprintf(stderr, ", using standard rcp\n");
@@ -927,21 +926,11 @@ oldw(fmt, va_alist)
#endif
void
#if __STDC__
run_err(const char *fmt, ...)
#else
run_err(fmt, va_alist)
char *fmt;
va_dcl
#endif
{
static FILE *fp;
va_list ap;
#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
++errs;
if (fp == NULL && !(fp = fdopen(rem, "w")))
+8 -16
View File
@@ -35,9 +35,9 @@
#if 0
static char sccsid[] = "@(#)util.c 8.2 (Berkeley) 4/2/94";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/stat.h>
@@ -56,8 +56,7 @@ static const char rcsid[] =
#include "extern.h"
char *
colon(cp)
char *cp;
colon(char *cp)
{
if (*cp == ':') /* Leading colon is part of file name. */
return (0);
@@ -72,8 +71,7 @@ colon(cp)
}
void
verifydir(cp)
char *cp;
verifydir(char *cp)
{
struct stat stb;
@@ -87,8 +85,7 @@ verifydir(cp)
}
int
okname(cp0)
char *cp0;
okname(char *cp0)
{
int c;
char *cp;
@@ -108,9 +105,7 @@ bad: warnx("%s: invalid user name", cp0);
}
int
susystem(s, userid)
int userid;
char *s;
susystem(char *s, int userid)
{
sig_t istat, qstat;
int status;
@@ -136,9 +131,7 @@ susystem(s, userid)
}
BUF *
allocbuf(bp, fd, blksize)
BUF *bp;
int fd, blksize;
allocbuf(BUF *bp, int fd, int blksize)
{
struct stat stb;
size_t size;
@@ -162,8 +155,7 @@ allocbuf(bp, fd, blksize)
}
void
lostconn(signo)
int signo;
lostconn(int signo)
{
if (!iamremote)
warnx("lost connection");
+24 -31
View File
@@ -40,11 +40,10 @@ static const char copyright[] =
#ifndef lint
#if 0
static char sccsid[] = "@(#)rm.c 8.5 (Berkeley) 4/18/94";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <sys/param.h>
@@ -63,12 +62,12 @@ static const char rcsid[] =
int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok;
uid_t uid;
int check __P((char *, char *, struct stat *));
void checkdot __P((char **));
void rm_file __P((char **));
void rm_overwrite __P((char *, struct stat *));
void rm_tree __P((char **));
void usage __P((void));
int check(char *, char *, struct stat *);
void checkdot(char **);
void rm_file(char **);
void rm_overwrite(char *, struct stat *);
void rm_tree(char **);
void usage(void);
/*
* rm --
@@ -78,9 +77,7 @@ void usage __P((void));
* file removal.
*/
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
int ch, rflag;
char *p;
@@ -95,11 +92,14 @@ main(argc, argv)
else
++p;
if (strcmp(p, "unlink") == 0) {
if (argc == 2) {
rm_file(&argv[1]);
exit(eval);
} else
while (getopt(argc, argv, "") != -1)
usage();
argc -= optind;
argv += optind;
if (argc != 1)
usage();
rm_file(&argv[0]);
exit(eval);
}
Pflag = rflag = 0;
@@ -157,8 +157,7 @@ main(argc, argv)
}
void
rm_tree(argv)
char **argv;
rm_tree(char **argv)
{
FTS *fts;
FTSENT *p;
@@ -289,8 +288,7 @@ err:
}
void
rm_file(argv)
char **argv;
rm_file(char **argv)
{
struct stat sb;
int rval;
@@ -357,14 +355,12 @@ rm_file(argv)
* XXX
* This is a cheap way to *really* delete files. Note that only regular
* files are deleted, directories (and therefore names) will remain.
* Also, this assumes a fixed-block file system (like FFS, or a V7 or a
* System V file system). In a logging file system, you'll have to have
* Also, this assumes a fixed-block filesystem (like FFS, or a V7 or a
* System V filesystem). In a logging filesystem, you'll have to have
* kernel support.
*/
void
rm_overwrite(file, sbp)
char *file;
struct stat *sbp;
rm_overwrite(char *file, struct stat *sbp)
{
struct stat sb;
struct statfs fsb;
@@ -416,9 +412,7 @@ err: eval = 1;
int
check(path, name, sp)
char *path, *name;
struct stat *sp;
check(char *path, char *name, struct stat *sp)
{
int ch, first;
char modep[15], *flagsp;
@@ -459,8 +453,7 @@ check(path, name, sp)
#define ISDOT(a) ((a)[0] == '.' && (!(a)[1] || ((a)[1] == '.' && !(a)[2])))
void
checkdot(argv)
char **argv;
checkdot(char **argv)
{
char *p, **save, **t;
int complained;
@@ -484,7 +477,7 @@ checkdot(argv)
}
void
usage()
usage(void)
{
(void)fprintf(stderr, "%s\n%s\n",
+25 -27
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <stdlib.h>
#include "shell.h"
@@ -56,14 +56,13 @@ static const char rcsid[] =
struct alias *atab[ATABSIZE];
STATIC void setalias __P((char *, char *));
STATIC int unalias __P((char *));
STATIC struct alias **hashalias __P((char *));
STATIC void setalias(char *, char *);
STATIC int unalias(char *);
STATIC struct alias **hashalias(char *);
STATIC
void
setalias(name, val)
char *name, *val;
setalias(char *name, char *val)
{
struct alias *ap, **app;
@@ -116,9 +115,8 @@ setalias(name, val)
}
STATIC int
unalias(name)
char *name;
{
unalias(char *name)
{
struct alias *ap, **app;
app = hashalias(name);
@@ -158,7 +156,8 @@ SHELLPROC {
#endif
void
rmaliases() {
rmaliases(void)
{
struct alias *ap, *tmp;
int i;
@@ -178,9 +177,7 @@ rmaliases() {
}
struct alias *
lookupalias(name, check)
char *name;
int check;
lookupalias(char *name, int check)
{
struct alias *ap = *hashalias(name);
@@ -199,9 +196,7 @@ lookupalias(name, check)
* TODO - sort output
*/
int
aliascmd(argc, argv)
int argc;
char **argv;
aliascmd(int argc, char **argv)
{
char *n, *v;
int ret = 0;
@@ -212,8 +207,11 @@ aliascmd(argc, argv)
for (i = 0; i < ATABSIZE; i++)
for (ap = atab[i]; ap; ap = ap->next) {
if (*ap->name != '\0')
out1fmt("alias %s=%s\n", ap->name, ap->val);
if (*ap->name != '\0') {
out1fmt("alias %s=", ap->name);
out1qstr(ap->val);
out1c('\n');
}
}
return (0);
}
@@ -222,8 +220,11 @@ aliascmd(argc, argv)
if ((ap = lookupalias(n, 0)) == NULL) {
outfmt(out2, "alias: %s not found\n", n);
ret = 1;
} else
out1fmt("alias %s=%s\n", n, ap->val);
} else {
out1fmt("alias %s=", n);
out1qstr(ap->val);
out1c('\n');
}
else {
*v++ = '\0';
setalias(n, v);
@@ -234,9 +235,7 @@ aliascmd(argc, argv)
}
int
unaliascmd(argc, argv)
int argc __unused;
char **argv __unused;
unaliascmd(int argc __unused, char **argv __unused)
{
int i;
@@ -253,9 +252,8 @@ unaliascmd(argc, argv)
}
STATIC struct alias **
hashalias(p)
char *p;
{
hashalias(char *p)
{
unsigned int hashval;
hashval = *p << 4;
+4 -4
View File
@@ -46,7 +46,7 @@ struct alias {
int flag;
};
struct alias *lookupalias __P((char *, int));
int aliascmd __P((int, char **));
int unaliascmd __P((int, char **));
void rmaliases __P((void));
struct alias *lookupalias(char *, int);
int aliascmd(int, char **);
int unaliascmd(int, char **);
void rmaliases(void);
+2 -2
View File
@@ -34,5 +34,5 @@
* $FreeBSD$
*/
int arith __P((char *));
int expcmd __P((int , char **));
int arith(char *);
int expcmd(int , char **);
+8 -15
View File
@@ -87,8 +87,6 @@ expr: ARITH_LPAREN expr ARITH_RPAREN = { $$ = $2; }
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef lint
@@ -107,12 +105,11 @@ static const char rcsid[] =
char *arith_buf, *arith_startbuf;
extern void arith_lex_reset();
int yylex __P((void));
int yyparse __P((void));
int yylex(void);
int yyparse(void);
int
arith(s)
char *s;
arith(char *s)
{
long result;
@@ -127,8 +124,7 @@ arith(s)
}
void
yyerror(s)
char *s;
yyerror(char *s)
{
yyerrok;
@@ -141,9 +137,7 @@ yyerror(s)
* The exp(1) builtin.
*/
int
expcmd(argc, argv)
int argc;
char **argv;
expcmd(int argc, char **argv)
{
char *p;
char *concat;
@@ -180,13 +174,12 @@ expcmd(argc, argv)
/*************************/
#ifdef TEST_ARITH
#include <stdio.h>
main(argc, argv)
char *argv[];
main(int argc, char *argv[])
{
printf("%d\n", exp(argv[1]));
}
error(s)
char *s;
error(char *s)
{
fprintf(stderr, "exp: %s\n", s);
exit(1);
+2 -3
View File
@@ -33,8 +33,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef lint
@@ -85,6 +83,7 @@ extern char *arith_buf, *arith_startbuf;
%%
void
arith_lex_reset() {
arith_lex_reset()
{
YY_NEW_FILE;
}
-5
View File
@@ -83,13 +83,8 @@
#define INITARGS(argv) if ((commandname = argv[0]) == NULL) {fputs("Argc is zero\n", stderr); exit(2);} else
#endif
#ifdef __STDC__
pointer stalloc(int);
void error(const char *, ...) __printf0like(1, 2);
#else
pointer stalloc();
void error();
#endif
extern char *commandname;
+1 -3
View File
@@ -48,9 +48,7 @@
/* #define eflag 1 */
int
main(argc, argv)
int argc;
char **argv;
main(int argc, char *argv[])
{
char **ap;
char *p;
+3 -1
View File
@@ -49,7 +49,8 @@
#
# NOTE: bltincmd must come first!
bltincmd command
bltincmd builtin
commandcmd command
#alloccmd alloc
bgcmd -j bg
breakcmd break continue
@@ -91,3 +92,4 @@ waitcmd wait
aliascmd alias
ulimitcmd ulimit
testcmd test [
bindcmd bind
+114 -105
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)cd.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
@@ -48,6 +48,7 @@ static const char rcsid[] =
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
/*
* The cd and pwd commands.
@@ -67,27 +68,47 @@ static const char rcsid[] =
#include "show.h"
#include "cd.h"
STATIC int docd __P((char *, int));
STATIC char *getcomponent __P((void));
STATIC void updatepwd __P((char *));
STATIC int cdlogical(char *);
STATIC int cdphysical(char *);
STATIC int docd(char *, int, int);
STATIC char *getcomponent(void);
STATIC int updatepwd(char *);
char *curdir = NULL; /* current working directory */
char *prevdir; /* previous working directory */
STATIC char *cdcomppath;
int
cdcmd(argc, argv)
int argc __unused;
char **argv __unused;
cdcmd(int argc, char **argv)
{
char *dest;
char *path;
char *p;
struct stat statb;
int print = 0;
int ch, phys, print = 0;
nextopt(nullstr);
if ((dest = *argptr) == NULL && (dest = bltinlookup("HOME", 1)) == NULL)
optreset = 1; optind = 1; opterr = 0; /* initialize getopt */
phys = Pflag;
while ((ch = getopt(argc, argv, "LP")) != -1) {
switch (ch) {
case 'L':
phys = 0;
break;
case 'P':
phys = 1;
break;
default:
error("unknown option: -%c", optopt);
break;
}
}
argc -= optind;
argv += optind;
if (argc > 1)
error("too many arguments");
if ((dest = *argv) == NULL && (dest = bltinlookup("HOME", 1)) == NULL)
error("HOME not set");
if (*dest == '\0')
dest = ".";
@@ -110,9 +131,8 @@ cdcmd(argc, argv)
p += 2;
print = strcmp(p, dest);
}
if (docd(p, print) >= 0)
if (docd(p, print, phys) >= 0)
return 0;
}
}
error("can't cd to %s", dest);
@@ -122,13 +142,27 @@ cdcmd(argc, argv)
/*
* Actually do the chdir. In an interactive shell, print the
* Actually change the directory. In an interactive shell, print the
* directory name if "print" is nonzero.
*/
STATIC int
docd(dest, print)
char *dest;
int print;
docd(char *dest, int print, int phys)
{
TRACE(("docd(\"%s\", %d, %d) called\n", dest, print, phys));
/* If logical cd fails, fall back to physical. */
if ((phys || cdlogical(dest) < 0) && cdphysical(dest) < 0)
return (-1);
if (print && iflag && curdir)
out1fmt("%s\n", curdir);
return 0;
}
STATIC int
cdlogical(char *dest)
{
char *p;
char *q;
@@ -137,8 +171,6 @@ docd(dest, print)
int first;
int badstat;
TRACE(("docd(\"%s\", %d) called\n", dest, print));
/*
* Check each component of the path. If we find a symlink or
* something we can't stat, clear curdir to force a getcwd()
@@ -165,33 +197,40 @@ docd(dest, print)
if (equal(component, ".."))
continue;
STACKSTRNUL(p);
if ((lstat(stackblock(), &statb) < 0)
|| (S_ISLNK(statb.st_mode))) {
/* print = 1; */
if (lstat(stackblock(), &statb) < 0) {
badstat = 1;
break;
}
}
INTOFF;
if (chdir(dest) < 0) {
if (updatepwd(badstat ? NULL : dest) < 0 || chdir(curdir) < 0) {
INTON;
return -1;
return (-1);
}
updatepwd(badstat ? NULL : dest);
INTON;
if (print && iflag && curdir)
out1fmt("%s\n", curdir);
return 0;
return (0);
}
STATIC int
cdphysical(char *dest)
{
INTOFF;
if (chdir(dest) < 0 || updatepwd(NULL) < 0) {
INTON;
return (-1);
}
INTON;
return (0);
}
/*
* Get the next component of the path name pointed to by cdcomppath.
* This routine overwrites the string pointed to by cdcomppath.
*/
STATIC char *
getcomponent()
getcomponent(void)
{
char *p;
char *start;
@@ -216,9 +255,8 @@ getcomponent()
* cd command. We also call hashcd to let the routines in exec.c know
* that the current directory has changed.
*/
STATIC void
updatepwd(dir)
char *dir;
STATIC int
updatepwd(char *dir)
{
char *new;
char *p;
@@ -236,12 +274,14 @@ updatepwd(dir)
INTOFF;
prevdir = curdir;
curdir = NULL;
if (getpwd() == NULL)
error("getcwd() failed: %s", strerror(errno));
if (getpwd() == NULL) {
INTON;
return (-1);
}
setvar("PWD", curdir, VEXPORT);
setvar("OLDPWD", prevdir, VEXPORT);
INTON;
return;
return (0);
}
cdcomppath = stalloc(strlen(dir) + 1);
scopy(dir, cdcomppath);
@@ -273,51 +313,61 @@ updatepwd(dir)
setvar("PWD", curdir, VEXPORT);
setvar("OLDPWD", prevdir, VEXPORT);
INTON;
}
return (0);
}
int
pwdcmd(argc, argv)
int argc __unused;
char **argv __unused;
pwdcmd(int argc, char **argv)
{
if (!getpwd())
error("getcwd() failed: %s", strerror(errno));
out1str(curdir);
out1c('\n');
char buf[PATH_MAX];
int ch, phys;
optreset = 1; optind = 1; opterr = 0; /* initialize getopt */
phys = Pflag;
while ((ch = getopt(argc, argv, "LP")) != -1) {
switch (ch) {
case 'L':
phys = 0;
break;
case 'P':
phys = 1;
break;
default:
error("unknown option: -%c", optopt);
break;
}
}
argc -= optind;
argv += optind;
if (argc != 0)
error("too many arguments");
if (!phys && getpwd()) {
out1str(curdir);
out1c('\n');
} else {
if (getcwd(buf, sizeof(buf)) == NULL)
error(".: %s", strerror(errno));
out1str(buf);
out1c('\n');
}
return 0;
}
#define MAXPWD 256
/*
* Find out what the current directory is. If we already know the current
* directory, this routine returns immediately.
*/
char *
getpwd()
getpwd(void)
{
char buf[MAXPWD];
char buf[PATH_MAX];
if (curdir)
return curdir;
/*
* Things are a bit complicated here; we could have just used
* getcwd, but traditionally getcwd is implemented using popen
* to /bin/pwd. This creates a problem for us, since we cannot
* keep track of the job if it is being ran behind our backs.
* So we re-implement getcwd(), and we suppress interrupts
* throughout the process. This is not completely safe, since
* the user can still break out of it by killing the pwd program.
* We still try to use getcwd for systems that we know have a
* c implementation of getcwd, that does not open a pipe to
* /bin/pwd.
*/
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__SVR4)
if (getcwd(buf, sizeof(buf)) == NULL) {
char *pwd = getenv("PWD");
struct stat stdot, stpwd;
@@ -332,47 +382,6 @@ getpwd()
return NULL;
}
curdir = savestr(buf);
#else
{
char *p;
int i;
int status;
struct job *jp;
int pip[2];
INTOFF;
if (pipe(pip) < 0)
error("Pipe call failed: %s", strerror(errno));
jp = makejob((union node *)NULL, 1);
if (forkshell(jp, (union node *)NULL, FORK_NOJOB) == 0) {
(void) close(pip[0]);
if (pip[1] != 1) {
close(1);
copyfd(pip[1], 1);
close(pip[1]);
}
(void) execl("/bin/pwd", "pwd", (char *)0);
error("Cannot exec /bin/pwd");
}
(void) close(pip[1]);
pip[1] = -1;
p = buf;
while ((i = read(pip[0], p, buf + MAXPWD - p)) > 0
|| (i == -1 && errno == EINTR)) {
if (i > 0)
p += i;
}
(void) close(pip[0]);
pip[0] = -1;
status = waitforjob(jp);
if (status != 0)
error((char *)0);
if (i < 0 || p == buf || p[-1] != '\n')
error("pwd command failed");
p[-1] = '\0';
}
curdir = savestr(buf);
INTON;
#endif
return curdir;
}
+3 -3
View File
@@ -33,6 +33,6 @@
* $FreeBSD$
*/
char *getpwd __P((void));
int cdcmd __P((int, char **));
int pwdcmd __P((int, char **));
char *getpwd(void);
int cdcmd (int, char **);
int pwdcmd(int, char **);
+9 -46
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)error.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* Errors and exceptions.
@@ -71,7 +71,7 @@ volatile sig_atomic_t intpending;
char *commandname;
static void exverror __P((int, const char *, va_list)) __printf0like(2, 0);
static void exverror(int, const char *, va_list) __printf0like(2, 0);
/*
* Called to raise an exception. Since C doesn't include exceptions, we
@@ -80,8 +80,7 @@ static void exverror __P((int, const char *, va_list)) __printf0like(2, 0);
*/
void
exraise(e)
int e;
exraise(int e)
{
if (handler == NULL)
abort();
@@ -101,7 +100,8 @@ exraise(e)
*/
void
onint() {
onint(void)
{
sigset_t sigset;
/*
@@ -140,10 +140,7 @@ onint() {
* formatting. It then raises the error exception.
*/
static void
exverror(cond, msg, ap)
int cond;
const char *msg;
va_list ap;
exverror(int cond, const char *msg, va_list ap)
{
CLEAR_PENDING_INT;
INTOFF;
@@ -165,51 +162,21 @@ exverror(cond, msg, ap)
}
#ifdef __STDC__
void
error(const char *msg, ...)
#else
void
error(va_alist)
va_dcl
#endif
{
#ifndef __STDC__
const char *msg;
#endif
va_list ap;
#ifdef __STDC__
va_start(ap, msg);
#else
va_start(ap);
msg = va_arg(ap, char *);
#endif
exverror(EXERROR, msg, ap);
va_end(ap);
}
#ifdef __STDC__
void
exerror(int cond, const char *msg, ...)
#else
void
exerror(va_alist)
va_dcl
#endif
{
#ifndef __STDC__
int cond;
char *msg;
#endif
va_list ap;
#ifdef __STDC__
va_start(ap, msg);
#else
va_start(ap);
cond = va_arg(ap, int);
msg = va_arg(ap, char *);
#endif
exverror(cond, msg, ap);
va_end(ap);
}
@@ -254,9 +221,6 @@ STATIC const struct errname errormsg[] = {
{ ENXIO, ALL, "no such device or address" },
{ EROFS, ALL, "read-only file system" },
{ ETXTBSY, ALL, "text busy" },
#ifdef SYSV
{ EAGAIN, E_EXEC, "not enough memory" },
#endif
{ ENOMEM, ALL, "not enough memory" },
#ifdef ENOLINK
{ ENOLINK, ALL, "remote access failed" },
@@ -280,6 +244,7 @@ STATIC const struct errname errormsg[] = {
#ifdef ELIBACC
{ ELIBACC, E_EXEC, "shared library missing" },
#endif
{ EEXIST, E_CREAT, "file exists" },
{ 0, 0, NULL },
};
@@ -291,9 +256,7 @@ STATIC const struct errname errormsg[] = {
*/
char *
errmsg(e, action)
int e;
int action;
errmsg(int e, int action)
{
struct errname const *ep;
static char buf[12];
+5 -7
View File
@@ -89,11 +89,11 @@ extern volatile sig_atomic_t intpending;
#define CLEAR_PENDING_INT intpending = 0
#define int_pending() intpending
void exraise __P((int));
void onint __P((void));
void error __P((const char *, ...)) __printf0like(1, 2);
void exerror __P((int, const char *, ...)) __printf0like(2, 3);
char *errmsg __P((int, int));
void exraise(int);
void onint(void);
void error(const char *, ...) __printf0like(1, 2);
void exerror(int, const char *, ...) __printf0like(2, 3);
char *errmsg(int, int);
/*
@@ -101,7 +101,5 @@ char *errmsg __P((int, int));
* so we use _setjmp instead.
*/
#ifdef BSD
#define setjmp(jmploc) _setjmp(jmploc)
#define longjmp(jmploc, val) _longjmp(jmploc, val)
#endif
+85 -62
View File
@@ -38,10 +38,11 @@
#if 0
static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <paths.h>
#include <signal.h>
#include <unistd.h>
#include <sys/wait.h> /* For WIFSIGNALED(status) */
@@ -92,14 +93,14 @@ int exitstatus; /* exit status of last command */
int oexitstatus; /* saved exit status */
STATIC void evalloop __P((union node *));
STATIC void evalfor __P((union node *));
STATIC void evalcase __P((union node *, int));
STATIC void evalsubshell __P((union node *, int));
STATIC void expredir __P((union node *));
STATIC void evalpipe __P((union node *));
STATIC void evalcommand __P((union node *, int, struct backcmd *));
STATIC void prehash __P((union node *));
STATIC void evalloop(union node *);
STATIC void evalfor(union node *);
STATIC void evalcase(union node *, int);
STATIC void evalsubshell(union node *, int);
STATIC void expredir(union node *);
STATIC void evalpipe(union node *);
STATIC void evalcommand(union node *, int, struct backcmd *);
STATIC void prehash(union node *);
/*
@@ -127,9 +128,7 @@ SHELLPROC {
*/
int
evalcmd(argc, argv)
int argc;
char **argv;
evalcmd(int argc, char **argv)
{
char *p;
char *concat;
@@ -161,9 +160,8 @@ evalcmd(argc, argv)
*/
void
evalstring(s)
char *s;
{
evalstring(char *s)
{
union node *n;
struct stackmark smark;
@@ -185,9 +183,7 @@ evalstring(s)
*/
void
evaltree(n, flags)
union node *n;
int flags;
evaltree(union node *n, int flags)
{
if (n == NULL) {
TRACE(("evaltree(NULL) called\n"));
@@ -305,8 +301,7 @@ out:
STATIC void
evalloop(n)
union node *n;
evalloop(union node *n)
{
int status;
@@ -342,8 +337,7 @@ skipping: if (evalskip == SKIPCONT && --skipcount <= 0) {
STATIC void
evalfor(n)
union node *n;
evalfor(union node *n)
{
struct arglist arglist;
union node *argp;
@@ -383,9 +377,7 @@ out:
STATIC void
evalcase(n, flags)
union node *n;
int flags;
evalcase(union node *n, int flags)
{
union node *cp;
union node *patp;
@@ -417,9 +409,7 @@ out:
*/
STATIC void
evalsubshell(n, flags)
union node *n;
int flags;
evalsubshell(union node *n, int flags)
{
struct job *jp;
int backgnd = (n->type == NBACKGND);
@@ -446,8 +436,7 @@ evalsubshell(n, flags)
*/
STATIC void
expredir(n)
union node *n;
expredir(union node *n)
{
union node *redir;
@@ -460,6 +449,7 @@ expredir(n)
case NTO:
case NFROMTO:
case NAPPEND:
case NCLOBBER:
expandarg(redir->nfile.fname, &fn, EXP_TILDE | EXP_REDIR);
redir->nfile.expfname = fn.list->text;
break;
@@ -484,8 +474,7 @@ expredir(n)
*/
STATIC void
evalpipe(n)
union node *n;
evalpipe(union node *n)
{
struct job *jp;
struct nodelist *lp;
@@ -551,9 +540,7 @@ evalpipe(n)
*/
void
evalbackcmd(n, result)
union node *n;
struct backcmd *result;
evalbackcmd(union node *n, struct backcmd *result)
{
int pip[2];
struct job *jp;
@@ -603,10 +590,7 @@ out:
*/
STATIC void
evalcommand(cmd, flags, backcmd)
union node *cmd;
int flags;
struct backcmd *backcmd;
evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
{
struct stackmark smark;
union node *argp;
@@ -764,7 +748,9 @@ evalcommand(cmd, flags, backcmd)
&& (cmdentry.cmdtype != CMDBUILTIN
|| cmdentry.u.index == CDCMD
|| cmdentry.u.index == DOTCMD
|| cmdentry.u.index == EVALCMD))) {
|| cmdentry.u.index == EVALCMD))
|| (cmdentry.cmdtype == CMDBUILTIN &&
cmdentry.u.index == COMMANDCMD)) {
jp = makejob(cmd, 1);
mode = cmd->ncmd.backgnd;
if (flags & EV_BACKCMD) {
@@ -886,7 +872,8 @@ cmddone:
#ifndef NO_HISTORY
|| cmdentry.u.index == HISTCMD
#endif
|| cmdentry.u.index == EXECCMD)
|| cmdentry.u.index == EXECCMD
|| cmdentry.u.index == COMMANDCMD)
exraise(e);
FORCEINTON;
}
@@ -944,8 +931,7 @@ out:
*/
STATIC void
prehash(n)
union node *n;
prehash(union node *n)
{
struct cmdentry entry;
@@ -968,9 +954,7 @@ prehash(n)
*/
int
bltincmd(argc, argv)
int argc __unused;
char **argv __unused;
bltincmd(int argc __unused, char **argv __unused)
{
listsetvar(cmdenviron);
/*
@@ -993,9 +977,7 @@ bltincmd(argc, argv)
*/
int
breakcmd(argc, argv)
int argc;
char **argv;
breakcmd(int argc, char **argv)
{
int n = argc > 1 ? number(argv[1]) : 1;
@@ -1008,15 +990,62 @@ breakcmd(argc, argv)
return 0;
}
/*
* The `command' command.
*/
int
commandcmd(int argc, char **argv)
{
static char stdpath[] = _PATH_STDPATH;
struct jmploc loc, *old;
struct strlist *sp;
char *path;
int ch;
for (sp = cmdenviron; sp ; sp = sp->next)
setvareq(sp->text, VEXPORT|VSTACK);
path = pathval();
optind = optreset = 1;
opterr = 0;
while ((ch = getopt(argc, argv, "p")) != -1) {
switch (ch) {
case 'p':
path = stdpath;
break;
case '?':
default:
error("unknown option: -%c", optopt);
}
}
argc -= optind;
argv += optind;
if (argc != 0) {
old = handler;
handler = &loc;
if (setjmp(handler->loc) == 0)
shellexec(argv, environment(), path, 0);
handler = old;
if (exception == EXEXEC)
exit(exerrno);
exraise(exception);
}
/*
* Do nothing successfully if no command was specified;
* ksh also does this.
*/
exit(0);
}
/*
* The return command.
*/
int
returncmd(argc, argv)
int argc;
char **argv;
returncmd(int argc, char **argv)
{
int ret = argc > 1 ? number(argv[1]) : oexitstatus;
@@ -1033,27 +1062,21 @@ returncmd(argc, argv)
int
falsecmd(argc, argv)
int argc __unused;
char **argv __unused;
falsecmd(int argc __unused, char **argv __unused)
{
return 1;
}
int
truecmd(argc, argv)
int argc __unused;
char **argv __unused;
truecmd(int argc __unused, char **argv __unused)
{
return 0;
}
int
execcmd(argc, argv)
int argc;
char **argv;
execcmd(int argc, char **argv)
{
if (argc > 1) {
struct strlist *sp;
+11 -10
View File
@@ -49,17 +49,18 @@ struct backcmd { /* result of evalbackcmd */
struct job *jp; /* job structure for command */
};
int evalcmd __P((int, char **));
void evalstring __P((char *));
int evalcmd(int, char **);
void evalstring(char *);
union node; /* BLETCH for ansi C */
void evaltree __P((union node *, int));
void evalbackcmd __P((union node *, struct backcmd *));
int bltincmd __P((int, char **));
int breakcmd __P((int, char **));
int returncmd __P((int, char **));
int falsecmd __P((int, char **));
int truecmd __P((int, char **));
int execcmd __P((int, char **));
void evaltree(union node *, int);
void evalbackcmd(union node *, struct backcmd *);
int bltincmd(int, char **);
int breakcmd(int, char **);
int returncmd(int, char **);
int falsecmd(int, char **);
int truecmd(int, char **);
int execcmd(int, char **);
int commandcmd(int, char **);
/* in_function returns nonzero if we are currently evaluating a function */
#define in_function() funcnest
+35 -182
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
@@ -99,13 +99,10 @@ STATIC int builtinloc = -1; /* index in path of %builtin, or -1 */
int exerrno = 0; /* Last exec error */
STATIC void tryexec __P((char *, char **, char **));
#ifndef BSD
STATIC void execinterp __P((char **, char **));
#endif
STATIC void printentry __P((struct tblentry *, int));
STATIC struct tblentry *cmdlookup __P((char *, int));
STATIC void delete_cmd_entry __P((void));
STATIC void tryexec(char *, char **, char **);
STATIC void printentry(struct tblentry *, int);
STATIC struct tblentry *cmdlookup(char *, int);
STATIC void delete_cmd_entry(void);
@@ -115,10 +112,7 @@ STATIC void delete_cmd_entry __P((void));
*/
void
shellexec(argv, envp, path, index)
char **argv, **envp;
char *path;
int index;
shellexec(char **argv, char **envp, char *path, int index)
{
char *cmdname;
int e;
@@ -155,36 +149,16 @@ shellexec(argv, envp, path, index)
STATIC void
tryexec(cmd, argv, envp)
char *cmd;
char **argv;
char **envp;
{
tryexec(char *cmd, char **argv, char **envp)
{
int e;
#ifndef BSD
char *p;
#endif
#ifdef SYSV
do {
execve(cmd, argv, envp);
} while (errno == EINTR);
#else
execve(cmd, argv, envp);
#endif
e = errno;
if (e == ENOEXEC) {
initshellproc();
setinputfile(cmd, 0);
commandname = arg0 = savestr(argv[0]);
#ifndef BSD
pgetc(); pungetc(); /* fill up input buffer */
p = parsenextc;
if (parsenleft > 2 && p[0] == '#' && p[1] == '!') {
argv[0] = cmd;
execinterp(argv, envp);
}
#endif
setparam(argv + 1);
exraise(EXSHELLPROC);
/*NOTREACHED*/
@@ -192,86 +166,6 @@ tryexec(cmd, argv, envp)
errno = e;
}
#ifndef BSD
/*
* Execute an interpreter introduced by "#!", for systems where this
* feature has not been built into the kernel. If the interpreter is
* the shell, return (effectively ignoring the "#!"). If the execution
* of the interpreter fails, exit.
*
* This code peeks inside the input buffer in order to avoid actually
* reading any input. It would benefit from a rewrite.
*/
#define NEWARGS 5
STATIC void
execinterp(argv, envp)
char **argv, **envp;
{
int n;
char *inp;
char *outp;
char c;
char *p;
char **ap;
char *newargs[NEWARGS];
int i;
char **ap2;
char **new;
n = parsenleft - 2;
inp = parsenextc + 2;
ap = newargs;
for (;;) {
while (--n >= 0 && (*inp == ' ' || *inp == '\t'))
inp++;
if (n < 0)
goto bad;
if ((c = *inp++) == '\n')
break;
if (ap == &newargs[NEWARGS])
bad: error("Bad #! line");
STARTSTACKSTR(outp);
do {
STPUTC(c, outp);
} while (--n >= 0 && (c = *inp++) != ' ' && c != '\t' && c != '\n');
STPUTC('\0', outp);
n++, inp--;
*ap++ = grabstackstr(outp);
}
if (ap == newargs + 1) { /* if no args, maybe no exec is needed */
p = newargs[0];
for (;;) {
if (equal(p, "sh") || equal(p, "ash")) {
return;
}
while (*p != '/') {
if (*p == '\0')
goto break2;
p++;
}
p++;
}
break2:;
}
i = (char *)ap - (char *)newargs; /* size in bytes */
if (i == 0)
error("Bad #! line");
for (ap2 = argv ; *ap2++ != NULL ; );
new = ckmalloc(i + ((char *)ap2 - (char *)argv));
ap = newargs, ap2 = new;
while ((i -= sizeof (char **)) >= 0)
*ap2++ = *ap++;
ap = argv;
while (*ap2++ = *ap++);
shellexec(new, envp, pathval(), 0);
}
#endif
/*
* Do a path search. The variable path (passed by reference) should be
* set to the start of the path before the first call; padvance will update
@@ -285,10 +179,8 @@ break2:;
char *pathopt;
char *
padvance(path, name)
char **path;
char *name;
{
padvance(char **path, char *name)
{
char *p, *q;
char *start;
int len;
@@ -325,9 +217,7 @@ padvance(path, name)
int
hashcmd(argc, argv)
int argc __unused;
char **argv __unused;
hashcmd(int argc __unused, char **argv __unused)
{
struct tblentry **pp;
struct tblentry *cmdp;
@@ -347,7 +237,8 @@ hashcmd(argc, argv)
if (*argptr == NULL) {
for (pp = cmdtable ; pp < &cmdtable[CMDTABLESIZE] ; pp++) {
for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) {
printentry(cmdp, verbose);
if (cmdp->cmdtype == CMDNORMAL)
printentry(cmdp, verbose);
}
}
return 0;
@@ -375,10 +266,8 @@ hashcmd(argc, argv)
STATIC void
printentry(cmdp, verbose)
struct tblentry *cmdp;
int verbose;
{
printentry(struct tblentry *cmdp, int verbose)
{
int index;
char *path;
char *name;
@@ -421,11 +310,7 @@ printentry(cmdp, verbose)
*/
void
find_command(name, entry, printerr, path)
char *name;
struct cmdentry *entry;
int printerr;
char *path;
find_command(char *name, struct cmdentry *entry, int printerr, char *path)
{
struct tblentry *cmdp;
int index;
@@ -494,11 +379,7 @@ loop:
TRACE(("searchexec \"%s\": no change\n", name));
goto success;
}
while (stat(fullname, &statb) < 0) {
#ifdef SYSV
if (errno == EINTR)
continue;
#endif
if (stat(fullname, &statb) < 0) {
if (errno != ENOENT && errno != ENOTDIR)
e = errno;
goto loop;
@@ -556,8 +437,7 @@ success:
*/
int
find_builtin(name)
char *name;
find_builtin(char *name)
{
const struct builtincmd *bp;
@@ -576,7 +456,8 @@ find_builtin(name)
*/
void
hashcd() {
hashcd(void)
{
struct tblentry **pp;
struct tblentry *cmdp;
@@ -598,8 +479,7 @@ hashcd() {
*/
void
changepath(newval)
const char *newval;
changepath(const char *newval)
{
const char *old, *new;
int index;
@@ -643,8 +523,7 @@ changepath(newval)
*/
void
clearcmdentry(firstchange)
int firstchange;
clearcmdentry(int firstchange)
{
struct tblentry **tblp;
struct tblentry **pp;
@@ -682,7 +561,8 @@ SHELLPROC {
#endif
void
deletefuncs() {
deletefuncs(void)
{
struct tblentry **tblp;
struct tblentry **pp;
struct tblentry *cmdp;
@@ -717,9 +597,7 @@ struct tblentry **lastcmdentry;
STATIC struct tblentry *
cmdlookup(name, add)
char *name;
int add;
cmdlookup(char *name, int add)
{
int hashval;
char *p;
@@ -756,7 +634,8 @@ cmdlookup(name, add)
*/
STATIC void
delete_cmd_entry() {
delete_cmd_entry(void)
{
struct tblentry *cmdp;
INTOFF;
@@ -768,35 +647,14 @@ delete_cmd_entry() {
#ifdef notdef
void
getcmdentry(name, entry)
char *name;
struct cmdentry *entry;
{
struct tblentry *cmdp = cmdlookup(name, 0);
if (cmdp) {
entry->u = cmdp->param;
entry->cmdtype = cmdp->cmdtype;
} else {
entry->cmdtype = CMDUNKNOWN;
entry->u.index = 0;
}
}
#endif
/*
* Add a new command entry, replacing any existing command entry for
* the same name.
*/
void
addcmdentry(name, entry)
char *name;
struct cmdentry *entry;
{
addcmdentry(char *name, struct cmdentry *entry)
{
struct tblentry *cmdp;
INTOFF;
@@ -815,10 +673,8 @@ addcmdentry(name, entry)
*/
void
defun(name, func)
char *name;
union node *func;
{
defun(char *name, union node *func)
{
struct cmdentry entry;
INTOFF;
@@ -834,9 +690,8 @@ defun(name, func)
*/
int
unsetfunc(name)
char *name;
{
unsetfunc(char *name)
{
struct tblentry *cmdp;
if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->cmdtype == CMDFUNCTION) {
@@ -852,9 +707,7 @@ unsetfunc(name)
*/
int
typecmd(argc, argv)
int argc;
char **argv;
typecmd(int argc, char **argv)
{
struct cmdentry entry;
struct tblentry *cmdp;
+14 -14
View File
@@ -56,17 +56,17 @@ struct cmdentry {
extern char *pathopt; /* set by padvance */
extern int exerrno; /* last exec error */
void shellexec __P((char **, char **, char *, int));
char *padvance __P((char **, char *));
int hashcmd __P((int, char **));
void find_command __P((char *, struct cmdentry *, int, char *));
int find_builtin __P((char *));
void hashcd __P((void));
void changepath __P((const char *));
void deletefuncs __P((void));
void getcmdentry __P((char *, struct cmdentry *));
void addcmdentry __P((char *, struct cmdentry *));
void defun __P((char *, union node *));
int unsetfunc __P((char *));
int typecmd __P((int, char **));
void clearcmdentry __P((int));
void shellexec(char **, char **, char *, int);
char *padvance(char **, char *);
int hashcmd(int, char **);
void find_command(char *, struct cmdentry *, int, char *);
int find_builtin(char *);
void hashcd(void);
void changepath(const char *);
void deletefuncs(void);
void getcmdentry(char *, struct cmdentry *);
void addcmdentry(char *, struct cmdentry *);
void defun(char *, union node *);
int unsetfunc(char *);
int typecmd(int, char **);
void clearcmdentry(int);
+68 -105
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/time.h>
@@ -95,27 +95,27 @@ struct ifsregion ifsfirst; /* first struct in list of ifs regions */
struct ifsregion *ifslastp; /* last struct in list */
struct arglist exparg; /* holds expanded arg list */
STATIC void argstr __P((char *, int));
STATIC char *exptilde __P((char *, int));
STATIC void expbackq __P((union node *, int, int));
STATIC int subevalvar __P((char *, char *, int, int, int, int));
STATIC char *evalvar __P((char *, int));
STATIC int varisset __P((char *, int));
STATIC void varvalue __P((char *, int, int));
STATIC void recordregion __P((int, int, int));
STATIC void removerecordregions __P((int));
STATIC void ifsbreakup __P((char *, struct arglist *));
STATIC void expandmeta __P((struct strlist *, int));
STATIC void expmeta __P((char *, char *));
STATIC void addfname __P((char *));
STATIC struct strlist *expsort __P((struct strlist *));
STATIC struct strlist *msort __P((struct strlist *, int));
STATIC int pmatch __P((char *, char *, int));
STATIC char *cvtnum __P((int, char *));
STATIC int collate_range_cmp __P((int, int));
STATIC void argstr(char *, int);
STATIC char *exptilde(char *, int);
STATIC void expbackq(union node *, int, int);
STATIC int subevalvar(char *, char *, int, int, int, int);
STATIC char *evalvar(char *, int);
STATIC int varisset(char *, int);
STATIC void varvalue(char *, int, int);
STATIC void recordregion(int, int, int);
STATIC void removerecordregions(int);
STATIC void ifsbreakup(char *, struct arglist *);
STATIC void expandmeta(struct strlist *, int);
STATIC void expmeta(char *, char *);
STATIC void addfname(char *);
STATIC struct strlist *expsort(struct strlist *);
STATIC struct strlist *msort(struct strlist *, int);
STATIC int pmatch(char *, char *, int);
STATIC char *cvtnum(int, char *);
STATIC int collate_range_cmp(int, int);
STATIC int collate_range_cmp (c1, c2)
int c1, c2;
STATIC int
collate_range_cmp (int c1, int c2)
{
static char s1[2], s2[2];
int ret;
@@ -133,13 +133,13 @@ STATIC int collate_range_cmp (c1, c2)
/*
* Expand shell variables and backquotes inside a here document.
* union node *arg the document
* int fd; where to write the expanded version
*/
void
expandhere(arg, fd)
union node *arg; /* the document */
int fd; /* where to write the expanded version */
{
expandhere(union node *arg, int fd)
{
herefd = fd;
expandarg(arg, (struct arglist *)NULL, 0);
xwrite(fd, stackblock(), expdest - stackblock());
@@ -154,10 +154,7 @@ expandhere(arg, fd)
*/
void
expandarg(arg, arglist, flag)
union node *arg;
struct arglist *arglist;
int flag;
expandarg(union node *arg, struct arglist *arglist, int flag)
{
struct strlist *sp;
char *p;
@@ -213,9 +210,7 @@ expandarg(arg, arglist, flag)
*/
STATIC void
argstr(p, flag)
char *p;
int flag;
argstr(char *p, int flag)
{
char c;
int quotes = flag & (EXP_FULL | EXP_CASE); /* do CTLESC */
@@ -277,9 +272,7 @@ breakloop:;
}
STATIC char *
exptilde(p, flag)
char *p;
int flag;
exptilde(char *p, int flag)
{
char c, *startp = p;
struct passwd *pw;
@@ -327,8 +320,7 @@ lose:
STATIC void
removerecordregions(endoff)
int endoff;
removerecordregions(int endoff)
{
if (ifslastp == NULL)
return;
@@ -371,8 +363,7 @@ removerecordregions(endoff)
* evaluate, place result in (backed up) result, adjust string position.
*/
void
expari(flag)
int flag;
expari(int flag)
{
char *p, *start;
int result;
@@ -431,10 +422,7 @@ expari(flag)
*/
STATIC void
expbackq(cmd, quoted, flag)
union node *cmd;
int quoted;
int flag;
expbackq(union node *cmd, int quoted, int flag)
{
struct backcmd in;
int i;
@@ -507,13 +495,8 @@ expbackq(cmd, quoted, flag)
STATIC int
subevalvar(p, str, strloc, subtype, startloc, varflags)
char *p;
char *str;
int strloc;
int subtype;
int startloc;
int varflags;
subevalvar(char *p, char *str, int strloc, int subtype, int startloc,
int varflags)
{
char *startp;
char *loc = NULL;
@@ -638,9 +621,7 @@ recordleft:
*/
STATIC char *
evalvar(p, flag)
char *p;
int flag;
evalvar(char *p, int flag)
{
int subtype;
int varflags;
@@ -676,6 +657,17 @@ again: /* jump here after setting a variable with ${var=text} */
}
varlen = 0;
startloc = expdest - stackblock();
if (!set && uflag) {
switch (subtype) {
case VSNORMAL:
case VSTRIMLEFT:
case VSTRIMLEFTMAX:
case VSTRIMRIGHT:
case VSTRIMRIGHTMAX:
case VSLENGTH:
error("%.*s: parameter not set", p - var - 1, var);
}
}
if (set && subtype != VSPLUS) {
/* insert the value of the variable */
if (special) {
@@ -804,9 +796,7 @@ record:
*/
STATIC int
varisset(name, nulok)
char *name;
int nulok;
varisset(char *name, int nulok)
{
if (*name == '!')
@@ -848,10 +838,7 @@ varisset(name, nulok)
*/
STATIC void
varvalue(name, quoted, allow_split)
char *name;
int quoted;
int allow_split;
varvalue(char *name, int quoted, int allow_split)
{
int num;
char *p;
@@ -942,10 +929,7 @@ numvar:
*/
STATIC void
recordregion(start, end, nulonly)
int start;
int end;
int nulonly;
recordregion(int start, int end, int nulonly)
{
struct ifsregion *ifsp;
@@ -970,10 +954,8 @@ recordregion(start, end, nulonly)
* searched for IFS characters have been stored by recordregion.
*/
STATIC void
ifsbreakup(string, arglist)
char *string;
struct arglist *arglist;
{
ifsbreakup(char *string, struct arglist *arglist)
{
struct ifsregion *ifsp;
struct strlist *sp;
char *start;
@@ -1068,9 +1050,7 @@ char *expdir;
STATIC void
expandmeta(str, flag)
struct strlist *str;
int flag __unused;
expandmeta(struct strlist *str, int flag __unused)
{
char *p;
struct strlist **savelastp;
@@ -1124,10 +1104,8 @@ nometa:
*/
STATIC void
expmeta(enddir, name)
char *enddir;
char *name;
{
expmeta(char *enddir, char *name)
{
char *p;
char *q;
char *start;
@@ -1255,9 +1233,8 @@ expmeta(enddir, name)
*/
STATIC void
addfname(name)
char *name;
{
addfname(char *name)
{
char *p;
struct strlist *sp;
@@ -1277,9 +1254,8 @@ addfname(name)
*/
STATIC struct strlist *
expsort(str)
struct strlist *str;
{
expsort(struct strlist *str)
{
int len;
struct strlist *sp;
@@ -1291,9 +1267,7 @@ expsort(str)
STATIC struct strlist *
msort(list, len)
struct strlist *list;
int len;
msort(struct strlist *list, int len)
{
struct strlist *p, *q = NULL;
struct strlist **lpp;
@@ -1339,11 +1313,8 @@ msort(list, len)
*/
int
patmatch(pattern, string, squoted)
char *pattern;
char *string;
int squoted; /* string might have quote chars */
{
patmatch(char *pattern, char *string, int squoted)
{
#ifdef notdef
if (pattern[0] == '!' && pattern[1] == '!')
return 1 - pmatch(pattern + 2, string);
@@ -1354,11 +1325,8 @@ patmatch(pattern, string, squoted)
STATIC int
pmatch(pattern, string, squoted)
char *pattern;
char *string;
int squoted;
{
pmatch(char *pattern, char *string, int squoted)
{
char *p, *q;
char c;
@@ -1482,8 +1450,7 @@ breakloop:
*/
void
rmescapes(str)
char *str;
rmescapes(char *str)
{
char *p, *q;
@@ -1512,10 +1479,8 @@ rmescapes(str)
*/
int
casematch(pattern, val)
union node *pattern;
char *val;
{
casematch(union node *pattern, char *val)
{
struct stackmark smark;
int result;
char *p;
@@ -1537,10 +1502,8 @@ casematch(pattern, val)
*/
STATIC char *
cvtnum(num, buf)
int num;
char *buf;
{
cvtnum(int num, char *buf)
{
char temp[32];
int neg = num < 0;
char *p = temp + 31;
+6 -6
View File
@@ -59,9 +59,9 @@ struct arglist {
union node;
void expandhere __P((union node *, int));
void expandarg __P((union node *, struct arglist *, int));
void expari __P((int));
int patmatch __P((char *, char *, int));
void rmescapes __P((char *));
int casematch __P((union node *, char *));
void expandhere(union node *, int);
void expandarg(union node *, struct arglist *, int);
void expari(int);
int patmatch(char *, char *, int);
void rmescapes(char *);
int casematch(union node *, char *);
+31 -19
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <limits.h>
@@ -72,14 +72,14 @@ EditLine *el; /* editline cookie */
int displayhist;
static FILE *el_in, *el_out;
STATIC char *fc_replace __P((const char *, char *, char *));
STATIC char *fc_replace(const char *, char *, char *);
/*
* Set history and editing status. Called whenever the status may
* have changed (figures out what to do).
*/
void
histedit()
histedit(void)
{
#define editing (Eflag || Vflag)
@@ -130,6 +130,7 @@ bad:
el_set(el, EL_EDITOR, "vi");
else if (Eflag)
el_set(el, EL_EDITOR, "emacs");
el_source(el, NULL);
}
} else {
INTOFF;
@@ -165,9 +166,7 @@ sethistsize(hs)
* the Korn shell fc command. Oh well...
*/
int
histcmd(argc, argv)
int argc;
char **argv;
histcmd(int argc, char **argv)
{
int ch;
char *editor = NULL;
@@ -182,6 +181,7 @@ histcmd(argc, argv)
struct jmploc *volatile savehandler;
char editfile[PATH_MAX];
FILE *efp;
int oldhistnum;
#ifdef __GNUC__
/* Avoid longjmp clobbering */
(void) &editor;
@@ -205,11 +205,12 @@ histcmd(argc, argv)
error("missing history argument");
optreset = 1; optind = 1; /* initialize getopt */
opterr = 0;
while (not_fcnumber(argv[optind]) &&
(ch = getopt(argc, argv, ":e:lnrs")) != -1)
switch ((char)ch) {
case 'e':
editor = shoptarg;
editor = optarg;
break;
case 'l':
lflg = 1;
@@ -392,9 +393,7 @@ histcmd(argc, argv)
}
STATIC char *
fc_replace(s, p, r)
const char *s;
char *p, *r;
fc_replace(const char *s, char *p, char *r)
{
char *dest;
int plen = strlen(p);
@@ -416,8 +415,7 @@ fc_replace(s, p, r)
}
int
not_fcnumber(s)
char *s;
not_fcnumber(char *s)
{
if (s == NULL)
return (0);
@@ -427,9 +425,7 @@ not_fcnumber(s)
}
int
str_to_event(str, last)
char *str;
int last;
str_to_event(char *str, int last)
{
const HistEvent *he;
char *s = str;
@@ -475,17 +471,33 @@ str_to_event(str, last)
}
return (he->num);
}
int
bindcmd(int argc, char **argv)
{
if (el == NULL)
error("line editing is disabled");
return (el_parse(el, argc, argv));
}
#else
#include "error.h"
int
histcmd(argc, argv)
int argc;
char **argv;
histcmd(int argc, char **argv)
{
error("not compiled with history support");
/*NOTREACHED*/
return (0);
}
int
bindcmd(int argc, char **argv)
{
error("not compiled with line editing support");
return (0);
}
#endif
+3 -3
View File
@@ -37,6 +37,6 @@
* $FreeBSD$
*/
void init __P((void));
void reset __P((void));
void initshellproc __P((void));
void init(void);
void reset(void);
void initshellproc(void);
+32 -30
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <stdio.h> /* defines BUFSIZ */
#include <fcntl.h>
@@ -64,6 +64,7 @@ static const char rcsid[] =
#include "alias.h"
#include "parser.h"
#include "myhistedit.h"
#include "trap.h"
#define EOF_NLEFT -99 /* value of parsenleft when EOF pushed back */
@@ -107,8 +108,8 @@ int whichprompt; /* 1 == PS1, 2 == PS2 */
EditLine *el; /* cookie for editline package */
STATIC void pushfile __P((void));
static int preadfd __P((void));
STATIC void pushfile(void);
static int preadfd(void);
#ifdef mkinit
INCLUDE "input.h"
@@ -137,9 +138,7 @@ SHELLPROC {
*/
char *
pfgets(line, len)
char *line;
int len;
pfgets(char *line, int len)
{
char *p = line;
int nleft = len;
@@ -168,18 +167,24 @@ pfgets(line, len)
*/
int
pgetc()
pgetc(void)
{
return pgetc_macro();
}
static int
preadfd()
preadfd(void)
{
int nr;
parsenextc = parsefile->buf;
#ifndef NO_HISTORY
if (el != NULL && gotwinch) {
gotwinch = 0;
el_resize(el);
}
#endif
retry:
#ifndef NO_HISTORY
if (parsefile->fd == 0 && el) {
@@ -227,7 +232,7 @@ retry:
*/
int
preadbuffer()
preadbuffer(void)
{
char *p, *q;
int more;
@@ -314,7 +319,8 @@ check:
*/
void
pungetc() {
pungetc(void)
{
parsenleft++;
parsenextc--;
}
@@ -324,11 +330,8 @@ pungetc() {
* We handle aliases this way.
*/
void
pushstring(s, len, ap)
char *s;
int len;
void *ap;
{
pushstring(char *s, int len, void *ap)
{
struct strpush *sp;
INTOFF;
@@ -351,7 +354,7 @@ pushstring(s, len, ap)
}
void
popstring()
popstring(void)
{
struct strpush *sp = parsefile->strpush;
@@ -374,9 +377,7 @@ popstring()
*/
void
setinputfile(fname, push)
char *fname;
int push;
setinputfile(char *fname, int push)
{
int fd;
int fd2;
@@ -402,8 +403,7 @@ setinputfile(fname, push)
*/
void
setinputfd(fd, push)
int fd, push;
setinputfd(int fd, int push)
{
(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
if (push) {
@@ -425,10 +425,8 @@ setinputfd(fd, push)
*/
void
setinputstring(string, push)
char *string;
int push;
{
setinputstring(char *string, int push)
{
INTOFF;
if (push)
pushfile();
@@ -447,7 +445,8 @@ setinputstring(string, push)
*/
STATIC void
pushfile() {
pushfile(void)
{
struct parsefile *pf;
parsefile->nleft = parsenleft;
@@ -464,7 +463,8 @@ pushfile() {
void
popfile() {
popfile(void)
{
struct parsefile *pf = parsefile;
INTOFF;
@@ -489,7 +489,8 @@ popfile() {
*/
void
popallfiles() {
popallfiles(void)
{
while (parsefile != &basepf)
popfile();
}
@@ -502,7 +503,8 @@ popallfiles() {
*/
void
closescript() {
closescript(void)
{
popallfiles();
if (parsefile->fd > 0) {
close(parsefile->fd);
+12 -12
View File
@@ -49,17 +49,17 @@ extern int parsenleft; /* number of characters left in input buffer */
extern char *parsenextc; /* next character in input buffer */
extern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */
char *pfgets __P((char *, int));
int pgetc __P((void));
int preadbuffer __P((void));
void pungetc __P((void));
void pushstring __P((char *, int, void *));
void popstring __P((void));
void setinputfile __P((char *, int));
void setinputfd __P((int, int));
void setinputstring __P((char *, int));
void popfile __P((void));
void popallfiles __P((void));
void closescript __P((void));
char *pfgets(char *, int);
int pgetc(void);
int preadbuffer(void);
void pungetc(void);
void pushstring(char *, int, void *);
void popstring(void);
void setinputfile(char *, int);
void setinputfd(int, int);
void setinputstring(char *, int);
void popfile(void);
void popallfiles(void);
void closescript(void);
#define pgetc_macro() (--parsenleft >= 0? *parsenextc++ : preadbuffer())
+337 -266
View File
@@ -38,31 +38,26 @@
#if 0
static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <fcntl.h>
#include <signal.h>
#include <errno.h>
#include <paths.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/param.h>
#ifdef BSD
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <paths.h>
#endif
#include <sys/ioctl.h>
#include "shell.h"
#if JOBS
#if OLD_TTY_DRIVER
#include "sgtty.h"
#else
#include <termios.h>
#endif
#undef CEOF /* syntax.h redefines this */
#endif
#include "redir.h"
@@ -85,90 +80,84 @@ struct job *jobtab; /* array of jobs */
int njobs; /* size of array */
MKINIT pid_t backgndpid = -1; /* pid of last background process */
#if JOBS
int initialpgrp; /* pgrp of shell on invocation */
int curjob; /* current job */
struct job *jobmru; /* most recently used job list */
pid_t initialpgrp; /* pgrp of shell on invocation */
#endif
int in_waitcmd = 0; /* are we in waitcmd()? */
int in_dowait = 0; /* are we in dowait()? */
volatile sig_atomic_t breakwaitcmd = 0; /* should wait be terminated? */
static int ttyfd = -1;
#if JOBS
STATIC void restartjob __P((struct job *));
STATIC void restartjob(struct job *);
#endif
STATIC void freejob __P((struct job *));
STATIC struct job *getjob __P((char *));
STATIC int dowait __P((int, struct job *));
#if SYSV
STATIC int onsigchild __P((void));
STATIC void freejob(struct job *);
STATIC struct job *getjob(char *);
STATIC pid_t dowait(int, struct job *);
STATIC pid_t waitproc(int, int *);
STATIC void cmdtxt(union node *);
STATIC void cmdputs(char *);
#if JOBS
STATIC void setcurjob(struct job *);
STATIC void deljob(struct job *);
STATIC struct job *getcurjob(struct job *);
#endif
STATIC int waitproc __P((int, int *));
STATIC void cmdtxt __P((union node *));
STATIC void cmdputs __P((char *));
STATIC void showjob(struct job *, pid_t, int, int);
/*
* Turn job control on and off.
*
* Note: This code assumes that the third arg to ioctl is a character
* pointer, which is true on Berkeley systems but not System V. Since
* System V doesn't have job control yet, this isn't a problem now.
*/
MKINIT int jobctl;
#if JOBS
void
setjobctl(on)
int on;
setjobctl(int on)
{
#ifdef OLD_TTY_DRIVER
int ldisc;
#endif
int i;
if (on == jobctl || rootshell == 0)
return;
if (on) {
if (ttyfd != -1)
close(ttyfd);
if ((ttyfd = open(_PATH_TTY, O_RDWR)) < 0) {
i = 0;
while (i <= 2 && !isatty(i))
i++;
if (i > 2 || (ttyfd = dup(i)) < 0)
goto out;
}
if (fcntl(ttyfd, F_SETFD, FD_CLOEXEC) < 0) {
close(ttyfd);
ttyfd = -1;
goto out;
}
do { /* while we are in the background */
#ifdef OLD_TTY_DRIVER
if (ioctl(2, TIOCGPGRP, (char *)&initialpgrp) < 0) {
#else
initialpgrp = tcgetpgrp(2);
initialpgrp = tcgetpgrp(ttyfd);
if (initialpgrp < 0) {
#endif
out2str("sh: can't access tty; job control turned off\n");
out: out2str("sh: can't access tty; job control turned off\n");
mflag = 0;
return;
}
if (initialpgrp == -1)
initialpgrp = getpgrp();
else if (initialpgrp != getpgrp()) {
killpg(initialpgrp, SIGTTIN);
killpg(0, SIGTTIN);
continue;
}
} while (0);
#ifdef OLD_TTY_DRIVER
if (ioctl(2, TIOCGETD, (char *)&ldisc) < 0 || ldisc != NTTYDISC) {
out2str("sh: need new tty driver to run job control; job control turned off\n");
mflag = 0;
return;
}
#endif
setsignal(SIGTSTP);
setsignal(SIGTTOU);
setsignal(SIGTTIN);
setpgid(0, rootpid);
#ifdef OLD_TTY_DRIVER
ioctl(2, TIOCSPGRP, (char *)&rootpid);
#else
tcsetpgrp(2, rootpid);
#endif
tcsetpgrp(ttyfd, rootpid);
} else { /* turning job control off */
setpgid(0, initialpgrp);
#ifdef OLD_TTY_DRIVER
ioctl(2, TIOCSPGRP, (char *)&initialpgrp);
#else
tcsetpgrp(2, initialpgrp);
#endif
tcsetpgrp(ttyfd, initialpgrp);
close(ttyfd);
ttyfd = -1;
setsignal(SIGTSTP);
setsignal(SIGTTOU);
setsignal(SIGTTIN);
@@ -195,24 +184,22 @@ SHELLPROC {
#if JOBS
int
fgcmd(argc, argv)
int argc __unused;
char **argv;
fgcmd(int argc __unused, char **argv)
{
struct job *jp;
int pgrp;
pid_t pgrp;
int status;
jp = getjob(argv[1]);
if (jp->jobctl == 0)
error("job not created under job control");
out1str(jp->ps[0].cmd);
out1c('\n');
flushout(&output);
pgrp = jp->ps[0].pid;
#ifdef OLD_TTY_DRIVER
ioctl(2, TIOCSPGRP, (char *)&pgrp);
#else
tcsetpgrp(2, pgrp);
#endif
tcsetpgrp(ttyfd, pgrp);
restartjob(jp);
jp->foreground = 1;
INTOFF;
status = waitforjob(jp, (int *)NULL);
INTON;
@@ -221,31 +208,37 @@ fgcmd(argc, argv)
int
bgcmd(argc, argv)
int argc;
char **argv;
bgcmd(int argc, char **argv)
{
char s[64];
struct job *jp;
do {
jp = getjob(*++argv);
if (jp->jobctl == 0)
error("job not created under job control");
if (jp->state == JOBDONE)
continue;
restartjob(jp);
jp->foreground = 0;
fmtstr(s, 64, "[%d] ", jp - jobtab + 1);
out1str(s);
out1str(jp->ps[0].cmd);
out1c('\n');
} while (--argc > 1);
return 0;
}
STATIC void
restartjob(jp)
struct job *jp;
restartjob(struct job *jp)
{
struct procstat *ps;
int i;
if (jp->state == JOBDONE)
return;
setcurjob(jp);
INTOFF;
killpg(jp->ps[0].pid, SIGCONT);
for (ps = jp->ps, i = jp->nprocs ; --i >= 0 ; ps++) {
@@ -260,14 +253,121 @@ restartjob(jp)
int
jobscmd(argc, argv)
int argc __unused;
char **argv __unused;
jobscmd(int argc, char *argv[])
{
showjobs(0);
return 0;
char *id;
int ch, sformat, lformat;
optind = optreset = 1;
opterr = 0;
sformat = lformat = 0;
while ((ch = getopt(argc, argv, "ls")) != -1) {
switch (ch) {
case 'l':
lformat = 1;
break;
case 's':
sformat = 1;
break;
case '?':
default:
error("unknown option: -%c", optopt);
}
}
argc -= optind;
argv += optind;
if (argc == 0)
showjobs(0, sformat, lformat);
else
while ((id = *argv++) != NULL)
showjob(getjob(id), 0, sformat, lformat);
return (0);
}
STATIC void
showjob(struct job *jp, pid_t pid, int sformat, int lformat)
{
char s[64];
struct procstat *ps;
struct job *j;
int col, curr, i, jobno, prev, procno;
char c;
procno = jp->nprocs;
jobno = jp - jobtab + 1;
curr = prev = 0;
#if JOBS
if ((j = getcurjob(NULL)) != NULL) {
curr = j - jobtab + 1;
if ((j = getcurjob(j)) != NULL)
prev = j - jobtab + 1;
}
#endif
for (ps = jp->ps ; ; ps++) { /* for each process */
if (sformat) {
out1fmt("%d\n", (int)ps->pid);
goto skip;
}
if (!lformat && ps != jp->ps && pid == 0)
goto skip;
if (pid != 0 && pid != ps->pid)
goto skip;
if (jobno == curr && ps == jp->ps)
c = '+';
else if (jobno == prev && ps == jp->ps)
c = '-';
else
c = ' ';
if (ps == jp->ps)
fmtstr(s, 64, "[%d] %c ", jobno, c);
else
fmtstr(s, 64, " %c ", c);
out1str(s);
col = strlen(s);
if (lformat) {
fmtstr(s, 64, "%d ", (int)ps->pid);
out1str(s);
col += strlen(s);
}
s[0] = '\0';
if (ps != jp->ps) {
*s = '\0';
} else if (ps->status == -1) {
strcpy(s, "Running");
} else if (WIFEXITED(ps->status)) {
if (WEXITSTATUS(ps->status) == 0)
strcpy(s, "Done");
else
fmtstr(s, 64, "Done (%d)",
WEXITSTATUS(ps->status));
} else {
#if JOBS
if (WIFSTOPPED(ps->status))
i = WSTOPSIG(ps->status);
else
#endif
i = WTERMSIG(ps->status);
if ((i & 0x7F) < NSIG && sys_siglist[i & 0x7F])
scopy(sys_siglist[i & 0x7F], s);
else
fmtstr(s, 64, "Signal %d", i & 0x7F);
if (WCOREDUMP(ps->status))
strcat(s, " (core dumped)");
}
out1str(s);
col += strlen(s);
do {
out1c(' ');
col++;
} while (col < 30);
out1str(ps->cmd);
out1c('\n');
skip: if (--procno <= 0)
break;
}
}
/*
* Print a list of jobs. If "change" is nonzero, only print jobs whose
@@ -279,16 +379,10 @@ jobscmd(argc, argv)
*/
void
showjobs(change)
int change;
showjobs(int change, int sformat, int lformat)
{
int jobno;
int procno;
int i;
struct job *jp;
struct procstat *ps;
int col;
char s[64];
TRACE(("showjobs(%d) called\n", change));
while (dowait(0, (struct job *)NULL) > 0);
@@ -301,44 +395,7 @@ showjobs(change)
}
if (change && ! jp->changed)
continue;
procno = jp->nprocs;
for (ps = jp->ps ; ; ps++) { /* for each process */
if (ps == jp->ps)
fmtstr(s, 64, "[%d] %d ", jobno, ps->pid);
else
fmtstr(s, 64, " %d ", ps->pid);
out1str(s);
col = strlen(s);
s[0] = '\0';
if (ps->status == -1) {
/* don't print anything */
} else if (WIFEXITED(ps->status)) {
fmtstr(s, 64, "Exit %d", WEXITSTATUS(ps->status));
} else {
#if JOBS
if (WIFSTOPPED(ps->status))
i = WSTOPSIG(ps->status);
else
#endif
i = WTERMSIG(ps->status);
if ((i & 0x7F) < NSIG && sys_siglist[i & 0x7F])
scopy(sys_siglist[i & 0x7F], s);
else
fmtstr(s, 64, "Signal %d", i & 0x7F);
if (WCOREDUMP(ps->status))
strcat(s, " (core dumped)");
}
out1str(s);
col += strlen(s);
do {
out1c(' ');
col++;
} while (col < 30);
out1str(ps->cmd);
out1c('\n');
if (--procno <= 0)
break;
}
showjob(jp, 0, sformat, lformat);
jp->changed = 0;
if (jp->state == JOBDONE) {
freejob(jp);
@@ -352,9 +409,8 @@ showjobs(change)
*/
STATIC void
freejob(jp)
struct job *jp;
{
freejob(struct job *jp)
{
struct procstat *ps;
int i;
@@ -367,8 +423,7 @@ freejob(jp)
ckfree(jp->ps);
jp->used = 0;
#if JOBS
if (curjob == jp - jobtab + 1)
curjob = 0;
deljob(jp);
#endif
INTON;
}
@@ -376,9 +431,7 @@ freejob(jp)
int
waitcmd(argc, argv)
int argc;
char **argv;
waitcmd(int argc, char **argv)
{
struct job *job;
int status, retval;
@@ -432,16 +485,14 @@ waitcmd(argc, argv)
int
jobidcmd(argc, argv)
int argc __unused;
char **argv;
jobidcmd(int argc __unused, char **argv)
{
struct job *jp;
int i;
jp = getjob(argv[1]);
for (i = 0 ; i < jp->nprocs ; ) {
out1fmt("%d", jp->ps[i].pid);
out1fmt("%d", (int)jp->ps[i].pid);
out1c(++i < jp->nprocs? ' ' : '\n');
}
return 0;
@@ -454,20 +505,18 @@ jobidcmd(argc, argv)
*/
STATIC struct job *
getjob(name)
char *name;
{
getjob(char *name)
{
int jobno;
struct job *jp;
int pid;
struct job *found, *jp;
pid_t pid;
int i;
if (name == NULL) {
#if JOBS
currentjob:
if ((jobno = curjob) == 0 || jobtab[jobno - 1].used == 0)
currentjob: if ((jp = getcurjob(NULL)) == NULL)
error("No current job");
return &jobtab[jobno - 1];
return (jp);
#else
error("No current job");
#endif
@@ -480,9 +529,28 @@ currentjob:
#if JOBS
} else if (name[1] == '%' && name[2] == '\0') {
goto currentjob;
} else if (name[1] == '+' && name[2] == '\0') {
goto currentjob;
} else if (name[1] == '-' && name[2] == '\0') {
if ((jp = getcurjob(NULL)) == NULL ||
(jp = getcurjob(jp)) == NULL)
error("No previous job");
return (jp);
#endif
} else if (name[1] == '?') {
found = NULL;
for (jp = jobtab, i = njobs ; --i >= 0 ; jp++) {
if (jp->used && jp->nprocs > 0
&& strstr(jp->ps[0].cmd, name + 2) != NULL) {
if (found)
error("%s: ambiguous", name);
found = jp;
}
}
if (found != NULL)
return (found);
} else {
struct job *found = NULL;
found = NULL;
for (jp = jobtab, i = njobs ; --i >= 0 ; jp++) {
if (jp->used && jp->nprocs > 0
&& prefix(name + 1, jp->ps[0].cmd)) {
@@ -495,7 +563,7 @@ currentjob:
return found;
}
} else if (is_number(name)) {
pid = number(name);
pid = (pid_t)number(name);
for (jp = jobtab, i = njobs ; --i >= 0 ; jp++) {
if (jp->used && jp->nprocs > 0
&& jp->ps[jp->nprocs - 1].pid == pid)
@@ -514,9 +582,7 @@ currentjob:
*/
struct job *
makejob(node, nprocs)
union node *node __unused;
int nprocs;
makejob(union node *node __unused, int nprocs)
{
int i;
struct job *jp;
@@ -526,9 +592,21 @@ makejob(node, nprocs)
INTOFF;
if (njobs == 0) {
jobtab = ckmalloc(4 * sizeof jobtab[0]);
#if JOBS
jobmru = NULL;
#endif
} else {
jp = ckmalloc((njobs + 4) * sizeof jobtab[0]);
memcpy(jp, jobtab, njobs * sizeof jp[0]);
#if JOBS
/* Relocate `next' pointers and list head */
if (jobmru != NULL)
jobmru = &jp[jobmru - jobtab];
for (i = 0; i < njobs; i++)
if (jp[i].next != NULL)
jp[i].next = &jp[jp[i].next -
jobtab];
#endif
/* Relocate `ps' pointers */
for (i = 0; i < njobs; i++)
if (jp[i].ps == &jobtab[i].ps0)
@@ -549,8 +627,10 @@ makejob(node, nprocs)
jp->used = 1;
jp->changed = 0;
jp->nprocs = 0;
jp->foreground = 0;
#if JOBS
jp->jobctl = jobctl;
jp->next = NULL;
#endif
if (nprocs > 1) {
jp->ps = ckmalloc(nprocs * sizeof (struct procstat));
@@ -563,6 +643,65 @@ makejob(node, nprocs)
return jp;
}
#if JOBS
STATIC void
setcurjob(struct job *cj)
{
struct job *jp, *prev;
for (prev = NULL, jp = jobmru; jp != NULL; prev = jp, jp = jp->next) {
if (jp == cj) {
if (prev != NULL)
prev->next = jp->next;
else
jobmru = jp->next;
jp->next = jobmru;
jobmru = cj;
return;
}
}
cj->next = jobmru;
jobmru = cj;
}
STATIC void
deljob(struct job *j)
{
struct job *jp, *prev;
for (prev = NULL, jp = jobmru; jp != NULL; prev = jp, jp = jp->next) {
if (jp == j) {
if (prev != NULL)
prev->next = jp->next;
else
jobmru = jp->next;
return;
}
}
}
/*
* Return the most recently used job that isn't `nj', and preferably one
* that is stopped.
*/
STATIC struct job *
getcurjob(struct job *nj)
{
struct job *jp;
/* Try to find a stopped one.. */
for (jp = jobmru; jp != NULL; jp = jp->next)
if (jp->used && jp != nj && jp->state == JOBSTOPPED)
return (jp);
/* Otherwise the most recently used job that isn't `nj' */
for (jp = jobmru; jp != NULL; jp = jp->next)
if (jp->used && jp != nj)
return (jp);
return (NULL);
}
#endif
/*
* Fork of a subshell. If we are doing job control, give the subshell its
@@ -579,14 +718,11 @@ makejob(node, nprocs)
* in a pipeline).
*/
int
forkshell(jp, n, mode)
union node *n;
struct job *jp;
int mode;
pid_t
forkshell(struct job *jp, union node *n, int mode)
{
int pid;
int pgrp;
pid_t pid;
pid_t pgrp;
TRACE(("forkshell(%%%d, 0x%lx, %d) called\n", jp - jobtab, (long)n,
mode));
@@ -602,12 +738,9 @@ forkshell(jp, n, mode)
int wasroot;
int i;
TRACE(("Child shell %d\n", getpid()));
TRACE(("Child shell %d\n", (int)getpid()));
wasroot = rootshell;
rootshell = 0;
for (i = njobs, p = jobtab ; --i >= 0 ; p++)
if (p->used)
freejob(p);
closescript();
INTON;
clear_traps();
@@ -620,13 +753,8 @@ forkshell(jp, n, mode)
pgrp = jp->ps[0].pid;
if (setpgid(0, pgrp) == 0 && mode == FORK_FG) {
/*** this causes superfluous TIOCSPGRPS ***/
#ifdef OLD_TTY_DRIVER
if (ioctl(2, TIOCSPGRP, (char *)&pgrp) < 0)
error("TIOCSPGRP failed, errno=%d", errno);
#else
if (tcsetpgrp(2, pgrp) < 0)
if (tcsetpgrp(ttyfd, pgrp) < 0)
error("tcsetpgrp failed, errno=%d", errno);
#endif
}
setsignal(SIGTSTP);
setsignal(SIGTTOU);
@@ -654,6 +782,11 @@ forkshell(jp, n, mode)
}
}
#endif
INTOFF;
for (i = njobs, p = jobtab ; --i >= 0 ; p++)
if (p->used)
freejob(p);
INTON;
if (wasroot && iflag) {
setsignal(SIGINT);
setsignal(SIGQUIT);
@@ -677,9 +810,13 @@ forkshell(jp, n, mode)
ps->cmd = nullstr;
if (iflag && rootshell && n)
ps->cmd = commandtext(n);
jp->foreground = mode == FORK_FG;
#if JOBS
setcurjob(jp);
#endif
}
INTON;
TRACE(("In parent shell: child = %d\n", pid));
TRACE(("In parent shell: child = %d\n", (int)pid));
return pid;
}
@@ -705,12 +842,10 @@ forkshell(jp, n, mode)
*/
int
waitforjob(jp, origstatus)
struct job *jp;
int *origstatus;
waitforjob(struct job *jp, int *origstatus)
{
#if JOBS
int mypgrp = getpgrp();
pid_t mypgrp = getpgrp();
#endif
int status;
int st;
@@ -722,16 +857,11 @@ waitforjob(jp, origstatus)
dotrap();
#if JOBS
if (jp->jobctl) {
#ifdef OLD_TTY_DRIVER
if (ioctl(2, TIOCSPGRP, (char *)&mypgrp) < 0)
error("TIOCSPGRP failed, errno=%d\n", errno);
#else
if (tcsetpgrp(2, mypgrp) < 0)
if (tcsetpgrp(ttyfd, mypgrp) < 0)
error("tcsetpgrp failed, errno=%d\n", errno);
#endif
}
if (jp->state == JOBSTOPPED)
curjob = jp - jobtab + 1;
setcurjob(jp);
#endif
status = jp->ps[jp->nprocs - 1].status;
if (origstatus != NULL)
@@ -763,26 +893,24 @@ waitforjob(jp, origstatus)
* Wait for a process to terminate.
*/
STATIC int
dowait(block, job)
int block;
struct job *job;
STATIC pid_t
dowait(int block, struct job *job)
{
int pid;
pid_t pid;
int status;
struct procstat *sp;
struct job *jp;
struct job *thisjob;
int done;
int stopped;
int core;
int sig;
int i;
in_dowait++;
TRACE(("dowait(%d) called\n", block));
do {
pid = waitproc(block, &status);
TRACE(("wait returns %d, status=%d\n", pid, status));
TRACE(("wait returns %d, status=%d\n", (int)pid, status));
} while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) ||
(WIFSTOPPED(status) && !iflag));
in_dowait--;
@@ -803,7 +931,8 @@ dowait(block, job)
continue;
if (sp->pid == pid) {
TRACE(("Changing status of proc %d from 0x%x to 0x%x\n",
pid, sp->status, status));
(int)pid, sp->status,
status));
sp->status = status;
thisjob = jp;
}
@@ -818,8 +947,8 @@ dowait(block, job)
TRACE(("Job %d: changing state from %d to %d\n", jp - jobtab + 1, jp->state, state));
jp->state = state;
#if JOBS
if (done && curjob == jp - jobtab + 1)
curjob = 0; /* no current job */
if (done)
deljob(jp);
#endif
}
}
@@ -827,35 +956,29 @@ dowait(block, job)
}
INTON;
if (! rootshell || ! iflag || (job && thisjob == job)) {
core = WCOREDUMP(status);
#if JOBS
if (WIFSTOPPED(status))
sig = WSTOPSIG(status);
else
#endif
{
if (WIFEXITED(status))
sig = 0;
else
sig = WTERMSIG(status);
}
if (sig != 0 && sig != SIGINT && sig != SIGPIPE) {
if (thisjob != job)
outfmt(out2, "%d: ", pid);
#if JOBS
if (sig == SIGTSTP && rootshell && iflag)
outfmt(out2, "%%%d ", job - jobtab + 1);
#endif
if (sig < NSIG && sys_siglist[sig])
out2str(sys_siglist[sig]);
else
outfmt(out2, "Signal %d", sig);
if (core)
out2str(" - core dumped");
out2c('\n');
flushout(&errout);
} else {
TRACE(("Not printing status: status=%d, sig=%d\n",
status, sig));
if (thisjob->foreground && !WIFSTOPPED(status)) {
i = WTERMSIG(status);
if ((i & 0x7F) < NSIG && sys_siglist[i & 0x7F])
out1str(sys_siglist[i & 0x7F]);
else
out1fmt("Signal %d", i & 0x7F);
if (WCOREDUMP(status))
out1str(" (core dumped)");
out1c('\n');
} else
showjob(thisjob, pid, 0, 0);
}
} else {
TRACE(("Not printing status, rootshell=%d, job=0x%x\n", rootshell, job));
@@ -871,46 +994,10 @@ dowait(block, job)
* Do a wait system call. If job control is compiled in, we accept
* stopped processes. If block is zero, we return a value of zero
* rather than blocking.
*
* System V doesn't have a non-blocking wait system call. It does
* have a SIGCLD signal that is sent to a process when one of it's
* children dies. The obvious way to use SIGCLD would be to install
* a handler for SIGCLD which simply bumped a counter when a SIGCLD
* was received, and have waitproc bump another counter when it got
* the status of a process. Waitproc would then know that a wait
* system call would not block if the two counters were different.
* This approach doesn't work because if a process has children that
* have not been waited for, System V will send it a SIGCLD when it
* installs a signal handler for SIGCLD. What this means is that when
* a child exits, the shell will be sent SIGCLD signals continuously
* until is runs out of stack space, unless it does a wait call before
* restoring the signal handler. The code below takes advantage of
* this (mis)feature by installing a signal handler for SIGCLD and
* then checking to see whether it was called. If there are any
* children to be waited for, it will be.
*
* If neither SYSV nor BSD is defined, we don't implement nonblocking
* waits at all. In this case, the user will not be informed when
* a background process until the next time she runs a real program
* (as opposed to running a builtin command or just typing return),
* and the jobs command may give out of date information.
*/
#ifdef SYSV
STATIC sig_atomic_t gotsigchild;
STATIC int onsigchild() {
gotsigchild = 1;
}
#endif
STATIC int
waitproc(block, status)
int block;
int *status;
STATIC pid_t
waitproc(int block, int *status)
{
#ifdef BSD
int flags;
#if JOBS
@@ -921,24 +1008,6 @@ waitproc(block, status)
if (block == 0)
flags |= WNOHANG;
return wait3(status, flags, (struct rusage *)NULL);
#else
#ifdef SYSV
int (*save)();
if (block == 0) {
gotsigchild = 0;
save = signal(SIGCLD, onsigchild);
signal(SIGCLD, save);
if (gotsigchild == 0)
return 0;
}
return wait(status);
#else
if (block == 0)
return 0;
return wait(status);
#endif
#endif
}
/*
@@ -946,7 +1015,7 @@ waitproc(block, status)
*/
int job_warning = 0;
int
stoppedjobs()
stoppedjobs(void)
{
int jobno;
struct job *jp;
@@ -976,9 +1045,8 @@ STATIC int cmdnleft;
#define MAXCMDTEXT 200
char *
commandtext(n)
union node *n;
{
commandtext(union node *n)
{
char *name;
cmdnextc = name = ckmalloc(MAXCMDTEXT);
@@ -990,9 +1058,8 @@ commandtext(n)
STATIC void
cmdtxt(n)
union node *n;
{
cmdtxt(union node *n)
{
union node *np;
struct nodelist *lp;
char *p;
@@ -1085,6 +1152,8 @@ until:
p = ">>"; i = 1; goto redir;
case NTOFD:
p = ">&"; i = 1; goto redir;
case NCLOBBER:
p = ">|"; i = 1; goto redir;
case NFROM:
p = "<"; i = 0; goto redir;
case NFROMTO:
@@ -1099,7 +1168,10 @@ redir:
}
cmdputs(p);
if (n->type == NTOFD || n->type == NFROMFD) {
s[0] = n->ndup.dupfd + '0';
if (n->ndup.dupfd >= 0)
s[0] = n->ndup.dupfd + '0';
else
s[0] = '-';
s[1] = '\0';
cmdputs(s);
} else {
@@ -1119,9 +1191,8 @@ redir:
STATIC void
cmdputs(s)
char *s;
{
cmdputs(char *s)
{
char *p, *q;
char c;
int subtype = 0;
+15 -13
View File
@@ -67,12 +67,14 @@ struct job {
struct procstat ps0; /* status of process */
struct procstat *ps; /* status or processes when more than one */
short nprocs; /* number of processes */
short pgrp; /* process group of this job */
pid_t pgrp; /* process group of this job */
char state; /* true if job is finished */
char used; /* true if this entry is in used */
char changed; /* true if status has changed */
char foreground; /* true if running in the foreground */
#if JOBS
char jobctl; /* job running under job control */
struct job *next; /* job used after this one */
#endif
};
@@ -82,18 +84,18 @@ extern int in_waitcmd; /* are we in waitcmd()? */
extern int in_dowait; /* are we in dowait()? */
extern volatile sig_atomic_t breakwaitcmd; /* break wait to process traps? */
void setjobctl __P((int));
int fgcmd __P((int, char **));
int bgcmd __P((int, char **));
int jobscmd __P((int, char **));
void showjobs __P((int));
int waitcmd __P((int, char **));
int jobidcmd __P((int, char **));
struct job *makejob __P((union node *, int));
int forkshell __P((struct job *, union node *, int));
int waitforjob __P((struct job *, int *));
int stoppedjobs __P((void));
char *commandtext __P((union node *));
void setjobctl(int);
int fgcmd(int, char **);
int bgcmd(int, char **);
int jobscmd(int, char **);
void showjobs(int, int, int);
int waitcmd(int, char **);
int jobidcmd(int, char **);
struct job *makejob(union node *, int);
pid_t forkshell(struct job *, union node *, int);
int waitforjob(struct job *, int *);
int stoppedjobs(void);
char *commandtext(union node *);
#if ! JOBS
#define setjobctl(on) /* do nothing */
+3 -4
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)mail.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* Routines to check for mail. (Perhaps make part of main.c?)
@@ -72,8 +72,7 @@ STATIC time_t mailtime[MAXMBOXES]; /* times of mailboxes */
*/
void
chkmail(silent)
int silent;
chkmail(int silent)
{
int i;
char *mpath;
+1 -1
View File
@@ -37,4 +37,4 @@
* $FreeBSD$
*/
void chkmail __P((int));
void chkmail(int);
+13 -35
View File
@@ -44,9 +44,9 @@ static char const copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/28/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <stdio.h>
#include <signal.h>
@@ -86,8 +86,8 @@ short profile_buf[16384];
extern int etext();
#endif
STATIC void read_profile __P((char *));
STATIC char *find_dot_file __P((char *));
STATIC void read_profile(char *);
STATIC char *find_dot_file(char *);
/*
* Main routine. We initialize things, parse the arguments, execute
@@ -98,9 +98,7 @@ STATIC char *find_dot_file __P((char *));
*/
int
main(argc, argv)
int argc;
char **argv;
main(int argc, char *argv[])
{
struct jmploc jmploc;
struct stackmark smark;
@@ -216,8 +214,7 @@ state4: /* XXX ??? - why isn't this before the "if" statement */
*/
void
cmdloop(top)
int top;
cmdloop(int top)
{
union node *n;
struct stackmark smark;
@@ -232,7 +229,7 @@ cmdloop(top)
inter = 0;
if (iflag && top) {
inter++;
showjobs(1);
showjobs(1, 0, 0);
chkmail(0);
flushout(&output);
}
@@ -269,9 +266,8 @@ cmdloop(top)
*/
STATIC void
read_profile(name)
char *name;
{
read_profile(char *name)
{
int fd;
INTOFF;
@@ -291,8 +287,7 @@ read_profile(name)
*/
void
readcmdfile(name)
char *name;
readcmdfile(char *name)
{
int fd;
@@ -315,8 +310,7 @@ readcmdfile(name)
STATIC char *
find_dot_file(basename)
char *basename;
find_dot_file(char *basename)
{
static char localname[FILENAME_MAX+1];
char *fullname;
@@ -337,9 +331,7 @@ find_dot_file(basename)
}
int
dotcmd(argc, argv)
int argc;
char **argv;
dotcmd(int argc, char **argv)
{
struct strlist *sp;
exitstatus = 0;
@@ -360,9 +352,7 @@ dotcmd(argc, argv)
int
exitcmd(argc, argv)
int argc;
char **argv;
exitcmd(int argc, char **argv)
{
extern int oexitstatus;
@@ -376,15 +366,3 @@ exitcmd(argc, argv)
/*NOTREACHED*/
return 0;
}
#ifdef notdef
/*
* Should never be called.
*/
void
exit(exitstatus) {
_exit(exitstatus);
}
#endif
+4 -4
View File
@@ -40,7 +40,7 @@
extern int rootpid; /* pid of main shell */
extern int rootshell; /* true if we aren't a child of the main shell */
void readcmdfile __P((char *));
void cmdloop __P((int));
int dotcmd __P((int, char **));
int exitcmd __P((int, char **));
void readcmdfile(char *);
void cmdloop(int);
int dotcmd(int, char **);
int exitcmd(int, char **);
+15 -26
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)memalloc.c 8.3 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "shell.h"
#include "output.h"
@@ -57,8 +57,7 @@ static const char rcsid[] =
*/
pointer
ckmalloc(nbytes)
int nbytes;
ckmalloc(int nbytes)
{
pointer p;
@@ -73,9 +72,7 @@ ckmalloc(nbytes)
*/
pointer
ckrealloc(p, nbytes)
pointer p;
int nbytes;
ckrealloc(pointer p, int nbytes)
{
if ((p = realloc(p, nbytes)) == NULL)
error("Out of space");
@@ -88,8 +85,7 @@ ckrealloc(p, nbytes)
*/
char *
savestr(s)
char *s;
savestr(char *s)
{
char *p;
@@ -127,8 +123,7 @@ int herefd = -1;
pointer
stalloc(nbytes)
int nbytes;
stalloc(int nbytes)
{
char *p;
@@ -157,11 +152,10 @@ stalloc(nbytes)
void
stunalloc(p)
pointer p;
stunalloc(pointer p)
{
if (p == NULL) { /*DEBUG */
write(2, "stunalloc\n", 10);
write(STDERR_FILENO, "stunalloc\n", 10);
abort();
}
stacknleft += stacknxt - (char *)p;
@@ -171,8 +165,7 @@ stunalloc(p)
void
setstackmark(mark)
struct stackmark *mark;
setstackmark(struct stackmark *mark)
{
mark->stackp = stackp;
mark->stacknxt = stacknxt;
@@ -183,8 +176,7 @@ setstackmark(mark)
void
popstackmark(mark)
struct stackmark *mark;
popstackmark(struct stackmark *mark)
{
struct stack_block *sp;
@@ -212,7 +204,7 @@ popstackmark(mark)
*/
void
growstackblock()
growstackblock(void)
{
char *p;
int newlen;
@@ -261,8 +253,7 @@ growstackblock()
void
grabstackblock(len)
int len;
grabstackblock(int len)
{
len = ALIGN(len);
stacknxt += len;
@@ -291,7 +282,7 @@ grabstackblock(len)
char *
growstackstr()
growstackstr(void)
{
int len;
@@ -312,7 +303,7 @@ growstackstr()
*/
char *
makestrspace()
makestrspace(void)
{
int len;
@@ -325,9 +316,7 @@ makestrspace()
void
ungrabstackstr(s, p)
char *s;
char *p;
ungrabstackstr(char *s, char *p)
{
stacknleft += stacknxt - s;
stacknxt = s;
+12 -12
View File
@@ -50,18 +50,18 @@ extern int stacknleft;
extern int sstrnleft;
extern int herefd;
pointer ckmalloc __P((int));
pointer ckrealloc __P((pointer, int));
char *savestr __P((char *));
pointer stalloc __P((int));
void stunalloc __P((pointer));
void setstackmark __P((struct stackmark *));
void popstackmark __P((struct stackmark *));
void growstackblock __P((void));
void grabstackblock __P((int));
char *growstackstr __P((void));
char *makestrspace __P((void));
void ungrabstackstr __P((char *, char *));
pointer ckmalloc(int);
pointer ckrealloc(pointer, int);
char *savestr(char *);
pointer stalloc(int);
void stunalloc(pointer);
void setstackmark(struct stackmark *);
void popstackmark(struct stackmark *);
void growstackblock(void);
void grabstackblock(int);
char *growstackstr(void);
char *makestrspace(void);
void ungrabstackstr(char *, char *);
+7 -13
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* Miscellaneous builtins.
@@ -75,9 +75,7 @@ static const char rcsid[] =
*/
int
readcmd(argc, argv)
int argc __unused;
char **argv __unused;
readcmd(int argc __unused, char **argv __unused)
{
char **ap;
int backslash;
@@ -171,7 +169,7 @@ readcmd(argc, argv)
backslash = 0;
STARTSTACKSTR(p);
for (;;) {
if (read(0, &c, 1) != 1) {
if (read(STDIN_FILENO, &c, 1) != 1) {
status = 1;
break;
}
@@ -194,7 +192,7 @@ readcmd(argc, argv)
}
startword = 0;
if (backslash && c == '\\') {
if (read(0, &c, 1) != 1) {
if (read(STDIN_FILENO, &c, 1) != 1) {
status = 1;
break;
}
@@ -219,9 +217,7 @@ readcmd(argc, argv)
int
umaskcmd(argc, argv)
int argc __unused;
char **argv;
umaskcmd(int argc __unused, char **argv)
{
char *ap;
int mask;
@@ -353,9 +349,7 @@ static const struct limits limits[] = {
};
int
ulimitcmd(argc, argv)
int argc __unused;
char **argv __unused;
ulimitcmd(int argc __unused, char **argv __unused)
{
int c;
quad_t val = 0;
+1
View File
@@ -54,6 +54,7 @@ cat <<\!
* This file was generated by the mkbuiltins program.
*/
#include <stdlib.h>
#include "shell.h"
#include "builtins.h"
+41 -63
View File
@@ -44,9 +44,9 @@ static char const copyright[] =
#if 0
static char sccsid[] = "@(#)mkinit.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* This program scans all the source files for code to handle various
@@ -152,27 +152,25 @@ struct text decls; /* declarations */
int amiddecls; /* for formatting */
void readfile __P((char *));
int match __P((char *, char *));
int gooddefine __P((char *));
void doevent __P((struct event *, FILE *, char *));
void doinclude __P((char *));
void dodecl __P((char *, FILE *));
void output __P((void));
void addstr __P((char *, struct text *));
void addchar __P((int, struct text *));
void writetext __P((struct text *, FILE *));
FILE *ckfopen __P((char *, char *));
void *ckmalloc __P((int));
char *savestr __P((char *));
void error __P((char *));
void readfile(char *);
int match(char *, char *);
int gooddefine(char *);
void doevent(struct event *, FILE *, char *);
void doinclude(char *);
void dodecl(char *, FILE *);
void output(void);
void addstr(char *, struct text *);
void addchar(int, struct text *);
void writetext(struct text *, FILE *);
FILE *ckfopen(char *, char *);
void *ckmalloc(int);
char *savestr(char *);
void error(char *);
#define equal(s1, s2) (strcmp(s1, s2) == 0)
int
main(argc, argv)
int argc __unused;
char **argv;
main(int argc __unused, char *argv[])
{
char **ap;
@@ -191,9 +189,8 @@ main(argc, argv)
*/
void
readfile(fname)
char *fname;
{
readfile(char *fname)
{
FILE *fp;
char line[1024];
struct event *ep;
@@ -236,9 +233,7 @@ readfile(fname)
int
match(name, line)
char *name;
char *line;
match(char *name, char *line)
{
char *p, *q;
@@ -254,8 +249,7 @@ match(name, line)
int
gooddefine(line)
char *line;
gooddefine(char *line)
{
char *p;
@@ -278,11 +272,8 @@ gooddefine(line)
void
doevent(ep, fp, fname)
struct event *ep;
FILE *fp;
char *fname;
{
doevent(struct event *ep, FILE *fp, char *fname)
{
char line[1024];
int indent;
char *p;
@@ -318,9 +309,8 @@ doevent(ep, fp, fname)
void
doinclude(line)
char *line;
{
doinclude(char *line)
{
char *p;
char *name;
char **pp;
@@ -343,10 +333,8 @@ doinclude(line)
void
dodecl(line1, fp)
char *line1;
FILE *fp;
{
dodecl(char *line1, FILE *fp)
{
char line[1024];
char *p, *q;
@@ -390,7 +378,8 @@ dodecl(line1, fp)
*/
void
output() {
output(void)
{
FILE *fp;
char **pp;
struct event *ep;
@@ -421,10 +410,8 @@ output() {
*/
void
addstr(s, text)
char *s;
struct text *text;
{
addstr(char *s, struct text *text)
{
while (*s) {
if (--text->nleft < 0)
addchar(*s++, text);
@@ -435,9 +422,7 @@ addstr(s, text)
void
addchar(c, text)
int c;
struct text *text;
addchar(int c, struct text *text)
{
struct block *bp;
@@ -458,10 +443,8 @@ addchar(c, text)
* Write the contents of a text structure to a file.
*/
void
writetext(text, fp)
struct text *text;
FILE *fp;
{
writetext(struct text *text, FILE *fp)
{
struct block *bp;
if (text->start != NULL) {
@@ -472,10 +455,8 @@ writetext(text, fp)
}
FILE *
ckfopen(file, mode)
char *file;
char *mode;
{
ckfopen(char *file, char *mode)
{
FILE *fp;
if ((fp = fopen(file, mode)) == NULL) {
@@ -486,8 +467,7 @@ ckfopen(file, mode)
}
void *
ckmalloc(nbytes)
int nbytes;
ckmalloc(int nbytes)
{
char *p;
@@ -497,9 +477,8 @@ ckmalloc(nbytes)
}
char *
savestr(s)
char *s;
{
savestr(char *s)
{
char *p;
p = ckmalloc(strlen(s) + 1);
@@ -508,9 +487,8 @@ savestr(s)
}
void
error(msg)
char *msg;
{
error(char *msg)
{
if (curfile != NULL)
fprintf(stderr, "%s:%d: ", curfile, linno);
fprintf(stderr, "%s\n", msg);
+24 -55
View File
@@ -44,9 +44,9 @@ static char const copyright[] =
#if 0
static char sccsid[] = "@(#)mknodes.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* This program reads the nodetypes file and nodes.c.pat file. It generates
@@ -57,12 +57,7 @@ static const char rcsid[] =
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#define MAXTYPES 50 /* max number of node types */
#define MAXFIELDS 20 /* max fields in a structure */
@@ -103,23 +98,21 @@ static char line[1024];
static int linno;
static char *linep;
static void parsenode __P((void));
static void parsefield __P((void));
static void output __P((char *));
static void outsizes __P((FILE *));
static void outfunc __P((FILE *, int));
static void indent __P((int, FILE *));
static int nextfield __P((char *));
static void skipbl __P((void));
static int readline __P((void));
static void error __P((const char *, ...)) __printf0like(1, 2);
static char *savestr __P((const char *));
static void parsenode(void);
static void parsefield(void);
static void output(char *);
static void outsizes(FILE *);
static void outfunc(FILE *, int);
static void indent(int, FILE *);
static int nextfield(char *);
static void skipbl(void);
static int readline(void);
static void error(const char *, ...) __printf0like(1, 2);
static char *savestr(const char *);
int
main(argc, argv)
int argc;
char **argv;
main(int argc, char *argv[])
{
if (argc != 3)
error("usage: mknodes file");
@@ -139,7 +132,7 @@ main(argc, argv)
static void
parsenode()
parsenode(void)
{
char name[BUFLEN];
char tag[BUFLEN];
@@ -169,7 +162,7 @@ parsenode()
static void
parsefield()
parsefield(void)
{
char name[BUFLEN];
char type[BUFLEN];
@@ -222,8 +215,7 @@ char writer[] = "\
\n";
static void
output(file)
char *file;
output(char *file)
{
FILE *hfile;
FILE *cfile;
@@ -260,13 +252,8 @@ output(file)
fputs("\tstruct nodelist *next;\n", hfile);
fputs("\tunion node *n;\n", hfile);
fputs("};\n\n\n", hfile);
fputs("#ifdef __STDC__\n", hfile);
fputs("union node *copyfunc(union node *);\n", hfile);
fputs("void freefunc(union node *);\n", hfile);
fputs("#else\n", hfile);
fputs("union node *copyfunc();\n", hfile);
fputs("void freefunc();\n", hfile);
fputs("#endif\n", hfile);
fputs(writer, cfile);
while (fgets(line, sizeof line, patfile) != NULL) {
@@ -285,8 +272,7 @@ output(file)
static void
outsizes(cfile)
FILE *cfile;
outsizes(FILE *cfile)
{
int i;
@@ -299,9 +285,7 @@ outsizes(cfile)
static void
outfunc(cfile, calcsize)
FILE *cfile;
int calcsize;
outfunc(FILE *cfile, int calcsize)
{
struct str *sp;
struct field *fp;
@@ -380,9 +364,7 @@ outfunc(cfile, calcsize)
static void
indent(amount, fp)
int amount;
FILE *fp;
indent(int amount, FILE *fp)
{
while (amount >= 8) {
putc('\t', fp);
@@ -395,8 +377,7 @@ indent(amount, fp)
static int
nextfield(buf)
char *buf;
nextfield(char *buf)
{
char *p, *q;
@@ -413,7 +394,7 @@ nextfield(buf)
static void
skipbl()
skipbl(void)
{
while (*linep == ' ' || *linep == '\t')
linep++;
@@ -421,7 +402,7 @@ skipbl()
static int
readline()
readline(void)
{
char *p;
@@ -441,21 +422,10 @@ readline()
static void
#ifdef __STDC__
error(const char *msg, ...)
#else
error(va_alist)
va_dcl
#endif
{
va_list va;
#ifdef __STDC__
va_start(va, msg);
#else
const char *msg;
va_start(va);
msg = va_arg(va, char *);
#endif
(void) fprintf(stderr, "line %d: ", linno);
(void) vfprintf(stderr, msg, va);
@@ -469,8 +439,7 @@ error(va_alist)
static char *
savestr(s)
const char *s;
savestr(const char *s)
{
char *p;
+15 -20
View File
@@ -44,9 +44,9 @@ static char const copyright[] =
#if 0
static char sccsid[] = "@(#)mksyntax.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* This program creates syntax.h and syntax.c.
@@ -111,17 +111,15 @@ static int size; /* number of values which a char variable can have */
static int nbits; /* number of bits in a character */
static int digit_contig;/* true if digits are contiguous */
static void filltable __P((char *));
static void init __P((void));
static void add __P((char *, char *));
static void print __P((char *));
static void output_type_macros __P((void));
static void digit_convert __P((void));
static void filltable(char *);
static void init(void);
static void add(char *, char *);
static void print(char *);
static void output_type_macros(void);
static void digit_convert(void);
int
main(argc, argv)
int argc __unused;
char **argv __unused;
main(int argc __unused, char **argv __unused)
{
char c;
char d;
@@ -268,8 +266,7 @@ main(argc, argv)
*/
static void
filltable(dftval)
char *dftval;
filltable(char *dftval)
{
int i;
@@ -283,7 +280,7 @@ filltable(dftval)
*/
static void
init()
init(void)
{
filltable("CWORD");
syntax[0] = "CEOF";
@@ -303,8 +300,7 @@ init()
*/
static void
add(p, type)
char *p, *type;
add(char *p, char *type)
{
while (*p)
syntax[*p++ + base] = type;
@@ -317,8 +313,7 @@ add(p, type)
*/
static void
print(name)
char *name;
print(char *name)
{
int i;
int col;
@@ -360,7 +355,7 @@ static char *macro[] = {
};
static void
output_type_macros()
output_type_macros(void)
{
char **pp;
@@ -381,7 +376,7 @@ output_type_macros()
*/
static void
digit_convert()
digit_convert(void)
{
int maxdigit;
static char digit[] = "0123456789";
+2 -2
View File
@@ -81,14 +81,14 @@ const char tokendlist[] = {'
awk '{print "\t" $2 ","}' $temp
echo '};
char *const tokname[] = {'
const char *const tokname[] = {'
sed -e 's/"/\\"/g' \
-e 's/[^ ]*[ ][ ]*[^ ]*[ ][ ]*\(.*\)/ "\1",/' \
$temp
echo '};
'
sed 's/"//g' $temp | awk '
/TIF/{print "#define KWDOFFSET " NR-1; print ""; print "char *const parsekwd[] = {"}
/TIF/{print "#define KWDOFFSET " NR-1; print ""; print "const char *const parsekwd[] = {"}
/TIF/,/neverfound/{print " \"" $3 "\","}'
echo ' 0
};'
+6 -5
View File
@@ -40,9 +40,10 @@ extern History *hist;
extern EditLine *el;
extern int displayhist;
void histedit __P((void));
void sethistsize __P((const char *));
int histcmd __P((int, char **));
int not_fcnumber __P((char *));
int str_to_event __P((char *, int));
void histedit(void);
void sethistsize(const char *);
int histcmd(int, char **);
int not_fcnumber(char *);
int str_to_event(char *, int);
int bindcmd(int, char **);
+10 -18
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)mystring.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* String functions.
@@ -77,11 +77,8 @@ char nullstr[1]; /* zero length string */
*/
void
scopyn(from, to, size)
char const *from;
char *to;
int size;
{
scopyn(const char *from, char *to, int size)
{
while (--size > 0) {
if ((*to++ = *from++) == '\0')
@@ -96,10 +93,8 @@ scopyn(from, to, size)
*/
int
prefix(pfx, string)
char const *pfx;
char const *string;
{
prefix(const char *pfx, const char *string)
{
while (*pfx) {
if (*pfx++ != *string++)
return 0;
@@ -114,10 +109,8 @@ prefix(pfx, string)
*/
int
number(s)
const char *s;
{
number(const char *s)
{
if (! is_number(s))
error("Illegal number: %s", (char *)s);
return atoi(s);
@@ -130,9 +123,8 @@ number(s)
*/
int
is_number(p)
const char *p;
{
is_number(const char *p)
{
do {
if (! is_digit(*p))
return 0;
+4 -4
View File
@@ -39,10 +39,10 @@
#include <string.h>
void scopyn __P((const char *, char *, int));
int prefix __P((const char *, const char *));
int number __P((const char *));
int is_number __P((const char *));
void scopyn(const char *, char *, int);
int prefix(const char *, const char *);
int number(const char *);
int is_number(const char *);
#define equal(s1, s2) (strcmp(s1, s2) == 0)
#define scopy(s1, s2) ((void)strcpy(s2, s1))
+12 -19
View File
@@ -57,11 +57,11 @@ char *funcstring; /* block to allocate strings from */
%SIZES
STATIC void calcsize __P((union node *));
STATIC void sizenodelist __P((struct nodelist *));
STATIC union node *copynode __P((union node *));
STATIC struct nodelist *copynodelist __P((struct nodelist *));
STATIC char *nodesavestr __P((char *));
STATIC void calcsize(union node *);
STATIC void sizenodelist(struct nodelist *);
STATIC union node *copynode(union node *);
STATIC struct nodelist *copynodelist(struct nodelist *);
STATIC char *nodesavestr(char *);
@@ -70,8 +70,7 @@ STATIC char *nodesavestr __P((char *));
*/
union node *
copyfunc(n)
union node *n;
copyfunc(union node *n)
{
if (n == NULL)
return NULL;
@@ -86,8 +85,7 @@ copyfunc(n)
STATIC void
calcsize(n)
union node *n;
calcsize(union node *n)
{
%CALCSIZE
}
@@ -95,8 +93,7 @@ calcsize(n)
STATIC void
sizenodelist(lp)
struct nodelist *lp;
sizenodelist(struct nodelist *lp)
{
while (lp) {
funcblocksize += ALIGN(sizeof(struct nodelist));
@@ -108,8 +105,7 @@ sizenodelist(lp)
STATIC union node *
copynode(n)
union node *n;
copynode(union node *n)
{
union node *new;
@@ -119,8 +115,7 @@ copynode(n)
STATIC struct nodelist *
copynodelist(lp)
struct nodelist *lp;
copynodelist(struct nodelist *lp)
{
struct nodelist *start;
struct nodelist **lpp;
@@ -140,8 +135,7 @@ copynodelist(lp)
STATIC char *
nodesavestr(s)
char *s;
nodesavestr(char *s)
{
char *p = s;
char *q = funcstring;
@@ -160,8 +154,7 @@ nodesavestr(s)
*/
void
freefunc(n)
union node *n;
freefunc(union node *n)
{
if (n)
ckfree(n);
+1
View File
@@ -120,6 +120,7 @@ NTO nfile # fd> fname
NFROM nfile # fd< fname
NFROMTO nfile # fd<> fname
NAPPEND nfile # fd>> fname
NCLOBBER nfile # fd>| fname
type int
next nodeptr # next redirection in list
fd int # file descriptor being redirected
+45 -51
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <signal.h>
#include <unistd.h>
@@ -73,10 +73,10 @@ char *optptr; /* used by nextopt */
char *minusc; /* argument to -c option */
STATIC void options __P((int));
STATIC void minus_o __P((char *, int));
STATIC void setoption __P((int, int));
STATIC int getopts __P((char *, char *, char **, char ***, char **));
STATIC void options(int);
STATIC void minus_o(char *, int);
STATIC void setoption(int, int);
STATIC int getopts(char *, char *, char **, char ***, char **);
/*
@@ -84,9 +84,7 @@ STATIC int getopts __P((char *, char *, char **, char ***, char **));
*/
void
procargs(argc, argv)
int argc;
char **argv;
procargs(int argc, char **argv)
{
int i;
@@ -127,7 +125,7 @@ procargs(argc, argv)
void
optschanged()
optschanged(void)
{
setinteractive(iflag);
#ifndef NO_HISTORY
@@ -142,8 +140,7 @@ optschanged()
*/
STATIC void
options(cmdline)
int cmdline;
options(int cmdline)
{
char *p;
int val;
@@ -201,17 +198,30 @@ options(cmdline)
}
STATIC void
minus_o(name, val)
char *name;
int val;
minus_o(char *name, int val)
{
int i;
int doneset, i;
if (name == NULL) {
out1str("Current option settings\n");
for (i = 0; i < NOPTS; i++)
out1fmt("%-16s%s\n", optlist[i].name,
optlist[i].val ? "on" : "off");
if (val) {
/* "Pretty" output. */
out1str("Current option settings\n");
for (i = 0; i < NOPTS; i++)
out1fmt("%-16s%s\n", optlist[i].name,
optlist[i].val ? "on" : "off");
} else {
/* Output suitable for re-input to shell. */
for (doneset = i = 0; i < NOPTS; i++)
if (optlist[i].val) {
if (!doneset) {
out1str("set");
doneset = 1;
}
out1fmt(" -o %s", optlist[i].name);
}
if (doneset)
out1c('\n');
}
} else {
for (i = 0; i < NOPTS; i++)
if (equal(name, optlist[i].name)) {
@@ -228,10 +238,8 @@ minus_o(name, val)
STATIC void
setoption(flag, val)
char flag;
int val;
{
setoption(int flag, int val)
{
int i;
for (i = 0; i < NOPTS; i++)
@@ -270,9 +278,8 @@ SHELLPROC {
*/
void
setparam(argv)
char **argv;
{
setparam(char **argv)
{
char **newparam;
char **ap;
int nparam;
@@ -296,9 +303,8 @@ setparam(argv)
*/
void
freeparam(param)
struct shparam *param;
{
freeparam(struct shparam *param)
{
char **ap;
if (param->malloc) {
@@ -315,9 +321,7 @@ freeparam(param)
*/
int
shiftcmd(argc, argv)
int argc;
char **argv;
shiftcmd(int argc, char **argv)
{
int n;
char **ap1, **ap2;
@@ -347,9 +351,7 @@ shiftcmd(argc, argv)
*/
int
setcmd(argc, argv)
int argc;
char **argv;
setcmd(int argc, char **argv)
{
if (argc == 1)
return showvarscmd(argc, argv);
@@ -365,8 +367,7 @@ setcmd(argc, argv)
void
getoptsreset(value)
const char *value;
getoptsreset(const char *value)
{
if (number(value) == 1) {
shellparam.optnext = NULL;
@@ -382,14 +383,12 @@ getoptsreset(value)
*/
int
getoptscmd(argc, argv)
int argc;
char **argv;
getoptscmd(int argc, char **argv)
{
char **optbase = NULL;
if (argc < 3)
error("Usage: getopts optstring var [arg]");
error("usage: getopts optstring var [arg]");
else if (argc == 3)
optbase = shellparam.p;
else
@@ -406,12 +405,8 @@ getoptscmd(argc, argv)
}
STATIC int
getopts(optstr, optvar, optfirst, optnext, optptr)
char *optstr;
char *optvar;
char **optfirst;
char ***optnext;
char **optptr;
getopts(char *optstr, char *optvar, char **optfirst, char ***optnext,
char **optptr)
{
char *p, *q;
char c = '?';
@@ -515,9 +510,8 @@ out:
*/
int
nextopt(optstring)
char *optstring;
{
nextopt(char *optstring)
{
char *p, *q;
char c;
+12 -10
View File
@@ -65,8 +65,9 @@ struct shparam {
#define uflag optlist[14].val
#define privileged optlist[15].val
#define Tflag optlist[16].val
#define Pflag optlist[17].val
#define NOPTS 17
#define NOPTS 18
struct optent {
const char *name;
@@ -93,6 +94,7 @@ struct optent optlist[NOPTS] = {
{ "nounset", 'u', 0 },
{ "privileged", 'p', 0 },
{ "trapsasync", 'T', 0 },
{ "physical", 'P', 0 },
};
#else
extern struct optent optlist[NOPTS];
@@ -106,12 +108,12 @@ extern char **argptr; /* argument list for builtin commands */
extern char *shoptarg; /* set by nextopt */
extern char *optptr; /* used by nextopt */
void procargs __P((int, char **));
void optschanged __P((void));
void setparam __P((char **));
void freeparam __P((struct shparam *));
int shiftcmd __P((int, char **));
int setcmd __P((int, char **));
int getoptscmd __P((int, char **));
int nextopt __P((char *));
void getoptsreset __P((const char *));
void procargs(int, char **);
void optschanged(void);
void setparam(char **);
void freeparam(struct shparam *);
int shiftcmd(int, char **);
int setcmd(int, char **);
int getoptscmd(int, char **);
int nextopt(char *);
void getoptsreset(const char *);
+67 -148
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)output.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* Shell output routines. We use our own output routines because:
@@ -58,11 +58,7 @@ static const char rcsid[] =
#include <stdio.h> /* defines BUFSIZ */
#include <string.h>
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
@@ -72,6 +68,7 @@ static const char rcsid[] =
#include "output.h"
#include "memalloc.h"
#include "error.h"
#include "var.h"
#define OUTBUFSIZ BUFSIZ
@@ -105,60 +102,73 @@ RESET {
#endif
#ifdef notdef /* no longer used */
/*
* Set up an output file to write to memory rather than a file.
*/
void
open_mem(block, length, file)
char *block;
int length;
struct output *file;
{
file->nextc = block;
file->nleft = --length;
file->fd = BLOCK_OUT;
file->flags = 0;
}
#endif
void
out1str(p)
const char *p;
{
out1str(const char *p)
{
outstr(p, out1);
}
void
out1qstr(const char *p)
{
outqstr(p, out1);
}
void
out2str(p)
const char *p;
{
out2str(const char *p)
{
outstr(p, out2);
}
void
out2qstr(const char *p)
{
outqstr(p, out2);
}
void
outstr(p, file)
const char *p;
struct output *file;
{
outstr(const char *p, struct output *file)
{
while (*p)
outc(*p++, file);
if (file == out2)
flushout(file);
}
/* Like outstr(), but quote for re-input into the shell. */
void
outqstr(const char *p, struct output *file)
{
char ch;
if (p[strcspn(p, "|&;<>()$`\\\"'")] == '\0' && (!ifsset() ||
p[strcspn(p, ifsval())] == '\0')) {
outstr(p, file);
return;
}
out1c('\'');
while ((ch = *p++) != '\0') {
switch (ch) {
case '\'':
/*
* Can't quote single quotes inside single quotes;
* close them, write escaped single quote, open again.
*/
outstr("'\\''", file);
break;
default:
outc(ch, file);
}
}
out1c('\'');
}
char out_junk[16];
void
emptyoutbuf(dest)
struct output *dest;
{
emptyoutbuf(struct output *dest)
{
int offset;
if (dest->fd == BLOCK_OUT) {
@@ -187,16 +197,16 @@ emptyoutbuf(dest)
void
flushall() {
flushall(void)
{
flushout(&output);
flushout(&errout);
}
void
flushout(dest)
struct output *dest;
{
flushout(struct output *dest)
{
if (dest->buf == NULL || dest->nextc == dest->buf || dest->fd < 0)
return;
@@ -208,7 +218,8 @@ flushout(dest)
void
freestdout() {
freestdout(void)
{
INTOFF;
if (output.buf) {
ckfree(output.buf);
@@ -219,9 +230,9 @@ freestdout() {
}
#ifdef __STDC__
void
outfmt(struct output *file, const char *fmt, ...) {
outfmt(struct output *file, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -231,7 +242,8 @@ outfmt(struct output *file, const char *fmt, ...) {
void
out1fmt(const char *fmt, ...) {
out1fmt(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -240,7 +252,8 @@ out1fmt(const char *fmt, ...) {
}
void
dprintf(const char *fmt, ...) {
dprintf(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -250,7 +263,8 @@ dprintf(const char *fmt, ...) {
}
void
fmtstr(char *outbuf, int length, const char *fmt, ...) {
fmtstr(char *outbuf, int length, const char *fmt, ...)
{
va_list ap;
struct output strout;
@@ -265,77 +279,6 @@ fmtstr(char *outbuf, int length, const char *fmt, ...) {
outbuf[length - 1] = '\0';
}
#else /* not __STDC__ */
void
outfmt(va_alist)
va_dcl
{
va_list ap;
struct output *file;
const char *fmt;
va_start(ap);
file = va_arg(ap, struct output *);
fmt = va_arg(ap, char *);
doformat(file, fmt, ap);
va_end(ap);
}
void
out1fmt(va_alist)
va_dcl
{
va_list ap;
const char *fmt;
va_start(ap);
fmt = va_arg(ap, char *);
doformat(out1, fmt, ap);
va_end(ap);
}
void
dprintf(va_alist)
va_dcl
{
va_list ap;
const char *fmt;
va_start(ap);
fmt = va_arg(ap, char *);
doformat(out2, fmt, ap);
va_end(ap);
flushout(out2);
}
void
fmtstr(va_alist)
va_dcl
{
va_list ap;
struct output strout;
char *outbuf;
int length;
const char *fmt;
va_start(ap);
outbuf = va_arg(ap, char *);
length = va_arg(ap, int);
fmt = va_arg(ap, char *);
strout.nextc = outbuf;
strout.nleft = length;
strout.fd = BLOCK_OUT;
strout.flags = 0;
doformat(&strout, fmt, ap);
outc('\0', &strout);
if (strout.flags & OUTPUT_ERR)
outbuf[length - 1] = '\0';
}
#endif /* __STDC__ */
/*
* Formatted output. This routine handles a subset of the printf formats:
* - Formats supported: d, u, o, X, s, and c.
@@ -355,11 +298,8 @@ static const char digit[] = "0123456789ABCDEF";
void
doformat(dest, f, ap)
struct output *dest;
const char *f; /* format string */
va_list ap;
{
doformat(struct output *dest, const char *f, va_list ap)
{
char c;
char temp[TEMPSIZE];
int flushleft;
@@ -529,11 +469,8 @@ number: /* process a number */
*/
int
xwrite(fd, buf, nbytes)
int fd;
char *buf;
int nbytes;
{
xwrite(int fd, char *buf, int nbytes)
{
int ntry;
int i;
int n;
@@ -555,21 +492,3 @@ xwrite(fd, buf, nbytes)
}
}
}
/*
* Version of ioctl that retries after a signal is caught.
* XXX unused function
*/
int
xioctl(fd, request, arg)
int fd;
unsigned long request;
char * arg;
{
int i;
while ((i = ioctl(fd, request, arg)) == -1 && errno == EINTR);
return i;
}
+17 -19
View File
@@ -39,11 +39,7 @@
#ifndef OUTPUT_INCL
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
struct output {
char *nextc;
@@ -60,21 +56,23 @@ extern struct output memout;
extern struct output *out1;
extern struct output *out2;
void open_mem __P((char *, int, struct output *));
void out1str __P((const char *));
void out2str __P((const char *));
void outstr __P((const char *, struct output *));
void emptyoutbuf __P((struct output *));
void flushall __P((void));
void flushout __P((struct output *));
void freestdout __P((void));
void outfmt __P((struct output *, const char *, ...)) __printflike(2, 3);
void out1fmt __P((const char *, ...)) __printflike(1, 2);
void dprintf __P((const char *, ...)) __printflike(1, 2);
void fmtstr __P((char *, int, const char *, ...)) __printflike(3, 4);
void doformat __P((struct output *, const char *, va_list)) __printflike(2, 0);
int xwrite __P((int, char *, int));
int xioctl __P((int, unsigned long, char *));
void open_mem(char *, int, struct output *);
void out1str(const char *);
void out1qstr(const char *);
void out2str(const char *);
void out2qstr(const char *);
void outstr(const char *, struct output *);
void outqstr(const char *, struct output *);
void emptyoutbuf(struct output *);
void flushall(void);
void flushout(struct output *);
void freestdout(void);
void outfmt(struct output *, const char *, ...) __printflike(2, 3);
void out1fmt(const char *, ...) __printflike(1, 2);
void dprintf(const char *, ...) __printflike(1, 2);
void fmtstr(char *, int, const char *, ...) __printflike(3, 4);
void doformat(struct output *, const char *, va_list) __printflike(2, 0);
int xwrite(int, char *, int);
#define outc(c, file) (--(file)->nleft < 0? (emptyoutbuf(file), *(file)->nextc++ = (c)) : (*(file)->nextc++ = (c)))
#define out1c(c) outc(c, out1);
+60 -65
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <stdlib.h>
@@ -108,22 +108,22 @@ static const char types[] = "}-+?=";
#endif
STATIC union node *list __P((int));
STATIC union node *andor __P((void));
STATIC union node *pipeline __P((void));
STATIC union node *command __P((void));
STATIC union node *simplecmd __P((union node **, union node *));
STATIC union node *makename __P((void));
STATIC void parsefname __P((void));
STATIC void parseheredoc __P((void));
STATIC int peektoken __P((void));
STATIC int readtoken __P((void));
STATIC int xxreadtoken __P((void));
STATIC int readtoken1 __P((int, char const *, char *, int));
STATIC int noexpand __P((char *));
STATIC void synexpect __P((int));
STATIC void synerror __P((char *));
STATIC void setprompt __P((int));
STATIC union node *list(int);
STATIC union node *andor(void);
STATIC union node *pipeline(void);
STATIC union node *command(void);
STATIC union node *simplecmd(union node **, union node *);
STATIC union node *makename(void);
STATIC void parsefname(void);
STATIC void parseheredoc(void);
STATIC int peektoken(void);
STATIC int readtoken(void);
STATIC int xxreadtoken(void);
STATIC int readtoken1(int, char const *, char *, int);
STATIC int noexpand(char *);
STATIC void synexpect(int);
STATIC void synerror(char *);
STATIC void setprompt(int);
/*
@@ -132,8 +132,7 @@ STATIC void setprompt __P((int));
*/
union node *
parsecmd(interact)
int interact;
parsecmd(int interact)
{
int t;
@@ -155,8 +154,7 @@ parsecmd(interact)
STATIC union node *
list(nlflag)
int nlflag;
list(int nlflag)
{
union node *n1, *n2, *n3;
int tok;
@@ -226,7 +224,8 @@ list(nlflag)
STATIC union node *
andor() {
andor(void)
{
union node *n1, *n2, *n3;
int t;
@@ -252,7 +251,8 @@ andor() {
STATIC union node *
pipeline() {
pipeline(void)
{
union node *n1, *n2, *pipenode;
struct nodelist *lp, *prev;
int negate;
@@ -292,7 +292,8 @@ pipeline() {
STATIC union node *
command() {
command(void)
{
union node *n1, *n2;
union node *ap, **app;
union node *cp, **cpp;
@@ -477,14 +478,14 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
break;
/* Handle an empty command like other simple commands. */
case TSEMI:
case TAND:
case TOR:
/*
* An empty command before a ; doesn't make much sense, and
* should certainly be disallowed in the case of `if ;'.
*/
if (!redir)
synexpect(-1);
case TAND:
case TOR:
case TNL:
case TEOF:
case TWORD:
@@ -527,9 +528,8 @@ checkneg:
STATIC union node *
simplecmd(rpp, redir)
union node **rpp, *redir;
{
simplecmd(union node **rpp, union node *redir)
{
union node *args, **app;
union node **orig_rpp = rpp;
union node *n = NULL, *n2;
@@ -604,7 +604,8 @@ checkneg:
}
STATIC union node *
makename() {
makename(void)
{
union node *n;
n = (union node *)stalloc(sizeof (struct narg));
@@ -615,11 +616,8 @@ makename() {
return n;
}
void fixredir(n, text, err)
union node *n;
const char *text;
int err;
{
void fixredir(union node *n, const char *text, int err)
{
TRACE(("Fix redir %s %d\n", text, err));
if (!err)
n->ndup.vname = NULL;
@@ -639,7 +637,8 @@ void fixredir(n, text, err)
STATIC void
parsefname() {
parsefname(void)
{
union node *n = redirnode;
if (readtoken() != TWORD)
@@ -680,7 +679,8 @@ parsefname() {
*/
STATIC void
parseheredoc() {
parseheredoc(void)
{
struct heredoc *here;
union node *n;
@@ -703,7 +703,8 @@ parseheredoc() {
}
STATIC int
peektoken() {
peektoken(void)
{
int t;
t = readtoken();
@@ -712,7 +713,8 @@ peektoken() {
}
STATIC int
readtoken() {
readtoken(void)
{
int t;
int savecheckkwd = checkkwd;
struct alias *ap;
@@ -740,9 +742,9 @@ readtoken() {
*/
if (t == TWORD && !quoteflag)
{
char * const *pp;
const char * const *pp;
for (pp = (char **)parsekwd; *pp; pp++) {
for (pp = parsekwd; *pp; pp++) {
if (**pp == *wordtext && equal(*pp, wordtext))
{
lasttoken = t = pp - parsekwd + KWDOFFSET;
@@ -791,7 +793,8 @@ out:
#define RETURN(token) return lasttoken = token
STATIC int
xxreadtoken() {
xxreadtoken(void)
{
int c;
if (tokpushback) {
@@ -881,12 +884,8 @@ breakloop:
#define PARSEARITH() {goto parsearith; parsearith_return:;}
STATIC int
readtoken1(firstc, syntax, eofmark, striptabs)
int firstc;
char const *syntax;
char *eofmark;
int striptabs;
{
readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs)
{
int c = firstc;
char *out;
int len;
@@ -1146,6 +1145,8 @@ parseredir: {
np->type = NAPPEND;
else if (c == '&')
np->type = NTOFD;
else if (c == '|')
np->type = NCLOBBER;
else {
np->type = NTO;
pungetc();
@@ -1484,9 +1485,8 @@ RESET {
*/
STATIC int
noexpand(text)
char *text;
{
noexpand(char *text)
{
char *p;
char c;
@@ -1509,9 +1509,8 @@ noexpand(text)
*/
int
goodname(name)
char *name;
{
goodname(char *name)
{
char *p;
p = name;
@@ -1532,8 +1531,7 @@ goodname(name)
*/
STATIC void
synexpect(token)
int token;
synexpect(int token)
{
char msg[64];
@@ -1548,9 +1546,8 @@ synexpect(token)
STATIC void
synerror(msg)
char *msg;
{
synerror(char *msg)
{
if (commandname)
outfmt(&errout, "%s: %d: ", commandname, startlinno);
outfmt(&errout, "Syntax error: %s\n", msg);
@@ -1558,9 +1555,8 @@ synerror(msg)
}
STATIC void
setprompt(which)
int which;
{
setprompt(int which)
{
whichprompt = which;
#ifndef NO_HISTORY
@@ -1574,8 +1570,7 @@ setprompt(which)
* should be added here.
*/
char *
getprompt(unused)
void *unused __unused;
getprompt(void *unused __unused)
{
switch (whichprompt) {
case 0:
+4 -4
View File
@@ -76,7 +76,7 @@ extern int tokpushback;
extern int whichprompt; /* 1 == PS1, 2 == PS2 */
union node *parsecmd __P((int));
void fixredir __P((union node *, const char *, int));
int goodname __P((char *));
char *getprompt __P((void *));
union node *parsecmd(int);
void fixredir(union node *, const char *, int);
int goodname(char *);
char *getprompt(void *);
+31 -23
View File
@@ -38,11 +38,12 @@
#if 0
static char sccsid[] = "@(#)redir.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#include <string.h>
#include <fcntl.h>
@@ -62,6 +63,7 @@ static const char rcsid[] =
#include "output.h"
#include "memalloc.h"
#include "error.h"
#include "options.h"
#define EMPTY -2 /* marks an unused slot in redirtab */
@@ -71,7 +73,7 @@ static const char rcsid[] =
MKINIT
struct redirtab {
struct redirtab *next;
short renamed[10];
int renamed[10];
};
@@ -84,8 +86,8 @@ MKINIT struct redirtab *redirlist;
*/
int fd0_redirected = 0;
STATIC void openredirect __P((union node *, char[10 ]));
STATIC int openhere __P((union node *));
STATIC void openredirect(union node *, char[10 ]);
STATIC int openhere(union node *);
/*
@@ -97,10 +99,8 @@ STATIC int openhere __P((union node *));
*/
void
redirect(redir, flags)
union node *redir;
int flags;
{
redirect(union node *redir, int flags)
{
union node *n;
struct redirtab *sv = NULL;
int i;
@@ -161,10 +161,9 @@ again:
STATIC void
openredirect(redir, memory)
union node *redir;
char memory[10];
{
openredirect(union node *redir, char memory[10])
{
struct stat sb;
int fd = redir->nfile.fd;
char *fname;
int f;
@@ -211,6 +210,9 @@ movefd:
goto movefd;
case NTO:
fname = redir->nfile.expfname;
if (Cflag && stat(fname, &sb) != -1 && S_ISREG(sb.st_mode))
error("cannot create %s: %s", fname,
errmsg(EEXIST, E_CREAT));
#ifdef O_CREAT
if ((f = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
error("cannot create %s: %s", fname, errmsg(errno, E_CREAT));
@@ -219,6 +221,11 @@ movefd:
error("cannot create %s: %s", fname, errmsg(errno, E_CREAT));
#endif
goto movefd;
case NCLOBBER:
fname = redir->nfile.expfname;
if ((f = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
error("cannot create %s: %s", fname, errmsg(errno, E_CREAT));
goto movefd;
case NAPPEND:
fname = redir->nfile.expfname;
#ifdef O_APPEND
@@ -240,7 +247,8 @@ movefd:
close(fd);
copyfd(redir->ndup.dupfd, fd);
}
}
} else
close(fd);
break;
case NHERE:
case NXHERE:
@@ -260,9 +268,8 @@ movefd:
*/
STATIC int
openhere(redir)
union node *redir;
{
openhere(union node *redir)
{
int pip[2];
int len = 0;
@@ -302,7 +309,8 @@ out:
*/
void
popredir() {
popredir(void)
{
struct redirtab *rp = redirlist;
int i;
@@ -344,7 +352,8 @@ SHELLPROC {
/* Return true if fd 0 has already been redirected at least once. */
int
fd0_redirected_p () {
fd0_redirected_p(void)
{
return fd0_redirected != 0;
}
@@ -353,7 +362,8 @@ fd0_redirected_p () {
*/
void
clearredir() {
clearredir(void)
{
struct redirtab *rp;
int i;
@@ -376,9 +386,7 @@ clearredir() {
*/
int
copyfd(from, to)
int from;
int to;
copyfd(int from, int to)
{
int newfd;
+5 -5
View File
@@ -42,9 +42,9 @@
#define REDIR_BACKQ 02 /* save the command output in memory */
union node;
void redirect __P((union node *, int));
void popredir __P((void));
int fd0_redirected_p __P((void));
void clearredir __P((void));
int copyfd __P((int, int));
void redirect(union node *, int);
void popredir(void);
int fd0_redirected_p(void);
void clearredir(void);
int copyfd(int, int);
+178 -182
View File
@@ -43,10 +43,10 @@
.Nd command interpreter (shell)
.Sh SYNOPSIS
.Nm
.Op Fl /+abCEefIimnpsTuVvx
.Op Fl /+abCEefIimnPpsTuVvx
.Op Fl /+o Ar longname
.Op Fl c Ar string
.Op Ar arg ...\&
.Op Ar arg ...
.Sh DESCRIPTION
The
.Nm
@@ -77,7 +77,7 @@ command.
The shell
implements a language that has flow control constructs,
a macro facility that provides a variety of features in
addition to data storage, along with builtin history and line
addition to data storage, along with built-in history and line
editing capabilities. It incorporates many features to
aid interactive use and has the advantage that the interpretative
language is common to both interactive and non-interactive
@@ -164,9 +164,9 @@ the long name for an option may be specified as an argument to the
.Fl /+o
option of the
.Ic set
builtin command
built-in command
(described later in the section called
.Sx Builtin Commands ) .
.Sx Built-in Commands ) .
Introducing an option with a dash
.Pq Li -
enables the option,
@@ -185,7 +185,7 @@ and
.Fl c
options do not have long names.
They take arguments and are described after the single letter options.
.Bl -tag -width Ds
.Bl -tag -width indent
.It Fl a Li allexport
Flag variables for export when assignments are made to them.
.It Fl b Li notify
@@ -195,9 +195,8 @@ completion.
.It Fl C Li noclobber
Do not overwrite existing files with
.Dq Li > .
(UNIMPLEMENTED)
.It Fl E Li emacs
Enable the builtin
Enable the built-in
.Xr emacs 1
command line editor (disables the
.Fl V
@@ -226,6 +225,17 @@ Turn on job control (set automatically when interactive).
If not interactive, read commands but do not
execute them. This is useful for checking the
syntax of shell scripts.
.It Fl P Li physical
Change the default for the
.Ic cd
and
.Ic pwd
commands from
.Fl L
(logical directory layout)
to
.Fl P
(physical directory layout).
.It Fl p Li privileged
Turn on privileged mode. This mode is enabled on startup
if either the effective user or group id is not equal to the
@@ -265,9 +275,8 @@ sh -T -c "trap 'exit 1' 2 ; some-blocking-program"
Write a message to standard error when attempting
to expand a variable that is not set, and if the
shell is not interactive, exit immediately.
(UNIMPLEMENTED)
.It Fl V Li vi
Enable the builtin
Enable the built-in
.Xr vi 1
command line editor (disables
.Fl E
@@ -296,13 +305,21 @@ option takes as its only argument the long name of an option
to be enabled or disabled.
For example, the following two invocations of
.Nm
both enable the builtin
both enable the built-in
.Xr emacs 1
command line editor:
.Bd -literal -offset indent
set -E
set -o emacs
.Ed
.Pp
If used without an argument, the
.Fl o
option displays the current option settings in a human-readable format.
If
.Cm +o
is used without an argument, the current option settings are output
in a format suitable for re-input into the shell.
.Ss Lexical Structure
The shell reads input in terms of lines from a file and breaks
it up into words at whitespace (blanks and tabs), and at
@@ -313,38 +330,16 @@ which are special to the shell.
There are two types of operators: control operators and
redirection operators (their meaning is discussed later).
The following is a list of valid operators:
.Bl -tag -width Ds
.Bl -tag -width indent
.It Control operators:
.Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
.It Xo
.Li & Ta Xo
.Li && Ta Xo
.Li ( Ta Xo
.Li ) Ta Xo
.Li \en
.Xc Xc Xc Xc Xc
.It Xo
.Li ;; Ta Xo
.Li ; Ta Xo
.Li | Ta Xo
.Li ||
.Xc Xc Xc Xc
.It Li & Ta Li && Ta Li ( Ta Li ) Ta Li \en
.It Li ;; Ta Li ; Ta Li | Ta Li ||
.El
.It Redirection operators:
.Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
.It Xo
.Li < Ta Xo
.Li > Ta Xo
.Li << Ta Xo
.Li >> Ta Xo
.Li <>
.Xc Xc Xc Xc Xc
.It Xo
.Li <& Ta Xo
.Li >& Ta Xo
.Li <<- Ta Xo
.Li >|
.Xc Xc Xc Xc
.It Li < Ta Li > Ta Li << Ta Li >> Ta Li <>
.It Li <& Ta Li >& Ta Li <<- Ta Li >|
.El
.El
.Ss Quoting
@@ -352,7 +347,7 @@ Quoting is used to remove the special meaning of certain characters
or words to the shell, such as operators, whitespace, or
keywords. There are three types of quoting: matched single quotes,
matched double quotes, and backslash.
.Bl -tag -width Ds
.Bl -tag -width indent
.It Single Quotes
Enclosing characters in single quotes preserves the literal
meaning of all the characters (except single quotes, making
@@ -369,13 +364,7 @@ The backslash inside double quotes is historically weird.
It remains literal unless it precedes the following characters,
which it serves to quote:
.Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
.It Xo
.Li $ Ta Xo
.Li ` Ta Xo
.Li \&" Ta Xo
.Li \e\ Ta Xo
.Li \en
.Xc Xc Xc Xc Xc
.It Li $ Ta Li ` Ta Li \&" Ta Li \e\ Ta Li \en
.El
.It Backslash
A backslash preserves the literal meaning of the following
@@ -388,32 +377,14 @@ Reserved words are words that have special meaning to the
shell and are recognized at the beginning of a line and
after a control operator. The following are reserved words:
.Bl -column "doneXX" "elifXX" "elseXX" "untilXX" "whileX" -offset center
.It Xo
.Li \&! Ta Xo
.Li { Ta Xo
.Li } Ta Xo
.Ic case Ta Xo
.Ic do
.Xc Xc Xc Xc Xc
.It Xo
.Ic done Ta Xo
.Ic elif Ta Xo
.Ic else Ta Xo
.Ic esac Ta Xo
.Ic fi
.Xc Xc Xc Xc Xc
.It Xo
.Ic for Ta Xo
.Ic if Ta Xo
.Ic then Ta Xo
.Ic until Ta Xo
.Ic while
.Xc Xc Xc Xc Xc
.It Li \&! Ta { Ta } Ta Ic case Ta Ic do
.It Ic done Ta Ic elif Ta Ic else Ta Ic esac Ta Ic fi
.It Ic for Ta Ic if Ta Ic then Ta Ic until Ta Ic while
.El
.Ss Aliases
An alias is a name and corresponding value set using the
.Ic alias
builtin command. Whenever a reserved word may occur (see above),
built-in command. Whenever a reserved word may occur (see above),
and after checking for reserved words, the shell
checks the word to see if it matches an alias.
If it does, it replaces it in the input stream with its value.
@@ -534,7 +505,7 @@ then leading tabs
in the here-doc-text are stripped.
.Ss Search and Execution
There are three types of commands: shell functions,
builtin commands, and normal programs.
built-in commands, and normal programs.
The command is searched for (by name) in that order.
The three types of commands are all executed in a different way.
.Pp
@@ -550,12 +521,12 @@ The positional parameters are restored to their original values
when the command completes.
This all occurs within the current shell.
.Pp
Shell builtin commands are executed internally to the shell, without
Shell built-in commands are executed internally to the shell, without
spawning a new process.
.Pp
Otherwise, if the command name does not match a function
or builtin command, the command is searched for as a normal
program in the filesystem (as described in the next section).
or built-in command, the command is searched for as a normal
program in the file system (as described in the next section).
When a normal program is executed, the shell runs the program,
passing the arguments and the environment to the program.
If the program is not a normal executable file
@@ -584,7 +555,7 @@ as a
.Ss Path Search
When locating a command, the shell first looks to see if
it has a shell function by that name. Then it looks for a
builtin command by that name. If a builtin command is not found,
built-in command by that name. If a built-in command is not found,
one of two things happen:
.Bl -enum
.It
@@ -608,7 +579,7 @@ of other shell commands. The paradigm is that a command exits
with zero for normal or success, and non-zero for failure,
error, or a false indication. The man page for each command
should indicate the various exit codes and what they mean.
Additionally, the builtin commands return exit codes, as does
Additionally, the built-in commands return exit codes, as does
an executed shell function.
.Pp
If a command is terminated by a signal, its exit status is 128 plus
@@ -688,7 +659,7 @@ Note that unlike some other shells,
executes each process in the pipeline as a child of the
.Nm
process.
Shell builtin commands are the exception to this rule.
Shell built-in commands are the exception to this rule.
They are executed in the current shell, although they do not affect its
environment when used in pipelines.
.Ss Background Commands (&)
@@ -712,7 +683,7 @@ and optionally terminated by one of these three characters.
The commands in a
list are executed in the order they are written.
If command is followed by an ampersand, the shell starts the
command and immediately proceed onto the next command;
command and immediately proceeds onto the next command;
otherwise it waits for the command to terminate before
proceeding to the next one.
.Ss Short-Circuit List Operators
@@ -800,7 +771,7 @@ loops.
The
.Ic continue
command continues with the next iteration of the innermost loop.
These are implemented as builtin commands.
These are implemented as built-in commands.
.Pp
The syntax of the
.Ic case
@@ -829,7 +800,7 @@ or
.Ed
.Pp
The first form executes the commands in a subshell.
Note that builtin commands thus executed do not affect the current shell.
Note that built-in commands thus executed do not affect the current shell.
The second form does not fork another shell,
so it is slightly more efficient.
Grouping commands together this way allows the user to
@@ -859,13 +830,13 @@ This should appear as the first statement of a function,
and the syntax is:
.Bd -ragged -offset indent
.Ic local
.Op Ar variable ...\&
.Op Ar variable ...
.Op Ar -
.Ed
.Pp
The
.Ic local
command is implemented as a builtin command.
command is implemented as a built-in command.
.Pp
When a variable is made local, it inherits the initial
value and exported and readonly flags from the variable
@@ -908,7 +879,7 @@ command is
It terminates the currently executing function.
The
.Ic return
command is implemented as a builtin command.
command is implemented as a built-in command.
.Ss Variables and Parameters
The shell maintains a set of parameters. A parameter
denoted by a name is called a variable. When starting up,
@@ -928,7 +899,7 @@ A positional parameter is a parameter denoted by a number greater than zero.
The shell sets these initially to the values of its command line
arguments that follow the name of the shell script. The
.Ic set
builtin command can also be used to set or reset them.
built-in command can also be used to set or reset them.
.Ss Special Parameters
A special parameter is a parameter denoted by one of the following
special characters. The value of the parameter is listed
@@ -974,7 +945,7 @@ Expands to the exit status of the most recent pipeline.
.It Li -
(hyphen) Expands to the current option flags (the single-letter
option names concatenated into a string) as specified on
invocation, by the set builtin command, or implicitly
invocation, by the set built-in command, or implicitly
by the shell.
.It Li $
Expands to the process ID of the invoked shell. A subshell
@@ -1076,7 +1047,7 @@ expansion, with the exception of the special parameter
.Pp
In addition, a parameter expansion can be modified by using one of the
following formats.
.Bl -tag -width Ds
.Bl -tag -width indent
.It Li ${parameter:-word}
Use Default Values. If parameter is unset or
null, the expansion of word is
@@ -1129,7 +1100,7 @@ the result of the expansion is unspecified.
Enclosing the full parameter expansion string in double-quotes does not
cause the following four varieties of pattern characters to be quoted,
whereas quoting characters within the braces has this effect.
.Bl -tag -width Ds
.Bl -tag -width indent
.It Li ${parameter%word}
Remove Smallest Suffix Pattern. The word
is expanded to produce a pattern. The
@@ -1269,16 +1240,16 @@ if any).
To include a
.Dq Li - ,
make it the first or last character listed.
.Ss Builtin Commands
.Ss Built-in Commands
This section lists the commands which
are builtin because they need to perform some operation
are built-in because they need to perform some operation
that cannot be performed by a separate process. In addition to
these, builtin versions of the
these, built-in versions of the
.Xr printf 1
and
.Xr test 1
commands are provided for efficiency.
.Bl -tag -width Ds
.Bl -tag -width indent
.It Ic \&:
A null command that returns a 0 (true) exit value.
.It Ic \&. Ar file
@@ -1293,9 +1264,7 @@ for the file. If it is not found in the
.Ev PATH ,
it is sought in the current working directory.
.It Ic alias Op Ar name ...
.It Ic alias Xo
.Op Ar name Ns = Ns Ar string ...
.Xc
.It Ic alias Op Ar name Ns = Ns Ar string ...
If
.Ar name Ns = Ns Ar string
is specified, the shell defines the alias
@@ -1309,19 +1278,25 @@ is specified, the value of the alias
is printed.
With no arguments, the
.Ic alias
builtin command prints the names and values of all defined aliases
built-in command prints the names and values of all defined aliases
(see
.Ic unalias ) .
Alias values are written with appropriate quoting so that they are
suitable for re-input to the shell.
.It Ic bg Op Ar job ...
Continue the specified jobs
(or the current job if no jobs are given)
in the background.
.It Ic command Ar cmd Op Ar arg ...
Execute the specified builtin command,
.It Ic builtin Ar cmd Op Ar arg ...
Execute the specified built-in command,
.Ar cmd .
This is useful when the user wishes to override a shell function
with the same name as a builtin command.
.It Ic cd Op Ar directory
with the same name as a built-in command.
.It Ic bind Oo Fl aeklrsv Oc Oo Ar key Oo Ar command Oc Oc
List or alter key bindings for the line editor.
This command is documented in
.Xr editrc 5 .
.It Ic cd Oo Fl LP Oc Op Ar directory
Switch to the specified
.Ar directory ,
or to the directory specified in the
@@ -1332,8 +1307,7 @@ is specified.
If
.Ar directory
does not begin with
.Pa / ,
.Pa \&. ,
.Pa / , \&. ,
or
.Pa .. ,
then the directories listed in the
@@ -1357,26 +1331,49 @@ if this is different from the name that the user gave.
These may be different either because the
.Ev CDPATH
mechanism was used or because a symbolic link was crossed.
.Pp
If the
.Fl P
option is specified,
.Pa ..
is handled physically and symbolic links are resolved before
.Pa ..
components are processed.
If the
.Fl L
option is specified,
.Pa ..
is handled logically.
This is the default.
.It Ic chdir
A synonym for the
.Ic cd
builtin command.
.It Xo
.Ic echo
.Op Fl en
.Ar string
.Xc
built-in command.
.It Ic command Oo Fl p Oc Op Ar utility Op Ar argument ...
Execute the specified
.Ar utility
as a simple command (see the
.Sx Simple Commands
section).
.Pp
If the
.Fl p
option is specified, the command search is performed using a
default value of
.Ev PATH
that is guaranteed to find all of the standard utilities.
.It Ic echo Oo Fl e | n Oc Op Ar string
Print
.Ar string
to the standard output with a newline appended.
.Bl -tag -width Ds
.Bl -tag -width indent
.It Fl n
Suppress the output of the trailing newline.
.It Fl e
Process C-style backslash escape sequences.
.Ic echo
understands the following character escapes:
.Bl -tag -width Ds
.Bl -tag -width indent
.It \ea
Alert (ring the terminal bell)
.It \eb
@@ -1419,6 +1416,12 @@ $ echo -e a\e\e\e\eb
a\eb
.Ed
.El
.Pp
Only one of the
.Fl e
and
.Fl n
options may be specified.
.It Ic eval Ar string ...
Concatenate all the arguments with spaces.
Then re-parse and execute the command.
@@ -1427,7 +1430,7 @@ Unless
.Ar command
is omitted,
the shell process is replaced with the specified program
(which must be a real program, not a shell builtin command or function).
(which must be a real program, not a shell built-in command or function).
Any redirections on the
.Ic exec
command are marked as permanent,
@@ -1441,7 +1444,7 @@ If
is given
it is used as the exit status of the shell;
otherwise the exit status of the preceding command is used.
.It Ic export Ar name ...
.It Ic export Oo Fl p Oc Op Ar name ...
The specified names are exported so that they will
appear in the environment of subsequent commands.
The only way to un-export a variable is to
@@ -1455,28 +1458,19 @@ export name=value
.Pp
With no arguments the export command lists the names
of all exported variables.
.It Xo
.Ic fc
.Op Fl e Ar editor
.Op Ar first Op Ar last
.Xc
.It Xo
.Ic fc
.Fl l
.Op Fl nr
.Op Ar first Op Ar last
.Xc
.It Xo
.Ic fc
.Fl s
.Op Ar old=new
.Op Ar first
.Xc
If the
.Fl p
option is specified, the exported variables are printed as
.Dq Ic export Ar name Ns = Ns Ar value
lines, suitable for re-input to the shell.
.It Ic fc Oo Fl e Ar editor Oc Op Ar first Op Ar last
.It Ic fc Fl l Oo Fl nr Oc Op Ar first Op Ar last
.It Ic fc Fl s Oo Ar old Ns = Ns Ar new Oc Op Ar first
The
.Ic fc
builtin command lists, or edits and re-executes,
built-in command lists, or edits and re-executes,
commands previously entered to an interactive shell.
.Bl -tag -width Ds
.Bl -tag -width indent
.It Fl e Ar editor
Use the editor named by
.Ar editor
@@ -1533,7 +1527,7 @@ The value of
or
.Ar last
or both are one of the following:
.Bl -tag -width Ds
.Bl -tag -width indent
.It Ar [+]num
A positive number representing a command number;
command numbers can be displayed with the
@@ -1559,7 +1553,7 @@ the string form of the first operand cannot contain an embedded equal sign.
.Pp
The following environment variables affect the execution of
.Ic fc :
.Bl -tag -width Ds
.Bl -tag -width indent
.It Ev FCEDIT
Name of the editor to use.
.It Ev HISTSIZE
@@ -1590,11 +1584,7 @@ If an invalid option is encountered,
is set to
.Dq Li \&? .
It returns a false value (1) when it encounters the end of the options.
.It Xo
.Ic hash
.Op Fl rv
.Op Ar command ...
.Xc
.It Ic hash Oo Fl rv Oc Op Ar command ...
The shell maintains a hash table which remembers the locations of commands.
With no arguments whatsoever, the
.Ic hash
@@ -1625,26 +1615,38 @@ Print the process id's of the processes in the specified
If the
.Ar job
argument is omitted, use the current job.
.It Ic jobs
This command lists out all the background processes
which are children of the current shell process.
.It Ic pwd
Print the path of the current directory. The builtin command may
.It Ic jobs Oo Fl ls Oc Op Ar job ...
Print information about the specified jobs, or all jobs if no
.Ar job
argument is given.
The information printed includes job ID, status and command name.
.Pp
If the
.Fl l
option is specified, the PID of each job is also printed.
If the
.Fl s
option is specified, only the PIDs of the jobs are printed, one per line.
.It Ic pwd Op Fl LP
Print the path of the current directory. The built-in command may
differ from the program of the same name because the
builtin command remembers what the current directory
built-in command remembers what the current directory
is rather than recomputing it each time. This makes
it faster. However, if the current directory is
renamed,
the builtin version of
the built-in version of
.Xr pwd 1
will continue to print the old name for the directory.
.It Xo
.Ic read
.Op Fl p Ar prompt
.Op Fl t Ar timeout
.Op Fl er
.Ar variable ...
.Xc
.Pp
If the
.Fl P
option is specified, symbolic links are resolved.
If the
.Fl L
option is specified, the shell's notion of the current directory
is printed (symbolic links are not resolved).
This is the default.
.It Ic read Oo Fl p Ar prompt Oc Oo Fl t Ar timeout Oc Oo Fl er Oc Ar variable ...
The
.Ar prompt
is printed if the
@@ -1699,7 +1701,7 @@ is assumed.
The
.Fl e
option exists only for backward compatibility with older scripts.
.It Ic readonly Ar name ...
.It Ic readonly Oo Fl p Oc Op Ar name ...
Each specified
.Ar name
is marked as read only,
@@ -1714,13 +1716,13 @@ readonly name=value
With no arguments the
.Ic readonly
command lists the names of all read only variables.
.It Xo
.Ic set
.Op Fl /+abCEefIimnpTuVvx
.Op Fl /+o Ar longname
.Op Fl c Ar string
.Op Fl - Ar arg ...
.Xc
If the
.Fl p
option is specified, the read-only variables are printed as
.Dq Ic readonly Ar name Ns = Ns Ar value
lines, suitable for re-input to the shell.
.It Ic set Oo Fl /+abCEefIimnpTuVvx Oc Oo Fl /+o Ar longname Oc Oo
.Fl c Ar string Oc Op Fl - Ar arg ...
The
.Ic set
command performs three different functions:
@@ -1749,7 +1751,7 @@ which is equivalent to executing the command
.Dq Li shift $# .
The
.Dq Fl -
flag may be ommitted when specifying arguments to be used
flag may be omitted when specifying arguments to be used
as positional replacement parameters.
This is not recommended,
because the first argument may begin with a dash
@@ -1784,11 +1786,7 @@ A shift sets the value of $1 to the value of $2,
the value of $2 to the value of $3, and so on,
decreasing the value of $# by one.
If there are zero positional parameters, shifting does not do anything.
.It Xo
.Ic trap
.Op Ar action
.Ar signal ...
.Xc
.It Ic trap Oo Ar action Oc Ar signal ...
Cause the shell to parse and execute
.Ar action
when any specified
@@ -1810,16 +1808,12 @@ Interpret each
.Ar name
as a command and print the resolution of the command search.
Possible resolutions are:
shell keyword, alias, shell builtin command, command, tracked alias
shell keyword, alias, shell built-in command, command, tracked alias
and not found.
For aliases the alias expansion is printed;
for commands and tracked aliases
the complete pathname of the command is printed.
.It Xo
.Ic ulimit
.Op Fl HSabcdflmnstuv
.Op Ar limit
.Xc
.It Ic ulimit Oo Fl HSabcdflmnstuv Oc Op Ar limit
Set or display resource limits (see
.Xr getrlimit 2 ) .
If
@@ -1856,7 +1850,7 @@ is not acceptable in this mode.
The remaining options specify which resource value is to be
displayed or modified.
They are mutually exclusive.
.Bl -tag -width Ds
.Bl -tag -width indent
.It Fl b Ar sbsize
The maximum size of socket buffer usage, in bytes.
.It Fl c Ar coredumpsize
@@ -1887,23 +1881,25 @@ Set the file creation mask (see
to the octal value specified by
.Ar mask .
If the argument is omitted, the current mask value is printed.
.It Xo
.Ic unalias
.Op Fl a
.Op Ar name
.Xc
.It Ic unalias Oo Fl a Oc Op Ar name
If
.Ar name
is specified, the shell removes that alias.
If
.Fl a
is specified, all aliases are removed.
.It Ic unset Ar name ...
The specified variables and functions are unset and unexported.
If a given
.It Ic unset Oo Fl fv Oc Ar name ...
The specified variables or functions are unset and unexported.
If the
.Fl v
option is specified or no options are given, the
.Ar name
corresponds to both a variable and a function,
both the variable and the function are unset.
arguments are treated as variable names.
If the
.Fl f
option is specified, the
.Ar name
arguments are treated as function names.
.It Ic wait Op Ar job
Wait for the specified
.Ar job
@@ -1920,7 +1916,7 @@ and the command history
(see
.Ic fc
in
.Sx Builtin Commands )
.Sx Built-in Commands )
can be edited using vi-mode command line editing.
This mode uses commands similar
to a subset of those described in the vi man page.
@@ -1955,4 +1951,4 @@ emacs-style command line editing features.
A
.Nm
command appeared in
.At V.1 .
.At v1 .
-16
View File
@@ -40,9 +40,6 @@
/*
* The follow should be set to reflect the type of system you have:
* JOBS -> 1 if you have Berkeley job control, 0 otherwise.
* SHORTNAMES -> 1 if your linker cannot handle long names.
* define BSD if you are running 4.2 BSD or later.
* define SYSV if you are running under System V.
* define DEBUG=1 to compile in debugging (set global "debug" to turn on)
* define DEBUG=2 to compile in and turn on debugging.
*
@@ -52,22 +49,9 @@
#define JOBS 1
#ifndef BSD
#define BSD 1
#endif
/* #define DEBUG 1 */
#ifdef __STDC__
typedef void *pointer;
#ifndef NULL
#define NULL (void *)0
#endif
#else /* not __STDC__ */
typedef char *pointer;
#ifndef NULL
#define NULL 0
#endif
#endif /* not __STDC__ */
#define STATIC static
#define MKINIT /* empty */
+24 -53
View File
@@ -38,19 +38,12 @@
#if 0
static char sccsid[] = "@(#)show.c 8.3 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <stdio.h>
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#if DEBUG == 2
#include <errno.h>
#endif
#include <errno.h>
#include "shell.h"
@@ -61,16 +54,15 @@ static const char rcsid[] =
#ifdef DEBUG
static void shtree __P((union node *, int, char *, FILE*));
static void shcmd __P((union node *, FILE *));
static void sharg __P((union node *, FILE *));
static void indent __P((int, char *, FILE *));
static void trstring __P((char *));
static void shtree(union node *, int, char *, FILE*);
static void shcmd(union node *, FILE *);
static void sharg(union node *, FILE *);
static void indent(int, char *, FILE *);
static void trstring(char *);
void
showtree(n)
union node *n;
showtree(union node *n)
{
trputs("showtree called\n");
shtree(n, 1, NULL, stdout);
@@ -78,11 +70,7 @@ showtree(n)
static void
shtree(n, ind, pfx, fp)
union node *n;
int ind;
char *pfx;
FILE *fp;
shtree(union node *n, int ind, char *pfx, FILE *fp)
{
struct nodelist *lp;
char *s;
@@ -133,9 +121,7 @@ binop:
static void
shcmd(cmd, fp)
union node *cmd;
FILE *fp;
shcmd(union node *cmd, FILE *fp)
{
union node *np;
int first;
@@ -156,6 +142,7 @@ shcmd(cmd, fp)
case NTO: s = ">"; dftfd = 1; break;
case NAPPEND: s = ">>"; dftfd = 1; break;
case NTOFD: s = ">&"; dftfd = 1; break;
case NCLOBBER: s = ">|"; dftfd = 1; break;
case NFROM: s = "<"; dftfd = 0; break;
case NFROMTO: s = "<>"; dftfd = 0; break;
case NFROMFD: s = "<&"; dftfd = 0; break;
@@ -165,7 +152,10 @@ shcmd(cmd, fp)
fprintf(fp, "%d", np->nfile.fd);
fputs(s, fp);
if (np->nfile.type == NTOFD || np->nfile.type == NFROMFD) {
fprintf(fp, "%d", np->ndup.dupfd);
if (np->ndup.dupfd >= 0)
fprintf(fp, "%d", np->ndup.dupfd);
else
fprintf(fp, "-");
} else {
sharg(np->nfile.fname, fp);
}
@@ -176,10 +166,8 @@ shcmd(cmd, fp)
static void
sharg(arg, fp)
union node *arg;
FILE *fp;
{
sharg(union node *arg, FILE *fp)
{
char *p;
struct nodelist *bqlist;
int subtype;
@@ -263,10 +251,7 @@ sharg(arg, fp)
static void
indent(amount, pfx, fp)
int amount;
char *pfx;
FILE *fp;
indent(int amount, char *pfx, FILE *fp)
{
int i;
@@ -293,8 +278,7 @@ int debug = 0;
void
trputc(c)
int c;
trputc(int c)
{
if (tracefile == NULL)
return;
@@ -305,21 +289,10 @@ trputc(c)
void
#ifdef __STDC__
sh_trace(const char *fmt, ...)
#else
sh_trace(va_alist)
va_dcl
#endif
{
va_list va;
#ifdef __STDC__
va_start(va, fmt);
#else
char *fmt;
va_start(va);
fmt = va_arg(va, char *);
#endif
if (tracefile != NULL) {
(void) vfprintf(tracefile, fmt, va);
if (strchr(fmt, '\n'))
@@ -330,8 +303,7 @@ sh_trace(va_alist)
void
trputs(s)
char *s;
trputs(char *s)
{
if (tracefile == NULL)
return;
@@ -342,8 +314,7 @@ trputs(s)
static void
trstring(s)
char *s;
trstring(char *s)
{
char *p;
char c;
@@ -383,8 +354,7 @@ backslash: putc('\\', tracefile);
void
trargs(ap)
char **ap;
trargs(char **ap)
{
if (tracefile == NULL)
return;
@@ -400,7 +370,8 @@ trargs(ap)
void
opentrace() {
opentrace(void)
{
char s[100];
char *getenv();
#ifdef O_APPEND
+6 -6
View File
@@ -34,11 +34,11 @@
* $FreeBSD$
*/
void showtree __P((union node *));
void showtree(union node *);
#ifdef DEBUG
void sh_trace __P((const char *, ...)) __printflike(1, 2);
void trargs __P((char **));
void trputc __P((int));
void trputs __P((char *));
void opentrace __P((void));
void sh_trace(const char *, ...) __printflike(1, 2);
void trargs(char **);
void trputc(int);
void trputs(char *);
void opentrace(void);
#endif
+30 -29
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)trap.c 8.5 (Berkeley) 6/5/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <signal.h>
#include <unistd.h>
@@ -59,6 +59,7 @@ static const char rcsid[] =
#include "error.h"
#include "trap.h"
#include "mystring.h"
#include "myhistedit.h"
/*
@@ -81,16 +82,16 @@ static char *volatile trap[NSIG]; /* trap handler commands */
static volatile sig_atomic_t gotsig[NSIG];
/* indicates specified signal received */
static int ignore_sigchld; /* Used while handling SIGCHLD traps. */
volatile sig_atomic_t gotwinch;
static int getsigaction __P((int, sig_t *));
static int getsigaction(int, sig_t *);
/*
* Map a string to a signal number.
*/
static int
sigstring_to_signum(sig)
char *sig;
sigstring_to_signum(char *sig)
{
if (is_number(sig)) {
@@ -117,7 +118,7 @@ sigstring_to_signum(sig)
* Print a list of valid signal names.
*/
static void
printsignals()
printsignals(void)
{
int n;
@@ -135,9 +136,7 @@ printsignals()
* The trap builtin.
*/
int
trapcmd(argc, argv)
int argc;
char **argv;
trapcmd(int argc, char **argv)
{
char *action;
int signo;
@@ -188,7 +187,7 @@ trapcmd(argc, argv)
* Clear traps on a fork.
*/
void
clear_traps()
clear_traps(void)
{
char *volatile *tp;
@@ -210,8 +209,7 @@ clear_traps()
* out what it should be set to.
*/
void
setsignal(signo)
int signo;
setsignal(int signo)
{
int action;
sig_t sig, sigact = SIG_DFL;
@@ -249,6 +247,12 @@ setsignal(signo)
if (rootshell && mflag)
action = S_IGN;
break;
#endif
#ifndef NO_HISTORY
case SIGWINCH:
if (rootshell && iflag)
action = S_CATCH;
break;
#endif
}
}
@@ -285,10 +289,8 @@ setsignal(signo)
}
*t = action;
sig = signal(signo, sigact);
#ifdef BSD
if (sig != SIG_ERR && action == S_CATCH)
siginterrupt(signo, 1);
#endif
}
@@ -296,9 +298,7 @@ setsignal(signo)
* Return the current setting for sig w/o changing it.
*/
static int
getsigaction(signo, sigact)
int signo;
sig_t *sigact;
getsigaction(int signo, sig_t *sigact)
{
struct sigaction sa;
@@ -313,8 +313,7 @@ getsigaction(signo, sigact)
* Ignore a signal.
*/
void
ignoresig(signo)
int signo;
ignoresig(int signo)
{
if (sigmode[signo] != S_IGN && sigmode[signo] != S_HARD_IGN) {
@@ -344,13 +343,9 @@ SHELLPROC {
* Signal handler.
*/
void
onsig(signo)
int signo;
onsig(int signo)
{
#ifndef BSD
signal(signo, onsig);
#endif
if (signo == SIGINT && trap[SIGINT] == NULL) {
onint();
return;
@@ -372,6 +367,11 @@ onsig(signo)
! trap[signo][0] == '\0' &&
! (trap[signo][0] == ':' && trap[signo][1] == '\0'))
breakwaitcmd = 1;
#ifndef NO_HISTORY
if (signo == SIGWINCH)
gotwinch = 1;
#endif
}
@@ -380,7 +380,7 @@ onsig(signo)
* handlers while we are executing a trap handler.
*/
void
dotrap()
dotrap(void)
{
int i;
int savestatus;
@@ -418,8 +418,7 @@ dotrap()
* Controls whether the shell is interactive or not.
*/
void
setinteractive(on)
int on;
setinteractive(int on)
{
static int is_interactive = -1;
@@ -428,6 +427,9 @@ setinteractive(on)
setsignal(SIGINT);
setsignal(SIGQUIT);
setsignal(SIGTERM);
#ifndef NO_HISTORY
setsignal(SIGWINCH);
#endif
is_interactive = on;
}
@@ -436,8 +438,7 @@ setinteractive(on)
* Called to exit the shell.
*/
void
exitshell(status)
int status;
exitshell(int status)
{
struct jmploc loc1, loc2;
char *p;
+9 -8
View File
@@ -39,12 +39,13 @@
extern int pendingsigs;
extern int in_dotrap;
extern volatile sig_atomic_t gotwinch;
int trapcmd __P((int, char **));
void clear_traps __P((void));
void setsignal __P((int));
void ignoresig __P((int));
void onsig __P((int));
void dotrap __P((void));
void setinteractive __P((int));
void exitshell __P((int));
int trapcmd(int, char **);
void clear_traps(void);
void setsignal(int);
void ignoresig(int);
void onsig(int);
void dotrap(void);
void setinteractive(int);
void exitshell(int);
+84 -62
View File
@@ -38,9 +38,9 @@
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <unistd.h>
#include <stdlib.h>
@@ -77,7 +77,7 @@ struct varinit {
struct var *var;
int flags;
char *text;
void (*func) __P((const char *));
void (*func)(const char *);
};
@@ -91,6 +91,7 @@ struct var vifs;
struct var vmail;
struct var vmpath;
struct var vpath;
struct var vppid;
struct var vps1;
struct var vps2;
struct var vvers;
@@ -116,6 +117,8 @@ const struct varinit varinit[] = {
NULL },
{ &vpath, VSTRFIXED|VTEXTFIXED, "PATH=/bin:/usr/bin",
changepath },
{ &vppid, VSTRFIXED|VTEXTFIXED|VUNSET, "PPID=",
NULL },
/*
* vps1 depends on uid
*/
@@ -133,9 +136,9 @@ const struct varinit varinit[] = {
struct var *vartab[VTABSIZE];
STATIC struct var **hashvar __P((char *));
STATIC int varequal __P((char *, char *));
STATIC int localevar __P((char *));
STATIC struct var **hashvar(char *);
STATIC int varequal(char *, char *);
STATIC int localevar(char *);
/*
* Initialize the varable symbol tables and import the environment
@@ -163,7 +166,9 @@ INIT {
*/
void
initvar() {
initvar(void)
{
char ppid[20];
const struct varinit *ip;
struct var *vp;
struct var **vpp;
@@ -188,6 +193,10 @@ initvar() {
vps1.text = geteuid() ? "PS1=$ " : "PS1=# ";
vps1.flags = VSTRFIXED|VTEXTFIXED;
}
if ((vppid.flags & VEXPORT) == 0) {
fmtstr(ppid, sizeof(ppid), "%d", (int)getppid());
setvarsafe("PPID", ppid, 0);
}
}
/*
@@ -195,9 +204,7 @@ initvar() {
*/
int
setvarsafe(name, val, flags)
char *name, *val;
int flags;
setvarsafe(char *name, char *val, int flags)
{
struct jmploc jmploc;
struct jmploc *volatile savehandler = handler;
@@ -223,9 +230,7 @@ setvarsafe(name, val, flags)
*/
void
setvar(name, val, flags)
char *name, *val;
int flags;
setvar(char *name, char *val, int flags)
{
char *p, *q;
int len;
@@ -267,9 +272,8 @@ setvar(name, val, flags)
}
STATIC int
localevar(s)
char *s;
{
localevar(char *s)
{
static char *lnames[7] = {
"ALL", "COLLATE", "CTYPE", "MONETARY",
"NUMERIC", "TIME", NULL
@@ -296,11 +300,10 @@ localevar(s)
*/
void
setvareq(s, flags)
char *s;
int flags;
setvareq(char *s, int flags)
{
struct var *vp, **vpp;
int len;
if (aflag)
flags |= VEXPORT;
@@ -308,7 +311,7 @@ setvareq(s, flags)
for (vp = *vpp ; vp ; vp = vp->next) {
if (varequal(s, vp->text)) {
if (vp->flags & VREADONLY) {
size_t len = strchr(s, '=') - s;
len = strchr(s, '=') - s;
error("%.*s: is read only", len, s);
}
INTOFF;
@@ -359,9 +362,8 @@ setvareq(s, flags)
*/
void
listsetvar(list)
struct strlist *list;
{
listsetvar(struct strlist *list)
{
struct strlist *lp;
INTOFF;
@@ -378,9 +380,8 @@ listsetvar(list)
*/
char *
lookupvar(name)
char *name;
{
lookupvar(char *name)
{
struct var *v;
for (v = *hashvar(name) ; v ; v = v->next) {
@@ -402,9 +403,7 @@ lookupvar(name)
*/
char *
bltinlookup(name, doall)
char *name;
int doall;
bltinlookup(char *name, int doall)
{
struct strlist *sp;
struct var *v;
@@ -432,7 +431,8 @@ bltinlookup(name, doall)
*/
char **
environment() {
environment(void)
{
int nenv;
struct var **vpp;
struct var *vp;
@@ -470,7 +470,8 @@ SHELLPROC {
#endif
void
shprocvar() {
shprocvar(void)
{
struct var **vpp;
struct var *vp, **prev;
@@ -503,17 +504,21 @@ shprocvar() {
*/
int
showvarscmd(argc, argv)
int argc __unused;
char **argv __unused;
showvarscmd(int argc __unused, char **argv __unused)
{
struct var **vpp;
struct var *vp;
const char *s;
for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) {
for (vp = *vpp ; vp ; vp = vp->next) {
if ((vp->flags & VUNSET) == 0)
out1fmt("%s\n", vp->text);
if (vp->flags & VUNSET)
continue;
for (s = vp->text; *s != '='; s++)
out1c(*s);
out1c('=');
out1qstr(s + 1);
out1c('\n');
}
}
return 0;
@@ -526,18 +531,35 @@ showvarscmd(argc, argv)
*/
int
exportcmd(argc, argv)
int argc;
char **argv;
exportcmd(int argc, char **argv)
{
struct var **vpp;
struct var *vp;
char *name;
char *p;
char *cmdname;
int ch, values;
int flag = argv[0][0] == 'r'? VREADONLY : VEXPORT;
cmdname = argv[0];
optreset = optind = 1;
opterr = 0;
values = 0;
while ((ch = getopt(argc, argv, "p")) != -1) {
switch (ch) {
case 'p':
values = 1;
break;
case '?':
default:
error("unknown option: -%c", optopt);
}
}
argc -= optind;
argv += optind;
listsetvar(cmdenviron);
if (argc > 1) {
if (argc != 0) {
while ((name = *argptr++) != NULL) {
if ((p = strchr(name, '=')) != NULL) {
p++;
@@ -545,6 +567,7 @@ exportcmd(argc, argv)
vpp = hashvar(name);
for (vp = *vpp ; vp ; vp = vp->next) {
if (varequal(vp->text, name)) {
vp->flags |= flag;
if ((vp->flags & VEXPORT) && localevar(vp->text)) {
putenv(vp->text);
@@ -561,8 +584,16 @@ found:;
for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) {
for (vp = *vpp ; vp ; vp = vp->next) {
if (vp->flags & flag) {
if (values) {
out1str(cmdname);
out1c(' ');
}
for (p = vp->text ; *p != '=' ; p++)
out1c(*p);
if (values && !(vp->flags & VUNSET)) {
out1c('=');
out1qstr(p + 1);
}
out1c('\n');
}
}
@@ -577,9 +608,7 @@ found:;
*/
int
localcmd(argc, argv)
int argc __unused;
char **argv __unused;
localcmd(int argc __unused, char **argv __unused)
{
char *name;
@@ -600,9 +629,8 @@ localcmd(argc, argv)
*/
void
mklocal(name)
char *name;
{
mklocal(char *name)
{
struct localvar *lvp;
struct var **vpp;
struct var *vp;
@@ -644,7 +672,8 @@ mklocal(name)
*/
void
poplocalvars() {
poplocalvars(void)
{
struct localvar *lvp;
struct var *vp;
@@ -668,9 +697,7 @@ poplocalvars() {
int
setvarcmd(argc, argv)
int argc;
char **argv;
setvarcmd(int argc, char **argv)
{
if (argc <= 2)
return unsetcmd(argc, argv);
@@ -689,9 +716,7 @@ setvarcmd(argc, argv)
*/
int
unsetcmd(argc, argv)
int argc __unused;
char **argv __unused;
unsetcmd(int argc __unused, char **argv __unused)
{
char **ap;
int i;
@@ -723,9 +748,8 @@ unsetcmd(argc, argv)
*/
int
unsetvar(s)
char *s;
{
unsetvar(char *s)
{
struct var **vpp;
struct var *vp;
@@ -764,9 +788,8 @@ unsetvar(s)
*/
STATIC struct var **
hashvar(p)
char *p;
{
hashvar(char *p)
{
unsigned int hashval;
hashval = ((unsigned char) *p) << 4;
@@ -784,9 +807,8 @@ hashvar(p)
*/
STATIC int
varequal(p, q)
char *p, *q;
{
varequal(char *p, char *q)
{
while (*p == *q++) {
if (*p++ == '=')
return 1;
Loaded 100 of 3856 files, more files were not shown because too many files have changed in this diff. Show more