Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package blog for openSUSE:Factory checked in at 2023-07-11 15:56:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/blog (Old) and /work/SRC/openSUSE:Factory/.blog.new.8922 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "blog" Tue Jul 11 15:56:28 2023 rev:17 rq:1097973 version:2.27 Changes: -------- --- /work/SRC/openSUSE:Factory/blog/blog.changes 2023-01-10 14:59:39.237156112 +0100 +++ /work/SRC/openSUSE:Factory/.blog.new.8922/blog.changes 2023-07-11 15:56:34.232915624 +0200 @@ -1,0 +2,6 @@ +Mon Jul 10 13:37:24 UTC 2023 - Dr. Werner Fink <wer...@suse.de> + +- Fix big endian cast problems to be able to read commands + and ansers (blogctl) as well as passphrases (blogd) + +------------------------------------------------------------------- Old: ---- showconsole-2.26.tar.gz New: ---- showconsole-2.27.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ blog.spec ++++++ --- /var/tmp/diff_new_pack.kiMZel/_old 2023-07-11 15:56:34.896919487 +0200 +++ /var/tmp/diff_new_pack.kiMZel/_new 2023-07-11 15:56:34.900919510 +0200 @@ -17,7 +17,7 @@ Name: blog -Version: 2.26 +Version: 2.27 %define sonum 2 Release: 0 Summary: Boot logging ++++++ showconsole-2.26.tar.gz -> showconsole-2.27.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-2.26/blogctl.c new/showconsole-2.27/blogctl.c --- old/showconsole-2.26/blogctl.c 2021-12-03 08:40:53.000000000 +0100 +++ new/showconsole-2.27/blogctl.c 2023-07-10 15:24:36.000000000 +0200 @@ -35,11 +35,11 @@ return fd; } -static int getcmd(int argc, char *argv[]) +static char getcmd(int argc, char *argv[]) { static const struct { const char* cmd; - const int req; + const char req; const int arg; const char* opt; } cmds[] = { @@ -53,7 +53,7 @@ { "reactivate", MAGIC_REACTIVATE, 0, NULL }, /* Reactivate logging */ {} }, *cmd = cmds; - int ret = -1; + char ret = (char)-1; if (argc <= 1) goto out; @@ -87,7 +87,13 @@ int fdsock = -1, ret, len; cmd[1] = '\0'; - while ((cmd[0] = getcmd(argc, argv)) != -1) { + answer[0] = '\x15'; + + fdsock = getsocket(); + if (fdsock < 0) + error("no blogd active"); + + while ((cmd[0] = getcmd(argc, argv)) != (char)-1) { switch (cmd[0]) { case MAGIC_CHROOT: root = optarg; @@ -100,9 +106,7 @@ ret = asprintf(&message, "%c\002%c%s%n", cmd[0], (int)(strlen(root) + 1), root, &len); if (ret < 0) error("can not allocate message"); - fdsock = getsocket(); - if (fdsock >= 0) - safeout(fdsock, message, len+1, SSIZE_MAX); + safeout(fdsock, message, len+1, SSIZE_MAX); free(message); break; case MAGIC_PING: @@ -112,24 +116,26 @@ case MAGIC_CLOSE: case MAGIC_DEACTIVATE: case MAGIC_REACTIVATE: - fdsock = getsocket(); - if (fdsock >= 0) - safeout(fdsock, cmd, strlen(cmd)+1, SSIZE_MAX); + safeout(fdsock, cmd, strlen(cmd)+1, SSIZE_MAX); break; - case '?': - default: - return 1; + case '?': + default: + goto fail; } - answer[0] = '\0'; - if (fdsock >= 0) { - if (can_read(fdsock, 1000)) - safein(fdsock, &answer[0], sizeof(answer)); - close(fdsock); + if (can_read(fdsock, 1000)) { + answer[0] = '\0'; + safein(fdsock, &answer[0], sizeof(answer)); } + + break; /* One command per call only */ } + argv += optind; argc -= optind; +fail: + if (fdsock >= 0) + close(fdsock); return answer[0] == '\x6' ? 0 : 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-2.26/libconsole/console.c new/showconsole-2.27/libconsole/console.c --- old/showconsole-2.26/libconsole/console.c 2021-12-03 08:40:53.000000000 +0100 +++ new/showconsole-2.27/libconsole/console.c 2023-07-10 15:24:36.000000000 +0200 @@ -49,6 +49,16 @@ # define _PATH_BLOG_FIFO "/dev/blog" #endif +#if defined(__s390__) +# define RED "" +# define BOLD ">> " +# define NORM "" +#else +# define RED "\e[31m" +# define BOLD "\e[1m" +# define NORM "\e[m" +#endif + int final = 0; static volatile char *_arg0; @@ -101,9 +111,23 @@ void safeout (int fd, const void *ptr, size_t s, ssize_t max) { int saveerr = errno; + int issocket = 0; + struct stat st; + + if (fstat(fd, &st) < 0) + goto out; + if (S_ISSOCK(st.st_mode)) + issocket++; while (s > 0) { - ssize_t p = write (fd, ptr, (max < 1) ? 1 : ((s < (size_t)max) ? s : (size_t)max)); + ssize_t p; + if (issocket) { + int flags = MSG_NOSIGNAL; + if (s > max) + flags |= MSG_MORE; + p = send (fd, ptr, (max < 1) ? 1 : ((s < (size_t)max) ? s : (size_t)max), flags); + } else + p = write (fd, ptr, (max < 1) ? 1 : ((s < (size_t)max) ? s : (size_t)max)); if (p < 0) { if (errno == EPIPE) break; @@ -167,7 +191,7 @@ if (safein_noexit || signaled) goto out; if (fd == 0 && errno == EIO) - warn("\e[31m\e[1msystem console stolen at line %d!\e[m", __LINE__); + warn(RED BOLD "system console stolen at line %d!" NORM, __LINE__); lerror("Can not read from fd %d", fd); } @@ -191,7 +215,7 @@ if (safein_noexit || signaled) goto out; if (fd == 0 && errno == EIO) - warn("\e[31m\e[1msystem console stolen at line %d!\e[m", __LINE__); + warn(RED BOLD "system console stolen at line %d!" NORM, __LINE__); lerror("Can not read from fd %d", fd); } repeated = 0; @@ -1184,7 +1208,7 @@ if (c->flags & CON_SERIAL) len = asprintf(&message, "\n\r%s: ", pwprompt); else - len = asprintf(&message, "\e[1m\r%s:\e[m ", pwprompt); + len = asprintf(&message, BOLD "\r%s: " NORM, pwprompt); if (len < 0) { warn("can not set password prompt"); _exit(1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-2.26/libconsole/readpw.c new/showconsole-2.27/libconsole/readpw.c --- old/showconsole-2.26/libconsole/readpw.c 2021-12-03 08:40:53.000000000 +0100 +++ new/showconsole-2.27/libconsole/readpw.c 2023-07-10 15:24:36.000000000 +0200 @@ -28,12 +28,12 @@ { char *ptr = pass; struct chardata cp; - int c, ret; + int ret; cp.eol = *ptr = '\0'; while (cp.eol == '\0') { - char ascval; + char ascval, c; ret = read(fd, &c, 1); if (ret < 0) { @@ -58,7 +58,7 @@ if (eightbit) ascval = c; else if (c != (ascval = (c & 0177))) { - uint32_t bits, mask; + uint8_t bits, mask; for (bits = 1, mask = 1; mask & 0177; mask <<= 1) { if (mask & ascval) bits++;