From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mail.saout.de (Postfix) with ESMTP for ; Mon, 28 Sep 2009 20:51:59 +0200 (CEST) Message-ID: <4AC105CC.4080209@redhat.com> Date: Mon, 28 Sep 2009 20:51:56 +0200 From: Milan Broz MIME-Version: 1.0 References: <1253863271-17642-1-git-send-email-ludwig.nussel@suse.de> In-Reply-To: <1253863271-17642-1-git-send-email-ludwig.nussel@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] [PATCH] When reading no single byte for the key abort. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ludwig Nussel Cc: dm-crypt@saout.de Ludwig Nussel wrote: > Allows keyscripts that pipe into cryptsetup to quit due to e.g. a > timeout or user pressing ^D. > @@ -490,6 +490,8 @@ void get_key(char *prompt, char **key, unsigned int *passLen, int key_size, > } > if(key_file) > close(fd); > + if(!i) // we didn't read anything, user pressed ^D? > + goto out_err; there are two situations which with this patch fails now: if the key-file is empty (but regular) file, it should not fail here, I mean: touch empty cryptsetup luksOpen ... --key-file=empty You probably mean to fix only this situation (it should fail if piped input is closed and not try empty passphrase) $(sleep 1) | cryptsetup luksOpen ... I committed modified patch (see svn), please verify that it fixes reported problem. Thanks, Milan -- mbroz@redhat.com