]> git.ipfire.org Git - pakfire.git/log
pakfire.git
6 weeks agocli: Add a command to test user authentication against the API
Michael Tremer [Sat, 21 Jun 2025 11:48:00 +0000 (11:48 +0000)] 
cli: Add a command to test user authentication against the API

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agobuildservice: Add a function to authenticate a user against the API
Michael Tremer [Sat, 21 Jun 2025 11:47:29 +0000 (11:47 +0000)] 
buildservice: Add a function to authenticate a user against the API

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agobuildservice: Tell the API that we would like to receive JSON
Michael Tremer [Sat, 21 Jun 2025 11:46:36 +0000 (11:46 +0000)] 
buildservice: Tell the API that we would like to receive JSON

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoxfer: Add a function to send a custom POST payload
Michael Tremer [Sat, 21 Jun 2025 11:46:00 +0000 (11:46 +0000)] 
xfer: Add a function to send a custom POST payload

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoxfer: Add a function to set custom headers
Michael Tremer [Sat, 21 Jun 2025 11:45:35 +0000 (11:45 +0000)] 
xfer: Add a function to set custom headers

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoxfer: Add a function to URL escape any strings
Michael Tremer [Sat, 21 Jun 2025 11:44:58 +0000 (11:44 +0000)] 
xfer: Add a function to URL escape any strings

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoxfer: Pass any numeric values as long
Michael Tremer [Sat, 21 Jun 2025 11:43:59 +0000 (11:43 +0000)] 
xfer: Pass any numeric values as long

cURL now complains if the value is not long.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agoreadme: update bug report url
Rico Hoppe [Tue, 21 Jan 2025 12:05:32 +0000 (12:05 +0000)] 
readme: update bug report url

Signed-off-by: Rico Hoppe <rico.hoppe@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoxfer: Fix logic error in reading WebSocket messages
Michael Tremer [Sat, 3 May 2025 14:03:46 +0000 (14:03 +0000)] 
xfer: Fix logic error in reading WebSocket messages

After the message was read we never cleared the buffer which resulted
that on every message, the callback was called with the entire buffer.
Usually that meant that only the first JSON message was parsed and
handled. Again and again and again...

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoxfer: Remove recursive function call
Michael Tremer [Sat, 3 May 2025 14:02:53 +0000 (14:02 +0000)] 
xfer: Remove recursive function call

I am not sure why I am suddenly scared of this, but there have been some
security-relevant issues where this could exhaust the stack.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodaemon: Use our own string comparison macro
Michael Tremer [Sat, 3 May 2025 14:01:52 +0000 (14:01 +0000)] 
daemon: Use our own string comparison macro

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodaemon: Send the IDs of all running jobs
Michael Tremer [Sat, 3 May 2025 12:52:13 +0000 (12:52 +0000)] 
daemon: Send the IDs of all running jobs

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agojobs: Stream logs as base64-encoded data
Michael Tremer [Sun, 20 Apr 2025 14:11:43 +0000 (14:11 +0000)] 
jobs: Stream logs as base64-encoded data

There should not be anything else but ASCII or Unicode characters here,
but we can never be too sure. Therefore we will encode all data as
base64 to keep the protocol somewhat extensible.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agobase64: Replace the encoder/decoder with low-level functions
Michael Tremer [Sun, 20 Apr 2025 13:56:48 +0000 (13:56 +0000)] 
base64: Replace the encoder/decoder with low-level functions

The BIO interface is large and very well suited to encode larger
messages. However, we only have very small messages to encode and
therefore will spend a long time on setting up and destroying the BIO
interface all of the time.

These low-level functions are a lot faster and easier to set up.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agobuffer: Rename fields again
Michael Tremer [Wed, 16 Apr 2025 15:58:08 +0000 (15:58 +0000)] 
buffer: Rename fields again

I even confused myself here because length is actually not the length of
the buffer that I wanted. It is what has been allocated. That is however
nothing that we need to access at any time. Therefore the fields have
been renamed to be a little bit more intuitive again.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoxfer: Replace the send buffer with our own buffer implementation
Michael Tremer [Wed, 16 Apr 2025 15:54:30 +0000 (15:54 +0000)] 
xfer: Replace the send buffer with our own buffer implementation

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoxfer: Use our own buffer implementation for the receive buffer
Michael Tremer [Wed, 16 Apr 2025 15:45:29 +0000 (15:45 +0000)] 
xfer: Use our own buffer implementation for the receive buffer

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agopackager: Fix return codes
Michael Tremer [Tue, 15 Apr 2025 17:09:14 +0000 (17:09 +0000)] 
packager: Fix return codes

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agobuild: Log a better message when a build has been interrupted
Michael Tremer [Tue, 15 Apr 2025 17:05:32 +0000 (17:05 +0000)] 
build: Log a better message when a build has been interrupted

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoxfer: Clear the overflow buffer after the segment could be sent
Michael Tremer [Wed, 16 Apr 2025 15:37:07 +0000 (15:37 +0000)] 
xfer: Clear the overflow buffer after the segment could be sent

This is a stub and I will replace the send and receive buffers with our
own buffer implementation.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodaemon: Store Kerberos credentials in memory
Michael Tremer [Tue, 15 Apr 2025 17:00:28 +0000 (17:00 +0000)] 
daemon: Store Kerberos credentials in memory

I think I am starting to become confused. At least in trixie and
bookworm-backports, we seem to be linking against MIT. This seems to
work now on my machine. Let's hope this is a general thing.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodaemon: Completely destroy the Kerberos credentials cache on update
Michael Tremer [Tue, 15 Apr 2025 16:53:11 +0000 (16:53 +0000)] 
daemon: Completely destroy the Kerberos credentials cache on update

This is required because on Debian, cURL is linked against Heimdal which
does not seem to be able to skip any deleted tickets in the file.
Instead it always uses the first ticket which would eventually have
expired. Therefore we destroy the entire cache and write it again so
Heimdal cannot get confused.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojenkins: Ensure we have gawk available on Fedora
Michael Tremer [Wed, 2 Apr 2025 10:32:04 +0000 (10:32 +0000)] 
jenkins: Ensure we have gawk available on Fedora

Fedora 42 does not seem to install this by default any more, but our
configure script wants to use it.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojenkins: Always install all updates before trying to install any packages
Michael Tremer [Sun, 30 Mar 2025 17:33:42 +0000 (17:33 +0000)] 
jenkins: Always install all updates before trying to install any packages

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojenkins: Ensure the keyring is up to date on Archlinux
Michael Tremer [Sun, 30 Mar 2025 17:15:17 +0000 (17:15 +0000)] 
jenkins: Ensure the keyring is up to date on Archlinux

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodist: Remove the old solution to pass the filename
Michael Tremer [Sun, 30 Mar 2025 16:32:18 +0000 (16:32 +0000)] 
dist: Remove the old solution to pass the filename

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoarchive: Add function to fetch the desired filename
Michael Tremer [Sun, 30 Mar 2025 16:28:07 +0000 (16:28 +0000)] 
archive: Add function to fetch the desired filename

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: Add tests for dist()
Michael Tremer [Sun, 30 Mar 2025 16:11:07 +0000 (16:11 +0000)] 
tests: Add tests for dist()

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopython: Make dist() work again
Michael Tremer [Sun, 30 Mar 2025 16:10:43 +0000 (16:10 +0000)] 
python: Make dist() work again

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agofile: Don't try to resolve paths relative to Pakfire in stub mode
Michael Tremer [Thu, 27 Mar 2025 18:07:57 +0000 (18:07 +0000)] 
file: Don't try to resolve paths relative to Pakfire in stub mode

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopwd: Don't permit any UID/GID lookups in stub mode
Michael Tremer [Thu, 27 Mar 2025 18:07:27 +0000 (18:07 +0000)] 
pwd: Don't permit any UID/GID lookups in stub mode

This is simply not supported because we don't have a file system.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopackager: Don't use an invalid pointer to a freed JSON object
Michael Tremer [Thu, 27 Mar 2025 11:15:53 +0000 (11:15 +0000)] 
packager: Don't use an invalid pointer to a freed JSON object

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoarchive write: Fetch length of serialized JSON string from libjson-c
Michael Tremer [Thu, 27 Mar 2025 11:15:31 +0000 (11:15 +0000)] 
archive write: Fetch length of serialized JSON string from libjson-c

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojob: Always stream logs
Michael Tremer [Thu, 27 Mar 2025 10:33:04 +0000 (10:33 +0000)] 
job: Always stream logs

This was too fragile before and I think we should be able to afford the
stupid traffic...

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojobs: Use function to check if a flag is set
Michael Tremer [Thu, 27 Mar 2025 10:32:56 +0000 (10:32 +0000)] 
jobs: Use function to check if a flag is set

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodaemon: Retry authentication if we could not reach the KDC
Michael Tremer [Wed, 26 Mar 2025 17:03:07 +0000 (17:03 +0000)] 
daemon: Retry authentication if we could not reach the KDC

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodaemon: Remove any previous credentials
Michael Tremer [Wed, 26 Mar 2025 16:49:01 +0000 (16:49 +0000)] 
daemon: Remove any previous credentials

Otherwise krb5 will append all credentials, but Heimdal only seems to
read the first (eventually) expired ticket.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodaemon: Make Kerberos refresh time easier to understand
Michael Tremer [Wed, 26 Mar 2025 16:48:40 +0000 (16:48 +0000)] 
daemon: Make Kerberos refresh time easier to understand

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoutil: Return converted timestamps as long
Michael Tremer [Wed, 26 Mar 2025 16:48:17 +0000 (16:48 +0000)] 
util: Return converted timestamps as long

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Move the main callback
Michael Tremer [Wed, 26 Mar 2025 15:53:41 +0000 (15:53 +0000)] 
jail: Move the main callback

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agorepo: Use our own string comparison function
Michael Tremer [Wed, 26 Mar 2025 15:46:12 +0000 (15:46 +0000)] 
repo: Use our own string comparison function

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Fix return codes of bind function
Michael Tremer [Wed, 26 Mar 2025 15:38:55 +0000 (15:38 +0000)] 
jail: Fix return codes of bind function

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopython: execute: Implement bind-mounting mountpoints
Michael Tremer [Wed, 26 Mar 2025 14:43:13 +0000 (14:43 +0000)] 
python: execute: Implement bind-mounting mountpoints

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopython: execute: Capture stdout/stderr separately
Michael Tremer [Wed, 26 Mar 2025 10:30:14 +0000 (10:30 +0000)] 
python: execute: Capture stdout/stderr separately

That way, we can raise the error output and return the rest

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: execute: Actually verify the set nice level
Michael Tremer [Tue, 25 Mar 2025 11:38:45 +0000 (11:38 +0000)] 
tests: execute: Actually verify the set nice level

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: execute: Bring back the open file descriptor test
Michael Tremer [Tue, 25 Mar 2025 11:36:41 +0000 (11:36 +0000)] 
tests: execute: Bring back the open file descriptor test

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: execute: Actually check the output
Michael Tremer [Tue, 25 Mar 2025 11:36:12 +0000 (11:36 +0000)] 
tests: execute: Actually check the output

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: Add some simple tests for the buffer
Michael Tremer [Tue, 25 Mar 2025 11:33:37 +0000 (11:33 +0000)] 
tests: Add some simple tests for the buffer

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: Only negative return values are considered unsuccessful
Michael Tremer [Tue, 25 Mar 2025 11:26:15 +0000 (11:26 +0000)] 
tests: Only negative return values are considered unsuccessful

Sometimes we want to return the length of consumed input, so this should
all be considered successful.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopo: Update translations
Michael Tremer [Tue, 25 Mar 2025 11:10:57 +0000 (11:10 +0000)] 
po: Update translations

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolog stream: Don't fail if no callback has been registered
Michael Tremer [Tue, 25 Mar 2025 11:09:35 +0000 (11:09 +0000)] 
log stream: Don't fail if no callback has been registered

This should usually never happen.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agobuild: Don't drop into a shell when build has been interrupted
Michael Tremer [Tue, 25 Mar 2025 11:08:51 +0000 (11:08 +0000)] 
build: Don't drop into a shell when build has been interrupted

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Cleanly terminate on SIGINT
Michael Tremer [Tue, 25 Mar 2025 11:06:46 +0000 (11:06 +0000)] 
jail: Cleanly terminate on SIGINT

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Move syscall wrapper to where it should be
Michael Tremer [Tue, 25 Mar 2025 10:44:50 +0000 (10:44 +0000)] 
jail: Move syscall wrapper to where it should be

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: execute: Check that we are not running for forever
Michael Tremer [Tue, 25 Mar 2025 10:42:39 +0000 (10:42 +0000)] 
tests: execute: Check that we are not running for forever

There was a bug once where the loop never terminated if the process
actually could never be executed.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Drain the pipes after the process has terminated
Michael Tremer [Tue, 25 Mar 2025 10:42:19 +0000 (10:42 +0000)] 
jail: Drain the pipes after the process has terminated

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Free the input buffer after we are done
Michael Tremer [Tue, 25 Mar 2025 10:32:37 +0000 (10:32 +0000)] 
jail: Free the input buffer after we are done

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: Free string array after use
Michael Tremer [Tue, 25 Mar 2025 09:34:14 +0000 (09:34 +0000)] 
tests: Free string array after use

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Move the filelist streaming helper from PTY
Michael Tremer [Mon, 24 Mar 2025 19:38:31 +0000 (19:38 +0000)] 
jail: Move the filelist streaming helper from PTY

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Move the send buffer function from the PTY
Michael Tremer [Mon, 24 Mar 2025 19:34:46 +0000 (19:34 +0000)] 
jail: Move the send buffer function from the PTY

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Refactor the output callback
Michael Tremer [Mon, 24 Mar 2025 19:27:24 +0000 (19:27 +0000)] 
jail: Refactor the output callback

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agobuild: Remove any traces of the deprecated PTY stdin callback
Michael Tremer [Mon, 24 Mar 2025 18:58:33 +0000 (18:58 +0000)] 
build: Remove any traces of the deprecated PTY stdin callback

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Refactor streaming data into the jail
Michael Tremer [Mon, 24 Mar 2025 18:46:34 +0000 (18:46 +0000)] 
jail: Refactor streaming data into the jail

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: jail: Consume any output of the pipe
Michael Tremer [Mon, 24 Mar 2025 18:44:50 +0000 (18:44 +0000)] 
tests: jail: Consume any output of the pipe

This is just because of the log streamer complaining

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agobuffer: Add a helper function that fills a buffer with a callback
Michael Tremer [Mon, 24 Mar 2025 18:39:36 +0000 (18:39 +0000)] 
buffer: Add a helper function that fills a buffer with a callback

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolog stream: Return the number of bytes written
Michael Tremer [Mon, 24 Mar 2025 18:39:07 +0000 (18:39 +0000)] 
log stream: Return the number of bytes written

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Only make the parent ends of the pipes non-blocking
Michael Tremer [Mon, 24 Mar 2025 18:13:39 +0000 (18:13 +0000)] 
jail: Only make the parent ends of the pipes non-blocking

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agobuffer: Don't allow to resize the buffer smaller than what it holds
Michael Tremer [Mon, 24 Mar 2025 18:11:36 +0000 (18:11 +0000)] 
buffer: Don't allow to resize the buffer smaller than what it holds

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agobuffer: Don't allow the buffer to grow larger than its defined length
Michael Tremer [Mon, 24 Mar 2025 18:10:49 +0000 (18:10 +0000)] 
buffer: Don't allow the buffer to grow larger than its defined length

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopakfire: Don't leak our locking fd into the jail
Michael Tremer [Mon, 24 Mar 2025 18:10:15 +0000 (18:10 +0000)] 
pakfire: Don't leak our locking fd into the jail

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Flush any output after we have updated the buffers
Michael Tremer [Mon, 24 Mar 2025 16:53:42 +0000 (16:53 +0000)] 
jail: Flush any output after we have updated the buffers

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopty: Use our own buffer implementation
Michael Tremer [Mon, 24 Mar 2025 16:49:40 +0000 (16:49 +0000)] 
pty: Use our own buffer implementation

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: log stream: Replace PTY test with file handle test
Michael Tremer [Mon, 24 Mar 2025 16:47:31 +0000 (16:47 +0000)] 
tests: log stream: Replace PTY test with file handle test

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopty: Remove code that maps CRNL to NL
Michael Tremer [Mon, 24 Mar 2025 16:12:11 +0000 (16:12 +0000)] 
pty: Remove code that maps CRNL to NL

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopty: Remove all sorts of code that is not needed any more
Michael Tremer [Mon, 24 Mar 2025 16:10:01 +0000 (16:10 +0000)] 
pty: Remove all sorts of code that is not needed any more

This is all of the non-interactive code.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Bring back pipes for non-interactive sessions
Michael Tremer [Mon, 24 Mar 2025 15:58:33 +0000 (15:58 +0000)] 
jail: Bring back pipes for non-interactive sessions

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Use the PTY only for interactive sessions
Michael Tremer [Sun, 23 Mar 2025 13:53:48 +0000 (13:53 +0000)] 
jail: Use the PTY only for interactive sessions

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agobuffer: Always allocate at least one chunk
Michael Tremer [Sat, 22 Mar 2025 18:21:23 +0000 (18:21 +0000)] 
buffer: Always allocate at least one chunk

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agobuffer: Automatically shrink the buffer
Michael Tremer [Sat, 22 Mar 2025 18:21:02 +0000 (18:21 +0000)] 
buffer: Automatically shrink the buffer

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agobuffer: Correctly compute the new desired length when growing
Michael Tremer [Sat, 22 Mar 2025 18:20:17 +0000 (18:20 +0000)] 
buffer: Correctly compute the new desired length when growing

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agobuffer: Add function to configure the maximum length
Michael Tremer [Sat, 22 Mar 2025 18:10:14 +0000 (18:10 +0000)] 
buffer: Add function to configure the maximum length

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agobuffer: Give the functions slightly better names
Michael Tremer [Sat, 22 Mar 2025 18:07:09 +0000 (18:07 +0000)] 
buffer: Give the functions slightly better names

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolog stream: Use the new buffer implementation
Michael Tremer [Sat, 22 Mar 2025 18:04:22 +0000 (18:04 +0000)] 
log stream: Use the new buffer implementation

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agobuffer: Create a new generic buffer implementation
Michael Tremer [Sat, 22 Mar 2025 18:03:31 +0000 (18:03 +0000)] 
buffer: Create a new generic buffer implementation

This is used to hold a dynamically growing buffer.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolog stream: Expect the callback to consume the entire line
Michael Tremer [Sat, 22 Mar 2025 16:57:36 +0000 (16:57 +0000)] 
log stream: Expect the callback to consume the entire line

This is otherwise getting out of hand and we should not have a place
where this would become an issue.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Use log stream to perform line-buffered output
Michael Tremer [Sat, 22 Mar 2025 16:56:59 +0000 (16:56 +0000)] 
jail: Use log stream to perform line-buffered output

This helps us to split the complexity between the PTY and some extra
buffering code.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: log stream: Stream another line
Michael Tremer [Sat, 22 Mar 2025 16:39:24 +0000 (16:39 +0000)] 
tests: log stream: Stream another line

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopython: execute: Use the send buffer callback we already have
Michael Tremer [Sat, 22 Mar 2025 16:35:57 +0000 (16:35 +0000)] 
python: execute: Use the send buffer callback we already have

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolog stream: Move data as second argument of the callback
Michael Tremer [Sat, 22 Mar 2025 16:29:34 +0000 (16:29 +0000)] 
log stream: Move data as second argument of the callback

That way, we are compatible with the PTY stdout callback.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolog stream: Change first argument of the callback to ctx
Michael Tremer [Sat, 22 Mar 2025 16:16:58 +0000 (16:16 +0000)] 
log stream: Change first argument of the callback to ctx

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoPTY: Remove the rest of the line buffering code
Michael Tremer [Sat, 22 Mar 2025 16:11:44 +0000 (16:11 +0000)] 
PTY: Remove the rest of the line buffering code

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolog stream: Add an experimental implementation to stream from PTY
Michael Tremer [Sat, 22 Mar 2025 15:51:37 +0000 (15:51 +0000)] 
log stream: Add an experimental implementation to stream from PTY

This is the first step to split all the complicated line buffering from
the PTY code.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolog streamer: Move line sanitization from PTY
Michael Tremer [Sat, 22 Mar 2025 15:50:53 +0000 (15:50 +0000)] 
log streamer: Move line sanitization from PTY

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopty: Major refactor
Michael Tremer [Sat, 22 Mar 2025 15:02:12 +0000 (15:02 +0000)] 
pty: Major refactor

This adds loads of comments to hopefully make this thing more robust. So
far we don't really seem to be able to implement all the features we
need without destroying others.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Pass the program exit code as return code of the loop
Michael Tremer [Sat, 22 Mar 2025 14:20:23 +0000 (14:20 +0000)] 
jail: Pass the program exit code as return code of the loop

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotests: command: Always return zero after the pipe is finished
Michael Tremer [Sat, 22 Mar 2025 14:19:46 +0000 (14:19 +0000)] 
tests: command: Always return zero after the pipe is finished

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopty: Always disable character echoing
Michael Tremer [Thu, 20 Mar 2025 16:47:16 +0000 (16:47 +0000)] 
pty: Always disable character echoing

This usually happens later in case of the interactive version, but since
we don't need to configure much in the pipe case, we can just set this
as default.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopty: Add a function to set up interactive mode
Michael Tremer [Thu, 20 Mar 2025 11:30:38 +0000 (11:30 +0000)] 
pty: Add a function to set up interactive mode

This way we can split off the initialization code a little bit better
from the main initialization of the PTY object.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopty: Refactor how we capture output
Michael Tremer [Tue, 18 Mar 2025 18:02:26 +0000 (18:02 +0000)] 
pty: Refactor how we capture output

This will now avoid copying all the data around between the kernel and
userland and will also simply use our own callbacks which helps us to
keep the code a little bit less of an if/else hell.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agojail: Remove use of removed PTY flags
Michael Tremer [Tue, 18 Mar 2025 17:20:01 +0000 (17:20 +0000)] 
jail: Remove use of removed PTY flags

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>