aboutsummaryrefslogtreecommitdiff
path: root/sbin
Commit message (Collapse)AuthorAgeFilesLines
* When mount(8) is invoked with the `-v' flag, display the filesystemIan Dowse2003-07-183-17/+54
| | | | | | | | | | | | | | | ID for each file system in addition to the normal information. In umount(8), accept filesystem IDs as well as the usual device and path names. This makes it possible to unambiguously specify which file system is to be unmounted even when two or more file systems share the same device and mountpoint names (e.g. NFS mounts from the same export into different chroots). Suggested by: Dan Nelson <dnelson@allantgroup.com> Notes: svn path=/head/; revision=117742
* Don't call print_pdu() when we are not debugging. This would resultHartmut Brandt2003-07-181-1/+2
| | | | | | | | | | in calling fprintf() with a NULL fp. Strange enough this didn't result in cores in stable, but results in cores now. MFC after: 2 weeks Notes: svn path=/head/; revision=117726
* Since checkmntlist() and getmntentry() return a struct statfs thatIan Dowse2003-07-181-24/+17
| | | | | | | includes the filesystem type name, remove the "type" output parameter. Notes: svn path=/head/; revision=117720
* When the file system to unmount is specified by device name insteadIan Dowse2003-07-181-45/+7
| | | | | | | | | | | of by mount point, umount had to take care not to unmount the wrong file system if another file system was covering the requested one. Now that the file system to unmount is specified to the kernel using the filesystem ID, this confusion cannot occur, so remove the code that checked for it. Notes: svn path=/head/; revision=117712
* Userland side of:Luigi Rizzo2003-07-152-14/+22
| | | | | | | | | | | | | | | | | Allow set 31 to be used for rules other than 65535. Set 31 is still special because rules belonging to it are not deleted by the "ipfw flush" command, but must be deleted explicitly with "ipfw delete set 31" or by individual rule numbers. This implement a flexible form of "persistent rules" which you might want to have available even after an "ipfw flush". Note that this change does not violate POLA, because you could not use set 31 in a ruleset before this change. Suggested by: Paul Richards Notes: svn path=/head/; revision=117655
* Make sure that comments are printed at the end of a rule.Luigi Rizzo2003-07-151-2/+4
| | | | | | | Reported by: Patrick Tracanelli <eksffa@freebsdbrasil.com.br> Notes: svn path=/head/; revision=117626
* Fix one typo in help() string, remove whitespace at end of line andLuigi Rizzo2003-07-141-24/+23
| | | | | | | | | other minor whitespace changes. Replace u_char with uint8_t in a few places. Notes: svn path=/head/; revision=117577
* o Rename local variables, do not shadow global declarations.Maxim Konovalov2003-07-141-7/+7
| | | | Notes: svn path=/head/; revision=117550
* o Kill MINICMPLEN, there is ICMP_MINLEN already.Maxim Konovalov2003-07-141-7/+6
| | | | Notes: svn path=/head/; revision=117549
* o Be ready to get a reply with length up to IP_MAXPACKET.Maxim Konovalov2003-07-141-11/+18
| | | | | | | | | | | o Warn when recieved packet length is not equal to length of the packet we sent out. Idea from NetBSD. o Fit the dump of packet with wrong data to 80 columns (from NetBSD). Comments from: bde Notes: svn path=/head/; revision=117548
* ccept of empty lines when reading from a file (this fixes a bugLuigi Rizzo2003-07-141-25/+52
| | | | | | | | | | | | | | | | | introduced in the latest commits). Also: * update the 'ipfw -h' output; * allow rules of the form "100 add allow ..." i.e. with the index first. (requested by Paul Richards). This was an undocumented ipfw1 behaviour, and it is left undocumented. and minor code cleanups. Notes: svn path=/head/; revision=117544
* Remove reference to max block size. dump no longer limits the block size.Greg Lehey2003-07-141-13/+1
| | | | Notes: svn path=/head/; revision=117533
* Add a '-T' flag to print the timestamp as numeric value insteadLuigi Rizzo2003-07-122-5/+14
| | | | | | | | | | of converting it with ctime(). This is a lot more convenient for postprocessing. Submitted by: "Jacob S. Barrett" <jbarrett@amduat.net> Notes: svn path=/head/; revision=117472
* Document the existence of comments in ipfw rules,Luigi Rizzo2003-07-121-4/+11
| | | | | | | | | | the new flags handled when reading from a file, and clarify that only numeric values are allowed for icmptypes. MFC after: 3 days Notes: svn path=/head/; revision=117470
* In random order:Luigi Rizzo2003-07-121-218/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * make the code compile with WARNS=5 (at least on i386), mostly by adding 'const' specifier and replacing "void *" with "char *" in places where pointer arithmetic was used. This also spotted a few places where invalid tests (e.g. uint < 0) were used. * support ranges in "list" and "show" commands. Now you can say ipfw show 100-1000 4000-8000 which is very convenient when you have large rulesets. * implement comments in ipfw commands. These are implemented in the kernel as O_NOP commands (which always match) whose body contains the comment string. In userland, a comment is a C++-style comment: ipfw add allow ip from me to any // i can talk to everybody The choice of '//' versus '#' is somewhat arbitrary, but because the preprocessor/readfile part of ipfw used to strip away '#', I did not want to change this behaviour. If a rule only contains a comment ipfw add 1000 // this rule is just a comment then it is stored as a 'count' rule (this is also to remind the user that scanning through a rule is expensive). * improve handling of flags (still to be completed). ipfw_main() was written thinking of 'one rule per ipfw invocation', and so flags are set and never cleared. With readfile/preprocessor support, this changes and certain flags should be reset on each line. For the time being, only fix handling of '-a' which differentiates the "list" and "show" commands. * rework the preprocessor support -- ipfw_main() already had most of the parsing code, so i have moved in there the only missing bit (stripping away '#' and comments) and removed the parsing from ipfw_readfile(). Also, add some more options (such as -c, -N, -S) to the readfile section. MFC after: 3 days Notes: svn path=/head/; revision=117469
* Do not compare unsigned int values with ULONG_MAX. The comparison isAlexander Kabaev2003-07-112-5/+5
| | | | | | | always false on 64bit platforms and GCC 3.3.1 issues warning there. Notes: svn path=/head/; revision=117430
* Correct to match reality regarding interface names.Daniel Harris2003-07-081-3/+7
| | | | | | | | | | PR: 51006 Submitted by: "Dmitry Pryanishnikov" <dmitry@atlantis.dp.ua> mdoc clue by: "Simon L. Nielsen" <simon@nitro.dk> MFC after: 10 days Notes: svn path=/head/; revision=117334
* * introduce a section on SYNTAX to document the handlingLuigi Rizzo2003-07-081-44/+77
| | | | | | | | | | | | | | | | | spaces and comma-separated lists of arguments; * reword the description of address specifications, to include previous and current changes for address sets and lists; * document the new '-n' flag. * update the section on differences between ipfw1 and ipfw2 (this is becoming boring!) MFC after: 3 days Notes: svn path=/head/; revision=117329
* A bunch of changes (mostly syntactic sugar, all backward compatible):Luigi Rizzo2003-07-081-251/+383
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make the addr-set size optional (defaults to /24) You can now write 1.2.3.0/24{56-80} or 1.2.3.0{56-80} Also make the parser more strict. * Support a new format for the list of addresses: 1.2.3.4,5.6.7.8/30,9.10.11.12/22,12.12.12.13, ... which exploits the new capabilities of O_IP_SRC_MASK/O_IP_DST_MASK * Allow spaces after commas to make lists of addresses more readable. 1.2.3.4, 5.6.7.8/30, 9.10.11.12/22, 12.12.12.13, ... * ipfw will now accept full commands as a single argument and strip extra leading/trailing whitespace as below: ipfw "-q add allow ip from 1.2.3.4 to 5.6.7.8, 9.10.11.23 " This should help in moving the body of ipfw into a library that user programs can invoke. * Cleanup some comments and data structures. * Do not print rule counters for dynamic rules with ipfw -d list (PR 51182) * Improve 'ipfw -h' output (PR 46785) * Add a '-n' flag to test the syntax of commands without actually calling [gs]etsockopt() (PR 44238) * Support the '-n' flag also with the preprocessors; Manpage commit to follow. MFC after: 3 days Notes: svn path=/head/; revision=117328
* Drop the pid file after we call the final daemon call. w/o -n wouldWarner Losh2003-07-051-2/+4
| | | | | | | | | | give the wrong pid. Submitted by: ru and Lukas Ertl PR: 54113 Notes: svn path=/head/; revision=117246
* Implement the 'ipsec' option to match packets coming out of an ipsec tunnel.Luigi Rizzo2003-07-042-0/+22
| | | | | | | | | | | | Should work with both regular and fast ipsec (mutually exclusive). See manpage for more details. Submitted by: Ari Suutari (ari.suutari@syncrontech.com) Revised by: sam MFC after: 1 week Notes: svn path=/head/; revision=117241
* Remove smbfs, portalfs, and nwfs from sbin. The sources live in usr.sbinGordon Tetlow2003-07-0217-2370/+0
| | | | | | | now. Notes: svn path=/head/; revision=117170
* Move mount_portalfs, mount_smbfs, and mount_nwfs from sbin to usr.sbin.Gordon Tetlow2003-07-021-4/+1
| | | | | | | | | | | They don't have alot of reason to be in sbin and contribute to library bloat in the dynamic case. If you are using any of these filesystem type to hold your /usr, please seek professional help. The actual code was repo-copied by joe. Notes: svn path=/head/; revision=117169
* Add a new mount flag MNT_BYFSID that can be used to unmount a fileIan Dowse2003-07-011-70/+71
| | | | | | | | | | | | | | | | | | | | | system by specifying the file system ID instead of a path. Use this by default in umount(8). This avoids the need to perform any vnode operations to look up the mount point, so it makes it possible to unmount a file system whose root vnode cannot be looked up (e.g. due to a dead NFS server, or a file system that has become detached from the hierarchy because an underlying file system was unmounted). It also provides an unambiguous way to specify which file system is to be unmunted. Since the ability to unmount using a path name is retained only for compatibility, that case now just uses a simple string comparison of the supplied path against f_mntonname of each mounted file system. Discussed on: freebsd-arch mdoc help from: ru Notes: svn path=/head/; revision=117132
* Remove pathnames.h.Gordon Tetlow2003-06-291-2/+0
| | | | | | | Pointed out by: Mathieu Arnold <mat@mat.cc> Notes: svn path=/head/; revision=117037
* Tweak a couple of utilities so they compile cleanly for /rescue. MostlyGordon Tetlow2003-06-292-2/+8
| | | | | | | | | path fixes. Submitted by: Tim Kientzle <kientzle@acm.org> Notes: svn path=/head/; revision=117036
* Move path definitions to include/paths.h. This makes it easier to overrideGordon Tetlow2003-06-292-14/+5
| | | | | | | | | these definitions in the /rescue case. Submitted by: Tim Kientzle <kientzle@acm.org> Notes: svn path=/head/; revision=117033
* Convert fsck and mount to using execvP to find fsck_foo and mount_foo.Gordon Tetlow2003-06-294-89/+13
| | | | | | | | | | This simplifies the code path and makes the default path easy to override in the /rescue case. Submitted by: Tim Kientzle <kientzle@acm.org> Notes: svn path=/head/; revision=117031
* o update for new 802.11 supportSam Leffler2003-06-281-2/+6
| | | | | | | o fix channel command so channel - does what the man page says Notes: svn path=/head/; revision=116957
* remove extra whitespace and blank linesLuigi Rizzo2003-06-271-5/+2
| | | | Notes: svn path=/head/; revision=116919
* o correct mode request handlingSam Leffler2003-06-251-3/+6
| | | | | | | | o add 802.11 alias support o suppress display of the default "mode autoselect" when showing the "phy mode" Notes: svn path=/head/; revision=116820
* The current recommended default time to live (TTL) for the InternetRuslan Ermilov2003-06-251-3/+3
| | | | | | | | | | Protocol (IP) is 64 [RFC791, RFC1122]. Prodded by: Igor Kucherenko <kivvy@sunbay.com> Obtained from: http://www.iana.org/assignments/ip-parameters Notes: svn path=/head/; revision=116806
* remove unused file (RELENG_5 and above use ipfw2, the old ipfw1Luigi Rizzo2003-06-241-2667/+0
| | | | | | | has been unused and unmaintained for a long time). Notes: svn path=/head/; revision=116777
* Split some long lines to fit 80 columns (the code in RELENG_4Luigi Rizzo2003-06-231-5/+10
| | | | | | | was already correct). Notes: svn path=/head/; revision=116770
* syntactic sugar: support range notation such asLuigi Rizzo2003-06-231-5/+32
| | | | | | | | | | | | | | | | | | 1.2.3.4/24{5,6,7,10-20,60-90} for set of ip addresses. Previously you needed to specify every address in the range, which was unconvenient and lead to very long lines. Internally the set is still stored in the same way, just the input and output routines are modified. Manpage update still missing. Perhaps a similar preprocessing step would be useful for port ranges. MFC after: 3 days Notes: svn path=/head/; revision=116716
* o Fix sets of rules usage example.Maxim Konovalov2003-06-231-4/+4
| | | | | | | | | PR: docs/53625 Submitted by: Kostyuk Oleg <cub@cub.org.ua> MFC after: 1 week Notes: svn path=/head/; revision=116715
* Add support for multiple values and ranges for the "iplen", "ipttl",Luigi Rizzo2003-06-222-29/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | "ipid" options. This feature has been requested by several users. On passing, fix some minor bugs in the parser. This change is fully backward compatible so if you have an old /sbin/ipfw and a new kernel you are not in trouble (but you need to update /sbin/ipfw if you want to use the new features). Document the changes in the manpage. Now you can write things like ipfw add skipto 1000 iplen 0-500 which some people were asking to give preferential treatment to short packets. The 'MFC after' is just set as a reminder, because I still need to merge the Alpha/Sparc64 fixes for ipfw2 (which unfortunately change the size of certain kernel structures; not that it matters a lot since ipfw2 is entirely optional and not the default...) PR: bin/48015 MFC after: 1 week Notes: svn path=/head/; revision=116690
* Replace the code for reading and writing the kernel message bufferIan Dowse2003-06-221-3/+1
| | | | | | | | | | | | | | | | | | | | with a new implementation that has a mostly reentrant "addchar" routine, supports multiple message buffers in the kernel, and hides the implementation details from callers. The new code uses a kind of sequence number to represend the current read and write positions in the buffer. This approach (suggested mainly by bde) permits the read and write pointers to be maintained separately, which reduces the number of atomic operations that are required. The "mostly reentrant" above refers to the way that while it is now always safe to have any number of concurrent writers, readers could see the message buffer after a writer has advanced the pointers but before it has witten the new character. Discussed on: freebsd-arch Notes: svn path=/head/; revision=116660
* Remove another reference to ffsinfo.8Christian Brueffer2003-06-171-3/+1
| | | | Notes: svn path=/head/; revision=116507
* Remove references to ffsinfo(8) for now. It was disconnected fromChristian Brueffer2003-06-172-2/+0
| | | | | | | the build almost a year ago. Notes: svn path=/head/; revision=116499
* Xref police: chmod(8) -> chmod(1).Maxim Sobolev2003-06-171-1/+1
| | | | Notes: svn path=/head/; revision=116478
* Compile sunlabel on all archs.Poul-Henning Kamp2003-06-171-4/+1
| | | | Notes: svn path=/head/; revision=116473
* o Pass a correct argument to printf(3).Maxim Konovalov2003-06-161-3/+4
| | | | | | | | | PR: bin/51750 Submitted by: Vasil Dimov <vd@datamax.bg> MFC after: 2 weeks Notes: svn path=/head/; revision=116438
* Tighten up the string->integer conversion in sysctl(8):Robert Watson2003-06-151-5/+25
| | | | | | | | | | | | | | | | | | | | | | (1) Reject zero-length strings for CTLTYPE_INT, _UINT, _LONG, _ULONG. Do not silently convert to 0. (2) When converting CTLTYPE_INT, _UINT, _LONG, and _ULONG, check the end pointer generated by strtol() and strtoul() rather than discarding it. Reject the string if either none of the string was useful for conversion to an integer, or if there was trailing garbage. I.e., we will not allow you to set a numeric sysctl to a value unless we can completely convert the string argument to a numeric value. I tripped over this when I put the following in /etc/sysctl.conf: kern.maxfiles="4000" Ouch. Notes: svn path=/head/; revision=116383
* Remove MAINTAINER= lines in the makefiles for camcontrol, iostat, libcamKenneth D. Merry2003-06-141-2/+0
| | | | | | | | | | | and libdevstat, since the new way of doing things is to just list maintainership in src/MAINTAINERS. Also, remove duplicate entries in src/MAINTAINERS for those utilities. I already had entries for them. Notes: svn path=/head/; revision=116325
* If the -proxy_only option is used, the -alias_address/-interfaceRuslan Ermilov2003-06-132-4/+9
| | | | | | | | | | options are not required. Suggested by: Vaclav Petricek MFC after: 2 weeks Notes: svn path=/head/; revision=116319
* Remove label command. It has been deprecated since December 1998, andGreg Lehey2003-06-121-37/+1
| | | | | | | | | recent changes broke it altogether. Prompted by: phk Notes: svn path=/head/; revision=116248
* Remove "label" keyword.Greg Lehey2003-06-121-2/+1
| | | | Notes: svn path=/head/; revision=116247
* style clean.David E. O'Brien2003-06-112-11/+9
| | | | Notes: svn path=/head/; revision=116224
* Add "-n" argument, which causes mdconfig to simply print the unitRobert Watson2003-06-112-5/+16
| | | | | | | | | number X, rather than mdX, making it easier to script tests that use md devices but don't want to make assumptions about any existing md use (such as in diskless environments). Notes: svn path=/head/; revision=116194