forked from pool/cryptsetup
checked in (request 29937)
OBS-URL: https://build.opensuse.org/package/show/security/cryptsetup?expand=0&rev=34
This commit is contained in:
parent
6658141e6e
commit
c007e95de9
@ -1,42 +0,0 @@
|
||||
From 6b92a27195e21e9d96ce2f324c3da593a01a7ae0 Mon Sep 17 00:00:00 2001
|
||||
From: Ludwig Nussel <ludwig.nussel@suse.de>
|
||||
Date: Tue, 29 Sep 2009 11:09:31 +0200
|
||||
Subject: [PATCH] Fail if piped input is broken.
|
||||
|
||||
---
|
||||
ChangeLog | 1 +
|
||||
lib/utils.c | 13 ++++++++++---
|
||||
2 files changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: cryptsetup-1.0.7/lib/utils.c
|
||||
===================================================================
|
||||
--- cryptsetup-1.0.7.orig/lib/utils.c
|
||||
+++ cryptsetup-1.0.7/lib/utils.c
|
||||
@@ -361,6 +361,7 @@ int get_key(char *prompt, char **key, un
|
||||
char *pass = NULL;
|
||||
int newline_stop;
|
||||
int read_horizon;
|
||||
+ int regular_file = 0;
|
||||
|
||||
if(key_file && !strcmp(key_file, "-")) {
|
||||
/* Allow binary reading from stdin */
|
||||
@@ -435,6 +436,8 @@ int get_key(char *prompt, char **key, un
|
||||
// goto out_err;
|
||||
fprintf(stderr,"Warning: exhausting read requested, but key file is not a regular file, function might never return.\n");
|
||||
}
|
||||
+ else
|
||||
+ regular_file = 1;
|
||||
}
|
||||
buflen = 0;
|
||||
for(i = 0; read_horizon == 0 || i < read_horizon; i++) {
|
||||
@@ -452,6 +455,10 @@ int get_key(char *prompt, char **key, un
|
||||
}
|
||||
if(key_file)
|
||||
close(fd);
|
||||
+ /* Fail if piped input dies reading nothing */
|
||||
+ if(!i && !regular_file) {
|
||||
+ goto out_err;
|
||||
+ }
|
||||
pass[i] = 0;
|
||||
*key = pass;
|
||||
*passLen = i;
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package cryptsetup (Version 1.0.7)
|
||||
# spec file for package cryptsetup (Version 1.1.0)
|
||||
#
|
||||
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
# norootforbuild
|
||||
|
||||
|
||||
Name: cryptsetup
|
||||
Url: http://code.google.com/p/cryptsetup/
|
||||
BuildRequires: device-mapper-devel e2fsprogs-devel libgcrypt-devel popt-devel
|
||||
@ -25,18 +26,18 @@ BuildRequires: libselinux-devel
|
||||
%define haver 0.3
|
||||
# boot.crypto version
|
||||
%define bcver 0_200911271000
|
||||
License: BSD 3-clause (or similar) ; GPL v2 only ; GPL v2 or later
|
||||
License: BSD3c(or similar) ; GPLv2 ; GPLv2+
|
||||
Group: System/Base
|
||||
AutoReqProv: on
|
||||
Version: 1.1.0
|
||||
Release: 0
|
||||
Release: 1
|
||||
Summary: Set Up dm-crypt Based Encrypted Block Devices
|
||||
Source: http://cryptsetup.googlecode.com/files/cryptsetup-%{version}.tar.bz2
|
||||
Source1: http://cryptsetup.googlecode.com/files/cryptsetup-%{version}.tar.bz2.asc
|
||||
Source2: baselibs.conf
|
||||
Source10: hashalot-%haver.tar.bz2
|
||||
Source10: hashalot-%haver.tar.bz2
|
||||
# git://gitorious.org/opensuse/boot_crypto.git
|
||||
Source20: boot.crypto-%{bcver}.tar.bz2
|
||||
Source20: boot.crypto-%{bcver}.tar.bz2
|
||||
# use this to create the tarball from svn
|
||||
Source99: cryptsetup-mktar
|
||||
#Patch0: cryptsetup-svn131-noascii.diff
|
||||
@ -70,7 +71,7 @@ Authors:
|
||||
Ben Slusky <sluskyb@paranoiacs.org>
|
||||
|
||||
%package -n libcryptsetup1
|
||||
License: GPL v2 or later
|
||||
License: GPLv2+
|
||||
Summary: Set Up dm-crypt Based Encrypted Block Devices
|
||||
Group: System/Base
|
||||
|
||||
@ -90,7 +91,7 @@ Authors:
|
||||
Ben Slusky <sluskyb@paranoiacs.org>
|
||||
|
||||
%package -n libcryptsetup-devel
|
||||
License: GPL v2 or later
|
||||
License: GPLv2+
|
||||
Summary: Set Up dm-crypt Based Encrypted Block Devices
|
||||
Group: Development/Libraries/C and C++
|
||||
# cryptsetup-devel last used 11.1
|
||||
|
Loading…
Reference in New Issue
Block a user