blob: 9c951c3e4b485b827d70773192a73d31ae721293 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
--- crypt/keymgmt.c.orig 1993-08-17 21:56:14 UTC
+++ crypt/keymgmt.c
@@ -495,11 +495,24 @@ BOOLEAN getKey( const BOOLEAN isPemKey,
FD keyFileFD, savedInFD = getInputFD();
BOOLEAN matched, firstTime = TRUE;
char *matchID, firstChar;
- char *keyFilePath;
+ char *keyFilePath, *s;
int userIDlength, i;
+#ifdef __UNIX__
+ char *h, buf[ MAX_PATH ];
+#endif
+ if ((s = getenv( PGPPATH )) == NULL)
+#ifdef __UNIX__
+ if ((h = getenv( "HOME" )) != NULL) {
+ strcpy(buf, h);
+ strcat(buf, "/.pgp");
+ s = buf;
+ }
+#else
+ ;
+#endif
/* Use the keyID to get the public key from a key file */
- keyFilePath = getFirstKeyPath( getenv( PGPPATH ), keyFileName );
+ keyFilePath = getFirstKeyPath( s, keyFileName );
while( keyFilePath != NULL )
{
/* Open key file */
|