Compare commits

...
11 Commits
Author SHA1 Message Date
Joachim Wiberg 6b7478ff43 Update ChangeLog and bump version for v4.12 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-04-28 00:23:10 +02:00
Joachim Wiberg 6c4c16cbdb Update ChangeLog for v4.12
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-04-28 00:04:39 +02:00
Joachim Wiberg e539dbfe37 Merge pull request #436 from sirocyl/patch-1
README.md: typo
2025-04-27 09:56:17 +02:00
Tyler True 90c6bcd365 README.md: typo
`intictl` -> `initctl`, also linkified it to the command description
2025-04-26 23:45:19 -04:00
Joachim Wiberg c9c268f218 plugins: fix variable overloading warning in urandom plugin
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-04-07 12:55:01 +02:00
Joachim Wiberg 3feff37ba5 plugins: use byte addressing of rand_pool_info data buffer
Fix out-of-bounds write in urandom plugin.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-04-07 12:52:16 +02:00
Joachim Wiberg c67d15e272 runparts: update usage text, missing '-b' flag for batch mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-03-31 14:17:55 +02:00
Joachim Wiberg 8984c655f8 cond_get_agg: minor refactor
- Use stack instead of heap memory
 - constify

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-03-31 14:16:24 +02:00
Joachim Wiberg 1a7b26bac3 Bump version for 4.12 release cycle
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-03-31 07:49:05 +02:00
Joachim Wiberg 1f47718012 Merge pull request #435 from aanderse/master 2025-03-29 13:28:15 +01:00
Aaron Andersen fa13cddc28 improve notify:s6 compatibility 2025-03-29 08:03:43 -04:00
7 changed files with 34 additions and 17 deletions
+14
View File
@@ -3,6 +3,19 @@ Change Log
All relevant changes are documented in this file. All relevant changes are documented in this file.
[4.12][] - 2025-04-28
---------------------
### Changes
- Improve notify:s6 readiness compatibility, by Aaron Andersen
- Update `runparts` usage text
### Fixes
- Fix variable overloading in urandom plugin
- Fix buffer overwrite in urandom plugin, reported by Aaron Andersen
[4.11][] - 2025-03-27 [4.11][] - 2025-03-27
--------------------- ---------------------
@@ -1785,6 +1798,7 @@ Major bug fix release.
* Initial release * Initial release
[UNRELEASED]: https://github.com/troglobit/finit/compare/4.11...HEAD [UNRELEASED]: https://github.com/troglobit/finit/compare/4.11...HEAD
[4.12]: https://github.com/troglobit/finit/compare/4.11...4.12
[4.11]: https://github.com/troglobit/finit/compare/4.10...4.11 [4.11]: https://github.com/troglobit/finit/compare/4.10...4.11
[4.10]: https://github.com/troglobit/finit/compare/4.9...4.10 [4.10]: https://github.com/troglobit/finit/compare/4.9...4.10
[4.9]: https://github.com/troglobit/finit/compare/4.8...4.9 [4.9]: https://github.com/troglobit/finit/compare/4.8...4.9
+1 -1
View File
@@ -251,7 +251,7 @@ All services in runlevel S) are started first, followed by the desired
run-time runlevel. Run tasks in runlevel S can be started in sequence run-time runlevel. Run tasks in runlevel S can be started in sequence
by using `run [S] cmd`. Changing runlevels at runtime is done like any by using `run [S] cmd`. Changing runlevels at runtime is done like any
other init, e.g. <kbd>init 4</kbd>, but also using the more advanced other init, e.g. <kbd>init 4</kbd>, but also using the more advanced
`intictl` tool. [`initctl`](#commands--status) tool.
**Conditions** **Conditions**
+1 -1
View File
@@ -1,4 +1,4 @@
AC_INIT([Finit], [4.11], [https://github.com/troglobit/finit/issues], AC_INIT([Finit], [4.12], [https://github.com/troglobit/finit/issues],
[finit], [https://troglobit.com/projects/finit/]) [finit], [https://troglobit.com/projects/finit/])
AC_CONFIG_AUX_DIR(aux) AC_CONFIG_AUX_DIR(aux)
AM_INIT_AUTOMAKE([1.11 foreign dist-xz subdir-objects]) AM_INIT_AUTOMAKE([1.11 foreign dist-xz subdir-objects])
+8 -5
View File
@@ -78,6 +78,7 @@ static void setup(void *arg)
{ {
#ifdef RANDOMSEED #ifdef RANDOMSEED
struct rand_pool_info *rpi; struct rand_pool_info *rpi;
unsigned char *rpi_buf;
ssize_t len = 0; ssize_t len = 0;
struct stat st; struct stat st;
int rc = -1; int rc = -1;
@@ -103,13 +104,14 @@ static void setup(void *arg)
hw = fopen(hwrng, "r"); hw = fopen(hwrng, "r");
if (hw) { if (hw) {
char buf[512]; char buf[512];
size_t len; size_t num;
len = fread(buf, sizeof(buf[0]), sizeof(buf), hw); num = fread(buf, sizeof(buf[0]), sizeof(buf), hw);
if (len == 0) if (num == 0)
fallback(fp); fallback(fp);
else else
len = fwrite(buf, sizeof(buf[0]), len, fp); fwrite(buf, sizeof(buf[0]), num, fp);
fclose(hw); fclose(hw);
} else { } else {
fallback(fp); fallback(fp);
@@ -137,10 +139,11 @@ static void setup(void *arg)
goto fallback; goto fallback;
} }
rpi_buf = (unsigned char *)rpi->buf;
do { do {
ssize_t num; ssize_t num;
num = read(fd, &rpi->buf[len], RANDOM_BYTES - len); num = read(fd, &rpi_buf[len], RANDOM_BYTES - len);
if (num <= 0) { if (num <= 0) {
if (num == -1 && errno == EINTR) if (num == -1 && errno == EINTR)
continue; continue;
+7 -7
View File
@@ -96,16 +96,16 @@ enum cond_state cond_get(const char *name)
enum cond_state cond_get_agg(const char *names) enum cond_state cond_get_agg(const char *names)
{ {
static char conds[MAX_COND_LEN];
enum cond_state s = COND_ON; enum cond_state s = COND_ON;
char *cond;
if (!names) if (names) {
return COND_ON; char conds[strlen(names) + 1];
const char *cond;
strlcpy(conds, names, sizeof(conds)); strlcpy(conds, names, sizeof(conds));
for (cond = strtok(conds, ","); s && cond; cond = strtok(NULL, ",")) for (cond = strtok(conds, ","); s && cond; cond = strtok(NULL, ","))
s = min(s, cond_get(cond)); s = min(s, cond_get(cond));
}
return s; return s;
} }
+1 -1
View File
@@ -193,7 +193,7 @@ int run_parts(char *dir, char *cmd, const char *env[], int progress, int sysv)
#ifndef __FINIT__ #ifndef __FINIT__
static int usage(int rc) static int usage(int rc)
{ {
warnx("usage: runparts [-dhps?] DIRECTORY"); warnx("usage: runparts [-bdhps?] DIRECTORY");
return rc; return rc;
} }
+2 -2
View File
@@ -2912,7 +2912,7 @@ void service_notify_cb(uev_t *w, void *arg, int events)
} }
len = read(w->fd, buf, sizeof(buf) - 1); len = read(w->fd, buf, sizeof(buf) - 1);
if (len == -1) { if (len <= 0) {
warn("Failed reading notification from %s", svc_ident(svc, NULL, 0)); warn("Failed reading notification from %s", svc_ident(svc, NULL, 0));
return; return;
} }
@@ -2920,7 +2920,7 @@ void service_notify_cb(uev_t *w, void *arg, int events)
buf[len] = 0; buf[len] = 0;
/* systemd and s6, respectively. The latter then closes the socket */ /* systemd and s6, respectively. The latter then closes the socket */
if (!strcmp(buf, "READY=1\n") || !strcmp(buf, "\n")) { if (!strcmp(buf, "READY=1\n") || buf[len - 1] == '\n') {
/* /*
* native (pidfile) services are marked as started by * native (pidfile) services are marked as started by
* the pidfile plugin. * the pidfile plugin.