Commit graph

4 commits

Author SHA1 Message Date
Mark Johnston
1238610a27 setaudit: Add an update mode
By default, setaudit(8) overwrites the whole audit session state.  For
the purpose of overwriting only a single field, e.g., the audit user,
this is inconvenient.  Add -U to accomodate this case: when specified,
setaudit(8) will first fetch the current session state block and then
will only overwrite those fields specified on the command line.

Reviewed by:	csjp
MFC after:	2 weeks
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D53672
2025-11-18 16:24:20 +00:00
Mark Johnston
551191e14e setaudit: Fix handling of numeric UIDs
The usage of strtoul() was incorrect.

Reviewed by:	csjp
MFC after:	2 weeks
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D53671
2025-11-18 16:24:20 +00:00
Mark Johnston
a9be8f9968 setaudit: Bump WARNS and fix some style bugs
- Cast sockaddrs through void to silence warnings about expected
  alignment.
- Fix cast style.
- Sort includes.
- Make some global variables local.
- Sort options.

No functional change intended.

Reviewed by:	csjp
MFC after:	2 weeks
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D53670
2025-11-18 16:24:20 +00:00
Mark Johnston
dcb0790bad setaudit: Initial import
Unmodified sources from https://github.com/csjayp/setaudit at commit
aa4dd9dfa40b6437030d718834236f4eaeb18ccb.

Some follow-up changes will fix a few issues and make it easier to use
this utility in the rc framework.

Reviewed by:	csjp
MFC after:	2 weeks
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D53669
2025-11-18 16:24:20 +00:00