#
331722 |
|
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re)
|
#
330897 |
|
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg
|
#
302408 |
|
07-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
#
249593 |
|
17-Apr-2013 |
jilles |
pututxline: Don't set errno=0 in subfunctions.
The functions utx_active_add(), utx_active_remove(), utx_lastlogin_add() and utx_log_add() set errno to 0 if they are successful. This not only violates POSIX if pututxline() is successful, but may also overwrite a valid error with 0 if, for example, utx_lastlogin_add() fails while utx_log_add() succeeds.
Reviewed by: ed
|
#
241046 |
|
29-Sep-2012 |
jilles |
libc: Use O_CLOEXEC for various internal file descriptors.
This fixes a race condition where another thread may fork() before CLOEXEC is set, unintentionally passing the descriptor to the child process.
This commit only adds O_CLOEXEC flags to open() or openat() calls where no fcntl(fd, F_SETFD, FD_CLOEXEC) follows. The separate fcntl() call still leaves a race window so it should be fixed later.
|
#
226846 |
|
27-Oct-2011 |
ed |
Make our utmpx more like System V.
When booting the system, truncate the utx.active file, but do write the BOOT_TIME record into it afterwards. This allows one to obtain the boot time of the system as follows:
struct utmpx u1 = { .ut_type = BOOT_TIME }, *u2;
setutxent(); u2 = getutxid(&u1);
Now, the boot time is stored in u2->ut_tv, just like on Linux and other systems.
We don't open the utx.active file with O_EXLOCK. It's rather unlikely that other applications use this database at the same time and I want to prevent the possibility of deadlocks in init(8).
Discussed with: pluknet
|
#
223576 |
|
26-Jun-2011 |
ed |
Fix whitespace inconsistencies in libc in files copyrighted by me.
|
#
219045 |
|
25-Feb-2011 |
ed |
Fix style(9) issues in pututxline(3).
Also, make sure to initialize the `ret' variable properly.
Reported by: Cedric Jonas <cedric c84 eu> Patch by: Garrett Cooper <yanegomi gmail com>
|
#
218846 |
|
19-Feb-2011 |
ed |
Properly styleify utmpx code and document error codes in man page.
Submitted by: Garrett Cooper
|
#
215310 |
|
14-Nov-2010 |
ed |
Always set errno to a sane value when pututxline(3) fails.
For example, it will now return ESRCH when trying to replace a nonexistent entry with DEAD_PROCESS.
|
#
214134 |
|
21-Oct-2010 |
ed |
Fix error handling logic of pututxline(3).
Instead of only returning NULL when the entry is invalid and can't be matched against the current database, also return it when it cannot open the log files properly.
|
#
202876 |
|
23-Jan-2010 |
ed |
Just ignore the timestamps given to pututxline().
I've noticed many applications do a bad job at timekeeping, for several reasons:
- Applications like screen(1) don't update time records when restoring the old user login record. - Many applications only set ut_tv.tv_sec, not ut_tv.tv_usec.
This causes many problems for tools such as ac(8), which require the timestamps to be properly ordered. This is why I've decided to let the utmpx code obtain valid timestamps itself.
|
#
202530 |
|
17-Jan-2010 |
ed |
Perform several small cleanups to the utmpx code.
- Massively reduce BSS usage. Let futx_to_utx() dynamically allocate the structure. There is only a very small amount of applications out there that needs to use the utmpx database. Wasting 1 KB on unused structures makes little sense.
- Just let getutxid() search for matching ut_id's for any *PROCESS-type. This makes the code a bit more future-proof.
- Fix a POSIX-mistake: when reading POSIX and the OpenSolaris implementation, getutxline() must return USER_PROCESS and LOGIN_PROCESS records whose ut_lines match. When reading POSIX, it seems LOGIN_PROCESS should not use ut_line at the first place. I have reported this issue.
|
#
202287 |
|
14-Jan-2010 |
ed |
Unbreak pututxline() on 32-bit architectures.
I forgot to cast the size_t's back to off_t before negating them, causing all sorts of artifacts where the log files would grow to 2^32 - 197 bytes.
Reported by: ume
|
#
202277 |
|
14-Jan-2010 |
ed |
Don't use fseeko() to obtain the file offset.
I was a bit confused with lseek(), which returns the new offset. We should ftello() to obtain it using stdio.
|
#
202188 |
|
13-Jan-2010 |
ed |
Implement <utmpx.h>.
The utmpx interface is the standardized interface of the user accounting database. The standard only defines a subset of the functions that were present in System V-like systems.
I'd like to highlight some of the traits my implementation has:
- The standard allows the on-disk format to be different than the in-memory representation (struct utmpx). Most operating systems don't do this, but we do. This allows us to keep our ABI more stable, while giving us the opportunity to modify the on-disk format. It also allows us to use a common file format across different architectures (i.e. byte ordering).
- Our implementation of pututxline() also updates wtmp and lastlog (now called utx.log and utx.lastlogin). This means the databases are more likely to be in sync.
- Care must be taken that our implementation discard any fields that are not applicable. For example, our DEAD_PROCESS records do not hold a TTY name. Just a time stamp, a record identifier and a process identifier. It also guarantees that strings (ut_host, ut_line and ut_user) are null terminated. ut_id is obviously not null terminated, because it's not a string.
- The API and its behaviour should be conformant to POSIX, but there may be things that slightly deviate from the standard. This implementation uses separate file descriptors when writing to the log files. It also doesn't use getutxid() to search for a field to overwrite. It uses an allocation strategy similar to getutxid(), but prevents DEAD_PROCESS records from accumulating.
Make sure libulog doesn't overwrite the manpages shipped with our C library. Also keep the symbol list in Symbol.map sorted.
I'll bump __FreeBSD_version later this evening. I first want to convert everything to <utmpx.h> and get rid of <utmp.h>.
|