X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=userdir_gpg.py;h=455ba3fd60e99e5dc2d4d9d75a6aafc05ad800c7;hb=6730238ac1007b899b87675301db3a01dfece0da;hp=6319d583e59e7645b376bf3fa83a758f526bede5;hpb=701528fc8153f150dae52787cca172d8ab4f4bfb;p=mirror%2Fuserdir-ldap.git diff --git a/userdir_gpg.py b/userdir_gpg.py index 6319d58..455ba3f 100644 --- a/userdir_gpg.py +++ b/userdir_gpg.py @@ -1,5 +1,19 @@ - #!/usr/bin/env python -# -*- mode: python -*- +# Copyright (c) 1999-2001 Jason Gunthorpe +# Copyright (c) 2005 Joey Schulze +# +# 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., 675 Mass Ave, Cambridge, MA 02139, USA. # GPG issues - # - gpgm with a status FD being fed keymaterial and other interesting @@ -18,8 +32,12 @@ import rfc822, time, fcntl, FCNTL, anydbm # General GPG options GPGPath = "gpg" # "--load-extension","rsa", -GPGBasicOptions = ["--no-options","--batch", - "--no-default-keyring","--always-trust"]; +GPGBasicOptions = [ + "--no-options", + "--batch", + "--no-default-keyring", + "--secret-keyring", "/dev/null", + "--always-trust"]; GPGKeyRings = []; GPGSigOptions = ["--output","-"]; GPGSearchOptions = ["--dry-run","--with-colons","--fingerprint"]; @@ -407,6 +425,11 @@ def GPGKeySearch(SearchCriteria): Owner = ""; KeyID = ""; Hits = {}; + + dir = os.path.expanduser("~/.gnupg") + if not os.path.isdir(dir): + os.mkdir(dir, 0700) + try: Strm = os.popen(string.join(Args," "),"r");