Commit Graph

18 Commits

Author SHA1 Message Date
Todd C. Miller
3e21c8da5c Add missing PVS Studio Open Source comments.
Also avoid checking protobuf-c source and protobuf-c generated files.
2022-06-29 09:45:04 -06:00
Todd C. Miller
e5834bd405 Use #include <config.h> not #include "config.h" for consistency.
Otherwise, some compilers may do the wrong thing in a build
dir if there is a config.h file in the source dir too.
2022-06-29 08:47:16 -06:00
Todd C. Miller
38c6e1bffb Standardize protobuf "unable to unpack" warning messages. 2022-05-26 09:35:18 -06:00
Todd C. Miller
c7ed03c986 sudo_logsrvd: update elapsed time for winsize and suspend in journal mode
Fixes a bug in store-first relay mode where the commit point messages
sent by the server were incorrect.
2022-04-24 17:26:05 -06:00
Todd C. Miller
c4e67624e3 Add missing default return in last commit. 2022-02-03 10:24:10 -07:00
Todd C. Miller
d18ee79354 sudo_logsrvd: make sure journal exists before writing the alert message.
Fixes a potential NULL dereference when journaling an alert message.
2022-02-03 10:19:40 -07:00
Todd C. Miller
87c1dd9d7d Move include of log_server.pb-c.h into logsrvd.h and sendlog.h
This way there is no include file order issue with the
PROTOBUF_C_VERSION_NUMBER check.
2021-10-25 12:25:24 -06:00
Todd C. Miller
a78d3cc25d Reuse existing journal file for an accepted/rejected sub-command.
Otherwise we end up with zero-length files in the incoming queue
dir and may end up relaying one of those instead of the actual
journal file.
2021-09-20 15:33:10 -06:00
Todd C. Miller
9248ea6bbe Set umask to be less restrictive before creating parent directories.
Otherwise we could end up creating them with a more restrictive
mode than indended.  Coverity CID 221592
2021-08-14 10:49:51 -06:00
Todd C. Miller
5a3bbba12b Use sudo_warnx?() instead of sudo_debug_printf for errors.
We now hook the warn functions so the messages are logged.
The messages still show up in the debug log too.
2021-06-15 13:58:12 -06:00
Todd C. Miller
caf096e1a1 Update closure->elapsed_time in journal_seek().
Otherwise the commit point messages won't be accurate when restarting.
2021-05-04 10:45:12 -06:00
Todd C. Miller
177816b787 Send outgoing messages to the relay server on startup.
Also attempt to retry messages that could not be relayed periodically.
2021-05-01 16:27:21 -06:00
Todd C. Miller
f92bb8840c Create journal files in an incoming directory, move to outgoing when complete.
This will make it possible to process completed journal files
periodically if the relay server is down.
2021-04-29 14:19:08 -06:00
Todd C. Miller
65a55497ec Avoid calling fread() with a NUL buffer if msg_len is 0.
Coverity CID 221399
2021-04-23 19:01:44 -06:00
Todd C. Miller
761b02d34f Use function pointers for each client message type instead of conditionals.
This separats out the message handler from the functions that store
or relay the message contents.
2021-04-23 16:56:21 -06:00
Todd C. Miller
050e91f8d1 Forward the journaled entry after it has been stored locally. 2021-04-23 16:56:18 -06:00
Todd C. Miller
280fabac38 Stash the value of the store_first config setting in connection_closure.
If the configuration changes it should not affect a connection that
is already in progress.
2021-04-23 16:56:17 -06:00
Todd C. Miller
c2d3070fa1 Journal messages to disk when store_first is set in the relay section.
Instead of forwarding messages immediately, they are journaled
locally in wire format.
This will be used to implement relay store-and-forward mode.
2021-04-23 16:55:30 -06:00