summaryrefslogtreecommitdiffstats
path: root/sbin
Commit message (Collapse)AuthorAgeFilesLines
* Only print the unit number when invoked with the -n flag.brucec2011-02-131-1/+1
| | | | | | PR: bin/144300 Submitted by: arundel MFC after: 3 days
* In checker, read journal by sectors.kib2011-02-123-12/+19
| | | | | | | | | | | Due to UFS insistence to pretend that device sector size is 512 bytes, sector size is obtained from ioctl(DIOCGSECTORSIZE) for real devices, and from the label otherwise. The file images without label have to be made with 512 sector size. In collaboration with: pho Reviewed by: jeff Tested by: bz, pho
* When creating a directory entry for the journal, always read at leastkib2011-02-121-10/+20
| | | | | | | | | | | the fragment, and write the full block. Reading less might not work due to device sector size bigger then size of direntries in the last directory fragment. Reported by: bz In collaboration with: pho Reviewed by: jeff Tested by: bz, pho
* When we decide to unlink socket file, sun_path must be set. If it is set,pjd2011-02-091-1/+6
| | | | | | but there is problem unlinking the file, log a warning. MFC after: 1 week
* Explicitly include <sys/types.h> as suggested by getpid(2) and don't rely onpjd2011-02-081-0/+1
| | | | | | <sys/un.h> including what's needed. MFC after: 1 week
* Unlink UNIX domain socket file only if:pjd2011-02-081-5/+16
| | | | | | | | | 1. The descriptor is the one we are listening on (not the one when we connect as a client and not the one which is created on accept(2)). 2. Descriptor was created by us (PID matches with the PID stored on bind(2)). Reported by: Mikolaj Golub <to.my.trociny@gmail.com> MFC after: 1 week
* Now that we break the loop on fstat(2) failure we no longer need to satisfypjd2011-02-061-2/+0
| | | | | | gcc's imperfections. MFC after: 1 week
* Add (void) cast before snprintf(3)s for which we are not interested in returnpjd2011-02-061-13/+13
| | | | | | values. MFC after: 1 week
* Treat fstat(2) failure (different than EBADF) as fatal error.pjd2011-02-061-0/+1
| | | | | Reported by: Mikolaj Golub <to.my.trociny@gmail.com> MFC after: 1 week
* Open syslog when logging sysconf(3) failure.pjd2011-02-061-0/+4
| | | | | Reported by: Mikolaj Golub <to.my.trociny@gmail.com> MFC after: 1 week
* Close more descriptors that can be open if the worker process for the givenpjd2011-02-061-0/+6
| | | | | | | resource is already running. Submitted by: Mikolaj Golub <to.my.trociny@gmail.com> MFC after: 1 week
* Setup another socketpair between parent and child, so that primary sandboxedpjd2011-02-035-31/+143
| | | | | | | | | worker can ask the main privileged process to connect in worker's behalf and then we can migrate descriptor using this socketpair to worker. This is not really needed now, but will be needed once we start to use capsicum for sandboxing. MFC after: 1 week
* Add missing locking after moving keepalive_send() to remote send threadpjd2011-02-031-3/+9
| | | | | | in r214692. MFC after: 1 week
* Drop privileges after connecting to hastd, but before sending or receivingpjd2011-02-031-0/+5
| | | | | | anything. MFC after: 1 week
* Let the caller log info about successful privilege drop.pjd2011-02-033-2/+2
| | | | | | We don't want to log this in hastctl. MFC after: 1 week
* Add missing argument after r218192.bz2011-02-021-1/+1
|
* - Rename proto_descriptor_{send,recv}() functions topjd2011-02-027-166/+200
| | | | | | | | | | | proto_connection_{send,recv} and change them to return proto_conn structure. We don't operate directly on descriptors, but on proto_conns. - Add wrap method to wrap descriptor with proto_conn. - Remove methods to send and receive descriptors and implement this functionality as additional argument to send and receive methods. MFC after: 1 week
* Add proto_connect_wait() to wait for connection to finish.pjd2011-02-025-11/+84
| | | | | | | | | | | | | If timeout argument to proto_connect() is -1, then the caller needs to use this new function to wait for connection. This change is in preparation for capsicum, where sandboxed worker wants to ask main process to connect in worker's behalf and pass descriptor to the worker. Because we don't want the main process to wait for the connection, it will start async connection and pass descriptor to the worker who will be responsible for waiting for the connection to finish. MFC after: 1 week
* Allow to specify connection timeout by the caller.pjd2011-02-026-9/+12
| | | | MFC after: 1 week
* Move protocol allocation and deallocation to separate functions.pjd2011-02-021-17/+48
| | | | MFC after: 1 week
* Be prepared that hp_client or hp_server might be NULL now.pjd2011-02-021-4/+11
| | | | MFC after: 1 week
* Do not set socket send and receive buffer. It will be auto-tuned.pjd2011-02-011-14/+4
| | | | | Confirmed by: rwatson MFC after: 1 week
* Fix build on ia64.pjd2011-01-311-9/+7
| | | | | | | I found no way how to use CMSG_NXTHDR() macro on ia64 without alignment warnings. MFC after: 1 week
* Until I fix the build on ia64 comment out problematic lines.pjd2011-01-311-2/+2
| | | | Those lines are part of the (for now) unused functions.
* Implement two new functions for sending descriptor and receving descriptorpjd2011-01-316-8/+173
| | | | | | | over UNIX domain sockets and socket pairs. This is in preparation for capsicum. MFC after: 1 week
* - Use pjdlog for assertions and aborts as this will log assert/abort messagepjd2011-01-319-241/+197
| | | | | | | | | to syslog if we run in background. - Asserts in proto.c that method we want to call is implemented and remove dummy methods from protocols implementation that are only there to abort the program with nice message. MFC after: 1 week
* Rename pjdlog_verify() to pjdlog_abort() as it better describes what thepjd2011-01-312-7/+7
| | | | | | the function does and mark it with __dead2. MFC after: 1 week
* Fix the 'scan hang' issue.bschmidt2011-01-301-2/+6
| | | | | | | | | | | | When requesting a scan and one is already in progess, e.g. while in scan state, we happily wait for a scan done notification. Though, this notification might never be sent, e.g. if we are trying to find a network to associate to and there is none. Instead of always waiting for a notification just do so if a new scan has been started. For both cases the scan cache is used to report available networks even if the content might not be fresh. MFC after: 1 month
* When doing a scan while being associated it is possible that the scanbschmidt2011-01-301-0/+1
| | | | | | | | | | | | is deferred for the time it takes to flush the TX queue. This work being done the scan then is continued, but only if it is marked to do so. As the 'ifconfig scan' request is meant to be used after the interface is brought up, request a background scan by default. This behaviour is already documented in manual page. This fixes on possible case where 'ifconfig scan' hangs infinitely. MFC after: 1 month
* Drop privileges in worker processes.pjd2011-01-282-0/+8
| | | | | | | | | Accepting connections and handshaking in secondary is still done before dropping privileges. It should be implemented by only accepting connections in privileged main process and passing connection descriptors to the worker, but is not implemented yet. MFC after: 1 week
* Implement function that drops privileges by:pjd2011-01-283-0/+74
| | | | | | | | | | - chrooting to /var/empty (user hast home directory), - setting groups to 'hast' (user hast primary group), - setting real group id, effective group id and saved group id to 'hast', - setting real user id, effective user id and saved user id to 'hast'. At the end verify that those operations where successfull. MFC after: 1 week
* Use newly added descriptors_assert() function to ensure only expectedpjd2011-01-282-0/+4
| | | | | | descriptors are open. MFC after: 1 week
* Add function to assert that the only descriptors we have open are the onespjd2011-01-282-0/+142
| | | | | | | | | | we expect to be open. Also assert that they point at expected type. Because openlog(3) API is unable to tell us descriptor number it is using, we have to close syslog socket, remember assert message in local buffer and if we fail on assertion, reopen syslog socket and log the message. MFC after: 1 week
* Close all unneeded descriptors after fork(2).pjd2011-01-282-12/+22
| | | | MFC after: 1 week
* Add comments to places where we treat errors as ciritical, but it is possiblepjd2011-01-281-0/+3
| | | | | | to handle them more gracefully. MFC after: 1 week
* Add function to close all unneeded descriptors after fork(2).pjd2011-01-282-1/+29
| | | | MFC after: 1 week
* Initialize all global variables on pjdlog_init().pjd2011-01-281-2/+3
| | | | MFC after: 1 week
* Document the "bios-boot" partition type.ae2011-01-281-1/+6
| | | | MFC after: 2 weeks
* Remember created control connection so on fork(2) we can close it in child.pjd2011-01-272-0/+4
| | | | | Found with: procstat(1) MFC after: 1 week
* Close the control socket before exiting, so it will be unlinked.pjd2011-01-271-0/+1
| | | | MFC after: 1 week
* Extend pjdlog_verify() to support the following additional macros:pjd2011-01-272-9/+44
| | | | | | | | | | PJDLOG_RVERIFY() - always check expression and on false log the given message and exit. PJDLOG_RASSERT() - check expression when NDEBUG is not defined and on false log given message and exit. PJDLOG_ABORT() - log the given message and exit. MFC after: 1 week
* Add functions to initialize/finalize pjdlog. This allows to open/close logpjd2011-01-274-1/+72
| | | | | | file at will. MFC after: 1 week
* Use my copyright for 2011 work.pjd2011-01-271-1/+2
| | | | MFC after: 1 week
* Add LOG_NDELAY flag to openlog(3) - we want descriptor to be immediately openpjd2011-01-271-1/+1
| | | | | | so there are no surprises once we start chrooting or using capsicum. MFC after: 1 week
* - Remove obvious NOTREACHED comment after abort() call.pjd2011-01-271-3/+1
| | | | | | - Remove redundant newline at the end of the file. MFC after: 1 week
* Remove __dead2 from pjdlog_verify() prototype, it does return sometimes.pjd2011-01-271-1/+1
| | | | MFC after: 1 week
* Clarify the availability of the noatime option on network file systemsdougb2011-01-261-2/+6
|
* Fix compilation with debug on.cracauer2011-01-252-3/+3
| | | | Fix segfault when TargetAddress is missing or mis-spelled in config file.
* Supply maximum value as an argument to the decimal() functionsobomax2011-01-251-27/+27
| | | | | | instead of supplying number of bits. Submitted by: bde
* Don't open configuration file from worker process. Handle SIGHUP in thepjd2011-01-245-58/+83
| | | | | | | | master process only and pass changes to the worker processes over control socket. This removes access to global namespace in preparation for capsicum sandboxing. MFC after: 2 weeks
OpenPOWER on IntegriCloud