oab-java6 icon indicating copy to clipboard operation
oab-java6 copied to clipboard

Autogenerated GPG key export failed if hostname was changed later

Open albenik opened this issue 11 years ago • 3 comments

This line just checked for gpg database files exists not for valid keys inside: if [ -n "${BUILD_KEY}" ] || [ -e ${WORK_PATH}/gpg/pubring.gpg ] && [ -e ${WORK_PATH}/gpg/secring.gpg ] && [ -e ${WORK_PATH}/gpg/trustdb.gpg ]; then

But next command try to export keys related to hostname: gpg --homedir ${WORK_PATH}/gpg --export -a "hostname --fqdn" > ${WORK_PATH}/deb/pubkey.asc

So no key exported if hostname was changed after initial keys generation

albenik avatar Oct 03 '12 06:10 albenik

I encountered this issue and fixed it by regenerating the gpg key: gpg --gen-key

tomcashman avatar Nov 07 '12 12:11 tomcashman

@tomcashman Thanks for the solution! Of course I fixed this issue too, I just simle deleted autogenerated keys from ${WORK_PATH} and re-run a script But the main idea of this issue is unclear behavior and log message in described situation

albenik avatar Nov 20 '12 12:11 albenik

Maybe try to export first and if it fails then generate the key?

shinji257 avatar Jan 18 '14 17:01 shinji257