[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postfix-users
Subject:    Re: postfix tls deploy-server-cert fails with "can't shift that many"
From:       postfix-users () vintagesfinewine ! com
Date:       2020-05-30 15:59:44
Message-ID: f8a3d6067039d14096ee0cfaa378d89e () vintagesfinewine ! com
[Download RAW message or body]

On 2020-05-30 09:42, Wietse Venema wrote:
> postfix-users@vintagesfinewine.com:
>> 
>> I've run into a problem with one of the postfix tls scripts.
>> 
>> Attempting to deploy server certificates with
>> # postfix tls deploy-server-cert certificate.crt keyfile.key
>> 
>> Expected to deploy new certificates
>> 
>> What happened - command fails with
>>       /usr/lib/postfix/sbin/postfix-tls-script: 780: shift: can't 
>> shift
>> that many
>> 
>> 
>> 
>> Reproducing this doesn't need a lot of pre-setup:
>> # apt install postfix ssl-cert
>> # postfix tls deploy-server-cert /etc/ssl/certs/ssl-cert-snakeoil.pem
>> /etc/ssl/private/ssl-cert-snakeoil.key
>> /usr/lib/postfix/sbin/postfix-tls-script: 780: shift: can't shift that
>> many
> 
> Below is a patch. I find that the handling of this differ a lot
> among shell implementations, from terminating to ignoring.
> 
> 	Wietse
> 
> diff -ur /var/tmp/postfix-3.6-20200523/conf/postfix-tls-script
> conf/postfix-tls-script
> --- /var/tmp/postfix-3.6-20200523/conf/postfix-tls-script	2017-02-18
> 20:58:20.000000000 -0500
> +++ conf/postfix-tls-script	2020-05-30 10:37:04.000000000 -0400
> @@ -777,7 +777,7 @@
>  deploy_server_cert() {
>      certfile=$1; shift
>      keyfile=$1; shift
> -    deploy=$1; shift
> +    case $# in 0) deploy=;; *) deploy=$1; shift;; esac
> 
>      # Sets key_algo, key_param and cert_param
>      check_key "$keyfile" || return 1

Works perfectly.  Thank you!

=>Robert
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic