Index: common-src/krb5-security.c
===================================================================
--- common-src/krb5-security.c  (revision 3343)
+++ common-src/krb5-security.c  (working copy)
@@ -42,6 +42,9 @@
 #include "stream.h"
 #include "sockaddr-util.h"
 
+#define xstr(s) str(s)
+#define str(s) #s
+
 #ifdef KRB5_HEIMDAL_INCLUDES
 #include "com_err.h"
 #endif
@@ -70,7 +73,7 @@
 #include <krb5.h>
 
 #ifndef KRB5_ENV_CCNAME
-#define KRB5_ENV_CCNAME "KRB5CCNAME"
+#define KRB5_ENV_CCNAME KRB5CCNAME
 #endif
 
 /*
@@ -711,7 +714,7 @@
     beenhere = 1;
 
 #ifndef BROKEN_MEMORY_CCACHE
-    putenv(stralloc("KRB5_ENV_CCNAME=MEMORY:amanda_ccache"));
+    putenv(stralloc(xstr(KRB5_ENV_CCNAME=MEMORY:amanda_ccache));
 #else
     /*
      * MEMORY ccaches seem buggy and cause a lot of internal heap
@@ -726,7 +729,7 @@
        char *ccache;
        ccache = malloc(128);
        g_snprintf(ccache, SIZEOF(ccache),
-                "KRB5_ENV_CCNAME=FILE:/tmp/amanda_ccache.%ld.%ld",
+                xstr(KRB5_ENV_CCNAME=FILE:/tmp/amanda_ccache.%ld.%ld),
                 (long)geteuid(), (long)getpid());
        putenv(ccache);
     }
@@ -884,7 +887,7 @@
     }
 
     if ((ret = krb5_cc_default(context, &ccache)) != 0) {
-       error = vstrallocf(_("error initializing ccache: %s"), error_message(ret));
+       error = vstrallocf(_("error resolving ccache: %s"), error_message(ret));
        goto cleanup;
     }
     if ((ret = krb5_cc_initialize(context, ccache, client)) != 0) {
