aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* Final update to current version of head in preparation for reintegration.Kirk McKusick2010-05-0613-502/+2418
|\ | | | | | | Notes: svn path=/projects/quota64/; revision=207707
| * Bring in new files from edwin's tftpWarner Losh2010-05-0410-0/+2064
| | | | | | | | Notes: svn path=/head/; revision=207614
| * Go ahead and merge the work edwin@ on tftpd into the tree. It is aWarner Losh2010-05-043-502/+354
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lot better than what's in the tree now. Edwin tested it at a prior employer, but can't test it today. I've found that it works a lot better with the various uboot versions that I've used in my embedded work. Here's the pkg-descr from the port that describes the changes: It all started when we got some new routers, which told me the following when trying to upload configuration or download images from it: The TFTP server doesn't support the blocksize option. My curiousity was triggered, it took me some reading of RFCs and other documentation to find out what was possible and what could be done. Was plain TFTP very simple in its handshake, TFTP with options was kind of messy because of its backwards capability: The first packet returned could either be an acknowledgement of options, or the first data packet. Going through the source code of src/libexec/tftpd and going through the code of src/usr.bin/tftp showed that there was a lot of duplicate code, and the addition of options would only increase the amount of duplicate code. After all, both the client and the server can act as a sender and receiver. At the end, it ended up with a nearly complete rewrite of the tftp client and server. It has been tested against the following TFTP clients and servers: - Itself (yay!) - The standard FreeBSD tftp client and server - The Fedora Core 6 tftp client and server - Cisco router tftp client - Extreme Networks tftp client It supports the following RFCs: RFC1350 - THE TFTP PROTOCOL (REVISION 2) RFC2347 - TFTP Option Extension RFC2348 - TFTP Blocksize Option RFC2349 - TFTP Timeout Interval and Transfer Size Options RFC3617 - Uniform Resource Identifier (URI) Scheme and Applicability Statement for the Trivial File Transfer Protocol (TFTP) It supports the following unofficial TFTP Options as described at http://www.compuphase.com/tftp.htm: blksize2 - Block size restricted to powers of 2, excluding protocol headers rollover - Block counter roll-over (roll back to zero or to one) From the tftp program point of view the following things are changed: - New commands: "blocksize", "blocksize2", "rollover" and "options" - Development features: "debug" and "packetdrop" If you try this tftp/tftpd implementation, please let me know if it works (or doesn't work) and against which implementaion so I can get a list of confirmed working systems. Author: Edwin Groothuis <edwin@FreeBSD.org> Notes: svn path=/head/; revision=207608
* | Update to current version of head.Kirk McKusick2010-04-287-168/+366
|\| | | | | | | Notes: svn path=/projects/quota64/; revision=207307
| * Forgot to initialize the debug variable.Dag-Erling Smørgrav2010-04-011-1/+1
| | | | | | | | | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=206040
| * Add a debugging option (-d)Dag-Erling Smørgrav2010-04-012-12/+47
| | | | | | | | | | | | | | | | | | Add a -k option which fingerd(8) passes through to finger(1). MFC after: 2 weeks Notes: svn path=/head/; revision=206038
| * Check that gl_pathc is bigger than zero before derefencing gl_pathv.Xin LI2010-03-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | When gl_pathc == 0, the content of gl_pathv is undefined. PR: bin/144761 Submitted by: David BERARD <contact davidberard fr> Obtained from: OpenBSD MFC after: 1 week Notes: svn path=/head/; revision=205656
| * - Remove const'ness from dlerror(3) prototype, for consistency with POSIX.Pietro Cerutti2010-03-241-1/+1
| | | | | | | | | | | | | | | | Approved by: cognet MFC after: 1 week Notes: svn path=/head/; revision=205606
| * Fix several typos in macros or macro misusage.Ulrich Spörlein2010-03-121-1/+1
| | | | | | | | | | | | | | | | | | Found by: make manlint Reviewed by: ru Approved by: philip (mentor) Notes: svn path=/head/; revision=205076
| * Updated rtld for n32 support.Warner Losh2010-03-042-153/+315
| | | | | | | | | | | | | | | | Submitted by: jmallet@ Obtained from: NetBSD Notes: svn path=/head/; revision=204687
* | The NFS quota-reporting RPC uses 32-bit sized fields. We approximateKirk McKusick2010-04-251-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | 64-bit quota sizes by scaling down the sizes by the minimum amount necessary to fit in a 32-bit field and then upscale the filesystem block size to compensate. For example, if the hard block limit is 0x300000008 then we set the hard block limit to 0xA0000002 and claim that the blocksize is 4 * DEV_BSIZE. This will lose the minimal amount of information thus delivering nearly correct answers. Notes: svn path=/projects/quota64/; revision=207177
* | IFH@204581Dag-Erling Smørgrav2010-03-0448-525/+552
|\| | | | | | | Notes: svn path=/projects/quota64/; revision=204708
| * Fixed static linkage.Ruslan Ermilov2010-02-262-4/+4
| | | | | | | | Notes: svn path=/head/; revision=204352
| * Support the extended PLT format used when objects have more than 8192Nathan Whitehorn2010-02-223-25/+67
| | | | | | | | | | | | | | PLT relocations on PPC32. Notes: svn path=/head/; revision=204211
| * The NetBSD Foundation has granted permission to remove clauses 3 and 4.Warner Losh2010-02-161-7/+0
| | | | | | | | | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=203973
| * Improve TLS variant I:Marcel Moolenaar2010-02-161-11/+8
| | | | | | | | | | | | | | | | | | o Use obj->tlsinitsize to determine whether there's initialized data. o If obj->tlssize > obj->tlsinitsize, then bzero uninitialized data. o Don't exclude variant I from the work-around in free_tls_offset(). Notes: svn path=/head/; revision=203947
| * Set ut_line to "ftpd" for ftpd.Ed Schouten2010-02-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | This makes it a little easier to figure out which application was responsible for this log entry. Ideally we should add an ut_process or something similar. Suggested by: Vincent Poy <vincepoy gmail com> Notes: svn path=/head/; revision=203698
| * Remove stale references to utmp(5) and its corresponding filenames.Ed Schouten2010-01-212-3/+2
| | | | | | | | | | | | | | I removed utmp and its manpage, but not other manpages referring to it. Notes: svn path=/head/; revision=202756
| * Really disable wtmp logging when chrooting.Ed Schouten2010-01-182-6/+9
| | | | | | | | | | | | | | | | | | | | | | Also perform a small cleanup to ftpd_logwtmp(). Just use a NULL parameter for the username to indicate a logout, instead of an empty string. Reported by: Alexey Shuvaev <shuvaev physik uni-wuerzburg de> Notes: svn path=/head/; revision=202604
| * Phase out ttyslot(3).Ed Schouten2010-01-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | The ttyslot() function was originally part for SUSv1, marked LEGACY in SUSv2 and removed later on. This function only makes sense when using utmp(5), because it was used to determine the offset of the record for the controlling TTY. It makes little sense to keep it here, because the new utmpx file format doesn't index based on TTY slots. Notes: svn path=/head/; revision=202274
| * Port all apps in libexec/ from libulog to utmpx.Ed Schouten2010-01-134-10/+4
| | | | | | | | Notes: svn path=/head/; revision=202210
| * Port ftpd to utmpx.Ed Schouten2010-01-132-52/+38
| | | | | | | | | | | | | | | | | | | | | | Unfortunately I have to partially wreck its functionality, though. ftpd used to keep a file descriptor to the wtmp, which allowed it to work from within a chroot. The current utmpx implementation doesn't offer a way to do this. Maybe we can address this in the future, if it turns out to be a real issue. Notes: svn path=/head/; revision=202209
| * Port comsat to utmpx.Ed Schouten2010-01-131-64/+21
| | | | | | | | | | | | | | | | | | | | | | It seems comsat stats the utmpx database each 15 seconds to see whether it has been changed. I am changing this behaviour to look at the utmpx database upon processing. I don't want to allow direct interference with the database files. I also wonder whether this optimization has any measurable performance benefit nowadays. Notes: svn path=/head/; revision=202208
| * Remove `dead code' from rlogind.Ed Schouten2010-01-131-12/+1
| | | | | | | | | | | | | | | | | | | | - It shouldn't call logwtmp(). Applications like login(1) already make sure both login and logout entries are written to the storage. - There's no need to restore permissions on the pseudo-terminal, since it should be garbage collected by the kernel. Notes: svn path=/head/; revision=202207
| * Make WARNS=6 the default for libexec/.Ed Schouten2010-01-0226-10/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just like bin/ and sbin/, I think setting WARNS to the highest value possible will make it more attractive for people to fix warnings. - The WARNS variable is set in the Makefile in the directory of the application itself, making it more likely that it will be removed out of curiosity to see what happens. - New applications will most likely build with WARNS=6 out of the box, because the author would more likely fix the warnings during development than lower WARNS. Unfortunately almost all apps in libexec require a lowered value of WARNS. Notes: svn path=/head/; revision=201380
| * Fix several warnings.Ed Schouten2010-01-021-10/+10
| | | | | | | | | | | | | | | | | | - Add __unused keywords. - Don't shadow a global variable called cr. - Make the global cr variable const. Notes: svn path=/head/; revision=201379
| * ANSIfy ldconfig and the aout bits it still uses from rtld-aout.Ed Schouten2009-12-292-28/+10
| | | | | | | | | | | | | | (Why is aout support still there?) Notes: svn path=/head/; revision=201217
| * Make rpc.ruserd work with utmpx/libulog.Ed Schouten2009-12-293-92/+35
| | | | | | | | | | | | | | | | | | | | Because strings are now null-terminated, I've decided to just use an array of utmpx structures, instead of the separated strings. This means we just copy the entire utmpx structure and point to the strings within the structures directly. Notes: svn path=/head/; revision=201192
| * Perform cleanups to rpc.rusersd:Ed Schouten2009-12-283-198/+204
| | | | | | | | | | | | | | | | - Perform whitespace fixes. Use tabs instead of 8 spaces. - Make it build at WARNS=6. Notes: svn path=/head/; revision=201146
| * Modify the sources to make WARNS=6 work.Ed Schouten2009-12-262-3/+4
| | | | | | | | Notes: svn path=/head/; revision=201022
| * Unbreak the build.Ed Schouten2009-12-261-2/+1
| | | | | | | | | | | | | | | | | | | | I increased the WARNS, but it looks like it breaks certain architectures with more strict alignment requirements (mips, sparc64, ia64). Pointy hat to: me Notes: svn path=/head/; revision=201017
| * Let talkd use utmpx instead of utmp.Ed Schouten2009-12-252-20/+17
| | | | | | | | | | | | | | | | Because strings are null terminated now, there is no need to copy ut_line into a separate buffer first. Also enable WARNS. Notes: svn path=/head/; revision=200983
| * Don't use UT_NAMESIZE here to determine the maximum username length.Ed Schouten2009-12-251-9/+2
| | | | | | | | Notes: svn path=/head/; revision=200982
| * Repair breakage to last-minute API change.Ed Schouten2009-12-031-4/+2
| | | | | | | | | | | | | | | | | | | | I changed ulog_log{in,out} to return a void, but forgot to change ulog-helper as well. Reported by: stefanf Notes: svn path=/head/; revision=200085
| * Add a new library: libulog.Ed Schouten2009-12-033-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the things I really want to do, is to get rid of the limitations of our current utmp(5) mechanism: - It only allows 8 byte TTY device names. - The hostname only allows 16 bytes of storage. I'm not a big fan of <utmpx.h>, but I think we should at least try to add parts of it. Unfortunately we cannot implement <utmpx.h>, because we miss various fields, such as ut_id, ut_pid, etc. The API provided by libulog shares some similarities with <utmpx.h>, so it shouldn't be too hard to port these applications eventually. In most simple cases, it should just be a matter of removing the ulog_ prefix everywhere. As a bonus, it also implements a function called ulog_login_pseudo(), which allows unprivileged applications to write log entries, provided they have a valid file descriptor to a pseudo-terminal master device. libulog will allow a smoother transition to a new file format by adding a library interface to deal with utmp/wtmp/lastlog files. I initially thought about adding the functionality to libutil, but because I'm not planning on keeping this library around forever, we'd better keep it separated. Next items on the todo list: 1. Port applications in the base system (and ports) to libulog, instead of letting them use <utmp.h>. 2. Remove <utmp.h>, implement <utmpx.h> and reimplement this library on top. 3. Port as many applications as possible back to <utmpx.h>. Notes: svn path=/head/; revision=200062
| * Fix local root vulnerability.Colin Percival2009-12-011-6/+6
| | | | | | | | | | | | | | | | Security: Advisory will be coming soon. X-MFC-After: 30 seconds Notes: svn path=/head/; revision=199979
| * Allow to load not-openable dso when tracing. This fixes ldd on such dso orKonstantin Belousov2009-11-282-4/+8
| | | | | | | | | | | | | | | | | | | | | | dso linked to non-openable object. Remove '\n' at the end of error message. End comments with dot. MFC after: 3 weeks (together with r199829) Notes: svn path=/head/; revision=199877
| * Implement rtld part of the support for -z nodlopen (see ld(1)).Konstantin Belousov2009-11-262-14/+31
| | | | | | | | | | | | | | | | Reviewed by: kan MFC after: 3 weeks Notes: svn path=/head/; revision=199829
| * Flag controlling origin expansion in DT_FLAGS is DF_ORIGIN, not DF_1_ORIGIN.Konstantin Belousov2009-11-261-1/+1
| | | | | | | | | | | | | | | | Reviewed by: kan MFC after: 3 days Notes: svn path=/head/; revision=199828
| * Fix white space in rtld runtime error printf.Robert Watson2009-11-141-1/+1
| | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=199270
| * Calculate relocation base for the main object, and apply the relocationKonstantin Belousov2009-10-101-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adjustment for all virtual addresses encoded into the ELF structures of it. PIE binary could and should be loaded at non-zero mapbase. For sym_zero pseudosymbol used as a return value from find_symdef() for undefined weak symbols, st_value also should be adjusted, since _rtld_bind corrects symbol values by relocbase. Discussed with: bz Reviewed by: kan Tested by: bz (i386, amd64), bsam (linux) MFC after: some time Notes: svn path=/head/; revision=197931
| * In rtld's map_object(), use pread(..., 0) rather than read() to read theRobert Watson2009-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | ELF header from the front of the file. As all other I/O on the binary is done using mmap(), this avoids the need for seek privileges on the file descriptor during run-time linking. MFC after: 1 month Sponsored by: Google Notes: svn path=/head/; revision=197808
* | WIP: the last missing piece of the quota64 puzzle. Not quite thereDag-Erling Smørgrav2010-03-041-103/+28
| | | | | | | | | | | | | | yet. Notes: svn path=/projects/quota64/; revision=204681
* | Sync from head.Dag-Erling Smørgrav2009-09-261-31/+12
|\| | | | | | | Notes: svn path=/projects/quota64/; revision=197533
| * printerr_reply() has never been used for as long as we've had this code inDag-Erling Smørgrav2009-09-261-31/+12
| | | | | | | | | | | | | | | | our tree (13+ years). This is an excellent argument for aggressive use of "static". Notes: svn path=/head/; revision=197531
* | Sync with headDag-Erling Smørgrav2009-09-251-5/+3
|\| | | | | | | Notes: svn path=/projects/quota64/; revision=197511
| * Other minor style issues.Dag-Erling Smørgrav2009-09-251-5/+3
| | | | | | | | Notes: svn path=/head/; revision=197508
* | Sync with headDag-Erling Smørgrav2009-09-251-18/+16
|\| | | | | | | Notes: svn path=/projects/quota64/; revision=197507
| * Slight style cleanup.Dag-Erling Smørgrav2009-09-251-18/+16
| | | | | | | | Notes: svn path=/head/; revision=197506
* | Merge from headDag-Erling Smørgrav2009-09-1722-308/+346
|\| | | | | | | Notes: svn path=/projects/quota64/; revision=197292