Compare commits

...

No commits in common. "c8" and "c9" have entirely different histories.
c8 ... c9

11 changed files with 332 additions and 173 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
SOURCES/kbd-2.0.4.tar.xz SOURCES/kbd-2.4.0.tar.xz
SOURCES/kbd-latarcyrheb-32.tar.bz2 SOURCES/kbd-latarcyrheb-32.tar.bz2
SOURCES/kbd-latsun-fonts.tar.bz2 SOURCES/kbd-latsun-fonts.tar.bz2

View File

@ -1,3 +1,3 @@
cf5d45c62d6af70b8b1f210d89193b52f5efb05d SOURCES/kbd-2.0.4.tar.xz 724c030926d125b5e430274e92c4236d8534d410 SOURCES/kbd-2.4.0.tar.xz
17db7aaba451796278758e7c6e443b4659af17b9 SOURCES/kbd-latarcyrheb-32.tar.bz2 17db7aaba451796278758e7c6e443b4659af17b9 SOURCES/kbd-latarcyrheb-32.tar.bz2
a5f6d9dff7a8a484cd5014ec7ffdf1eaed27084a SOURCES/kbd-latsun-fonts.tar.bz2 a5f6d9dff7a8a484cd5014ec7ffdf1eaed27084a SOURCES/kbd-latsun-fonts.tar.bz2

View File

@ -1,6 +1,6 @@
diff -up kbd-2.0.4/docs/man/man1/showkey.1.orig kbd-2.0.4/docs/man/man1/showkey.1 diff -up kbd-2.3.0/docs/man/man1/showkey.1.orig kbd-2.3.0/docs/man/man1/showkey.1
--- kbd-2.0.4/docs/man/man1/showkey.1.orig 2016-10-31 16:56:02.000000000 +0100 --- kbd-2.3.0/docs/man/man1/showkey.1.orig 2020-07-08 19:25:47.000000000 +0200
+++ kbd-2.0.4/docs/man/man1/showkey.1 2017-01-11 10:45:03.763312393 +0100 +++ kbd-2.3.0/docs/man/man1/showkey.1 2020-07-16 08:56:15.970254183 +0200
@@ -84,6 +84,19 @@ corresponds to what the keyboard hardwar @@ -84,6 +84,19 @@ corresponds to what the keyboard hardwar
to know the scan codes sent by various keys it is better to boot a to know the scan codes sent by various keys it is better to boot a
2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=0 2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=0
@ -21,13 +21,13 @@ diff -up kbd-2.0.4/docs/man/man1/showkey.1.orig kbd-2.0.4/docs/man/man1/showkey.
.SH "SEE ALSO" .SH "SEE ALSO"
.BR loadkeys (1), .BR loadkeys (1),
.BR dumpkeys (1), .BR dumpkeys (1),
diff -up kbd-2.0.4/docs/man/man8/setkeycodes.8.orig kbd-2.0.4/docs/man/man8/setkeycodes.8 diff -up kbd-2.3.0/docs/man/man8/setkeycodes.8.orig kbd-2.3.0/docs/man/man8/setkeycodes.8
--- kbd-2.0.4/docs/man/man8/setkeycodes.8.orig 2016-10-31 16:56:02.000000000 +0100 --- kbd-2.3.0/docs/man/man8/setkeycodes.8.orig 2020-07-08 19:35:35.000000000 +0200
+++ kbd-2.0.4/docs/man/man8/setkeycodes.8 2017-01-11 10:45:03.763312393 +0100 +++ kbd-2.3.0/docs/man/man8/setkeycodes.8 2020-07-16 08:57:52.293900997 +0200
@@ -38,6 +38,10 @@ to showkey(1), the command @@ -42,6 +42,10 @@ the command
.RE will assign the keycode 112 to it, and then
will assign the keycode 112 to it, and then loadkeys(1) can be used .BR loadkeys (1)
to define the function of this key. can be used to define the function of this key.
+ +
+USB keyboards have standardized keycodes and +USB keyboards have standardized keycodes and
+.B setkeycodes +.B setkeycodes
@ -35,7 +35,7 @@ diff -up kbd-2.0.4/docs/man/man8/setkeycodes.8.orig kbd-2.0.4/docs/man/man8/setk
.LP .LP
Some older kernels might hardwire a low scancode range to the Some older kernels might hardwire a low scancode range to the
equivalent keycodes; setkeycodes will fail when you try to remap equivalent keycodes; setkeycodes will fail when you try to remap
@@ -56,6 +60,14 @@ None. @@ -60,6 +64,14 @@ None.
.SH BUGS .SH BUGS
The keycodes of X have nothing to do with those of Linux. The keycodes of X have nothing to do with those of Linux.
Unusual keys can be made visible under Linux, but not under X. Unusual keys can be made visible under Linux, but not under X.
@ -48,5 +48,5 @@ diff -up kbd-2.0.4/docs/man/man8/setkeycodes.8.orig kbd-2.0.4/docs/man/man8/setk
+cannot change the mapping of other devices than the "first" one. +cannot change the mapping of other devices than the "first" one.
+ +
.SH "SEE ALSO" .SH "SEE ALSO"
.I "dumpkeys (1), loadkeys (1), showkey (1), getkeycodes (8)" .BR dumpkeys (1),
.BR loadkeys (1),

View File

@ -1,7 +1,7 @@
diff -up kbd-2.0.4/docs/man/man8/kbdrate.8.orig kbd-2.0.4/docs/man/man8/kbdrate.8 diff -up kbd-2.1.0/docs/man/man8/kbdrate.8.orig kbd-2.1.0/docs/man/man8/kbdrate.8
--- kbd-2.0.4/docs/man/man8/kbdrate.8.orig 2017-01-11 11:04:50.114831348 +0100 --- kbd-2.1.0/docs/man/man8/kbdrate.8.orig 2019-06-21 10:08:17.000000000 +0200
+++ kbd-2.0.4/docs/man/man8/kbdrate.8 2017-01-11 11:05:35.619851252 +0100 +++ kbd-2.1.0/docs/man/man8/kbdrate.8 2019-07-17 10:36:19.876499648 +0200
@@ -22,7 +22,7 @@ Using @@ -19,7 +19,7 @@ Using
without any options will reset the repeat rate to 10.9 characters per second (cps) without any options will reset the repeat rate to 10.9 characters per second (cps)
and the delay to 250 milliseconds (ms) for Intel- and M68K-based systems. and the delay to 250 milliseconds (ms) for Intel- and M68K-based systems.
These are the IBM defaults. On SPARC-based systems it will reset the repeat rate These are the IBM defaults. On SPARC-based systems it will reset the repeat rate
@ -10,10 +10,10 @@ diff -up kbd-2.0.4/docs/man/man8/kbdrate.8.orig kbd-2.0.4/docs/man/man8/kbdrate.
.SH OPTIONS .SH OPTIONS
.TP .TP
diff -up kbd-2.0.4/src/kbdrate.c.orig kbd-2.0.4/src/kbdrate.c diff -up kbd-2.1.0/src/kbdrate.c.orig kbd-2.1.0/src/kbdrate.c
--- kbd-2.0.4/src/kbdrate.c.orig 2017-01-11 11:05:10.226840148 +0100 --- kbd-2.1.0/src/kbdrate.c.orig 2019-07-02 17:44:57.000000000 +0200
+++ kbd-2.0.4/src/kbdrate.c 2017-01-11 11:05:56.832860537 +0100 +++ kbd-2.1.0/src/kbdrate.c 2019-07-17 11:07:04.732486323 +0200
@@ -111,9 +111,12 @@ static int valid_delays[] = { 250, 500, @@ -114,9 +114,12 @@ static int print_only = 0;
static int static int
KDKBDREP_ioctl_ok(double rate, int delay, int silent) KDKBDREP_ioctl_ok(double rate, int delay, int silent)
{ {
@ -26,8 +26,8 @@ diff -up kbd-2.0.4/src/kbdrate.c.orig kbd-2.0.4/src/kbdrate.c
* Since 2.4.9 also on i386. * Since 2.4.9 also on i386.
*/ */
struct my_kbd_repeat kbdrep_s; struct my_kbd_repeat kbdrep_s;
@@ -176,6 +179,9 @@ KDKBDREP_ioctl_ok(double rate, int delay @@ -181,6 +184,9 @@ KDKBDREP_ioctl_ok(double rate, int delay
rate, kbdrep_s.delay); }
return 1; /* success! */ return 1; /* success! */
+#else /* no KDKBDREP or __sparc__ */ +#else /* no KDKBDREP or __sparc__ */
@ -35,31 +35,28 @@ diff -up kbd-2.0.4/src/kbdrate.c.orig kbd-2.0.4/src/kbdrate.c
+#endif /* KDKBDREP */ +#endif /* KDKBDREP */
} }
#ifndef KIOCSRATE #ifdef KIOCSRATE
@@ -226,7 +232,7 @@ sigalrmhandler(int sig __attribute__((un @@ -251,6 +257,9 @@ ioport_set(double rate, int delay, int s
int main(int argc, char **argv)
{ /* https://wiki.osdev.org/PS/2_Keyboard */
#ifdef __sparc__
- double rate = 5.0; /* Default rate */
+ double rate = 20.0; /* Default rate */
int delay = 200; /* Default delay */
#else
double rate = 10.9; /* Default rate */
@@ -275,8 +281,9 @@ int main(int argc, char **argv)
if (KIOCSRATE_ioctl_ok(rate, delay, silent)) /* sparc? */
return 0;
- /* The ioport way */
+ /* The ioport way - will crash on sparc */ + /* The ioport way - will crash on sparc */
+
+#ifndef __sparc__ +#ifndef __sparc__
for (i = 0; i < RATE_COUNT; i++) for (i = 0; i < (int) RATE_COUNT; i++)
if (rate * 10 >= valid_rates[i]) { if (rate * 10 >= valid_rates[i]) {
value &= 0x60; value &= 0x60;
@@ -333,5 +340,6 @@ int main(int argc, char **argv) @@ -304,11 +313,12 @@ ioport_set(double rate, int delay, int s
valid_rates[value & 0x1f] / 10.0, valid_rates[value & 0x1f] / 10.0,
valid_delays[(value & 0x60) >> 5]); valid_delays[(value & 0x60) >> 5]);
+#endif +#endif
return EXIT_SUCCESS; return 1;
} }
#ifdef __sparc__
-double rate = 5.0; /* Default rate */
+double rate = 20.0; /* Default rate */
int delay = 200; /* Default delay */
#else
double rate = 10.9; /* Default rate */

View File

@ -1,18 +1,18 @@
diff -up kbd-2.0.4/src/loadkeys.c.orig kbd-2.0.4/src/loadkeys.c diff -up kbd-2.3.0/src/loadkeys.c.orig kbd-2.3.0/src/loadkeys.c
--- kbd-2.0.4/src/loadkeys.c.orig 2017-01-11 11:14:48.308093019 +0100 --- kbd-2.3.0/src/loadkeys.c.orig 2020-06-02 12:16:45.000000000 +0200
+++ kbd-2.0.4/src/loadkeys.c 2017-01-11 11:15:18.018106020 +0100 +++ kbd-2.3.0/src/loadkeys.c 2020-07-16 09:02:50.398864688 +0200
@@ -27,7 +27,7 @@ @@ -28,6 +28,8 @@
#include "keymap.h" static const char *const dirpath1[] = {
"",
static const char *progname = NULL; DATADIR "/" KEYMAPDIR "/**",
-static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", KERNDIR "/", 0 }; + DATADIR "/" XKBKEYMAPDIR "/",
+static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", DATADIR "/" XKBKEYMAPDIR "/", DATADIR "/" LEGACYKEYMAPDIR "/**", KERNDIR "/", 0 }; + DATADIR "/" LEGACYKEYMAPDIR "/**",
static const char *const suffixes[] = { "", ".kmap", ".map", 0 }; KERNDIR "/",
NULL
static void __attribute__((noreturn)) };
diff -up kbd-2.0.4/src/paths.h.orig kbd-2.0.4/src/paths.h diff -up kbd-2.3.0/src/paths.h.orig kbd-2.3.0/src/paths.h
--- kbd-2.0.4/src/paths.h.orig 2017-01-11 11:15:40.404115812 +0100 --- kbd-2.3.0/src/paths.h.orig 2020-07-16 09:02:59.243010909 +0200
+++ kbd-2.0.4/src/paths.h 2017-01-11 11:15:59.730124274 +0100 +++ kbd-2.3.0/src/paths.h 2020-07-16 09:03:23.446410942 +0200
@@ -5,6 +5,8 @@ @@ -5,6 +5,8 @@
* The following five subdirectories are defined: * The following five subdirectories are defined:
*/ */

View File

@ -1,35 +1,11 @@
diff -up kbd-2.0.4/src/kdmapop.c.orig kbd-2.0.4/src/kdmapop.c diff -up kbd-2.3.0/src/libkfont/kdmapop.c.orig kbd-2.3.0/src/libkfont/kdmapop.c
--- kbd-2.0.4/src/kdmapop.c.orig 2018-11-05 10:06:05.208744333 +0100 --- kbd-2.3.0/src/libkfont/kdmapop.c.orig 2020-04-27 17:53:01.000000000 +0200
+++ kbd-2.0.4/src/kdmapop.c 2018-11-05 10:14:16.149215908 +0100 +++ kbd-2.3.0/src/libkfont/kdmapop.c 2020-07-16 09:06:45.246742724 +0200
@@ -154,6 +154,7 @@ int getunimap(int fd, struct unimapdesc @@ -166,6 +166,7 @@ kfont_get_unicodemap(struct kfont_contex
}
if (ioctl(fd, GIO_UNIMAP, &ud)) { if (ioctl(fd, GIO_UNIMAP, &ud)) {
perror("GIO_UNIMAP"); KFONT_ERR(ctx, "ioctl(GIO_UNIMAP): %m");
+ free(ud.entries); + free(ud.entries);
return -1; return -1;
} }
if (ct != ud.entry_ct) if (ct != ud.entry_ct)
diff -up kbd-2.0.4/src/libkeymap/common.c.orig kbd-2.0.4/src/libkeymap/common.c
--- kbd-2.0.4/src/libkeymap/common.c.orig 2016-12-19 16:01:51.000000000 +0100
+++ kbd-2.0.4/src/libkeymap/common.c 2018-11-05 10:05:50.207730393 +0100
@@ -246,5 +246,8 @@ int lk_free(struct lk_ctx *ctx)
ctx->key_line = NULL;
}
+ free(ctx);
+ ctx = NULL;
+
return 0;
}
diff -up kbd-2.0.4/src/setfont.c.orig kbd-2.0.4/src/setfont.c
--- kbd-2.0.4/src/setfont.c.orig 2018-11-05 10:28:01.994027734 +0100
+++ kbd-2.0.4/src/setfont.c 2018-11-05 10:35:54.933477039 +0100
@@ -327,6 +327,8 @@ do_loadfont(int fd, char *inbuf, int wid
if (putfont(fd, buf, fontsize, width, hwunit))
exit(EX_OSERR);
+
+ free(buf);
}
static void

View File

@ -1,15 +0,0 @@
diff -up kbd-2.0.4/src/vlock/auth.c.orig kbd-2.0.4/src/vlock/auth.c
--- kbd-2.0.4/src/vlock/auth.c.orig 2016-12-19 16:01:51.000000000 +0100
+++ kbd-2.0.4/src/vlock/auth.c 2023-03-20 09:34:06.010036016 +0100
@@ -140,9 +140,9 @@ int get_password(pam_handle_t *pamh, con
fflush(stdout);
/*
* EOF encountered on read?
- * If not on VT, check stdin.
+ * Check stdin.
*/
- if (is_vt || isatty(STDIN_FILENO)) {
+ if (isatty(STDIN_FILENO)) {
/* Ignore error. */
sleep(SHORT_DELAY);
break;

View File

@ -0,0 +1,93 @@
diff -up kbd-2.4.0/src/libkbdfile/kbdfile.c.orig kbd-2.4.0/src/libkbdfile/kbdfile.c
--- kbd-2.4.0/src/libkbdfile/kbdfile.c.orig 2020-11-11 13:44:48.000000000 +0100
+++ kbd-2.4.0/src/libkbdfile/kbdfile.c 2021-04-27 09:58:08.405671071 +0200
@@ -39,8 +39,10 @@ kbdfile_new(struct kbdfile_ctx *ctx)
if (!fp->ctx) {
fp->ctx = kbdfile_context_new();
- if (!fp->ctx)
+ if (!fp->ctx) {
+ free(fp);
return NULL;
+ }
fp->flags |= KBDFILE_CTX_INITIALIZED;
}
@@ -69,7 +71,7 @@ kbdfile_get_pathname(struct kbdfile *fp)
int
kbdfile_set_pathname(struct kbdfile *fp, const char *pathname)
{
- strncpy(fp->pathname, pathname, sizeof(fp->pathname));
+ strncpy(fp->pathname, pathname, sizeof(fp->pathname) - 1);
return 0;
}
@@ -385,7 +387,7 @@ kbdfile_find(const char *fnam, const cha
fp->flags &= ~KBDFILE_PIPE;
/* Try explicitly given name first */
- strncpy(fp->pathname, fnam, sizeof(fp->pathname));
+ strncpy(fp->pathname, fnam, sizeof(fp->pathname) - 1);
if (!maybe_pipe_open(fp))
return 0;
diff -up kbd-2.4.0/src/libkeymap/common.c.orig kbd-2.4.0/src/libkeymap/common.c
--- kbd-2.4.0/src/libkeymap/common.c.orig 2019-06-24 13:55:23.000000000 +0200
+++ kbd-2.4.0/src/libkeymap/common.c 2021-04-27 09:58:08.405671071 +0200
@@ -139,6 +139,7 @@ init_array(struct lk_ctx *ctx, struct lk
rc = lk_array_init(ptr, size, 0);
if (rc < 0) {
ERR(ctx, _("unable to initialize array: %s"), strerror(rc));
+ free(ptr);
return -1;
}
diff -up kbd-2.4.0/src/libkfont/psffontop.c.orig kbd-2.4.0/src/libkfont/psffontop.c
--- kbd-2.4.0/src/libkfont/psffontop.c.orig 2020-04-27 17:53:01.000000000 +0200
+++ kbd-2.4.0/src/libkfont/psffontop.c 2021-04-27 09:59:14.170153676 +0200
@@ -235,6 +235,7 @@ kfont_read_psffont(struct kfont_context
if (psfhdr->mode > PSF1_MAXMODE) {
KFONT_ERR(ctx, _("Unsupported psf file mode (%d)"), psfhdr->mode);
+ free(psfhdr);
return -EX_DATAERR;
}
fontlen = ((psfhdr->mode & PSF1_MODE512) ? 512 : 256);
@@ -251,6 +252,7 @@ kfont_read_psffont(struct kfont_context
if (psfhdr.version > PSF2_MAXVERSION) {
KFONT_ERR(ctx, _("Unsupported psf version (%d)"), psfhdr.version);
+ free(inputbuf);
return -EX_DATAERR;
}
fontlen = assemble_uint32((unsigned char *)&psfhdr.length);
@@ -260,16 +262,20 @@ kfont_read_psffont(struct kfont_context
ftoffset = assemble_uint32((unsigned char *)&psfhdr.headersize);
fontwidth = assemble_uint32((unsigned char *)&psfhdr.width);
utf8 = 1;
- } else
+ } else {
+ free(inputbuf);
return -EX_DATAERR; /* not psf */
+ }
/* tests required - we divide by these */
if (fontlen == 0) {
KFONT_ERR(ctx, _("zero input font length?"));
+ free(inputbuf);
return -EX_DATAERR;
}
if (charsize == 0) {
KFONT_ERR(ctx, _("zero input character size?"));
+ free(inputbuf);
return -EX_DATAERR;
}
@@ -277,6 +283,7 @@ kfont_read_psffont(struct kfont_context
if (i > inputlth || (!hastable && i != inputlth)) {
KFONT_ERR(ctx, _("Input file: bad input length (%d)"), inputlth);
+ free(inputbuf);
return -EX_DATAERR;
}

View File

@ -0,0 +1,12 @@
diff -up kbd-2.4.0/src/libkfont/setfont.c.orig kbd-2.4.0/src/libkfont/setfont.c
--- kbd-2.4.0/src/libkfont/setfont.c.orig 2020-06-01 17:53:08.000000000 +0200
+++ kbd-2.4.0/src/libkfont/setfont.c 2024-04-16 11:04:00.455262477 +0200
@@ -270,7 +270,7 @@ kfont_load_fonts(struct kfont_context *c
unsigned char *inbuf, *fontbuf, *bigfontbuf;
unsigned int inputlth, fontbuflth, fontsize, height, width, bytewidth;
unsigned int bigfontbuflth, bigfontsize, bigheight, bigwidth;
- unsigned char *ptr;
+ unsigned char *ptr = NULL;
struct unicode_list *uclistheads;
struct kbdfile *fp = NULL;
int i;

View File

@ -0,0 +1,14 @@
diff -up kbd-2.4.0/src/setfont.c.orig kbd-2.4.0/src/setfont.c
--- kbd-2.4.0/src/setfont.c.orig 2020-06-02 11:30:41.000000000 +0200
+++ kbd-2.4.0/src/setfont.c 2021-05-17 12:06:44.360616147 +0200
@@ -189,8 +189,8 @@ int main(int argc, char *argv[])
if (restore)
kfont_restore_font(kfont, fd);
- if (ifilct)
- kfont_load_fonts(kfont, fd, ifiles, ifilct, iunit, hwunit, no_m, no_u);
+ if (ifilct && (ret = kfont_load_fonts(kfont, fd, ifiles, ifilct, iunit, hwunit, no_m, no_u)) < 0)
+ return -ret;
if (ufil && (ret = kfont_load_unicodemap(kfont, fd, ufil)) < 0)
return -ret;

View File

@ -1,11 +1,15 @@
Name: kbd # {_exec_prefix}/lib/kbd is correct even on x86_64.
Version: 2.0.4 # It is traditionally used for kdb data (console fonts, keymaps, ...).
Release: 11%{?dist} # It is not used for any shared objects/executables.
Summary: Tools for configuring the console (keyboard, virtual terminals, etc.) %global kbd_datadir %{_exec_prefix}/lib/kbd
Group: System Environment/Base Name: kbd
Version: 2.4.0
Release: 10%{?dist}
Summary: Tools for configuring the console (keyboard, virtual terminals, etc.)
License: GPLv2+ License: GPLv2+
URL: http://www.kbd-project.org/ URL: http://www.kbd-project.org/
Source0: ftp://ftp.altlinux.org/pub/people/legion/kbd/kbd-%{version}.tar.xz Source0: ftp://ftp.altlinux.org/pub/people/legion/kbd/kbd-%{version}.tar.xz
Source1: kbd-latsun-fonts.tar.bz2 Source1: kbd-latsun-fonts.tar.bz2
Source2: kbd-latarcyrheb-32.tar.bz2 Source2: kbd-latarcyrheb-32.tar.bz2
@ -28,16 +32,22 @@ Patch5: kbd-1.15.5-loadkeys-search-path.patch
# Patch6: don't hardcode font used in unicode_start, take it from vconsole.conf, # Patch6: don't hardcode font used in unicode_start, take it from vconsole.conf,
# bz 1101007 # bz 1101007
Patch6: kbd-2.0.2-unicode-start-font.patch Patch6: kbd-2.0.2-unicode-start-font.patch
# Patch7: fixes issues found by static analysis, bz 1602566 # Patch7: fixes issues found by static analysis
Patch7: kbd-2.0.4-covscan-fixes.patch Patch7: kbd-2.0.4-covscan-fixes.patch
# Patch8: fixes vlock when console or terminal is closed abruptly, bz 2178798 # Patch8: fixes another batch of issues found by static analysis
Patch8: kbd-2.0.4-vlock-stdin-closed-inf-loop.patch Patch8: kbd-2.4.0-covscan-fixes.patch
# Patch9: fixes setfont exit code, bz 1947953
Patch9: kbd-2.4.0-setfont-exit-code.patch
# Patch10: initializes variable (SAST)
Patch10: kbd-2.4.0-initialize-variable.patch
BuildRequires: bison, flex, gettext, pam-devel, check-devel BuildRequires: gcc, bison, flex, gettext, pam-devel, check-devel, automake
BuildRequires: console-setup, xkeyboard-config BuildRequires: console-setup, xkeyboard-config
BuildRequires: make
Requires: %{name}-misc = %{version}-%{release} Requires: %{name}-misc = %{version}-%{release}
# Temporarily require -legacy
Requires: %{name}-legacy = %{version}-%{release} Requires: %{name}-legacy = %{version}-%{release}
# Be sure that system is after UsrMove
Conflicts: filesystem < 3
Provides: vlock = %{version} Provides: vlock = %{version}
Conflicts: vlock <= 1.3 Conflicts: vlock <= 1.3
Obsoletes: vlock Obsoletes: vlock
@ -75,7 +85,11 @@ cp -fp %{SOURCE6} .
%patch5 -p1 -b .loadkeys-search-path %patch5 -p1 -b .loadkeys-search-path
%patch6 -p1 -b .unicode-start-font %patch6 -p1 -b .unicode-start-font
%patch7 -p1 -b .covscan-fixes %patch7 -p1 -b .covscan-fixes
%patch8 -p1 -b .vlock-stdin-closed-inf-loop %patch8 -p1 -b .covscan-fixes-pt2
%patch9 -p1 -b .setfont-exit-code
%patch10 -p1 -b .initialize-variable
aclocal
autoconf
# 7-bit maps are obsolete; so are non-euro maps # 7-bit maps are obsolete; so are non-euro maps
pushd data/keymaps/i386 pushd data/keymaps/i386
@ -88,7 +102,6 @@ cp azerty/fr-latin9.map azerty/fr.map
cp azerty/fr-latin9.map azerty/fr-latin0.map # legacy alias cp azerty/fr-latin9.map azerty/fr-latin0.map # legacy alias
# Rename conflicting keymaps # Rename conflicting keymaps
mv dvorak/no.map dvorak/no-dvorak.map
mv fgGIod/trf.map fgGIod/trf-fgGIod.map mv fgGIod/trf.map fgGIod/trf-fgGIod.map
mv olpc/es.map olpc/es-olpc.map mv olpc/es.map olpc/es-olpc.map
mv olpc/pt.map olpc/pt-olpc.map mv olpc/pt.map olpc/pt-olpc.map
@ -105,79 +118,62 @@ iconv -f iso-8859-1 -t utf-8 < "ChangeLog" > "ChangeLog_"
mv "ChangeLog_" "ChangeLog" mv "ChangeLog_" "ChangeLog"
%build %build
%configure --prefix=%{_prefix} --datadir=/lib/kbd --mandir=%{_mandir} --localedir=%{_datadir}/locale --enable-nls %configure --prefix=%{_prefix} --datadir=%{kbd_datadir} --mandir=%{_mandir} --localedir=%{_datadir}/locale --enable-nls
make %{?_smp_mflags} %make_build
%install %install
make install DESTDIR=$RPM_BUILD_ROOT %make_install
# ro_win.map.gz is useless # ro_win.map.gz is useless
rm -f $RPM_BUILD_ROOT/lib/kbd/keymaps/i386/qwerty/ro_win.map.gz rm -f $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/ro_win.map.gz
# Create additional name for Serbian latin keyboard # Create additional name for Serbian latin keyboard
ln -s sr-cy.map.gz $RPM_BUILD_ROOT/lib/kbd/keymaps/i386/qwerty/sr-latin.map.gz ln -s sr-cy.map.gz $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/sr-latin.map.gz
# The rhpl keyboard layout table is indexed by kbd layout names, so we need a # The rhpl keyboard layout table is indexed by kbd layout names, so we need a
# Korean keyboard # Korean keyboard
ln -s us.map.gz $RPM_BUILD_ROOT/lib/kbd/keymaps/i386/qwerty/ko.map.gz ln -s us.map.gz $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/ko.map.gz
# Move binaries which we use before /usr is mounted from %{_bindir} to /bin.
mkdir -p $RPM_BUILD_ROOT/bin
for binary in setfont dumpkeys kbd_mode unicode_start unicode_stop loadkeys ; do
mv $RPM_BUILD_ROOT%{_bindir}/$binary $RPM_BUILD_ROOT/bin/
done
# Some microoptimization # Some microoptimization
sed -i -e 's,\<kbd_mode\>,/bin/kbd_mode,g;s,\<setfont\>,/bin/setfont,g' \ sed -i -e 's,\<kbd_mode\>,%{_bindir}/kbd_mode,g;s,\<setfont\>,%{_bindir}/setfont,g' \
$RPM_BUILD_ROOT/bin/unicode_start $RPM_BUILD_ROOT%{_bindir}/unicode_start
# Link open to openvt
ln -s openvt $RPM_BUILD_ROOT%{_bindir}/open
ln -s openvt.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/open.1.gz
# install kbdinfo manpage # install kbdinfo manpage
gzip -c %SOURCE5 > $RPM_BUILD_ROOT/%{_mandir}/man1/kbdinfo.1.gz gzip -c %SOURCE5 > $RPM_BUILD_ROOT/%{_mandir}/man1/kbdinfo.1.gz
# Move locale files to correct place
cp -r $RPM_BUILD_ROOT/lib/kbd/locale/ $RPM_BUILD_ROOT%{_datadir}/locale
rm -rf $RPM_BUILD_ROOT/lib/kbd/locale
# Install PAM configuration for vlock # Install PAM configuration for vlock
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/vlock install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/vlock
# Move original keymaps to legacy directory # Move original keymaps to legacy directory
mkdir -p $RPM_BUILD_ROOT/lib/kbd/keymaps/legacy mkdir -p $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/legacy
mv $RPM_BUILD_ROOT/lib/kbd/keymaps/{amiga,atari,i386,include,mac,ppc,sun} $RPM_BUILD_ROOT/lib/kbd/keymaps/legacy mv $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/{amiga,atari,i386,include,mac,ppc,sun} $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/legacy
# Convert X keyboard layouts to console keymaps # Convert X keyboard layouts to console keymaps
mkdir -p $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb mkdir -p $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb
perl xml2lst.pl < /usr/share/X11/xkb/rules/base.xml > layouts-variants.lst perl xml2lst.pl < /usr/share/X11/xkb/rules/base.xml > layouts-variants.lst
while read line; do while read line; do
XKBLAYOUT=`echo "$line" | cut -d " " -f 1` XKBLAYOUT=`echo "$line" | cut -d " " -f 1`
echo "$XKBLAYOUT" >> layouts-list.lst echo "$XKBLAYOUT" >> layouts-list.lst
XKBVARIANT=`echo "$line" | cut -d " " -f 2` XKBVARIANT=`echo "$line" | cut -d " " -f 2`
ckbcomp "$XKBLAYOUT" "$XKBVARIANT" | gzip > $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/"$XKBLAYOUT"-"$XKBVARIANT".map.gz ckbcomp -rules base "$XKBLAYOUT" "$XKBVARIANT" | gzip > $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/"$XKBLAYOUT"-"$XKBVARIANT".map.gz
done < layouts-variants.lst done < layouts-variants.lst
# Convert X keyboard layouts (plain, no variant) # Convert X keyboard layouts (plain, no variant)
cat layouts-list.lst | sort -u >> layouts-list-uniq.lst cat layouts-list.lst | sort -u >> layouts-list-uniq.lst
while read line; do while read line; do
ckbcomp "$line" | gzip > $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/"$line".map.gz ckbcomp -rules base "$line" | gzip > $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/"$line".map.gz
done < layouts-list-uniq.lst done < layouts-list-uniq.lst
# wipe converted layouts which cannot input ASCII (#1031848) # wipe converted layouts which cannot input ASCII (#1031848)
zgrep -L "U+0041" $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/* | xargs rm -f zgrep -L "U+0041" $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/* | xargs rm -f
# Rename the converted default fi (kotoistus) layout (#1117891) # Fix converted cz layout - add compose rules, if exists
gunzip $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/fi.map.gz if [ -f "$RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map.gz" ]; then
mv $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/fi.map $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/fi-kotoistus.map gunzip $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map.gz
gzip $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/fi-kotoistus.map patch $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map < %{SOURCE6}
gzip $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map
# Fix converted cz layout - add compose rules fi
gunzip $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/cz.map.gz
patch $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/cz.map < %{SOURCE6}
gzip $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/cz.map
%find_lang %{name} %find_lang %{name}
@ -187,41 +183,127 @@ make check
%endif %endif
%files -f %{name}.lang %files -f %{name}.lang
%doc ChangeLog AUTHORS README COPYING docs/doc/kbd.FAQ*.html docs/doc/font-formats/*.html docs/doc/utf/utf* docs/doc/dvorak/* %license COPYING
/bin/* %doc ChangeLog AUTHORS README docs/doc/kbd.FAQ*.html docs/doc/font-formats/*.html docs/doc/utf/utf* docs/doc/dvorak/*
%{_bindir}/* %{_bindir}/*
%{_mandir}/*/* %{_mandir}/*/*
%config(noreplace) %{_sysconfdir}/pam.d/vlock %config(noreplace) %{_sysconfdir}/pam.d/vlock
# library used only for tests
%exclude %{_libdir}/libtswrap*
%exclude %{_prefix}/lib/debug/%{_libdir}/libtswrap*
%files misc %files misc
/lib/kbd %{kbd_datadir}
%exclude /lib/kbd/keymaps/legacy %exclude %{kbd_datadir}/keymaps/legacy
%files legacy %files legacy
/lib/kbd/keymaps/legacy %{kbd_datadir}/keymaps/legacy
%changelog %changelog
* Tue Apr 18 2023 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-11 * Tue May 21 2024 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-10
- Fix vlock when console or terminal is closed abruptly - Initialize variable to avoid possible uninitialized use
Resolves: #2178798 Resolves: RHEL-31795
* Wed Jun 17 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-10 * Mon Apr 17 2023 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-9
- Add %%check, rebuild - Require kbd-legacy in main kbd package again
Resolves: #2139165
* Tue Jun 16 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-9 * Tue Jan 18 2022 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-8
- Rebuild - Use default Finnish xkb-converted layout
Resolves: #1844967 Resolves: #2031127
* Mon Dec 10 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-8 * Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.0-7
- Fix issues found by static analysis - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Resoloves: #1602566 Related: rhbz#1991688
* Tue Jul 31 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-7 * Mon May 17 2021 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-6
- Drop initscripts Require - Fix setfont exit code
Resolves: #1610277 Resolves: #1947953
* Tue Jul 24 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-6 * Wed May 05 2021 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-5
- Rebuilt (reuploaded upstream tarball, the checksum differed) - Fix issues detected by static analysis
Resolves: #1938749
* Thu Apr 22 2021 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-4
- Fix layout->keymap conversion broken by change in xkeyboard-config
(patch by Peter Hutterer)
Resolves: #1950406
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.0-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Dec 16 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-1
- Update to kbd-2.4.0
Resolves: #1908123
* Thu Oct 29 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.3.0-4
- Don't require kbd-legacy in main kbd package anymore
Resolves: #1891811
* Wed Sep 23 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.3.0-3
- Exclude test library instead of removing it to fix --nocheck builds
Resolves: #1881515
* Fri Aug 28 2020 Adam Williamson <awilliam@redhat.com> - 2.3.0-2
- Rebuild with grep #1872913 fix to correctly drop non-ASCII layouts
Resolves: #1872922
* Wed Jul 29 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.3.0-1
- Make changes in converted layouts conditionally
- Use make macros, patch by Tom Stellard <tstellar@redhat.com>
(https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro)
- Update to kbd-2.3.0
Resolves: #1855867
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Mar 17 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.0-3
- Use upstream test suite in %%check
* Thu Mar 05 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.0-2
- Don't move binaries to /bin, shouldn't be needed after UsrMove
- Move kbd data (console fonts, keymaps, ...) to /usr
Resolves: #1809257
* Mon Feb 10 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.0-1
- Update to kbd-2.2.0
Resolves: #1742036
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Nov 28 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-12
- Apply only tty non-breaking fixes from -10
* Tue Nov 13 2018 Adam Williamson <awilliam@redhat.com> - 2.0.4-11
- Drop fixes from -10 for now as they are breaking ttys (#1649531)
* Mon Nov 12 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-10
- Fix issues detected by static analysis
* Mon Aug 13 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-9
- Remove the link from open to openvt
(related discussion and rationale in Debian bug tracker, bug #732796)
* Mon Jul 30 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2.0.4-8
- Drop initscripts Require, use %%license
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 21 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-6
- Add BuildRequires gcc
- Escape macro in comment, remove Group tag
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-5 * Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild