I'm all for changing error messages - searching the source for error
messages is an underutilized debugging technique!

Dustin

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
@@ -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

I don't see the point of doing this - why not just use C's normal
string-concatenation:

-    putenv(stralloc("KRB5_ENV_CCNAME=MEMORY:amanda_ccache"));
+    putenv(stralloc(KRB5_ENV_CCNAME "=MEMORY:amanda_ccache"));

@@ -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);
     }

Same thing here.

Dustin

-- 
Open Source Storage Engineer
http://www.zmanda.com

Reply via email to