Compare commits

..

20 commits

Author SHA1 Message Date
Michal Hlavinka
58bcfd3404 rebuild for gpgme 2.0 2025-11-11 11:15:58 +01:00
Python Maint
6156da804d Rebuilt for Python 3.14.0rc3 bytecode 2025-09-19 15:02:54 +02:00
Python Maint
f67afe1eb4 Rebuilt for Python 3.14.0rc2 bytecode 2025-08-15 15:22:26 +02:00
Fedora Release Engineering
c1f5a0ff90 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 20:12:47 +00:00
Lukáš Zaoral
e6019f9dc3
tests: migrate from STI to TMT
Related: https://fedoraproject.org/wiki/Changes/DisableSTI
2025-07-07 12:47:47 +02:00
Python Maint
d35de5bf23 Rebuilt for Python 3.14 2025-06-02 20:49:24 +02:00
Fedora Release Engineering
02d462c1da Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-19 14:35:41 +00:00
Fedora Release Engineering
4d23ac14cc Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-20 08:59:20 +00:00
Python Maint
c4f79d2d76 Rebuilt for Python 3.13 2024-06-07 09:08:58 +02:00
Software Management Team
291e835b65 Eliminate use of obsolete %patchN syntax (#2283636) 2024-05-30 12:46:49 +02:00
Yaakov Selkowitz
6c794a9595 Fix build with Python 3.12
The configure script uses distutils to determine various locations.
While that has been removed from the standard library, setuptools
provides a compatibility layer.
2024-01-27 23:11:45 -05:00
Fedora Release Engineering
3c2df9d55f Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-27 08:10:28 +00:00
Fedora Release Engineering
dbc3ddc9fb Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-22 17:50:39 +00:00
Yaakov Selkowitz
db4e43302b Fix build with Python 3.12
The autotools py-compile script in the source tarball is outdated.
2023-07-05 20:02:52 -04:00
Jiri Kucera
dda2026478 Migrate to SPDX license identifier 2023-06-29 11:41:12 +02:00
Python Maint
c8f5c5be68 Rebuilt for Python 3.12 2023-06-13 20:57:10 +02:00
Fedora Release Engineering
105ff46f89 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-21 06:28:37 +00:00
Fedora Release Engineering
d910ad63d3 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-23 12:05:08 +00:00
Python Maint
bcce6fbbd2 Rebuilt for Python 3.11 2022-06-13 15:33:09 +02:00
Fedora Release Engineering
55fd48c0f1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-22 04:09:17 +00:00
9 changed files with 59 additions and 445 deletions

5
plans/ci.fmf Normal file
View file

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

View file

@ -1,60 +0,0 @@
#!/bin/bash
#
# File: ./tests/Regression/bz1841869-pwd-from-tty/runtest.sh
# Author: Jiří Kučera <jkucera AT redhat.com>
# Brief: Test whether the passphrase is read from tty properly
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2021 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
TEST="${TEST:-/CoreOS/volume_key/tests/Regression/bz1841869-pwd-from-tty}"
TESTVERSION="${TESTVERSION:-1.0}"
PACKAGES="${PACKAGES:-volume_key}"
REQUIRES="${REQUIRES:-gcc cryptsetup nss-tools expect tcllib}"
_PASSPHRASE="t0pS3cr31!"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm --all
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "cp -v vk_wrap.c ${TmpDir}" 0 "Copying vk_wrap.c"
rlRun "cp -v vk_dummy.c ${TmpDir}" 0 "Copying vk_dummy.c"
rlRun "pushd ${TmpDir}"
rlRun "gcc --std=c99 -pedantic -W -Wall -Werror -o vk_wrap vk_wrap.c" 0 \
"Compiling vk_wrap.c"
rlRun "gcc --std=c99 -pedantic -W -Wall -Werror -o vk_dummy vk_dummy.c" 0 \
"Compiling vk_dummy.c"
rlPhaseEnd
rlPhaseStartTest
_PARAMS="VK_WRAP_PROGAM=${TmpDir}/vk_dummy"
_PARAMS="${_PARAMS} VK_WRAP_PASSPHRASE=${_PASSPHRASE}"
rlRun "${_PARAMS} ${TmpDir}/vk_wrap" 0 "Run volume_key via wrapper"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -rfd $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,185 +0,0 @@
/*
* File: ./tests/Regression/bz1841869-pwd-from-tty/vk_dummy.c
* Author: Jiří Kučera <jkucera AT redhat.com>
* Brief: Dummy volume_key (only request passphrase)
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* Copyright (C) 2021 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <sys/types.h>
#include <sys/stat.h>
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <limits.h>
#include <string.h>
#include <termios.h>
#include <fcntl.h>
#include <unistd.h>
struct ditem {
char *message;
struct ditem *next;
};
struct diagnose {
struct ditem *head, *tail;
};
static int diagnose_append(struct diagnose *diagnose, char *message)
{
struct ditem *p = NULL;
if ((p = malloc(sizeof(struct ditem))) == NULL)
return -1;
p->message = message;
p->next = NULL;
if (diagnose->head == NULL)
diagnose->head = diagnose->tail = p;
else {
diagnose->tail->next = p;
diagnose->tail = p;
}
return 0;
}
static void diagnose_dispose(struct diagnose *diagnose)
{
struct ditem *p = NULL, *t = NULL;
for (p = diagnose->head; (t = p); p = p->next, free(t))
free(t->message);
diagnose->head = diagnose->tail = NULL;
}
static void diagnose_show(struct diagnose *diagnose)
{
struct ditem *p = NULL;
fputs("=== Diagnose ===\n", stderr);
for (p = diagnose->head; p; p = p->next)
fprintf(sdterr, "- %s\n", p->message ? p->message : "(null)");
fputs("================\n", stderr);
}
static void log_read(int nread, struct diagnose *diagnose)
{
char *s = NULL;
if (nread < 0) {
switch (errno) {
case EINTR:
diagnose_append(diagnose, strdup("(EINTR)"));
break;
case EAGAIN:
diagnose_append(diagnose, strdup("(EAGAIN)"));
break;
default:
if (asprintf(&s, "(%s)", strerror(errno)) < 0)
s = NULL;
diagnose_append(diagnose, s);
break;
}
}
else if (nread == 0)
diagnose_append(diagnose, strdup("(EOF)"));
else {
if (asprintf(&s, "Read %d bytes.", nread) < 0)
s = NULL;
diagnose_append(diagnose, s);
}
}
static char *get_password(const char *prompt, struct diagnose *diagnose)
{
int tty = -1, in_file = -1, out_file = -1, echo_disabled = 0;
int nread = 0, tread = 0;
char buf[LINE_MAX + 1], *p = NULL;
struct termios otermios;
if ((tty = open("/dev/tty", O_RDONLY, 0)) < 0) {
in_file = STDIN_FILENO;
out_file = STDERR_FILENO;
}
else
out_file = in_file = tty;
write(out_file, prompt, strlen(prompt));
if (tcgetattr(in_file, &otermios) == 0) {
struct termios ntermios;
ntermios = otermios;
ntermios.c_lflag &= ~ECHO;
echo_disabled = tcsetattr(in_file, TCSAFLUSH, &ntermios) == 0;
}
while (tread < LINE_MAX) {
nread = read(in_file, buf + tread, LINE_MAX - tread);
log_read(nread, diagnose);
if (nread < 0) {
if (errno == EINTR || errno == EAGAIN)
continue;
break;
}
else if (nread == 0)
break;
tread += nread;
}
buf[tread] = '\0';
if (echo_disabled) {
tcsetattr(in_file, TCSAFLUSH, &otermios);
write(out_file, "\n", 1);
}
if (tty >= 0)
close(tty);
if (nread < 0)
return NULL;
p = strchr(buf, '\r');
if (p != NULL)
*p = '\0';
p = strchr(buf, '\n');
if (p != NULL)
*p = '\0';
return strdup(buf);
}
int main(void)
{
struct diagnose diagnose = {NULL, NULL};
char *passphrase = NULL, *s = NULL;
passphrase = get_password("Please, enter the passphrase: ", &diagnose);
if (asprintf(&s, "The passphrase is: %s", passphrase) < 0)
s = NULL;
free(passphrase);
diagnose_append(&diagnose, s);
diagnose_show(&diagnose);
diagnose_dispose(&diagnose);
return EXIT_SUCCESS;
}

View file

@ -1,179 +0,0 @@
/*
* File: ./tests/Regression/bz1841869-pwd-from-tty/vk_wrap.c
* Author: Jiří Kučera <jkucera AT redhat.com>
* Brief: Run volume_key, emulate EINTR and EAGAIN
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* Copyright (C) 2021 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <string.h>
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
enum emultypes {
NO_EMUL,
EINTR_EMUL,
EAGAIN_EMUL
};
static void error(const char *format, ...)
{
va_list args;
va_start(args, format);
vfprintf(stderr, format, args);
va_end(args);
}
static char *get_env(const char *name, int optional)
{
char *p = getenv(name);
if (!optional && (p == NULL || *p == '\0'))
return (error("Environment variable %s is not set!\n", name), NULL);
return p;
}
static int get_emul_type(void)
{
char *p = get_env("VK_WRAP_EMULATE", 1);
if (p == NULL)
return NO_EMUL;
else if (strcmp(p, "EINTR") == 0)
return EINTR_EMUL;
else if (strcmp(p, "EAGAIN") == 0)
return EAGAIN_EMUL;
return NO_EMUL;
}
static void close_pipe(int pipefd[2])
{
close(pipefd[0]);
close(pipefd[1]);
}
static void freeargs(char **args)
{
char **p = args;
if (!p)
return;
while (*p)
free(*p++);
free(args);
}
static char **mkargs(const *program, int argc, char **argv)
{
char **args = NULL;
size_t args_size = (argc + 1) * sizeof(*args);
int i = 0;
if ((args = malloc(args_size)) == NULL)
return NULL;
memset(args, '\0', args_size);
if ((args[0] = strdup(program)) == NULL)
return (freeargs(args), NULL);
for (i = 1; i < argc; i++)
if ((args[i] = strdup(argv[i])) == NULL)
return (freeargs(args), NULL);
return args;
}
int main(int argc, char *argv[])
{
char *program = NULL, *passphrase = NULL;
int emultype = NO_EMUL, cpid = 0, pipefd[2];
if ((program = get_env("VK_WRAP_PROGRAM", 0)) == NULL)
return EXIT_FAILURE;
if ((passphrase = get_env("VK_WRAP_PASSPHRASE", 0)) == NULL)
return EXIT_FAILURE;
emultype = get_emul_type();
if (pipe(pipefd) < 0)
return (perror("pipe"), EXIT_FAILURE);
/* Set non-blocking reading only if we emulate EAGAIN */
if (emultype == EAGAIN_EMUL && fcntl(pipefd[0], F_SETFL, O_NONBLOCK) < 0)
return (perror("fcntl"), close_pipe(pipefd), EXIT_FAILURE);
cpid = fork();
if (cpid < 0)
return (perror("fork"), close_pipe(pipefd), EXIT_FAILURE);
if (cpid == 0) {
char **args = NULL;
/* We are in the child, close the writing end of the pipe */
close(pipefd[1]);
/* Map the reading end of the pipe to standard input */
if (pipefd[0] != STDIN_FILENO) {
if (dup2(pipefd[0], STDIN_FILENO) < 0)
return (perror("dup2"), close(pipefd[0]), EXIT_FAILURE);
close(pipefd[0]);
}
/* Copy the program arguments */
if ((args = mkargs(program, argc, argv)) == NULL)
return (perror("mkargs"), EXIT_FAILURE);
/* Replace the current process image with the program */
if (execv(args[0], args) < 0)
return (perror("execv"), freeargs(args), EXIT_FAILURE);
}
/* We are in the parent, close the reading end of the pipe */
close(pipefd[0]);
switch (emultype) {
case EINTR_EMUL:
/* Hopefully this emulate EINTR */
sleep(2); /* Wait for the child to enter read */
/* Now child is inside kernel space, send it the signal */
kill(cpid, SIGSTOP);
sleep(1); /* Wait a bit */
/* Resume child */
kill(cpid, SIGCONT);
break;
case EAGAIN_EMUL:
/* Delay writing the passphrase. When the child read from an empty pipe
in the non-blocking mode, read() returns -1 and sets errno to EAGAIN
*/
sleep(3);
break;
default:
break;
}
/* Write the passphrase */
if (write(pipefd[1], passphrase, strlen(passphrase)) < 0)
perror("write");
if (write(pipefd[1], "\n", 1) < 0)
perror("write");
close(pipefd[1]); /* Reader will see EOF */
/* Wait for the child to finish */
waitpid(cpid, NULL, 0);
return EXIT_SUCCESS;
}

View file

@ -11,6 +11,6 @@ require:
- nss-tools
- expect
- tcllib
framework: beakerlib
test: ./runtest.sh
duration: 10m
tier: 1

View file

@ -28,7 +28,6 @@
_TESTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
# Include Beaker environment
. /usr/bin/rhts-environment.sh || exit 1
. /usr/share/beakerlib/beakerlib.sh || exit 1
# Include utils

View file

@ -1,14 +0,0 @@
---
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
- container
fmf_filter: "tier: 1"
required_packages:
- volume_key
- cryptsetup
- expect
- tcllib
- nss-tools

View file

@ -32,8 +32,8 @@
Summary: An utility for manipulating storage encryption keys and passphrases
Name: volume_key
Version: 0.3.12
Release: 14%{?dist}
License: GPLv2
Release: 29%{?dist}
License: GPL-2.0-only AND (MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later)
URL: https://pagure.io/%{name}/
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@ -44,10 +44,12 @@ Patch0: volume_key-0.3.12-support_LUKS2_and_more.patch
# Fix resource leaks
# - backport of bf6618ec0b09b4e51fc97fa021e687fbd87599ba
Patch1: volume_key-0.3.12-fix_resource_leaks.patch
BuildRequires: autoconf, automake, libtool
BuildRequires: make
BuildRequires: gcc
BuildRequires: cryptsetup-devel, gettext-devel, glib2-devel, /usr/bin/gpg2
BuildRequires: gpgme-devel, libblkid-devel, nss-devel, python3-devel
BuildRequires: gpgme-devel, libblkid-devel, nss-devel
BuildRequires: python3-devel, python3-setuptools
%if 0%{?drop_python2} < 1
BuildRequires: python2-devel
%endif
@ -118,8 +120,9 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch -P0 -p1
%patch -P1 -p1
autoreconf -fiv
%build
%configure %{?with_pythons}
@ -170,6 +173,51 @@ exit 1; \
%endif
%changelog
* Tue Nov 11 2025 Michal Hlavinka <mhlavink@redhat.com> - 0.3.12-29
- rebuild for gpgme 2.0
* Fri Sep 19 2025 Python Maint <python-maint@redhat.com> - 0.3.12-28
- Rebuilt for Python 3.14.0rc3 bytecode
* Fri Aug 15 2025 Python Maint <python-maint@redhat.com> - 0.3.12-27
- Rebuilt for Python 3.14.0rc2 bytecode
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Mon Jun 02 2025 Python Maint <python-maint@redhat.com> - 0.3.12-25
- Rebuilt for Python 3.14
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 0.3.12-22
- Rebuilt for Python 3.13
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 0.3.12-19
- Rebuilt for Python 3.12
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.3.12-16
- Rebuilt for Python 3.11
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Aug 04 2021 Jiri Kucera <jkucera@redhat.com> - 0.3.12-14
- Fix FTBFS
- Move License tag back to GPLv2 (this is the effective license)