Index: openafs/src/JAVA/libjafs/File.c
diff -c openafs/src/JAVA/libjafs/File.c:1.4 openafs/src/JAVA/libjafs/File.c:1.4.4.1
*** openafs/src/JAVA/libjafs/File.c:1.4	Fri Oct 14 22:12:24 2005
--- openafs/src/JAVA/libjafs/File.c	Tue Apr 10 14:39:44 2007
***************
*** 168,174 ****
          return JNI_TRUE;   /* not really an error */
        } else {
          fprintf(stderr, "File::setAttributes(): uafs_statmountpoint failed "
!                         "for %s (%s)\n", dirName, error_message(errno));
          return JNI_FALSE;
        }
      }
--- 168,174 ----
          return JNI_TRUE;   /* not really an error */
        } else {
          fprintf(stderr, "File::setAttributes(): uafs_statmountpoint failed "
!                         "for %s (%s)\n", dirName, afs_error_message(errno));
          return JNI_FALSE;
        }
      }
***************
*** 208,214 ****
          }
          fprintf(stderr, 
              "File::setAttributes(): uafs_stat failed for %s (%s)\n", 
!              dirName, error_message(errno));
          return JNI_FALSE;
        }
      }
--- 208,214 ----
          }
          fprintf(stderr, 
              "File::setAttributes(): uafs_stat failed for %s (%s)\n", 
!              dirName, afs_error_message(errno));
          return JNI_FALSE;
        }
      }
***************
*** 427,433 ****
      dirp = uafs_opendir(dirName);
      if(dirp == NULL) {
        fprintf(stderr, "File::listNative(): uafs_opendir(%s) failed(%s)\n",
!                        dirName, error_message(errno));
        setError(env, &obj, errno);
        //throwAFSSecurityException( env, errno );
        return 0;
--- 427,433 ----
      dirp = uafs_opendir(dirName);
      if(dirp == NULL) {
        fprintf(stderr, "File::listNative(): uafs_opendir(%s) failed(%s)\n",
!                        dirName, afs_error_message(errno));
        setError(env, &obj, errno);
        //throwAFSSecurityException( env, errno );
        return 0;
Index: openafs/src/WINNT/afsd/afsd_init.c
diff -c openafs/src/WINNT/afsd/afsd_init.c:1.79.2.11 openafs/src/WINNT/afsd/afsd_init.c:1.79.2.12
*** openafs/src/WINNT/afsd/afsd_init.c:1.79.2.11	Wed Mar  7 13:14:05 2007
--- openafs/src/WINNT/afsd/afsd_init.c	Mon Apr 16 20:06:25 2007
***************
*** 136,142 ****
  void
  afsi_start()
  {
!     char wd[256];
      char t[100], u[100], *p, *path;
      int zilch;
      DWORD code;
--- 136,142 ----
  void
  afsi_start()
  {
!     char wd[MAX_PATH+1];
      char t[100], u[100], *p, *path;
      int zilch;
      DWORD code;
***************
*** 146,158 ****
      DWORD maxLogSize = 100 * 1024;
  
      afsi_file = INVALID_HANDLE_VALUE;
!     code = GetEnvironmentVariable("TEMP", wd, sizeof(wd));
!     if ( code == 0 || code > sizeof(wd) )
!     {
!         code = GetWindowsDirectory(wd, sizeof(wd));
!         if (code == 0) 
!             return;
!     }
      StringCbCatA(wd, sizeof(wd), "\\afsd_init.log");
      GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));
      afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL,
--- 146,155 ----
      DWORD maxLogSize = 100 * 1024;
  
      afsi_file = INVALID_HANDLE_VALUE;
!     code = GetTempPath(sizeof(wd)-15, wd);
!     if ( code == 0 || code > (sizeof(wd)-15) )
!         return;         /* unable to create a log */
! 
      StringCbCatA(wd, sizeof(wd), "\\afsd_init.log");
      GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));
      afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL,
Index: openafs/src/WINNT/afsd/afskfw.c
diff -c openafs/src/WINNT/afsd/afskfw.c:1.28.4.4 openafs/src/WINNT/afsd/afskfw.c:1.28.4.8
*** openafs/src/WINNT/afsd/afskfw.c:1.28.4.4	Tue Apr  3 10:50:40 2007
--- openafs/src/WINNT/afsd/afskfw.c	Wed Apr 18 11:59:35 2007
***************
*** 871,879 ****
  int
  KFW_get_ccache(krb5_context alt_ctx, krb5_principal principal, krb5_ccache * cc)
  {
!     krb5_context ctx;
!     char * pname = 0;
!     char * ccname = 0;
      krb5_error_code code;
  
      if (!pkrb5_init_context)
--- 871,879 ----
  int
  KFW_get_ccache(krb5_context alt_ctx, krb5_principal principal, krb5_ccache * cc)
  {
!     krb5_context ctx = NULL;
!     char * pname = NULL;
!     char * ccname = NULL;
      krb5_error_code code;
  
      if (!pkrb5_init_context)
***************
*** 916,924 ****
  void
  KFW_import_windows_lsa(void)
  {
!     krb5_context ctx = 0;
!     krb5_ccache  cc = 0;
!     krb5_principal princ = 0;
      char * pname = NULL;
      krb5_data *  princ_realm;
      krb5_error_code code;
--- 916,924 ----
  void
  KFW_import_windows_lsa(void)
  {
!     krb5_context ctx = NULL;
!     krb5_ccache  cc = NULL;
!     krb5_principal princ = NULL;
      char * pname = NULL;
      krb5_data *  princ_realm;
      krb5_error_code code;
***************
*** 1017,1030 ****
  void
  KFW_import_ccache_data(void)
  {
!     krb5_context ctx = 0;
!     krb5_ccache  cc = 0;
!     krb5_principal principal = 0;
      krb5_creds creds;
      krb5_error_code code;
      krb5_error_code cc_code;
      krb5_cc_cursor cur;
!     apiCB * cc_ctx = 0;
      struct _infoNC ** pNCi = NULL;
      int i, j, flags;
  
--- 1017,1030 ----
  void
  KFW_import_ccache_data(void)
  {
!     krb5_context ctx = NULL;
!     krb5_ccache  cc = NULL;
!     krb5_principal principal = NULL;
      krb5_creds creds;
      krb5_error_code code;
      krb5_error_code cc_code;
      krb5_cc_cursor cur;
!     apiCB * cc_ctx = NULL;
      struct _infoNC ** pNCi = NULL;
      int i, j, flags;
  
***************
*** 1214,1224 ****
                    char * smbname,
                    char ** reasonP )
  {
!     krb5_context ctx = 0;
!     krb5_ccache cc = 0;
!     char * realm = 0, * userrealm = 0;
!     krb5_principal principal = 0;
!     char * pname = 0;
      krb5_error_code code;
      char local_cell[MAXCELLCHARS+1];
      char **cells = NULL;
--- 1214,1224 ----
                    char * smbname,
                    char ** reasonP )
  {
!     krb5_context ctx = NULL;
!     krb5_ccache cc = NULL;
!     char * realm = NULL, * userrealm = NULL;
!     krb5_principal principal = NULL;
!     char * pname = NULL;
      krb5_error_code code;
      char local_cell[MAXCELLCHARS+1];
      char **cells = NULL;
***************
*** 1366,1373 ****
  int 
  KFW_AFS_destroy_tickets_for_cell(char * cell)
  {
!     krb5_context		ctx = 0;
!     krb5_error_code		code;
      int count;
      char ** principals = NULL;
  
--- 1366,1373 ----
  int 
  KFW_AFS_destroy_tickets_for_cell(char * cell)
  {
!     krb5_context	ctx = NULL;
!     krb5_error_code	code;
      int count;
      char ** principals = NULL;
  
***************
*** 1423,1441 ****
          }
          free(principals);
      }
!     pkrb5_free_context(ctx);
      return 0;
  }
  
  int 
  KFW_AFS_destroy_tickets_for_principal(char * user)
  {
!     krb5_context		ctx = 0;
!     krb5_error_code		code;
      int count;
      char ** cells = NULL;
!     krb5_principal      princ = 0;
!     krb5_ccache			cc  = 0;
  
      if (!pkrb5_init_context)
          return 0;
--- 1423,1442 ----
          }
          free(principals);
      }
!     if (ctx)
! 		pkrb5_free_context(ctx);
      return 0;
  }
  
  int 
  KFW_AFS_destroy_tickets_for_principal(char * user)
  {
!     krb5_context	ctx = NULL;
!     krb5_error_code	code;
      int count;
      char ** cells = NULL;
!     krb5_principal      princ = NULL;
!     krb5_ccache		cc  = NULL;
  
      if (!pkrb5_init_context)
          return 0;
***************
*** 1447,1453 ****
      }
  
      code = pkrb5_init_context(&ctx);
!     if (code) ctx = 0;
  
      code = pkrb5_parse_name(ctx, user, &princ);
      if (code) goto loop_cleanup;
--- 1448,1454 ----
      }
  
      code = pkrb5_init_context(&ctx);
!     if (code) return 0;
  
      code = pkrb5_parse_name(ctx, user, &princ);
      if (code) goto loop_cleanup;
***************
*** 1477,1492 ****
          free(cells);
      }
  
!     pkrb5_free_context(ctx);
      return 0;
  }
  
  int
  KFW_AFS_renew_expiring_tokens(void)
  {
!     krb5_error_code		        code = 0;
!     krb5_context		        ctx = 0;
!     krb5_ccache			        cc = 0;
      krb5_timestamp now;
      struct principal_ccache_data * pcc_next = princ_cc_data;
      int cell_count;
--- 1478,1494 ----
          free(cells);
      }
  
!     if (ctx)
! 		pkrb5_free_context(ctx);
      return 0;
  }
  
  int
  KFW_AFS_renew_expiring_tokens(void)
  {
!     krb5_error_code     code = 0;
!     krb5_context	ctx = NULL;
!     krb5_ccache		cc = NULL;
      krb5_timestamp now;
      struct principal_ccache_data * pcc_next = princ_cc_data;
      int cell_count;
***************
*** 1586,1593 ****
  BOOL
  KFW_AFS_renew_token_for_cell(char * cell)
  {
!     krb5_error_code		        code = 0;
!     krb5_context		        ctx = 0;
      int count;
      char ** principals = NULL;
  
--- 1588,1595 ----
  BOOL
  KFW_AFS_renew_token_for_cell(char * cell)
  {
!     krb5_error_code     code = 0;
!     krb5_context	ctx = NULL;
      int count;
      char ** principals = NULL;
  
***************
*** 1701,1707 ****
          code = -1;      // we did not renew the tokens 
  
    cleanup:
!     pkrb5_free_context(ctx);
      return (code ? FALSE : TRUE);
  
  }
--- 1703,1710 ----
          code = -1;      // we did not renew the tokens 
  
    cleanup:
!     if (ctx) 
! 		pkrb5_free_context(ctx);
      return (code ? FALSE : TRUE);
  
  }
***************
*** 1727,1739 ****
  int
  KFW_renew(krb5_context alt_ctx, krb5_ccache alt_cc)
  {
!     krb5_error_code		        code = 0;
!     krb5_context		        ctx = 0;
!     krb5_ccache			        cc = 0;
!     krb5_principal		        me = 0;
!     krb5_principal              server = 0;
!     krb5_creds			        my_creds;
!     krb5_data                   *realm = 0;
  
      if (!pkrb5_init_context)
          return 0;
--- 1730,1742 ----
  int
  KFW_renew(krb5_context alt_ctx, krb5_ccache alt_cc)
  {
!     krb5_error_code     code = 0;
!     krb5_context	ctx = NULL;
!     krb5_ccache		cc = NULL;
!     krb5_principal	me = NULL;
!     krb5_principal      server = NULL;
!     krb5_creds		my_creds;
!     krb5_data           *realm = NULL;
  
      if (!pkrb5_init_context)
          return 0;
***************
*** 1844,1855 ****
              DWORD                       publicIP
              )
  {
!     krb5_error_code		        code = 0;
!     krb5_context		        ctx = 0;
!     krb5_ccache			        cc = 0;
!     krb5_principal		        me = 0;
!     char*                       name = 0;
!     krb5_creds			        my_creds;
      krb5_get_init_creds_opt     options;
      krb5_address **             addrs = NULL;
      int                         i = 0, addr_count = 0;
--- 1847,1858 ----
              DWORD                       publicIP
              )
  {
!     krb5_error_code		code = 0;
!     krb5_context		ctx = NULL;
!     krb5_ccache			cc = NULL;
!     krb5_principal		me = NULL;
!     char*                       name = NULL;
!     krb5_creds			my_creds;
      krb5_get_init_creds_opt     options;
      krb5_address **             addrs = NULL;
      int                         i = 0, addr_count = 0;
***************
*** 2010,2017 ****
  int
  KFW_kdestroy(krb5_context alt_ctx, krb5_ccache alt_cc)
  {
!     krb5_context		ctx;
!     krb5_ccache			cc;
      krb5_error_code		code;
  
      if (!pkrb5_init_context)
--- 2013,2020 ----
  int
  KFW_kdestroy(krb5_context alt_ctx, krb5_ccache alt_cc)
  {
!     krb5_context		ctx = NULL;
!     krb5_ccache			cc = NULL;
      krb5_error_code		code;
  
      if (!pkrb5_init_context)
***************
*** 2640,2652 ****
      DWORD       CurrentState;
      char        HostName[64];
      BOOL        try_krb5 = 0;
!     krb5_context  ctx = 0;
!     krb5_ccache   cc = 0;
      krb5_creds increds;
!     krb5_creds * k5creds = 0;
      krb5_error_code code;
!     krb5_principal client_principal = 0;
!     krb5_data * k5data;
      int i, retry = 0;
  
      CurrentState = 0;
--- 2643,2655 ----
      DWORD       CurrentState;
      char        HostName[64];
      BOOL        try_krb5 = 0;
!     krb5_context  ctx = NULL;
!     krb5_ccache   cc = NULL;
      krb5_creds increds;
!     krb5_creds * k5creds = NULL;
      krb5_error_code code;
!     krb5_principal client_principal = NULL;
!     krb5_data * k5data = NULL;
      int i, retry = 0;
  
      CurrentState = 0;
***************
*** 3375,3387 ****
  
  BOOL KFW_probe_kdc(struct afsconf_cell * cellconfig)
  {
!     krb5_context ctx = 0;
!     krb5_ccache cc = 0;
      krb5_error_code code;
      krb5_data pwdata;
!     const char * realm = 0;
!     krb5_principal principal = 0;
!     char * pname = 0;
      char   password[PROBE_PASSWORD_LEN+1];
      BOOL serverReachable = 0;
  
--- 3378,3390 ----
  
  BOOL KFW_probe_kdc(struct afsconf_cell * cellconfig)
  {
!     krb5_context ctx = NULL;
!     krb5_ccache cc = NULL;
      krb5_error_code code;
      krb5_data pwdata;
!     const char * realm = NULL;
!     krb5_principal principal = NULL;
!     char * pname = NULL;
      char   password[PROBE_PASSWORD_LEN+1];
      BOOL serverReachable = 0;
  
***************
*** 3452,3462 ****
  BOOL
  KFW_AFS_get_lsa_principal(char * szUser, DWORD *dwSize)
  {
!     krb5_context   ctx = 0;
      krb5_error_code code;
!     krb5_ccache mslsa_ccache=0;
!     krb5_principal princ = 0;
!     char * pname = 0;
      BOOL success = 0;
  
      if (!KFW_is_available())
--- 3455,3465 ----
  BOOL
  KFW_AFS_get_lsa_principal(char * szUser, DWORD *dwSize)
  {
!     krb5_context   ctx = NULL;
      krb5_error_code code;
!     krb5_ccache mslsa_ccache=NULL;
!     krb5_principal princ = NULL;
!     char * pname = NULL;
      BOOL success = 0;
  
      if (!KFW_is_available())
***************
*** 3626,3636 ****
      char filename[MAX_PATH] = "";
      DWORD count;
      char cachename[MAX_PATH + 8] = "FILE:";
!     krb5_context		ctx = 0;
      krb5_error_code		code;
!     krb5_principal              princ = 0;
!     krb5_ccache			cc  = 0;
!     krb5_ccache                 ncc = 0;
  
      if (!pkrb5_init_context || !user || !szLogonId)
          return;
--- 3629,3639 ----
      char filename[MAX_PATH] = "";
      DWORD count;
      char cachename[MAX_PATH + 8] = "FILE:";
!     krb5_context		ctx = NULL;
      krb5_error_code		code;
!     krb5_principal              princ = NULL;
!     krb5_ccache			cc  = NULL;
!     krb5_ccache                 ncc = NULL;
  
      if (!pkrb5_init_context || !user || !szLogonId)
          return;
***************
*** 3651,3657 ****
      DeleteFile(filename);
  
      code = pkrb5_init_context(&ctx);
!     if (code) ctx = 0;
  
      code = pkrb5_parse_name(ctx, user, &princ);
      if (code) goto cleanup;
--- 3654,3660 ----
      DeleteFile(filename);
  
      code = pkrb5_init_context(&ctx);
!     if (code) goto cleanup;
  
      code = pkrb5_parse_name(ctx, user, &princ);
      if (code) goto cleanup;
***************
*** 3692,3702 ****
  KFW_AFS_copy_file_cache_to_default_cache(char * filename)
  {
      char cachename[MAX_PATH + 8] = "FILE:";
!     krb5_context		ctx = 0;
      krb5_error_code		code;
!     krb5_principal              princ = 0;
!     krb5_ccache			cc  = 0;
!     krb5_ccache                 ncc = 0;
      int retval = 1;
  
      if (!pkrb5_init_context || !filename)
--- 3695,3705 ----
  KFW_AFS_copy_file_cache_to_default_cache(char * filename)
  {
      char cachename[MAX_PATH + 8] = "FILE:";
!     krb5_context		ctx = NULL;
      krb5_error_code		code;
!     krb5_principal              princ = NULL;
!     krb5_ccache			cc  = NULL;
!     krb5_ccache                 ncc = NULL;
      int retval = 1;
  
      if (!pkrb5_init_context || !filename)
***************
*** 3705,3714 ****
      if ( strlen(filename) + sizeof("FILE:") > sizeof(cachename) )
          return 1;
  
-     strcat(cachename, filename);
- 
      code = pkrb5_init_context(&ctx);
!     if (code) ctx = 0;
  
      code = pkrb5_cc_resolve(ctx, cachename, &cc);
      if (code) goto cleanup;
--- 3708,3717 ----
      if ( strlen(filename) + sizeof("FILE:") > sizeof(cachename) )
          return 1;
  
      code = pkrb5_init_context(&ctx);
!     if (code) return 1;
! 
!     strcat(cachename, filename);
  
      code = pkrb5_cc_resolve(ctx, cachename, &cc);
      if (code) goto cleanup;
Index: openafs/src/WINNT/afsd/afslogon.c
diff -c openafs/src/WINNT/afsd/afslogon.c:1.45.2.9 openafs/src/WINNT/afsd/afslogon.c:1.45.2.11
*** openafs/src/WINNT/afsd/afslogon.c:1.45.2.9	Tue Apr  3 00:33:20 2007
--- openafs/src/WINNT/afsd/afslogon.c	Tue Apr 17 00:04:36 2007
***************
*** 45,53 ****
          return;
      
      h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
!     ptbuf[0] = a;
!     ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);
!     DeregisterEventSource(h);
  }
  
  #define MAXBUF_ 512
--- 45,55 ----
          return;
      
      h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
!     if (h != INVALID_HANDLE_VALUE) {
!         ptbuf[0] = a;
!         ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 1008, NULL, 1, 0, (const char **)ptbuf, NULL);
!         DeregisterEventSource(h);
!     }
  }
  
  #define MAXBUF_ 512
***************
*** 60,72 ****
          return;
  
      h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
!     va_start(marker,b);
!     StringCbVPrintf(buf, MAXBUF_+1,b,marker);
!     buf[MAXBUF_] = '\0';
!     ptbuf[0] = buf;
!     ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);
!     DeregisterEventSource(h);
!     va_end(marker);
  }
  
  static HANDLE hInitMutex = NULL;
--- 62,76 ----
          return;
  
      h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
!     if (h != INVALID_HANDLE_VALUE) {
!         va_start(marker,b);
!         StringCbVPrintf(buf, MAXBUF_+1,b,marker);
!         buf[MAXBUF_] = '\0';
!         ptbuf[0] = buf;
!         ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 1008, NULL, 1, 0, (const char **)ptbuf, NULL);
!         DeregisterEventSource(h);
!         va_end(marker);
!     }
  }
  
  static HANDLE hInitMutex = NULL;
***************
*** 315,335 ****
  		if(hkDom) { \
  			dwSize = sizeof(v); \
  			rv = RegQueryValueEx(hkDom, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \
! 			if(rv == ERROR_SUCCESS) DebugEvent(#v " found in hkDom with type [%d]", dwType); \
  		} \
! 		if(hkDoms && (rv != ERROR_SUCCESS || dwType != t)) { \
  			dwSize = sizeof(v); \
  			rv = RegQueryValueEx(hkDoms, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \
! 			if(rv == ERROR_SUCCESS) DebugEvent(#v " found in hkDoms with type [%d]", dwType); \
  		} \
! 		if(hkNp && (rv != ERROR_SUCCESS || dwType != t)) { \
  			dwSize = sizeof(v); \
  			rv = RegQueryValueEx(hkNp, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \
! 			if(rv == ERROR_SUCCESS) DebugEvent(#v " found in hkNp with type [%d]", dwType); \
  		} \
! 		if(rv != ERROR_SUCCESS || dwType != t) { \
  			v = d; \
! 			DebugEvent(#v " being set to default"); \
  		} \
  	} while(0)
  
--- 319,342 ----
  		if(hkDom) { \
  			dwSize = sizeof(v); \
  			rv = RegQueryValueEx(hkDom, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \
! 			if(rv == ERROR_SUCCESS || rv == ERROR_MORE_DATA) \
!                             DebugEvent(#v " found in hkDom with type [%d]", dwType); \
  		} \
! 		if(hkDoms && ((rv != ERROR_SUCCESS && rv != ERROR_MORE_DATA) || dwType != t)) { \
  			dwSize = sizeof(v); \
  			rv = RegQueryValueEx(hkDoms, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \
! 			if(rv == ERROR_SUCCESS || rv == ERROR_MORE_DATA) \
!                             DebugEvent(#v " found in hkDoms with type [%d]", dwType); \
  		} \
! 		if(hkNp && ((rv != ERROR_SUCCESS && rv != ERROR_MORE_DATA) || dwType != t)) { \
  			dwSize = sizeof(v); \
  			rv = RegQueryValueEx(hkNp, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \
! 			if(rv == ERROR_SUCCESS || rv == ERROR_MORE_DATA) \
!                             DebugEvent(#v " found in hkNp with type [%d]", dwType); \
  		} \
! 		if((rv != ERROR_SUCCESS && rv != ERROR_MORE_DATA) || dwType != t) { \
  			v = d; \
! 			DebugEvent0(#v " being set to default"); \
  		} \
  	} while(0)
  
***************
*** 398,404 ****
              hkDoms = NULL;
          }
      } else
!         DebugEvent("Not opening domain key");
  
      /* Each individual can either be specified on the domain key, the domains key or in the
         net provider key.  They fail over in that order.  If none is found, we just use the 
--- 405,411 ----
              hkDoms = NULL;
          }
      } else
!         DebugEvent0("Not opening domain key");
  
      /* Each individual can either be specified on the domain key, the domains key or in the
         net provider key.  They fail over in that order.  If none is found, we just use the 
***************
*** 485,491 ****
          strlwr(opt->smbName);
      }
  
!     DebugEvent("Looking up logon script");
      /* Logon script */
      /* First find out where the key is */
      hkTemp = NULL;
--- 492,498 ----
          strlwr(opt->smbName);
      }
  
!     DebugEvent0("Looking up logon script");
      /* Logon script */
      /* First find out where the key is */
      hkTemp = NULL;
***************
*** 495,514 ****
          rv = RegQueryValueExW(hkDom, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
      if(rv == ERROR_SUCCESS && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
          hkTemp = hkDom;
!         DebugEvent("Located logon script in hkDom");
      }
!     else if(hkDoms)
          rv = RegQueryValueExW(hkDoms, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
!     if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
!         hkTemp = hkDoms;
!         DebugEvent("Located logon script in hkDoms");
!     }
!     /* Note that the LogonScript in the NP key is only used if we are doing high security. */
!     else if(hkNp && ISHIGHSECURITY(opt->LogonOption))
!         rv = RegQueryValueExW(hkNp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
!     if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
!         hkTemp = hkNp;
!         DebugEvent("Located logon script in hkNp");
      }
  
      if(hkTemp) {
--- 502,523 ----
          rv = RegQueryValueExW(hkDom, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
      if(rv == ERROR_SUCCESS && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
          hkTemp = hkDom;
!         DebugEvent0("Located logon script in hkDom");
      }
!     else if(hkDoms) {
          rv = RegQueryValueExW(hkDoms, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
!         if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
!             hkTemp = hkDoms;
!             DebugEvent0("Located logon script in hkDoms");
!         }
!         /* Note that the LogonScript in the NP key is only used if we are doing high security. */
!         else if(hkNp && ISHIGHSECURITY(opt->LogonOption)) {
!             rv = RegQueryValueExW(hkNp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
!             if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
!                 hkTemp = hkNp;
!                 DebugEvent0("Located logon script in hkNp");
!             }
!         }
      }
  
      if(hkTemp) {
***************
*** 524,538 ****
          len ++;
  
          wuname = malloc(len * sizeof(WCHAR));
          MultiByteToWideChar(CP_ACP,0,opt->smbName,-1,wuname,(int)(len*sizeof(WCHAR)));
  
          DebugEvent("Username is set for [%S]", wuname);
  
          /* dwSize still has the size of the required buffer in bytes. */
          regscript = malloc(dwSize);
          rv = RegQueryValueExW(hkTemp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, (LPBYTE) regscript, &dwSize);
          if(rv != ERROR_SUCCESS) {/* what the ..? */
!             DebugEvent("Can't look up logon script [%d]",rv);
              goto doneLogonScript;
          }
  
--- 533,551 ----
          len ++;
  
          wuname = malloc(len * sizeof(WCHAR));
+         if (!wuname)
+             goto doneLogonScript;
          MultiByteToWideChar(CP_ACP,0,opt->smbName,-1,wuname,(int)(len*sizeof(WCHAR)));
  
          DebugEvent("Username is set for [%S]", wuname);
  
          /* dwSize still has the size of the required buffer in bytes. */
          regscript = malloc(dwSize);
+         if (!regscript)
+             goto doneLogonScript;
          rv = RegQueryValueExW(hkTemp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, (LPBYTE) regscript, &dwSize);
          if(rv != ERROR_SUCCESS) {/* what the ..? */
!             DebugEvent("Can't look up logon script rv [%d] size [%d] gle %d",rv, dwSize, GetLastError());
              goto doneLogonScript;
          }
  
***************
*** 543,554 ****
  
              dwSize += MAX_PATH * sizeof(WCHAR);  /* make room for environment expansion. */
              regexscript = malloc(dwSize);
              dwReq = ExpandEnvironmentStringsW(regscript, regexscript, dwSize / sizeof(WCHAR));
              free(regscript);
              regscript = regexscript;
              regexscript = NULL;
              if(dwReq > (dwSize / sizeof(WCHAR))) {
!                 DebugEvent("Overflow while expanding environment strings.");
                  goto doneLogonScript;
              }
          }
--- 556,569 ----
  
              dwSize += MAX_PATH * sizeof(WCHAR);  /* make room for environment expansion. */
              regexscript = malloc(dwSize);
+             if (!regexscript)
+                 goto doneLogonScript;
              dwReq = ExpandEnvironmentStringsW(regscript, regexscript, dwSize / sizeof(WCHAR));
              free(regscript);
              regscript = regexscript;
              regexscript = NULL;
              if(dwReq > (dwSize / sizeof(WCHAR))) {
!                 DebugEvent0("Overflow while expanding environment strings.");
                  goto doneLogonScript;
              }
          }
***************
*** 558,566 ****
--- 573,585 ----
          if(wcsstr(regscript, L"%s")) {
              dwSize += (DWORD)(len * sizeof(WCHAR)); /* make room for username expansion */
              regexuscript = (WCHAR *) LocalAlloc(LMEM_FIXED, dwSize);
+             if (!regexuscript)
+                 goto doneLogonScript;
              hr = StringCbPrintfW(regexuscript, dwSize, regscript, wuname);
          } else {
              regexuscript = (WCHAR *) LocalAlloc(LMEM_FIXED, dwSize);
+             if (!regexuscript)
+                 goto doneLogonScript;
              hr = StringCbCopyW(regexuscript, dwSize, regscript);
          }
  
***************
*** 577,621 ****
          if(regexscript) free(regexscript);
      }
  
!     DebugEvent("Looking up TheseCells");
!     /* Logon script */
      /* First find out where the key is */
      hkTemp = NULL;
      rv = ~ERROR_SUCCESS;
!     dwType = 0;
      if (hkDom)
          rv = RegQueryValueEx(hkDom, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize);
      if (rv == ERROR_SUCCESS && dwType == REG_MULTI_SZ) {
          hkTemp = hkDom;
!         DebugEvent("Located TheseCells in hkDom");
!     } else if (hkDoms)
          rv = RegQueryValueEx(hkDoms, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize);
!     if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_MULTI_SZ) {
!         hkTemp = hkDoms;
!         DebugEvent("Located TheseCells in hkDoms");
!     } else if (hkNp)
!         rv = RegQueryValueEx(hkNp, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize);
!     if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_MULTI_SZ) {
!         hkTemp = hkNp;
!         DebugEvent("Located TheseCells in hkNp");
      }
  
      if (hkTemp) {
!         CHAR * thesecells;
  
          /* dwSize still has the size of the required buffer in bytes. */
!         thesecells = malloc(dwSize);
!         rv = RegQueryValueEx(hkTemp, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, (LPBYTE) thesecells, &dwSize);
          if(rv != ERROR_SUCCESS) {/* what the ..? */
!             DebugEvent("Can't look up TheseCells [%d]",rv);
              goto doneTheseCells;
          }
  
          DebugEvent("Found TheseCells [%s]", thesecells);
          opt->theseCells = thesecells;
  
        doneTheseCells:
!         ;
      }
  
    cleanup:
--- 596,695 ----
          if(regexscript) free(regexscript);
      }
  
!     DebugEvent0("Looking up TheseCells");
!     /* TheseCells */
      /* First find out where the key is */
      hkTemp = NULL;
      rv = ~ERROR_SUCCESS;
!     dwSize = 0;
      if (hkDom)
          rv = RegQueryValueEx(hkDom, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize);
      if (rv == ERROR_SUCCESS && dwType == REG_MULTI_SZ) {
          hkTemp = hkDom;
!         DebugEvent("Located TheseCells in hkDom size %d", dwSize);
!     } else if (hkDoms) {
          rv = RegQueryValueEx(hkDoms, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize);
!         if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_MULTI_SZ) {
!             hkTemp = hkDoms;
!             DebugEvent("Located TheseCells in hkDoms size %d", dwSize);
!         } else if (hkNp) {
!             rv = RegQueryValueEx(hkNp, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize);
!             if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_MULTI_SZ) {
!                 hkTemp = hkNp;
!                 DebugEvent("Located TheseCells in hkNp size %d", dwSize);
!             }
!         }
      }
  
      if (hkTemp) {
!         CHAR * thesecells = NULL;
  
          /* dwSize still has the size of the required buffer in bytes. */
!         thesecells = malloc(dwSize*2);
!         if (!thesecells)
!             goto doneTheseCells;
!         dwSize *= 2;
!         SetLastError(0);
!         rv = RegQueryValueEx(hkTemp, REG_CLIENT_THESE_CELLS_PARM, 0, NULL, (LPBYTE) thesecells, &dwSize);
          if(rv != ERROR_SUCCESS) {/* what the ..? */
!             DebugEvent("Can't look up TheseCells rv [%d] size [%d] gle [%d]",rv, dwSize, GetLastError());
              goto doneTheseCells;
          }
  
          DebugEvent("Found TheseCells [%s]", thesecells);
          opt->theseCells = thesecells;
+         thesecells = NULL;
  
        doneTheseCells:
!         if (thesecells) free(thesecells);
!     }
! 
!     DebugEvent0("Looking up Realm");
!     /* Realm */
!     /* First find out where the key is */
!     hkTemp = NULL;
!     rv = ~ERROR_SUCCESS;
!     dwSize = 0;
!     if (hkDom)
!         rv = RegQueryValueEx(hkDom, REG_CLIENT_REALM_PARM, 0, &dwType, NULL, &dwSize);
!     if (rv == ERROR_SUCCESS && dwType == REG_SZ) {
!         hkTemp = hkDom;
!         DebugEvent("Located Realm in hkDom size %d", dwSize);
!     } else if (hkDoms) {
!         rv = RegQueryValueEx(hkDoms, REG_CLIENT_REALM_PARM, 0, &dwType, NULL, &dwSize);
!         if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_SZ) {
!             hkTemp = hkDoms;
!             DebugEvent("Located Realm in hkDoms size %d", dwSize);
!         } else if (hkNp) {
!             rv = RegQueryValueEx(hkNp, REG_CLIENT_REALM_PARM, 0, &dwType, NULL, &dwSize);
!             if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_SZ) {
!                 hkTemp = hkNp;
!                 DebugEvent("Located Realm in hkNp size %d", dwSize);
!             }
!         }
!     }
! 
!     if (hkTemp) {
!         CHAR * realm = NULL;
! 
!         /* dwSize still has the size of the required buffer in bytes. */
!         realm = malloc(dwSize*2);
!         if (!realm)
!             goto doneRealm;
!         dwSize *=2;
!         SetLastError(0);
!         rv = RegQueryValueEx(hkTemp, REG_CLIENT_REALM_PARM, 0, NULL, (LPBYTE) realm, &dwSize);
!         if(rv != ERROR_SUCCESS) {/* what the ..? */
!             DebugEvent("Can't look up Realm rv [%d] size [%d] gle [%d]",rv, dwSize, GetLastError());
!             goto doneRealm;
!         }
! 
!         DebugEvent("Found Realm [%s]", realm);
!         opt->realm = realm;
!         realm = NULL;
! 
!       doneRealm:
!         if (realm) free(realm);
      }
  
    cleanup:
***************
*** 716,722 ****
      int sleepInterval;
  
      /* Are we interactive? */
!     interactive = (wcscmp(lpStationName, L"WinSta0") == 0);
  
  #ifdef DISABLE_NON_INTERACTIVE
      /* Do not do anything if the logon session is not interactive. */
--- 790,796 ----
      int sleepInterval;
  
      /* Are we interactive? */
!     interactive = (wcsicmp(lpStationName, L"WinSta0") == 0);
  
  #ifdef DISABLE_NON_INTERACTIVE
      /* Do not do anything if the logon session is not interactive. */
***************
*** 743,750 ****
      /* MSV1_0_INTERACTIVE_LOGON and KERB_INTERACTIVE_LOGON are equivalent for
       * our purposes */
  
!     if ( wcscmp(lpAuthentInfoType,L"MSV1_0:Interactive") && 
!          wcscmp(lpAuthentInfoType,L"Kerberos:Interactive") )
      {
          DebugEvent("Unsupported Authentication Info Type: %S",
                     lpAuthentInfoType);
--- 817,824 ----
      /* MSV1_0_INTERACTIVE_LOGON and KERB_INTERACTIVE_LOGON are equivalent for
       * our purposes */
  
!     if ( wcsicmp(lpAuthentInfoType,L"MSV1_0:Interactive") && 
!          wcsicmp(lpAuthentInfoType,L"Kerberos:Interactive") )
      {
          DebugEvent("Unsupported Authentication Info Type: %S",
                     lpAuthentInfoType);
***************
*** 795,801 ****
      /* Check for zero length password if integrated logon*/
      if ( ISLOGONINTEGRATED(opt.LogonOption) )  {
          if ( password[0] == 0 ) {
!             DebugEvent("Password is the empty string");
              code = GT_PW_NULL;
              reason = "zero length password is illegal";
              code=0;
--- 869,875 ----
      /* Check for zero length password if integrated logon*/
      if ( ISLOGONINTEGRATED(opt.LogonOption) )  {
          if ( password[0] == 0 ) {
!             DebugEvent0("Password is the empty string");
              code = GT_PW_NULL;
              reason = "zero length password is illegal";
              code=0;
***************
*** 807,813 ****
          DebugEvent("About to call cm_GetRootCellName(%s)",cell);
          code = cm_GetRootCellName(cell);
          if (code < 0) { 
!             DebugEvent("Unable to obtain Root Cell");
              code = KTC_NOCELL;
              reason = "unknown cell";
              code=0;
--- 881,887 ----
          DebugEvent("About to call cm_GetRootCellName(%s)",cell);
          code = cm_GetRootCellName(cell);
          if (code < 0) { 
!             DebugEvent0("Unable to obtain Root Cell");
              code = KTC_NOCELL;
              reason = "unknown cell";
              code=0;
***************
*** 819,825 ****
             cell right away because the client service may not have started yet. This call
             also sets the AD_REALM flag in opt.flags if applicable. */
          if (ISREMOTE(opt.flags)) {
!             DebugEvent("Is Remote");
              GetAdHomePath(homePath,MAX_PATH,lpLogonId,&opt);
          }
      }
--- 893,899 ----
             cell right away because the client service may not have started yet. This call
             also sets the AD_REALM flag in opt.flags if applicable. */
          if (ISREMOTE(opt.flags)) {
!             DebugEvent0("Is Remote");
              GetAdHomePath(homePath,MAX_PATH,lpLogonId,&opt);
          }
      }
***************
*** 846,860 ****
  	    {			
  		if ( KFW_is_available() ) {
  		    SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, "");
! 		    code = KFW_AFS_get_cred(uname, cell, password, 0, opt.smbName, &reason);
  		    SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL);
- 		    DebugEvent("KFW_AFS_get_cred  uname=[%s] smbname=[%s] cell=[%s] code=[%d]",
- 				uname,opt.smbName,cell,code);
  		    if (code == 0 && opt.theseCells) { 
  			char * principal, *p;
  			size_t len, tlen;
  
! 			StringCchLength(cell, MAX_DOMAIN_LENGTH, &tlen);
  			len = tlen;
  			StringCchLength(uname, MAX_USERNAME_LENGTH, &tlen);
  			len += tlen + 2;
--- 920,957 ----
  	    {			
  		if ( KFW_is_available() ) {
  		    SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, "");
!                     if (opt.realm) {
! 			char * principal, *p;
! 			size_t len, tlen;
! 
! 			StringCchLength(opt.realm, MAX_DOMAIN_LENGTH, &tlen);
! 			len = tlen;
! 			StringCchLength(uname, MAX_USERNAME_LENGTH, &tlen);
! 			len += tlen + 2;
! 
! 			/* tlen is now the length of uname in characters */
! 			principal = (char *)malloc(len * sizeof(char));
! 			if ( principal ) {
! 			    StringCchCopy(principal, len, uname);
! 			    p = principal + tlen;
! 			    *p++ = '@';
!                             StringCchCopy(p, len - tlen -1, opt.realm);
!                             code = KFW_AFS_get_cred(principal, cell, password, 0, opt.smbName, &reason);
!                             DebugEvent("KFW_AFS_get_cred  uname=[%s] smbname=[%s] cell=[%s] code=[%d]",
! 					    principal,opt.smbName,cell,code);
! 			    free(principal);
! 			}
!                     } else {
!                         code = KFW_AFS_get_cred(uname, cell, password, 0, opt.smbName, &reason);
!                         DebugEvent("KFW_AFS_get_cred  uname=[%s] smbname=[%s] cell=[%s] code=[%d]",
!                                     uname,opt.smbName,cell,code);
!                     }
  		    SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL);
  		    if (code == 0 && opt.theseCells) { 
  			char * principal, *p;
  			size_t len, tlen;
  
! 			StringCchLength(opt.realm ? opt.realm : cell, MAX_DOMAIN_LENGTH, &tlen);
  			len = tlen;
  			StringCchLength(uname, MAX_USERNAME_LENGTH, &tlen);
  			len += tlen + 2;
***************
*** 865,882 ****
  			    StringCchCopy(principal, len, uname);
  			    p = principal + tlen;
  			    *p++ = '@';
! 			    StringCchCopy(p, len - tlen - 1, cell);
! 			    for ( ;*p; p++) {
! 				*p = toupper(*p);
! 			    }
! 
  			    p = opt.theseCells;
  			    while ( *p ) {
! 				SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, "");
! 				code2 = KFW_AFS_get_cred(principal, p, 0, 0, opt.smbName, &reason);
! 				SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL);
! 				DebugEvent("KFW_AFS_get_cred  uname=[%s] smbname=[%s] cell=[%s] code=[%d]",
! 					    principal,opt.smbName,p,code2);
  				p += strlen(p) + 1;
  			    }
  			    free(principal);
--- 962,984 ----
  			    StringCchCopy(principal, len, uname);
  			    p = principal + tlen;
  			    *p++ = '@';
!                             if (opt.realm) {
!                                 StringCchCopy(p, len - tlen -1, opt.realm);
!                             } else {
!                                 StringCchCopy(p, len - tlen - 1, cell);
!                                 for ( ;*p; p++) {
!                                     *p = toupper(*p);
!                                 }
!                             }
  			    p = opt.theseCells;
  			    while ( *p ) {
!                                 if ( stricmp(p, cell) ) {
!                                     SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, "");
!                                     code2 = KFW_AFS_get_cred(principal, p, 0, 0, opt.smbName, &reason);
!                                     SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL);
!                                     DebugEvent("KFW_AFS_get_cred  uname=[%s] smbname=[%s] cell=[%s] code=[%d]",
!                                                principal,opt.smbName,p,code2);
!                                 }
  				p += strlen(p) + 1;
  			    }
  			    free(principal);
***************
*** 941,947 ****
  	    retryInterval -= sleepInterval;
  	}
      }
!     DebugEvent("while loop exited");
  
      /* remove any kerberos 5 tickets currently held by the SYSTEM account
       * for this user 
--- 1043,1049 ----
  	    retryInterval -= sleepInterval;
  	}
      }
!     DebugEvent0("while loop exited");
  
      /* remove any kerberos 5 tickets currently held by the SYSTEM account
       * for this user 
***************
*** 986,991 ****
--- 1088,1094 ----
  
      if (opt.theseCells) free(opt.theseCells);
      if (opt.smbName) free(opt.smbName);
+     if (opt.realm) free(opt.realm);
  
      DebugEvent("AFS AfsLogon - Exit","Return Code[%x]",code);
      return code;
***************
*** 1003,1009 ****
      BOOLEAN interactive;
  
      /* Are we interactive? */
!     interactive = (wcscmp(lpStationName, L"WinSta0") == 0);
  
      /* Do not do anything if the logon session is not interactive. */
      if (!interactive)
--- 1106,1112 ----
      BOOLEAN interactive;
  
      /* Are we interactive? */
!     interactive = (wcsicmp(lpStationName, L"WinSta0") == 0);
  
      /* Do not do anything if the logon session is not interactive. */
      if (!interactive)
Index: openafs/src/WINNT/afsd/afslogon.h
diff -c openafs/src/WINNT/afsd/afslogon.h:1.9.4.3 openafs/src/WINNT/afsd/afslogon.h:1.9.4.4
*** openafs/src/WINNT/afsd/afslogon.h:1.9.4.3	Tue Apr  3 10:50:40 2007
--- openafs/src/WINNT/afsd/afslogon.h	Fri Apr  6 12:56:53 2007
***************
*** 45,50 ****
--- 45,51 ----
  #define REG_CLIENT_TRACE_OPTION_PARM	"TraceOption"
  #define REG_CLIENT_LOGON_OPTION_PARM	"LogonOptions"
  #define REG_CLIENT_LOGON_SCRIPT_PARMW	L"LogonScript"
+ #define REG_CLIENT_REALM_PARM           "Realm"
  #define REG_CLIENT_THESE_CELLS_PARM     "TheseCells"
  #define REG_CLIENT_LOGOFF_TOKENS_PARM	"LogoffPreserveTokens"
  #define DEFAULT_RETRY_INTERVAL          60                        /* seconds*/
***************
*** 76,81 ****
--- 77,83 ----
  	LPWSTR	logonScript;
  	DWORD	flags; /* LOGON_FLAG_* */
          char *  theseCells;
+         char *  realm;
  } LogonOptions_t;
  
  /* */
Index: openafs/src/WINNT/afsd/cklog.c
diff -c openafs/src/WINNT/afsd/cklog.c:1.4 openafs/src/WINNT/afsd/cklog.c:1.4.4.1
*** openafs/src/WINNT/afsd/cklog.c:1.4	Sat Nov  5 01:47:46 2005
--- openafs/src/WINNT/afsd/cklog.c	Tue Apr 10 14:39:48 2007
***************
*** 311,317 ****
         code = krb_write_ticket_file (realm);
         if (!Silent) {
            if (code) 
!               com_err (rn, code, "writing Kerberos ticket file");
            else fprintf (stderr, "Wrote ticket file to /tmp\n");
        }
     }
--- 311,317 ----
         code = krb_write_ticket_file (realm);
         if (!Silent) {
            if (code) 
!               afs_com_err (rn, code, "writing Kerberos ticket file");
            else fprintf (stderr, "Wrote ticket file to /tmp\n");
        }
     }
Index: openafs/src/WINNT/afsd/cm_conn.c
diff -c openafs/src/WINNT/afsd/cm_conn.c:1.49.2.12 openafs/src/WINNT/afsd/cm_conn.c:1.49.2.13
*** openafs/src/WINNT/afsd/cm_conn.c:1.49.2.12	Sat Mar 10 10:50:07 2007
--- openafs/src/WINNT/afsd/cm_conn.c	Sat Apr 14 14:49:36 2007
***************
*** 642,649 ****
  #endif /* DJGPP */        
  
      if (serversp == NULL) {
! 	osi_Log1(afsd_logp, "cm_ConnByMServers returning 0x%x", CM_ERROR_NOSUCHVOLUME);
! 	return CM_ERROR_NOSUCHVOLUME;
      }
  
      *connpp = NULL;
--- 642,649 ----
  #endif /* DJGPP */        
  
      if (serversp == NULL) {
! 	osi_Log1(afsd_logp, "cm_ConnByMServers returning 0x%x", CM_ERROR_ALLDOWN);
! 	return CM_ERROR_ALLDOWN;
      }
  
      *connpp = NULL;
Index: openafs/src/WINNT/afsd/cm_ioctl.c
diff -c openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.11 openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.12
*** openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.11	Sat Mar 24 01:00:39 2007
--- openafs/src/WINNT/afsd/cm_ioctl.c	Sat Apr 14 14:49:36 2007
***************
*** 2768,2770 ****
--- 2768,2863 ----
    
      return 0;
  }
+ 
+ 
+ static long 
+ cm_CheckServersStatus(cm_serverRef_t *serversp)
+ {
+     long code = 0;
+     cm_serverRef_t *tsrp;
+     cm_server_t *tsp;
+     int someBusy = 0, someOffline = 0, allOffline = 1, allBusy = 1, allDown = 1;
+ 
+     if (serversp == NULL) {
+ 	osi_Log1(afsd_logp, "cm_CheckServersStatus returning 0x%x", CM_ERROR_ALLDOWN);
+ 	return CM_ERROR_ALLDOWN;
+     }
+ 
+     lock_ObtainRead(&cm_serverLock);
+     for (tsrp = serversp; tsrp; tsrp=tsrp->next) {
+         if (tsp = tsrp->server) {
+             cm_GetServerNoLock(tsp);
+             lock_ReleaseRead(&cm_serverLock);
+             if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
+                 allDown = 0;
+                 if (tsrp->status == busy) {
+                     allOffline = 0;
+                     someBusy = 1;
+                 } else if (tsrp->status == offline) {
+                     allBusy = 0;
+                     someOffline = 1;
+                 } else {
+                     allOffline = 0;
+                     allBusy = 0;
+                     cm_PutServer(tsp);
+                     goto done;
+                 }
+             }
+             lock_ObtainRead(&cm_serverLock);
+             cm_PutServerNoLock(tsp);
+         }
+     }   
+     lock_ReleaseRead(&cm_serverLock);
+ 
+     if (allDown) 
+         code = CM_ERROR_ALLDOWN;
+     else if (allBusy) 
+         code = CM_ERROR_ALLBUSY;
+     else if (allOffline || (someBusy && someOffline))
+         code = CM_ERROR_ALLOFFLINE;
+ 
+   done:
+     osi_Log1(afsd_logp, "cm_CheckServersStatus returning 0x%x", code);
+     return code;
+ }
+ 
+ 
+ long cm_IoctlPathAvailability(struct smb_ioctl *ioctlp, struct cm_user *userp)
+ {
+     long code;
+     cm_scache_t *scp;
+     cm_cell_t *cellp;
+     cm_volume_t *tvp;
+     cm_serverRef_t **tsrpp;
+     unsigned long volume;
+     cm_req_t req;
+ 
+     cm_InitReq(&req);
+ 
+     code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
+     if (code) 
+         return code;
+         
+     volume = scp->fid.volume;
+ 
+     cellp = cm_FindCellByID(scp->fid.cell);
+ 
+     cm_ReleaseSCache(scp);
+ 
+     if (!cellp)
+ 	return CM_ERROR_NOSUCHCELL;
+ 
+     code = cm_GetVolumeByID(cellp, volume, userp, &req, &tvp);
+     if (code) 
+         return code;
+ 	
+     lock_ObtainMutex(&tvp->mx);
+     tsrpp = cm_GetVolServers(tvp, volume);
+     code = cm_CheckServersStatus(*tsrpp);
+     cm_FreeServerList(tsrpp);
+     lock_ReleaseMutex(&tvp->mx);
+     cm_PutVolume(tvp);
+     return 0;
+ }       
+ 
+ 
Index: openafs/src/WINNT/afsd/cm_ioctl.h
diff -c openafs/src/WINNT/afsd/cm_ioctl.h:1.14.2.1 openafs/src/WINNT/afsd/cm_ioctl.h:1.14.2.2
*** openafs/src/WINNT/afsd/cm_ioctl.h:1.14.2.1	Tue Jun 27 18:19:35 2006
--- openafs/src/WINNT/afsd/cm_ioctl.h	Sat Apr 14 14:49:36 2007
***************
*** 164,169 ****
--- 164,171 ----
  
  extern long cm_IoctlUUIDControl(struct smb_ioctl * ioctlp, struct cm_user *userp);
  
+ extern long cm_IoctlPathAvailability(struct smb_ioctl * ioctlp, struct cm_user *userp);
+ 
  #endif /* __CM_IOCTL_INTERFACES_ONLY__ */
  
  #endif /*  __CM_IOCTL_H_ENV__ */
Index: openafs/src/WINNT/afsd/fs.c
diff -c openafs/src/WINNT/afsd/fs.c:1.32.4.6 openafs/src/WINNT/afsd/fs.c:1.32.4.8
*** openafs/src/WINNT/afsd/fs.c:1.32.4.6	Fri Mar  2 20:32:06 2007
--- openafs/src/WINNT/afsd/fs.c	Sat Apr 14 14:49:36 2007
***************
*** 600,606 ****
  static int
  PrintStatus(VolumeStatus *status, char *name, char *motd, char *offmsg)
  {
!     printf("Volume status for vid = %u named %s\n",status->Vid, name);
      if (*offmsg != 0)
  	printf("Current offline message is %s\n",offmsg);
      if (*motd != 0)
--- 600,606 ----
  static int
  PrintStatus(VolumeStatus *status, char *name, char *motd, char *offmsg)
  {
!     printf("Volume status for vid = %u named %s is\n",status->Vid, name);
      if (*offmsg != 0)
  	printf("Current offline message is %s\n",offmsg);
      if (*motd != 0)
***************
*** 611,617 ****
      else 
          printf("unlimited\n");
      printf("Current blocks used are %d\n",status->BlocksInUse);
!     printf("The partition has %d blocks available out of %d\n\n",
              status->PartBlocksAvail, status->PartMaxBlocks);
      return 0;
  }
--- 611,617 ----
      else 
          printf("unlimited\n");
      printf("Current blocks used are %d\n",status->BlocksInUse);
!     printf("The partition has %d blocks available out of %d\n",
              status->PartBlocksAvail, status->PartMaxBlocks);
      return 0;
  }
***************
*** 1489,1494 ****
--- 1489,1495 ----
      struct cmd_item *ti;
      struct VolumeStatus *status;
      char *name, *offmsg, *motd;
+     long   online_state;
      int error = 0;
      
      SetDotDefault(&as->parms[0].items);
***************
*** 1525,1545 ****
  	    pr_SIdToName(owner[0], oname);
  	    printf("Owner %s (%u) Group %u\n", oname, owner[0], owner[1]);
          }
! 	
  	blob.out = space;
  	blob.out_size = MAXSIZE;
  	code = pioctl(ti->data, VIOCGETVOLSTAT, &blob, 1);
! 	if (code) {
! 	    Die(errno, ti->data);
! 	    error = 1;
! 	    continue;
! 	}
! 	status = (VolumeStatus *)space;
! 	name = (char *)status + sizeof(*status);
! 	offmsg = name + strlen(name) + 1;
! 	motd = offmsg + strlen(offmsg) + 1;
  
! 	PrintStatus(status, name, motd, offmsg);
      }
      return error;
  }
--- 1526,1563 ----
  	    pr_SIdToName(owner[0], oname);
  	    printf("Owner %s (%u) Group %u\n", oname, owner[0], owner[1]);
          }
! 
  	blob.out = space;
  	blob.out_size = MAXSIZE;
  	code = pioctl(ti->data, VIOCGETVOLSTAT, &blob, 1);
! 	if (code == 0) {
!             status = (VolumeStatus *)space;
!             name = (char *)status + sizeof(*status);
!             offmsg = name + strlen(name) + 1;
!             motd = offmsg + strlen(offmsg) + 1;
  
!             PrintStatus(status, name, motd, offmsg);
!         } else {
!             Die(errno, ti->data);
!         }
!         online_state = pioctl(ti->data, VIOC_PATH_AVAILABILITY, &blob, 1);
!         switch (online_state) {
!         case 0:
!             printf("Volume is online\n");
!             break;
!         case CM_ERROR_ALLOFFLINE:
!             printf("Volume offline\n");
!             break;
!         case CM_ERROR_ALLDOWN:
!             printf("All Volume servers are down\n");
!             break;
!         case CM_ERROR_ALLBUSY:
!             printf("All volume servers are busy\n");
!             break;
!         default:
!             Die(online_state, ti->data);
!         }
!         printf("\n");
      }
      return error;
  }
***************
*** 4645,4651 ****
  #ifdef WIN32
  	fprintf(stderr, ": code 0x%x\n", code);
  #else /* not WIN32 */
! 	fprintf(stderr,": %s\n", error_message(code));
  #endif /* not WIN32 */
      }
  } /*Die*/
--- 4663,4669 ----
  #ifdef WIN32
  	fprintf(stderr, ": code 0x%x\n", code);
  #else /* not WIN32 */
! 	fprintf(stderr,": %s\n", afs_error_message(code));
  #endif /* not WIN32 */
      }
  } /*Die*/
Index: openafs/src/WINNT/afsd/smb_iocons.h
diff -c openafs/src/WINNT/afsd/smb_iocons.h:1.10.4.2 openafs/src/WINNT/afsd/smb_iocons.h:1.10.4.3
*** openafs/src/WINNT/afsd/smb_iocons.h:1.10.4.2	Thu Jul 20 17:46:19 2006
--- openafs/src/WINNT/afsd/smb_iocons.h	Sat Apr 14 14:49:36 2007
***************
*** 97,100 ****
--- 97,101 ----
  #define VIOC_RXSTAT_PROC                0x2e
  #define VIOC_RXSTAT_PEER                0x2f
  #define VIOC_UUIDCTL                    0x30
+ #define VIOC_PATH_AVAILABILITY          0x31
  #endif /*  __SMB_IOCONS_H_ENV_ */
Index: openafs/src/WINNT/afsd/smb_ioctl.c
diff -c openafs/src/WINNT/afsd/smb_ioctl.c:1.25.2.3 openafs/src/WINNT/afsd/smb_ioctl.c:1.25.2.4
*** openafs/src/WINNT/afsd/smb_ioctl.c:1.25.2.3	Thu Jul 20 17:46:19 2006
--- openafs/src/WINNT/afsd/smb_ioctl.c	Sat Apr 14 14:49:36 2007
***************
*** 84,89 ****
--- 84,90 ----
          smb_ioctlProcsp[VIOC_RXSTAT_PROC] = cm_IoctlRxStatProcess;
          smb_ioctlProcsp[VIOC_RXSTAT_PEER] = cm_IoctlRxStatPeer;
          smb_ioctlProcsp[VIOC_UUIDCTL] = cm_IoctlUUIDControl;
+         smb_ioctlProcsp[VIOC_PATH_AVAILABILITY] = cm_IoctlPathAvailability;
  }
  
  /* called to make a fid structure into an IOCTL fid structure */
Index: openafs/src/WINNT/afsd/symlink.c
diff -c openafs/src/WINNT/afsd/symlink.c:1.8 openafs/src/WINNT/afsd/symlink.c:1.8.4.1
*** openafs/src/WINNT/afsd/symlink.c:1.8	Sat Nov  5 01:47:48 2005
--- openafs/src/WINNT/afsd/symlink.c	Tue Apr 10 14:39:48 2007
***************
*** 652,658 ****
  #ifdef WIN32
  	fprintf(stderr, ": code 0x%x\n", code);
  #else /* not WIN32 */
! 	fprintf(stderr,": %s\n", error_message(code));
  #endif /* not WIN32 */
      }
  } /*Die*/
--- 652,658 ----
  #ifdef WIN32
  	fprintf(stderr, ": code 0x%x\n", code);
  #else /* not WIN32 */
! 	fprintf(stderr,": %s\n", afs_error_message(code));
  #endif /* not WIN32 */
      }
  } /*Die*/
Index: openafs/src/WINNT/afsd/sample/token.c
diff -c openafs/src/WINNT/afsd/sample/token.c:1.3 openafs/src/WINNT/afsd/sample/token.c:1.3.14.1
*** openafs/src/WINNT/afsd/sample/token.c:1.3	Fri Nov 21 02:59:45 2003
--- openafs/src/WINNT/afsd/sample/token.c	Tue Apr 10 14:39:48 2007
***************
*** 276,282 ****
         code = krb_write_ticket_file (realm);
         if (!Silent) {
            if (code) 
!               com_err (rn, code, "writing Kerberos ticket file");
            else fprintf (stderr, "Wrote ticket file to /tmp\n");
        }
     }
--- 276,282 ----
         code = krb_write_ticket_file (realm);
         if (!Silent) {
            if (code) 
!               afs_com_err (rn, code, "writing Kerberos ticket file");
            else fprintf (stderr, "Wrote ticket file to /tmp\n");
        }
     }
Index: openafs/src/WINNT/afsreg/test/regman.c
diff -c openafs/src/WINNT/afsreg/test/regman.c:1.3 openafs/src/WINNT/afsreg/test/regman.c:1.3.20.1
*** openafs/src/WINNT/afsreg/test/regman.c:1.3	Tue Sep 18 00:26:55 2001
--- openafs/src/WINNT/afsreg/test/regman.c	Tue Apr 10 14:39:49 2007
***************
*** 60,71 ****
      vpDev = as->parms[1].items->data;
  
      if (!vpt_PartitionNameValid(vpName)) {
! 	com_err(whoami, 0, "Partition name invalid");
  	return 1;
      }
  
      if (!vpt_DeviceNameValid(vpDev)) {
! 	com_err(whoami, 0, "Device name invalid");
  	return 1;
      }
  
--- 60,71 ----
      vpDev = as->parms[1].items->data;
  
      if (!vpt_PartitionNameValid(vpName)) {
! 	afs_com_err(whoami, 0, "Partition name invalid");
  	return 1;
      }
  
      if (!vpt_DeviceNameValid(vpDev)) {
! 	afs_com_err(whoami, 0, "Device name invalid");
  	return 1;
      }
  
***************
*** 73,79 ****
      strcpy(vpentry.vp_dev, vpDev);
  
      if (vpt_AddEntry(&vpentry)) {
! 	com_err(whoami, 0, "Unable to create vice partition table entry");
  	return 1;
      }
      return 0;
--- 73,79 ----
      strcpy(vpentry.vp_dev, vpDev);
  
      if (vpt_AddEntry(&vpentry)) {
! 	afs_com_err(whoami, 0, "Unable to create vice partition table entry");
  	return 1;
      }
      return 0;
***************
*** 86,97 ****
      vpName = as->parms[0].items->data;
  
      if (!vpt_PartitionNameValid(vpName)) {
! 	com_err(whoami, 0, "Partition name invalid");
  	return 1;
      }
  
      if (vpt_RemoveEntry(vpName) && errno != ENOENT) {
! 	com_err(whoami, 0, "Unable to remove vice partition table entry");
  	return 1;
      }
      return 0;
--- 86,97 ----
      vpName = as->parms[0].items->data;
  
      if (!vpt_PartitionNameValid(vpName)) {
! 	afs_com_err(whoami, 0, "Partition name invalid");
  	return 1;
      }
  
      if (vpt_RemoveEntry(vpName) && errno != ENOENT) {
! 	afs_com_err(whoami, 0, "Unable to remove vice partition table entry");
  	return 1;
      }
      return 0;
***************
*** 103,109 ****
      char *buf;
  
      if (afssw_GetServerInstallDir(&buf)) {
! 	com_err(whoami, 0,
  		"Failed reading AFS install dir entry (or does not exist)");
  	return 1;
      }
--- 103,109 ----
      char *buf;
  
      if (afssw_GetServerInstallDir(&buf)) {
! 	afs_com_err(whoami, 0,
  		"Failed reading AFS install dir entry (or does not exist)");
  	return 1;
      }
***************
*** 136,142 ****
      }
  
      if (status) {
! 	com_err(whoami, 0, "Unable to set AFS installation directory entry");
      }
  
      return (status ? 1 : 0);
--- 136,142 ----
      }
  
      if (status) {
! 	afs_com_err(whoami, 0, "Unable to set AFS installation directory entry");
      }
  
      return (status ? 1 : 0);
***************
*** 157,163 ****
  	char *dirBuf;
  
  	if (afssw_GetServerInstallDir(&dirBuf)) {
! 	    com_err(whoami, 0,
  		    "binary path not specified and AFS server installation directory not set");
  	    return 1;
  	}
--- 157,163 ----
  	char *dirBuf;
  
  	if (afssw_GetServerInstallDir(&dirBuf)) {
! 	    afs_com_err(whoami, 0,
  		    "binary path not specified and AFS server installation directory not set");
  	    return 1;
  	}
***************
*** 177,183 ****
  	if (status == ERROR_ACCESS_DENIED) {
  	    reason = "(insufficient privilege)";
  	}
! 	com_err(whoami, 0, "unable to connect to the SCM %s", reason);
  	return 1;
      }
  
--- 177,183 ----
  	if (status == ERROR_ACCESS_DENIED) {
  	    reason = "(insufficient privilege)";
  	}
! 	afs_com_err(whoami, 0, "unable to connect to the SCM %s", reason);
  	return 1;
      }
  
***************
*** 202,208 ****
  	if (status == ERROR_SERVICE_EXISTS || status == ERROR_DUP_NAME) {
  	    reason = "(service or display name already exists)";
  	}
! 	com_err(whoami, 0, "unable to create service %s", reason);
  	CloseServiceHandle(scmHandle);
  	return 1;
      }
--- 202,208 ----
  	if (status == ERROR_SERVICE_EXISTS || status == ERROR_DUP_NAME) {
  	    reason = "(service or display name already exists)";
  	}
! 	afs_com_err(whoami, 0, "unable to create service %s", reason);
  	CloseServiceHandle(scmHandle);
  	return 1;
      }
***************
*** 227,233 ****
  	if (status == ERROR_ACCESS_DENIED) {
  	    reason = "(insufficient privilege)";
  	}
! 	com_err(whoami, 0, "unable to connect to the SCM %s", reason);
  	return 1;
      }
  
--- 227,233 ----
  	if (status == ERROR_ACCESS_DENIED) {
  	    reason = "(insufficient privilege)";
  	}
! 	afs_com_err(whoami, 0, "unable to connect to the SCM %s", reason);
  	return 1;
      }
  
***************
*** 238,244 ****
  	DWORD status = GetLastError();
  
  	if (status != ERROR_SERVICE_DOES_NOT_EXIST) {
! 	    com_err(whoami, 0, "unable to open service");
  	    rc = 1;
  	}
  	CloseServiceHandle(scmHandle);
--- 238,244 ----
  	DWORD status = GetLastError();
  
  	if (status != ERROR_SERVICE_DOES_NOT_EXIST) {
! 	    afs_com_err(whoami, 0, "unable to open service");
  	    rc = 1;
  	}
  	CloseServiceHandle(scmHandle);
***************
*** 249,255 ****
  	DWORD status = GetLastError();
  
  	if (status != ERROR_SERVICE_MARKED_FOR_DELETE) {
! 	    com_err(whoami, 0, "service delete failed");
  	    rc = 1;
  	}
      }
--- 249,255 ----
  	DWORD status = GetLastError();
  
  	if (status != ERROR_SERVICE_MARKED_FOR_DELETE) {
! 	    afs_com_err(whoami, 0, "service delete failed");
  	    rc = 1;
  	}
      }
Index: openafs/src/WINNT/aklog/NTMakefile
diff -c openafs/src/WINNT/aklog/NTMakefile:1.4.4.1 openafs/src/WINNT/aklog/NTMakefile:1.4.4.2
*** openafs/src/WINNT/aklog/NTMakefile:1.4.4.1	Sun Jun 25 13:58:06 2006
--- openafs/src/WINNT/aklog/NTMakefile	Tue Apr 10 14:39:49 2007
***************
*** 28,35 ****
  
  EXELIBS = \
  	$(DESTDIR)\lib\afs\afspioctl.lib \
!     $(DESTDIR)\lib\afsauthent.lib \
!     $(DESTDIR)\lib\afs\afskauth.lib
  
  !IF "$(CPU)" == "IA64" || "$(CPU)" == "AMD64" || "$(CPU)" == "ALPHA64"
  OTHERLIBS = \
--- 28,37 ----
  
  EXELIBS = \
  	$(DESTDIR)\lib\afs\afspioctl.lib \
!         $(DESTDIR)\lib\afsauthent.lib \
!         $(DESTDIR)\lib\afs\afskauth.lib \
!         $(DESTDIR)\lib\afs\afscom_err.lib \
!         $(DESTDIR)\lib\afs\afsutil.lib
  
  !IF "$(CPU)" == "IA64" || "$(CPU)" == "AMD64" || "$(CPU)" == "ALPHA64"
  OTHERLIBS = \
Index: openafs/src/WINNT/aklog/aklog.c
diff -c openafs/src/WINNT/aklog/aklog.c:1.14.4.2 openafs/src/WINNT/aklog/aklog.c:1.14.4.3
*** openafs/src/WINNT/aklog/aklog.c:1.14.4.2	Fri Feb  9 12:30:33 2007
--- openafs/src/WINNT/aklog/aklog.c	Wed Apr  4 16:26:10 2007
***************
*** 183,188 ****
--- 183,189 ----
  {
      static char lastcell[MAXCELLCHARS+1] = { 0 };
      static char confname[512] = { 0 };
+     char username_copy[BUFSIZ];
      afs_int32 viceId;			/* AFS uid of user */
  #ifdef ALLOW_REGISTER
      afs_int32 id;
***************
*** 247,252 ****
--- 248,254 ----
              }
  #ifdef ALLOW_REGISTER
          } else if (strcmp(realm_of_user, realm_of_cell) != 0) {
+             int i;
              if (dflag) {
                  printf("doing first-time registration of %s "
                          "at %s\n", username, cell_to_use);
***************
*** 255,260 ****
--- 257,268 ----
              strncpy(aclient->name, username, MAXKTCNAMELEN - 1);
              strcpy(aclient->instance, "");
              strncpy(aclient->cell, c->realm, MAXKTCREALMLEN - 1);
+ 
+             for ( i=0; aclient->cell[i]; i++ ) {
+                 if ( islower(aclient->cell[i]) )
+                     aclient->cell[i] = toupper(aclient->cell[i]);
+             }
+ 
              if ((*status = ktc_SetToken(aserver, atoken, aclient, 0))) {
                  printf("%s: unable to obtain tokens for cell %s "
                          "(status: %d).\n", progname, cell_to_use, status);
***************
*** 274,280 ****
                  return;
              }
  
!             if ((*status = pr_CreateUser(username, &id))) {
                  printf("%s: unable to create remote PTS "
                          "user %s in cell %s (status: %d).\n", progname,
                          username, cell_to_use, *status);
--- 282,296 ----
                  return;
              }
  
!             /* copy the name because pr_CreateUser lowercases the realm */
!             strncpy(username_copy, username, BUFSIZ);
! 
!             *status = pr_CreateUser(username, &id);
! 
!             /* and restore the name to the original state */
!             strncpy(username, username_copy, BUFSIZ);
! 
!             if (*status) {
                  printf("%s: unable to create remote PTS "
                          "user %s in cell %s (status: %d).\n", progname,
                          username, cell_to_use, *status);
***************
*** 282,288 ****
                  printf("created cross-cell entry for %s (Id %d) at %s\n",
                          username, viceId, cell_to_use);
  #ifdef AFS_ID_TO_NAME
-                 strncpy(username_copy, username, BUFSIZ);
                  snprintf (username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId);
  #endif /* AFS_ID_TO_NAME */
              }
--- 298,303 ----
***************
*** 555,564 ****
  static int auth_to_cell(krb5_context context, char *cell, char *realm)
  {
      int status = AKLOG_SUCCESS;
!     char username[BUFSIZ];	/* To hold client username structure */
  
!     char name[ANAME_SZ];		/* Name of afs key */
!     char instance[INST_SZ];	/* Instance of afs key */
      char realm_of_user[REALM_SZ]; /* Kerberos realm of user */
      char realm_of_cell[REALM_SZ]; /* Kerberos realm of cell */
      char local_cell[MAXCELLCHARS+1];
--- 570,579 ----
  static int auth_to_cell(krb5_context context, char *cell, char *realm)
  {
      int status = AKLOG_SUCCESS;
!     char username[BUFSIZ];	  /* To hold client username structure */
  
!     char name[ANAME_SZ];	  /* Name of afs key */
!     char instance[INST_SZ];	  /* Instance of afs key */
      char realm_of_user[REALM_SZ]; /* Kerberos realm of user */
      char realm_of_cell[REALM_SZ]; /* Kerberos realm of cell */
      char local_cell[MAXCELLCHARS+1];
***************
*** 569,575 ****
      struct ktc_principal aserver;
      struct ktc_principal aclient;
      struct ktc_token atoken, btoken;
! 
  
      /* try to avoid an expensive call to get_cellconfig */
      if (cell && ll_string_check(&authedcells, cell))
--- 584,590 ----
      struct ktc_principal aserver;
      struct ktc_principal aclient;
      struct ktc_token atoken, btoken;
!     int i;
  
      /* try to avoid an expensive call to get_cellconfig */
      if (cell && ll_string_check(&authedcells, cell))
***************
*** 806,811 ****
--- 821,831 ----
      } else
  	strncpy(aclient.cell, c.realm, MAXKTCREALMLEN - 1);
  
+     for ( i=0; aclient.cell[i]; i++ ) {
+         if ( islower(aclient.cell[i]) )
+             aclient.cell[i] = toupper(aclient.cell[i]);
+     }
+ 
      if (dflag)
          printf("Getting tokens.\n");
      if (status = ktc_SetToken(&aserver, &atoken, &aclient, 0))
Index: openafs/src/WINNT/aklog/asetkey.c
diff -c openafs/src/WINNT/aklog/asetkey.c:1.1 openafs/src/WINNT/aklog/asetkey.c:1.1.6.1
*** openafs/src/WINNT/aklog/asetkey.c:1.1	Sun Jun 12 07:25:13 2005
--- openafs/src/WINNT/aklog/asetkey.c	Tue Apr 10 14:39:49 2007
***************
*** 1,5 ****
  /*
!  * $Id: asetkey.c,v 1.1 2005/06/12 11:25:13 jaltman Exp $
   *
   * asetkey - Manipulates an AFS KeyFile
   *
--- 1,5 ----
  /*
!  * $Id: asetkey.c,v 1.1.6.1 2007/04/10 18:39:49 shadow Exp $
   *
   * asetkey - Manipulates an AFS KeyFile
   *
***************
*** 17,22 ****
--- 17,23 ----
  #ifndef PRE_AFS35
  #include <afs/dirpath.h>
  #endif /* !PRE_AFS35 */
+ #include <afs/com_err.h>
  
  int
  main(int argc, char **argv)
***************
*** 61,73 ****
  	kvno = atoi(argv[2]);
  	retval = krb5_parse_name(context, argv[4], &principal);
  	if (retval != 0) {
! 		com_err(argv[0], retval, "while parsing AFS principal");
  		exit(1);
  	}
  	retval = krb5_kt_read_service_key(context, argv[3], principal, kvno,
  					  ENCTYPE_DES_CBC_CRC, &key);
  	if (retval != 0) {
! 		com_err(argv[0], retval, "while extracting AFS service key");
  		exit(1);
  	}
  
--- 62,74 ----
  	kvno = atoi(argv[2]);
  	retval = krb5_parse_name(context, argv[4], &principal);
  	if (retval != 0) {
! 		afs_com_err(argv[0], retval, "while parsing AFS principal");
  		exit(1);
  	}
  	retval = krb5_kt_read_service_key(context, argv[3], principal, kvno,
  					  ENCTYPE_DES_CBC_CRC, &key);
  	if (retval != 0) {
! 		afs_com_err(argv[0], retval, "while extracting AFS service key");
  		exit(1);
  	}
  
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.12 openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.13
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.12	Tue Apr  3 09:15:04 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm	Wed Apr 18 12:03:12 2007
***************
*** 198,204 ****
  
  <h1>OpenAFS for Windows</h1>
  
! <h2>Version 1.5.18</h2>
  
  <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>&nbsp; <o:p></o:p></span></p>
  
--- 198,204 ----
  
  <h1>OpenAFS for Windows</h1>
  
! <h2>Version 1.5.19</h2>
  
  <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>&nbsp; <o:p></o:p></span></p>
  
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.13 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.14
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.13	Tue Apr  3 09:15:08 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm	Wed Apr 18 12:03:22 2007
***************
*** 18,24 ****
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.18 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Revision>1</o:Revision>
--- 18,24 ----
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.19 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Revision>1</o:Revision>
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.4.15 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.4.16
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.4.15	Tue Apr  3 09:15:08 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm	Wed Apr 18 12:03:22 2007
***************
*** 8,14 ****
  <meta name=Generator content="Microsoft Word 11">
  <meta name=Originator content="Microsoft Word 11">
  <link rel=File-List href="relnotes-frames_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.18 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <w:WordDocument>
    <w:Zoom>0</w:Zoom>
--- 8,14 ----
  <meta name=Generator content="Microsoft Word 11">
  <meta name=Originator content="Microsoft Word 11">
  <link rel=File-List href="relnotes-frames_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.19 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <w:WordDocument>
    <w:Zoom>0</w:Zoom>
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.6.4.16 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.6.4.17
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.6.4.16	Tue Apr  3 09:15:08 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm	Wed Apr 18 12:03:22 2007
***************
*** 19,25 ****
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.18 Release Notes</title>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
   name="PostalCode"/>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
--- 19,25 ----
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.19 Release Notes</title>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
   name="PostalCode"/>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
***************
*** 583,589 ****
  
  <div class=Section1>
  
! <p class=MsoTitle>OpenAFS for Windows 1.5.18<br>
  Release Notes</p>
  
  <p class=MsoBodyText>The Andrew File System (AFS) is a location-independent
--- 583,589 ----
  
  <div class=Section1>
  
! <p class=MsoTitle>OpenAFS for Windows 1.5.19<br>
  Release Notes</p>
  
  <p class=MsoBodyText>The Andrew File System (AFS) is a location-independent
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.11 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.12
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.11	Tue Apr  3 09:15:09 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm	Wed Apr 18 12:03:22 2007
***************
*** 10,16 ****
  <meta name=Originator content="Microsoft Word 11">
  <base target=body>
  <link rel=File-List href="toc_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.18 Table of Contents</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Author>Jeffrey Altman</o:Author>
--- 10,16 ----
  <meta name=Originator content="Microsoft Word 11">
  <base target=body>
  <link rel=File-List href="toc_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.19 Table of Contents</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Author>Jeffrey Altman</o:Author>
Index: openafs/src/WINNT/netidmgr_plugin/afsfuncs.c
diff -c openafs/src/WINNT/netidmgr_plugin/afsfuncs.c:1.1.2.6 openafs/src/WINNT/netidmgr_plugin/afsfuncs.c:1.1.2.8
*** openafs/src/WINNT/netidmgr_plugin/afsfuncs.c:1.1.2.6	Sat Mar 31 08:53:49 2007
--- openafs/src/WINNT/netidmgr_plugin/afsfuncs.c	Tue Apr 10 18:09:18 2007
***************
*** 22,28 ****
   * SOFTWARE.
   */
  
! /* $Id: afsfuncs.c,v 1.1.2.6 2007/03/31 12:53:49 jaltman Exp $ */
  
  /* Disable the 'macro redefinition' warning which is getting
     triggerred by a redefinition of the ENCRYPT and DECRYPT macros. */
--- 22,28 ----
   * SOFTWARE.
   */
  
! /* $Id: afsfuncs.c,v 1.1.2.8 2007/04/10 22:09:18 jaltman Exp $ */
  
  /* Disable the 'macro redefinition' warning which is getting
     triggerred by a redefinition of the ENCRYPT and DECRYPT macros. */
***************
*** 472,478 ****
  
             ASSUMPTION:
  
!            If Krb5 was used to obatain the token, then there is a Krb5
             ticket of the form afs/<cell>@<REALM> or afs@<CELL> still
             in the cache.  This is also true for Krb524 token
             acquisition.
--- 472,478 ----
  
             ASSUMPTION:
  
!            If Krb5 was used to obtain the token, then there is a Krb5
             ticket of the form afs/<cell>@<REALM> or afs@<CELL> still
             in the cache.  This is also true for Krb524 token
             acquisition.
***************
*** 630,638 ****
  {
      static char lastcell[MAXCELLCHARS+1] = { 0 };
      static char confname[512] = { 0 };
- #ifdef AFS_ID_TO_NAME
      char username_copy[BUFSIZ];
- #endif /* AFS_ID_TO_NAME */
      long viceId = ANONYMOUSID;		/* AFS uid of user */
      int  status = 0;
  #ifdef ALLOW_REGISTER
--- 630,636 ----
***************
*** 667,684 ****
       * automatically register with the ptserver in foreign cells
       */
  
  #ifdef ALLOW_REGISTER
      if (status == 0) {
          if (viceId != ANONYMOUSID) {
  #else /* ALLOW_REGISTER */
  	    if ((status == 0) && (viceId != ANONYMOUSID))
  #endif /* ALLOW_REGISTER */
!     {
  #ifdef AFS_ID_TO_NAME
! 	StringCbCopyA(username_copy, BUFSIZ, username);
! 	StringCchPrintfA(username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId);
  #endif /* AFS_ID_TO_NAME */
!     }
  #ifdef ALLOW_REGISTER
          } else if (strcmp(realm_of_user, realm_of_cell) != 0) {
              id = 0;
--- 665,684 ----
       * automatically register with the ptserver in foreign cells
       */
  
+     /* copy the username because pr_CreateUser will lowercase it */
+     StringCbCopyA(username_copy, BUFSIZ, username);
+ 
  #ifdef ALLOW_REGISTER
      if (status == 0) {
          if (viceId != ANONYMOUSID) {
  #else /* ALLOW_REGISTER */
  	    if ((status == 0) && (viceId != ANONYMOUSID))
  #endif /* ALLOW_REGISTER */
!             {
  #ifdef AFS_ID_TO_NAME
!                 StringCchPrintfA(username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId);
  #endif /* AFS_ID_TO_NAME */
!             }
  #ifdef ALLOW_REGISTER
          } else if (strcmp(realm_of_user, realm_of_cell) != 0) {
              id = 0;
***************
*** 691,700 ****
                  return status;
              status = pr_CreateUser(username, &id);
  	    pr_End();
  	    if (status)
  		return status;
  #ifdef AFS_ID_TO_NAME
-             StringCbCopyA(username_copy, BUFSIZ, username);
              StringCchPrintfA(username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId);
  #endif /* AFS_ID_TO_NAME */
          }
--- 691,700 ----
                  return status;
              status = pr_CreateUser(username, &id);
  	    pr_End();
+             StringCbCopyA(username, BUFSIZ, username_copy);
  	    if (status)
  		return status;
  #ifdef AFS_ID_TO_NAME
              StringCchPrintfA(username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId);
  #endif /* AFS_ID_TO_NAME */
          }
***************
*** 729,734 ****
--- 729,735 ----
      char	ServiceName[128];
      khm_handle	confighandle;
      khm_int32	supports_krb4 = 1;
+     khm_int32   got524cred = 0;
  
      /* signalling */
      BOOL        bGotCreds = FALSE; /* got creds? */
***************
*** 1017,1022 ****
--- 1018,1024 ----
                  goto end_krb5;
              }
              rc = KSUCCESS;
+ 	    got524cred = 1;
              bGotCreds = TRUE;
          }
  
***************
*** 1146,1152 ****
          StringCbCopyA(aclient.instance, sizeof(aclient.instance), "");
  
          StringCchCatA(aclient.name, MAXKTCNAMELEN, "@");
!         StringCchCatA(aclient.name, MAXKTCNAMELEN, creds.realm);
  
          StringCbCopyA(aclient.cell, sizeof(aclient.cell), CellName);
  
--- 1148,1154 ----
          StringCbCopyA(aclient.instance, sizeof(aclient.instance), "");
  
          StringCchCatA(aclient.name, MAXKTCNAMELEN, "@");
! 		StringCchCatA(aclient.name, MAXKTCNAMELEN, got524cred ? realm_of_user : creds.realm);
  
          StringCbCopyA(aclient.cell, sizeof(aclient.cell), CellName);
  
Index: openafs/src/WINNT/netidmgr_plugin/lang/en_us/langres.rc
diff -c openafs/src/WINNT/netidmgr_plugin/lang/en_us/langres.rc:1.1.2.5 openafs/src/WINNT/netidmgr_plugin/lang/en_us/langres.rc:1.1.2.6
*** openafs/src/WINNT/netidmgr_plugin/lang/en_us/langres.rc:1.1.2.5	Thu Feb 15 16:52:25 2007
--- openafs/src/WINNT/netidmgr_plugin/lang/en_us/langres.rc	Thu Apr 12 10:13:48 2007
***************
*** 113,119 ****
      EDITTEXT        IDC_CFG_VERSION,68,54,172,14,ES_AUTOHSCROLL | ES_READONLY
      LTEXT           "Company",IDC_CFG_LBL_COMPANY,14,75,31,8
      EDITTEXT        IDC_CFG_COMPANY,68,72,172,14,ES_AUTOHSCROLL | ES_READONLY
!     PUSHBUTTON      "OpenAFS Control Panel ...",IDC_CFG_CPL,128,161,112,14
      GROUPBOX        "Startup options",IDC_CFG_STARTGRP,7,99,241,48
      CONTROL         "Prevent AFSCreds.exe from starting automatically when you log in to Windows.",IDC_CFG_STARTAFSCREDS,
                      "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,14,108,226,22
--- 113,119 ----
      EDITTEXT        IDC_CFG_VERSION,68,54,172,14,ES_AUTOHSCROLL | ES_READONLY
      LTEXT           "Company",IDC_CFG_LBL_COMPANY,14,75,31,8
      EDITTEXT        IDC_CFG_COMPANY,68,72,172,14,ES_AUTOHSCROLL | ES_READONLY
!     PUSHBUTTON      "OpenAFS Control Panel",IDC_CFG_CPL,128,161,112,14
      GROUPBOX        "Startup options",IDC_CFG_STARTGRP,7,99,241,48
      CONTROL         "Prevent AFSCreds.exe from starting automatically when you log in to Windows.",IDC_CFG_STARTAFSCREDS,
                      "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,14,108,226,22
***************
*** 254,260 ****
      IDS_ERR_NOSERVICE       "The AFS service is not running.  If OpenAFS is installed, you can start the service using the AFS configuration panel."
      IDS_ERR_CELLCONFIG_S    "The error code returned was %2!d!."
      IDS_ERR_GENERAL         "Credentials could not be obtained for cell %1!S!."
!     IDS_ACTION_AFS_HELP     "Help for OpenAFS plug-in"
      IDS_ACTION_AFS_HELP_TT  "Display documentation for the OpenAFS plug-in"
  END
  
--- 254,260 ----
      IDS_ERR_NOSERVICE       "The AFS service is not running.  If OpenAFS is installed, you can start the service using the AFS configuration panel."
      IDS_ERR_CELLCONFIG_S    "The error code returned was %2!d!."
      IDS_ERR_GENERAL         "Credentials could not be obtained for cell %1!S!."
!     IDS_ACTION_AFS_HELP     "AFS"
      IDS_ACTION_AFS_HELP_TT  "Display documentation for the OpenAFS plug-in"
  END
  
Index: openafs/src/afs/LINUX/osi_alloc.c
diff -c openafs/src/afs/LINUX/osi_alloc.c:1.23 openafs/src/afs/LINUX/osi_alloc.c:1.23.8.1
*** openafs/src/afs/LINUX/osi_alloc.c:1.23	Wed Dec  1 18:38:58 2004
--- openafs/src/afs/LINUX/osi_alloc.c	Wed Apr 18 14:02:47 2007
***************
*** 15,21 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_alloc.c,v 1.23 2004/12/01 23:38:58 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 15,21 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_alloc.c,v 1.23.8.1 2007/04/18 18:02:47 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 98,104 ****
--- 98,109 ----
  	    if (new)		/* piggy back alloc type */
  		new = (void *)(KM_TYPE | (unsigned long)new);
  	} else {
+ 	    osi_Assert(drop_glock || !haveGlock);
+ 	    if (drop_glock && haveGlock)
+ 		AFS_GUNLOCK();
  	    new = (void *)vmalloc(asize);
+ 	    if (drop_glock && haveGlock)
+ 		AFS_GLOCK();
  	    if (new)		/* piggy back alloc type */
  		new = (void *)(VM_TYPE | (unsigned long)new);
  	}
Index: openafs/src/afs/LINUX/osi_vnodeops.c
diff -c openafs/src/afs/LINUX/osi_vnodeops.c:1.126.2.13 openafs/src/afs/LINUX/osi_vnodeops.c:1.126.2.14
*** openafs/src/afs/LINUX/osi_vnodeops.c:1.126.2.13	Thu Feb 22 16:41:33 2007
--- openafs/src/afs/LINUX/osi_vnodeops.c	Wed Apr 18 14:20:05 2007
***************
*** 22,28 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.126.2.13 2007/02/22 21:41:33 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 22,28 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.126.2.14 2007/04/18 18:20:05 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 1317,1323 ****
  	return -code;
  }
  
! #if !defined(AFS_LINUX24_ENV)
  /* afs_linux_readlink 
   * Fill target (which is in user space) with contents of symlink.
   */
--- 1317,1323 ----
  	return -code;
  }
  
! #if !defined(USABLE_KERNEL_PAGE_SYMLINK_CACHE)
  /* afs_linux_readlink 
   * Fill target (which is in user space) with contents of symlink.
   */
***************
*** 1337,1342 ****
--- 1337,1372 ----
  /* afs_linux_follow_link
   * a file system dependent link following routine.
   */
+ #if defined(AFS_LINUX24_ENV)
+ static int afs_linux_follow_link(struct dentry *dentry, struct nameidata *nd)
+ {
+     int code;
+     char *name;
+ 
+     name = osi_Alloc(PATH_MAX);
+     if (!name) {
+ 	return -EIO;
+     }
+ 
+     AFS_GLOCK();
+     code = afs_linux_ireadlink(dentry->d_inode, name, PATH_MAX - 1, AFS_UIOSYS);
+     AFS_GUNLOCK();
+ 
+     if (code < 0) {
+ 	goto out;
+     }
+ 
+     name[code] = '\0';
+     code = vfs_follow_link(nd, name);
+ 
+ out:
+     osi_Free(name, PATH_MAX);
+ 
+     return code;
+ }
+ 
+ #else /* !defined(AFS_LINUX24_ENV) */
+ 
  static struct dentry *
  afs_linux_follow_link(struct dentry *dp, struct dentry *basep,
  		      unsigned int follow)
***************
*** 1370,1376 ****
      AFS_GUNLOCK();
      return res;
  }
! #endif
  
  /* afs_linux_readpage
   * all reads come through here. A strategy-like read call.
--- 1400,1407 ----
      AFS_GUNLOCK();
      return res;
  }
! #endif /* AFS_LINUX24_ENV */
! #endif /* USABLE_KERNEL_PAGE_SYMLINK_CACHE */
  
  /* afs_linux_readpage
   * all reads come through here. A strategy-like read call.
***************
*** 1735,1741 ****
  /* We really need a separate symlink set of ops, since do_follow_link()
   * determines if it _is_ a link by checking if the follow_link op is set.
   */
! #if defined(AFS_LINUX24_ENV)
  static int
  afs_symlink_filler(struct file *file, struct page *page)
  {
--- 1766,1772 ----
  /* We really need a separate symlink set of ops, since do_follow_link()
   * determines if it _is_ a link by checking if the follow_link op is set.
   */
! #if defined(USABLE_KERNEL_PAGE_SYMLINK_CACHE)
  static int
  afs_symlink_filler(struct file *file, struct page *page)
  {
***************
*** 1770,1779 ****
  static struct address_space_operations afs_symlink_aops = {
    .readpage =	afs_symlink_filler
  };
! #endif
  
  static struct inode_operations afs_symlink_iops = {
! #if defined(AFS_LINUX24_ENV)
    .readlink = 		page_readlink,
  #if defined(HAVE_KERNEL_PAGE_FOLLOW_LINK)
    .follow_link =	page_follow_link,
--- 1801,1810 ----
  static struct address_space_operations afs_symlink_aops = {
    .readpage =	afs_symlink_filler
  };
! #endif	/* USABLE_KERNEL_PAGE_SYMLINK_CACHE */
  
  static struct inode_operations afs_symlink_iops = {
! #if defined(USABLE_KERNEL_PAGE_SYMLINK_CACHE)
    .readlink = 		page_readlink,
  #if defined(HAVE_KERNEL_PAGE_FOLLOW_LINK)
    .follow_link =	page_follow_link,
***************
*** 1781,1793 ****
    .follow_link =	page_follow_link_light,
    .put_link =           page_put_link,
  #endif
!   .setattr =		afs_notify_change,
! #else
    .readlink = 		afs_linux_readlink,
    .follow_link =	afs_linux_follow_link,
    .permission =		afs_linux_permission,
    .revalidate =		afs_linux_revalidate,
  #endif
  };
  
  void
--- 1812,1828 ----
    .follow_link =	page_follow_link_light,
    .put_link =           page_put_link,
  #endif
! #else /* !defined(USABLE_KERNEL_PAGE_SYMLINK_CACHE) */
    .readlink = 		afs_linux_readlink,
    .follow_link =	afs_linux_follow_link,
+ #if !defined(AFS_LINUX24_ENV)
    .permission =		afs_linux_permission,
    .revalidate =		afs_linux_revalidate,
  #endif
+ #endif /* USABLE_KERNEL_PAGE_SYMLINK_CACHE */
+ #if defined(AFS_LINUX24_ENV)
+   .setattr =		afs_notify_change,
+ #endif
  };
  
  void
***************
*** 1813,1819 ****
  
      } else if (S_ISLNK(ip->i_mode)) {
  	ip->i_op = &afs_symlink_iops;
! #if defined(AFS_LINUX24_ENV)
  	ip->i_data.a_ops = &afs_symlink_aops;
  	ip->i_mapping = &ip->i_data;
  #endif
--- 1848,1854 ----
  
      } else if (S_ISLNK(ip->i_mode)) {
  	ip->i_op = &afs_symlink_iops;
! #if defined(USABLE_KERNEL_PAGE_SYMLINK_CACHE)
  	ip->i_data.a_ops = &afs_symlink_aops;
  	ip->i_mapping = &ip->i_data;
  #endif
Index: openafs/src/aklog/Makefile.in
diff -c openafs/src/aklog/Makefile.in:1.10.2.1 openafs/src/aklog/Makefile.in:1.10.2.2
*** openafs/src/aklog/Makefile.in:1.10.2.1	Thu Jan  4 22:21:45 2007
--- openafs/src/aklog/Makefile.in	Tue Apr 10 14:39:49 2007
***************
*** 11,17 ****
  	  ${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/librxkad.a \
  	  ${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a \
  	  ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libdes.a \
! 	  ${TOP_LIBDIR}/libafsutil.a
  
  SRCS=	aklog.c aklog_main.c  krb_util.c linked_list.c
  OBJS=   aklog.o aklog_main.o krb_util.o linked_list.o
--- 11,17 ----
  	  ${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/librxkad.a \
  	  ${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a \
  	  ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libdes.a \
! 	  ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/libafsutil.a
  
  SRCS=	aklog.c aklog_main.c  krb_util.c linked_list.c
  OBJS=   aklog.o aklog_main.o krb_util.o linked_list.o
Index: openafs/src/aklog/aklog_main.c
diff -c openafs/src/aklog/aklog_main.c:1.12.2.4 openafs/src/aklog/aklog_main.c:1.12.2.5
*** openafs/src/aklog/aklog_main.c:1.12.2.4	Sat Feb 10 08:58:17 2007
--- openafs/src/aklog/aklog_main.c	Tue Apr 10 14:39:49 2007
***************
*** 1,5 ****
  /* 
!  * $Id: aklog_main.c,v 1.12.2.4 2007/02/10 13:58:17 jaltman Exp $
   *
   * Copyright 1990,1991 by the Massachusetts Institute of Technology
   * For distribution and copying rights, see the file "mit-copyright.h"
--- 1,5 ----
  /* 
!  * $Id: aklog_main.c,v 1.12.2.5 2007/04/10 18:39:49 shadow Exp $
   *
   * Copyright 1990,1991 by the Massachusetts Institute of Technology
   * For distribution and copying rights, see the file "mit-copyright.h"
***************
*** 7,13 ****
  
  #if !defined(lint) && !defined(SABER)
  static char *rcsid =
! 	"$Id: aklog_main.c,v 1.12.2.4 2007/02/10 13:58:17 jaltman Exp $";
  #endif /* lint || SABER */
  
  #include <afsconfig.h>
--- 7,13 ----
  
  #if !defined(lint) && !defined(SABER)
  static char *rcsid =
! 	"$Id: aklog_main.c,v 1.12.2.5 2007/04/10 18:39:49 shadow Exp $";
  #endif /* lint || SABER */
  
  #include <afsconfig.h>
***************
*** 1557,1579 ****
      exit(status);
  }
  
- #ifndef HAVE_ADD_TO_ERROR_TABLE
- 
- #define error_table error_table_compat
- #include <afs/error_table.h>
- #undef error_table
- 
- #ifndef HAVE_ADD_ERROR_TABLE
- void add_error_table (const struct error_table *);
- #endif /* !HAVE_ADD_ERROR_TABLE */
- 
- void
- add_to_error_table(struct et_list *new_table)
- {
- 	add_error_table((struct error_table *) new_table->table);
- }
- #endif /* HAVE_ADD_TO_ERROR_TABLE */
- 
  static int isdir(char *path, unsigned char *val)
  {
      struct stat statbuf;
--- 1557,1562 ----
Index: openafs/src/aklog/asetkey.c
diff -c openafs/src/aklog/asetkey.c:1.4.4.2 openafs/src/aklog/asetkey.c:1.4.4.3
*** openafs/src/aklog/asetkey.c:1.4.4.2	Thu Jan  4 22:21:45 2007
--- openafs/src/aklog/asetkey.c	Tue Apr 10 14:39:49 2007
***************
*** 1,5 ****
  /*
!  * $Id: asetkey.c,v 1.4.4.2 2007/01/05 03:21:45 shadow Exp $
   *
   * asetkey - Manipulates an AFS KeyFile
   *
--- 1,5 ----
  /*
!  * $Id: asetkey.c,v 1.4.4.3 2007/04/10 18:39:49 shadow Exp $
   *
   * asetkey - Manipulates an AFS KeyFile
   *
***************
*** 85,97 ****
  	kvno = atoi(argv[2]);
  	retval = krb5_parse_name(context, argv[4], &principal);
  	if (retval != 0) {
! 		com_err(argv[0], retval, "while parsing AFS principal");
  		exit(1);
  	}
  	retval = krb5_kt_read_service_key(context, argv[3], principal, kvno,
  					  ENCTYPE_DES_CBC_CRC, &key);
  	if (retval != 0) {
! 		com_err(argv[0], retval, "while extracting AFS service key");
  		exit(1);
  	}
  
--- 85,97 ----
  	kvno = atoi(argv[2]);
  	retval = krb5_parse_name(context, argv[4], &principal);
  	if (retval != 0) {
! 		afs_com_err(argv[0], retval, "while parsing AFS principal");
  		exit(1);
  	}
  	retval = krb5_kt_read_service_key(context, argv[3], principal, kvno,
  					  ENCTYPE_DES_CBC_CRC, &key);
  	if (retval != 0) {
! 		afs_com_err(argv[0], retval, "while extracting AFS service key");
  		exit(1);
  	}
  
Index: openafs/src/bozo/bos.c
diff -c openafs/src/bozo/bos.c:1.23.2.1 openafs/src/bozo/bos.c:1.23.2.2
*** openafs/src/bozo/bos.c:1.23.2.1	Thu Feb  8 20:00:19 2007
--- openafs/src/bozo/bos.c	Tue Apr 10 14:39:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bos.c,v 1.23.2.1 2007/02/09 01:00:19 shadow Exp $");
  
  #include <afs/stds.h>
  #include <stdlib.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bos.c,v 1.23.2.2 2007/04/10 18:39:50 shadow Exp $");
  
  #include <afs/stds.h>
  #include <stdlib.h>
***************
*** 94,100 ****
      else if (acode == -3)
  	return "communications timeout (-3)";
      else
! 	return (char *)error_message(acode);
  }
  
  /* get partition id from a name */
--- 94,100 ----
      else if (acode == -3)
  	return "communications timeout (-3)";
      else
! 	return (char *)afs_error_message(acode);
  }
  
  /* get partition id from a name */
***************
*** 205,211 ****
  	 * local cell */
  	code = afsconf_GetCellInfo(tdir, tname, NULL, &info);
  	if (code) {
! 	    com_err("bos", code, "(can't find cell '%s' in cell database)",
  		    (tname ? tname : "<default>"));
  	    exit(1);
  	} else
--- 205,211 ----
  	 * local cell */
  	code = afsconf_GetCellInfo(tdir, tname, NULL, &info);
  	if (code) {
! 	    afs_com_err("bos", code, "(can't find cell '%s' in cell database)",
  		    (tname ? tname : "<default>"));
  	    exit(1);
  	} else
***************
*** 225,238 ****
  	if (as->parms[ADDPARMOFFSET + 2].items) {	/* -localauth */
  	    code = afsconf_GetLatestKey(tdir, 0, 0);
  	    if (code)
! 		com_err("bos", code, "(getting key from local KeyFile)");
  	    else {
  		if (aencrypt)
  		    code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex);
  		else
  		    code = afsconf_ClientAuth(tdir, &sc[2], &scIndex);
  		if (code)
! 		    com_err("bos", code, "(calling ClientAuth)");
  		else if (scIndex != 2)	/* this shouldn't happen */
  		    sc[scIndex] = sc[2];
  	    }
--- 225,238 ----
  	if (as->parms[ADDPARMOFFSET + 2].items) {	/* -localauth */
  	    code = afsconf_GetLatestKey(tdir, 0, 0);
  	    if (code)
! 		afs_com_err("bos", code, "(getting key from local KeyFile)");
  	    else {
  		if (aencrypt)
  		    code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex);
  		else
  		    code = afsconf_ClientAuth(tdir, &sc[2], &scIndex);
  		if (code)
! 		    afs_com_err("bos", code, "(calling ClientAuth)");
  		else if (scIndex != 2)	/* this shouldn't happen */
  		    sc[scIndex] = sc[2];
  	    }
***************
*** 259,265 ****
  						  ttoken.ticket);
  		scIndex = 2;
  	    } else
! 		com_err("bos", code, "(getting tickets)");
  	}
  	if ((scIndex == 0) || (sc[scIndex] == 0)) {
  	    fprintf(stderr, "bos: running unauthenticated\n");
--- 259,265 ----
  						  ttoken.ticket);
  		scIndex = 2;
  	    } else
! 		afs_com_err("bos", code, "(getting tickets)");
  	}
  	if ((scIndex == 0) || (sc[scIndex] == 0)) {
  	    fprintf(stderr, "bos: running unauthenticated\n");
***************
*** 301,307 ****
      }
      code = BOZO_SetNoAuthFlag(tconn, flag);
      if (code)
! 	com_err("bos", code, "(failed to set authentication flag)");
      return 0;
  }
  
--- 301,307 ----
      }
      code = BOZO_SetNoAuthFlag(tconn, flag);
      if (code)
! 	afs_com_err("bos", code, "(failed to set authentication flag)");
      return 0;
  }
  
***************
*** 369,375 ****
  	flags |= 0xff;
      code = BOZO_Prune(tconn, flags);
      if (code)
! 	com_err("bos", code, "(failed to prune server files)");
      return code;
  }
  
--- 369,375 ----
  	flags |= 0xff;
      code = BOZO_Prune(tconn, flags);
      if (code)
! 	afs_com_err("bos", code, "(failed to prune server files)");
      return code;
  }
  
***************
*** 1493,1499 ****
  
    done:
      if (code)
! 	com_err("bos", code, "(while reading log)");
      return code;
  }
  
--- 1493,1499 ----
  
    done:
      if (code)
! 	afs_com_err("bos", code, "(while reading log)");
      return code;
  }
  
Index: openafs/src/bucoord/bc_status.c
diff -c openafs/src/bucoord/bc_status.c:1.11.14.1 openafs/src/bucoord/bc_status.c:1.11.14.2
*** openafs/src/bucoord/bc_status.c:1.11.14.1	Thu Jan  4 22:32:24 2007
--- openafs/src/bucoord/bc_status.c	Tue Apr 10 14:39:50 2007
***************
*** 11,17 ****
  #include <afs/stds.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/bc_status.c,v 1.11.14.1 2007/01/05 03:32:24 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/stds.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/bc_status.c,v 1.11.14.2 2007/04/10 18:39:50 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 118,124 ****
  
      code = cmd_ParseLine(internalCmdLine, targv, &targc, MAXV);
      if (code) {
! 	printf("Couldn't parse line: '%s'", error_message(code));
  	return (1);
      }
      free(internalCmdLine);
--- 118,124 ----
  
      code = cmd_ParseLine(internalCmdLine, targv, &targc, MAXV);
      if (code) {
! 	printf("Couldn't parse line: '%s'", afs_error_message(code));
  	return (1);
      }
      free(internalCmdLine);
***************
*** 266,273 ****
  	if (localTaskFlags & ABORT_REQUEST) {
  	    code = TC_RequestAbort(tconn, taskId);
  	    if (code) {
! 		com_err("statusWatcher", code, "; Can't post abort request");
! 		com_err("statusWatcher", 0, "...Deleting job");
  		if (localTaskFlags & NOREMOVE) {
  		    curPollPtr->flags |= (STARTING | TASK_ERROR);
  		    curPollPtr->scheduledDump = 0;
--- 266,273 ----
  	if (localTaskFlags & ABORT_REQUEST) {
  	    code = TC_RequestAbort(tconn, taskId);
  	    if (code) {
! 		afs_com_err("statusWatcher", code, "; Can't post abort request");
! 		afs_com_err("statusWatcher", 0, "...Deleting job");
  		if (localTaskFlags & NOREMOVE) {
  		    curPollPtr->flags |= (STARTING | TASK_ERROR);
  		    curPollPtr->scheduledDump = 0;
Index: openafs/src/bucoord/commands.c
diff -c openafs/src/bucoord/commands.c:1.18.2.2 openafs/src/bucoord/commands.c:1.18.2.3
*** openafs/src/bucoord/commands.c:1.18.2.2	Thu Jan  4 22:32:24 2007
--- openafs/src/bucoord/commands.c	Tue Apr 10 14:39:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/commands.c,v 1.18.2.2 2007/01/05 03:32:24 shadow Exp $");
  
  #include <afs/stds.h>
  #if defined(AFS_LINUX24_ENV)
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/commands.c,v 1.18.2.3 2007/04/10 18:39:50 shadow Exp $");
  
  #include <afs/stds.h>
  #if defined(AFS_LINUX24_ENV)
***************
*** 119,125 ****
      if (!(*ss)) {
  	*ss = (struct serversort *)malloc(sizeof(struct serversort));
  	if (!(*ss)) {
! 	    com_err(whoami, BC_NOMEM, "");
  	    *ss = 0;
  	    return (BC_NOMEM);
  	}
--- 119,125 ----
      if (!(*ss)) {
  	*ss = (struct serversort *)malloc(sizeof(struct serversort));
  	if (!(*ss)) {
! 	    afs_com_err(whoami, BC_NOMEM, "");
  	    *ss = 0;
  	    return (BC_NOMEM);
  	}
***************
*** 140,146 ****
      if (!(*ps)) {
  	*ps = (struct partitionsort *)malloc(sizeof(struct partitionsort));
  	if (!(*ps)) {
! 	    com_err(whoami, BC_NOMEM, "");
  	    free(*ss);
  	    *ps = 0;
  	    *ss = 0;
--- 140,146 ----
      if (!(*ps)) {
  	*ps = (struct partitionsort *)malloc(sizeof(struct partitionsort));
  	if (!(*ps)) {
! 	    afs_com_err(whoami, BC_NOMEM, "");
  	    free(*ss);
  	    *ps = 0;
  	    *ss = 0;
***************
*** 287,293 ****
  				 entries[e].serverPartition[ei], &servers,
  				 &ss, &ps);
  		if (tcode) {
! 		    com_err(whoami, tcode, "");
  		    ERROR(tcode);
  		}
  
--- 287,293 ----
  				 entries[e].serverPartition[ei], &servers,
  				 &ss, &ps);
  		if (tcode) {
! 		    afs_com_err(whoami, tcode, "");
  		    ERROR(tcode);
  		}
  
***************
*** 319,332 ****
  		    tvd = (struct bc_volumeDump *)
  			malloc(sizeof(struct bc_volumeDump));
  		    if (!tvd) {
! 			com_err(whoami, BC_NOMEM, "");
  			ERROR(BC_NOMEM);
  		    }
  		    memset(tvd, 0, sizeof(*tvd));
  
  		    tvd->name = (char *)malloc(strlen(entries[e].name) + 10);
  		    if (!(tvd->name)) {
! 			com_err(whoami, BC_NOMEM, "");
  			free(tvd);
  			ERROR(BC_NOMEM);
  		    }
--- 319,332 ----
  		    tvd = (struct bc_volumeDump *)
  			malloc(sizeof(struct bc_volumeDump));
  		    if (!tvd) {
! 			afs_com_err(whoami, BC_NOMEM, "");
  			ERROR(BC_NOMEM);
  		    }
  		    memset(tvd, 0, sizeof(*tvd));
  
  		    tvd->name = (char *)malloc(strlen(entries[e].name) + 10);
  		    if (!(tvd->name)) {
! 			afs_com_err(whoami, BC_NOMEM, "");
  			free(tvd);
  			ERROR(BC_NOMEM);
  		    }
***************
*** 489,495 ****
  		    sprintf(patt, "^%s$", tve->name);
  		    errm = (char *)re_comp(patt);
  		    if (errm) {
! 			com_err(whoami, 0,
  				"Can't compile regular expression '%s': %s",
  				patt, errm);
  			return (-1);
--- 489,495 ----
  		    sprintf(patt, "^%s$", tve->name);
  		    errm = (char *)re_comp(patt);
  		    if (errm) {
! 			afs_com_err(whoami, 0,
  				"Can't compile regular expression '%s': %s",
  				patt, errm);
  			return (-1);
***************
*** 543,549 ****
  		}
  
  		if (code < 0)
! 		    com_err(whoami, 0, "Internal error in regex package");
  	    }			/*s */
  
  	    /* If found a match, then create a new volume dump entry */
--- 543,549 ----
  		}
  
  		if (code < 0)
! 		    afs_com_err(whoami, 0, "Internal error in regex package");
  	    }			/*s */
  
  	    /* If found a match, then create a new volume dump entry */
***************
*** 554,560 ****
  				 entry.serverPartition[foundentry], &servers,
  				 &ss, &ps);
  		if (code) {
! 		    com_err(whoami, code, "");
  		    return (code);
  		}
  
--- 554,560 ----
  				 entry.serverPartition[foundentry], &servers,
  				 &ss, &ps);
  		if (code) {
! 		    afs_com_err(whoami, code, "");
  		    return (code);
  		}
  
***************
*** 562,575 ****
  		tvd = (struct bc_volumeDump *)
  		    malloc(sizeof(struct bc_volumeDump));
  		if (!tvd) {
! 		    com_err(whoami, BC_NOMEM, "");
  		    return (BC_NOMEM);
  		}
  		memset(tvd, 0, sizeof(*tvd));
  
  		tvd->name = (char *)malloc(strlen(entry.name) + 10);
  		if (!(tvd->name)) {
! 		    com_err(whoami, BC_NOMEM, "");
  		    free(tvd);
  		    return (BC_NOMEM);
  		}
--- 562,575 ----
  		tvd = (struct bc_volumeDump *)
  		    malloc(sizeof(struct bc_volumeDump));
  		if (!tvd) {
! 		    afs_com_err(whoami, BC_NOMEM, "");
  		    return (BC_NOMEM);
  		}
  		memset(tvd, 0, sizeof(*tvd));
  
  		tvd->name = (char *)malloc(strlen(entry.name) + 10);
  		if (!(tvd->name)) {
! 		    afs_com_err(whoami, BC_NOMEM, "");
  		    free(tvd);
  		    return (BC_NOMEM);
  		}
***************
*** 712,718 ****
      tlen = strlen(astring);
      tp = (char *)malloc(tlen + 1);	/* don't forget the terminating null */
      if (!tp) {
! 	com_err(whoami, BC_NOMEM, "");
  	return (tp);
      }
      strcpy(tp, astring);
--- 712,718 ----
      tlen = strlen(astring);
      tp = (char *)malloc(tlen + 1);	/* don't forget the terminating null */
      if (!tp) {
! 	afs_com_err(whoami, BC_NOMEM, "");
  	return (tp);
      }
      strcpy(tp, astring);
***************
*** 740,752 ****
      }
  
      if (length == 0) {		/* no string (0 length) */
! 	com_err(whoami, 0, "Can't have zero length date and time string");
  	return (NULL);
      }
  
      string = (char *)malloc(length);	/* allocate the string */
      if (!string) {
! 	com_err(whoami, BC_NOMEM, "");
  	return (NULL);
      }
      string[0] = 0;
--- 740,752 ----
      }
  
      if (length == 0) {		/* no string (0 length) */
! 	afs_com_err(whoami, 0, "Can't have zero length date and time string");
  	return (NULL);
      }
  
      string = (char *)malloc(length);	/* allocate the string */
      if (!string) {
! 	afs_com_err(whoami, BC_NOMEM, "");
  	return (NULL);
      }
      string[0] = 0;
***************
*** 809,818 ****
      portOffset = bc_SafeATOI(port);
  
      if (portOffset < 0) {
! 	com_err(whoami, 0, "Can't decode port offset '%s'", port);
  	return (-1);
      } else if (portOffset > BC_MAXPORTOFFSET) {
! 	com_err(whoami, 0, "%u exceeds max port offset %u", portOffset,
  		BC_MAXPORTOFFSET);
  	return (-1);
      }
--- 809,818 ----
      portOffset = bc_SafeATOI(port);
  
      if (portOffset < 0) {
! 	afs_com_err(whoami, 0, "Can't decode port offset '%s'", port);
  	return (-1);
      } else if (portOffset > BC_MAXPORTOFFSET) {
! 	afs_com_err(whoami, 0, "%u exceeds max port offset %u", portOffset,
  		BC_MAXPORTOFFSET);
  	return (-1);
      }
***************
*** 838,844 ****
  
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
--- 838,844 ----
  
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
***************
*** 861,867 ****
  	if (code) {
  	    if (code == TC_NOTASKS)
  		break;
! 	    com_err(whoami, code, "; Can't get status from butc");
  	    return (-1);
  	}
  	if ((flags & TSK_STAT_NOTFOUND))
--- 861,867 ----
  	if (code) {
  	    if (code == TC_NOTASKS)
  		break;
! 	    afs_com_err(whoami, code, "; Can't get status from butc");
  	    return (-1);
  	}
  	if ((flags & TSK_STAT_NOTFOUND))
***************
*** 897,903 ****
  
      extern dlqlinkT statusHead;
  
!     com_err(whoami, 0, "waiting for job termination");
  
      while (usefulJobRunning) {
  	usefulJobRunning = (dlqEmpty(&statusHead) ? 0 : 1);
--- 897,903 ----
  
      extern dlqlinkT statusHead;
  
!     afs_com_err(whoami, 0, "waiting for job termination");
  
      while (usefulJobRunning) {
  	usefulJobRunning = (dlqEmpty(&statusHead) ? 0 : 1);
***************
*** 1058,1064 ****
      if (strchr(tp, '.') == 0) {
  	slot = bc_SafeATOI(tp);
  	if (slot == -1) {
! 	    com_err(whoami, 0, "Bad syntax for number '%s'", tp);
  	    return -1;
  	}
  
--- 1058,1064 ----
      if (strchr(tp, '.') == 0) {
  	slot = bc_SafeATOI(tp);
  	if (slot == -1) {
! 	    afs_com_err(whoami, 0, "Bad syntax for number '%s'", tp);
  	    return -1;
  	}
  
***************
*** 1091,1097 ****
  	    }
  	}
  	if (i >= BC_MAXSIMDUMPS) {
! 	    com_err(whoami, 0, "Can't find job %s", tp);
  	    return -1;
  	}
  
--- 1091,1097 ----
  	    }
  	}
  	if (i >= BC_MAXSIMDUMPS) {
! 	    afs_com_err(whoami, 0, "Can't find job %s", tp);
  	    return -1;
  	}
  
***************
*** 1099,1105 ****
  	statusPtr = findStatus(td->dumpID);
  
  	if (statusPtr == 0) {
! 	    com_err(whoami, 0, "Can't locate status - internal error");
  	    unlock_Status();
  	    return (-1);
  	}
--- 1099,1105 ----
  	statusPtr = findStatus(td->dumpID);
  
  	if (statusPtr == 0) {
! 	    afs_com_err(whoami, 0, "Can't locate status - internal error");
  	    unlock_Status();
  	    return (-1);
  	}
***************
*** 1147,1153 ****
  
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
--- 1147,1153 ----
  
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
***************
*** 1155,1161 ****
      if (as->parms[0].items) {
  	tp = as->parms[0].items->data;
  	if (bc_ParseHost(tp, &destServ)) {
! 	    com_err(whoami, 0, "Failed to locate destination host '%s'", tp);
  	    return -1;
  	}
      }
--- 1155,1161 ----
      if (as->parms[0].items) {
  	tp = as->parms[0].items->data;
  	if (bc_ParseHost(tp, &destServ)) {
! 	    afs_com_err(whoami, 0, "Failed to locate destination host '%s'", tp);
  	    return -1;
  	}
      }
***************
*** 1164,1170 ****
      if (as->parms[1].items) {
  	tp = as->parms[1].items->data;
  	if (bc_GetPartitionID(tp, &destPartition)) {
! 	    com_err(whoami, 0, "Can't parse destination partition '%s'", tp);
  	    return -1;
  	}
      }
--- 1164,1170 ----
      if (as->parms[1].items) {
  	tp = as->parms[1].items->data;
  	if (bc_GetPartitionID(tp, &destPartition)) {
! 	    afs_com_err(whoami, 0, "Can't parse destination partition '%s'", tp);
  	    return -1;
  	}
      }
***************
*** 1173,1186 ****
  	/* build list of volume items */
  	tvol = (struct bc_volumeDump *)malloc(sizeof(struct bc_volumeDump));
  	if (!tvol) {
! 	    com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  	memset(tvol, 0, sizeof(struct bc_volumeDump));
  
  	tvol->name = (char *)malloc(VOLSER_MAXVOLNAME + 1);
  	if (!tvol->name) {
! 	    com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  	strncpy(tvol->name, ti->data, VOLSER_OLDMAXVOLNAME);
--- 1173,1186 ----
  	/* build list of volume items */
  	tvol = (struct bc_volumeDump *)malloc(sizeof(struct bc_volumeDump));
  	if (!tvol) {
! 	    afs_com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  	memset(tvol, 0, sizeof(struct bc_volumeDump));
  
  	tvol->name = (char *)malloc(VOLSER_MAXVOLNAME + 1);
  	if (!tvol->name) {
! 	    afs_com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  	strncpy(tvol->name, ti->data, VOLSER_OLDMAXVOLNAME);
***************
*** 1201,1208 ****
  	code = ktime_DateToLong(timeString, &fromDate);
  	free(timeString);
  	if (code) {
! 	    com_err(whoami, 0, "Can't parse restore date and time");
! 	    com_err(whoami, 0, "%s", ktime_GetDateUsage());
  	    return code;
  	}
      } else {
--- 1201,1208 ----
  	code = ktime_DateToLong(timeString, &fromDate);
  	free(timeString);
  	if (code) {
! 	    afs_com_err(whoami, 0, "Can't parse restore date and time");
! 	    afs_com_err(whoami, 0, "%s", ktime_GetDateUsage());
  	    return code;
  	}
      } else {
***************
*** 1220,1226 ****
  	    portCount++;
  	ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32));
  	if (!ports) {
! 	    com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  
--- 1220,1226 ----
  	    portCount++;
  	ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32));
  	if (!ports) {
! 	    afs_com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  
***************
*** 1243,1249 ****
  		       bc_Restorer, ports, portCount,
  		       /*dumpSched */ NULL, /*append */ 0, dontExecute);
      if (code)
! 	com_err(whoami, code, "; Failed to queue restore");
  
      return (code);
  }
--- 1243,1249 ----
  		       bc_Restorer, ports, portCount,
  		       /*dumpSched */ NULL, /*append */ 0, dontExecute);
      if (code)
! 	afs_com_err(whoami, code, "; Failed to queue restore");
  
      return (code);
  }
***************
*** 1289,1300 ****
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
--- 1289,1300 ----
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
***************
*** 1307,1319 ****
      tvolumeEntry.partname = as->parms[1].items->data;
  
      if (bc_GetPartitionID(tvolumeEntry.partname, &tvolumeEntry.partition)) {
! 	com_err(whoami, 0, "Can't parse partition '%s'",
  		tvolumeEntry.partname);
  	return -1;
      }
  
      if (bc_ParseHost(tvolumeEntry.serverName, &tvolumeEntry.server)) {
! 	com_err(whoami, 0, "Can't locate host '%s'", tvolumeEntry.serverName);
  	return -1;
      }
  
--- 1307,1319 ----
      tvolumeEntry.partname = as->parms[1].items->data;
  
      if (bc_GetPartitionID(tvolumeEntry.partname, &tvolumeEntry.partition)) {
! 	afs_com_err(whoami, 0, "Can't parse partition '%s'",
  		tvolumeEntry.partname);
  	return -1;
      }
  
      if (bc_ParseHost(tvolumeEntry.serverName, &tvolumeEntry.server)) {
! 	afs_com_err(whoami, 0, "Can't locate host '%s'", tvolumeEntry.serverName);
  	return -1;
      }
  
***************
*** 1321,1327 ****
      if (as->parms[8].items) {
  	tp = as->parms[8].items->data;
  	if (bc_ParseHost(tp, &destServ)) {
! 	    com_err(whoami, 0, "Can't locate destination host '%s'", tp);
  	    return -1;
  	}
      } else			/* use destination host == original host */
--- 1321,1327 ----
      if (as->parms[8].items) {
  	tp = as->parms[8].items->data;
  	if (bc_ParseHost(tp, &destServ)) {
! 	    afs_com_err(whoami, 0, "Can't locate destination host '%s'", tp);
  	    return -1;
  	}
      } else			/* use destination host == original host */
***************
*** 1331,1337 ****
      if (as->parms[9].items) {
  	tp = as->parms[9].items->data;
  	if (bc_GetPartitionID(tp, &destPartition)) {
! 	    com_err(whoami, 0, "Can't parse destination partition '%s'", tp);
  	    return -1;
  	}
      } else			/* use original partition */
--- 1331,1337 ----
      if (as->parms[9].items) {
  	tp = as->parms[9].items->data;
  	if (bc_GetPartitionID(tp, &destPartition)) {
! 	    afs_com_err(whoami, 0, "Can't parse destination partition '%s'", tp);
  	    return -1;
  	}
      } else			/* use original partition */
***************
*** 1344,1350 ****
  	    portCount++;
  	ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32));
  	if (!ports) {
! 	    com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  
--- 1344,1350 ----
  	    portCount++;
  	ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32));
  	if (!ports) {
! 	    afs_com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  
***************
*** 1365,1371 ****
  	bc_EvalVolumeSet(bc_globalConfig, &tvolumeSet, &volsToRestore,
  			 cstruct);
      if (code) {
! 	com_err(whoami, code, "; Failed to evaluate volume set");
  	return (-1);
      }
  
--- 1365,1371 ----
  	bc_EvalVolumeSet(bc_globalConfig, &tvolumeSet, &volsToRestore,
  			 cstruct);
      if (code) {
! 	afs_com_err(whoami, code, "; Failed to evaluate volume set");
  	return (-1);
      }
  
***************
*** 1406,1412 ****
  		       bc_Restorer, ports, portCount,
  		       /*dumpSched */ NULL, /*append */ 0, dontExecute);
      if (code)
! 	com_err(whoami, code, "; Failed to queue restore");
  
      return (code);
  }
--- 1406,1412 ----
  		       bc_Restorer, ports, portCount,
  		       /*dumpSched */ NULL, /*append */ 0, dontExecute);
      if (code)
! 	afs_com_err(whoami, code, "; Failed to queue restore");
  
      return (code);
  }
***************
*** 1439,1463 ****
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
      if (as->parms[0].items) {
  	if (as->parms[1].items) {
! 	    com_err(whoami, 0, "Can't have both -name and -file options");
  	    return (-1);
  	}
  
  	volsetName = as->parms[0].items->data;
  	volsetPtr = bc_FindVolumeSet(bc_globalConfig, volsetName);
  	if (!volsetPtr) {
! 	    com_err(whoami, 0,
  		    "Can't find volume set '%s' in backup database",
  		    volsetName);
  	    return (-1);
--- 1439,1463 ----
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
      if (as->parms[0].items) {
  	if (as->parms[1].items) {
! 	    afs_com_err(whoami, 0, "Can't have both -name and -file options");
  	    return (-1);
  	}
  
  	volsetName = as->parms[0].items->data;
  	volsetPtr = bc_FindVolumeSet(bc_globalConfig, volsetName);
  	if (!volsetPtr) {
! 	    afs_com_err(whoami, 0,
  		    "Can't find volume set '%s' in backup database",
  		    volsetName);
  	    return (-1);
***************
*** 1468,1474 ****
  	    bc_EvalVolumeSet(bc_globalConfig, volsetPtr, &volsToRestore,
  			     cstruct);
  	if (code) {
! 	    com_err(whoami, code, "; Failed to evaluate volume set");
  	    return (-1);
  	}
      } else if (as->parms[1].items) {
--- 1468,1474 ----
  	    bc_EvalVolumeSet(bc_globalConfig, volsetPtr, &volsToRestore,
  			     cstruct);
  	if (code) {
! 	    afs_com_err(whoami, code, "; Failed to evaluate volume set");
  	    return (-1);
  	}
      } else if (as->parms[1].items) {
***************
*** 1480,1486 ****
  
  	fd = fopen(as->parms[1].items->data, "r");
  	if (!fd) {
! 	    com_err(whoami, errno, "; Cannot open file '%s'",
  		    as->parms[1].items->data);
  	    return (-1);
  	}
--- 1480,1486 ----
  
  	fd = fopen(as->parms[1].items->data, "r");
  	if (!fd) {
! 	    afs_com_err(whoami, errno, "; Cannot open file '%s'",
  		    as->parms[1].items->data);
  	    return (-1);
  	}
***************
*** 1499,1510 ****
  	    }
  
  	    if (bc_ParseHost(server, &destServer)) {
! 		com_err(whoami, 0, "Failed to locate host '%s'", server);
  		continue;
  	    }
  
  	    if (bc_GetPartitionID(partition, &destPartition)) {
! 		com_err(whoami, 0,
  			"Failed to parse destination partition '%s'",
  			partition);
  		continue;
--- 1499,1510 ----
  	    }
  
  	    if (bc_ParseHost(server, &destServer)) {
! 		afs_com_err(whoami, 0, "Failed to locate host '%s'", server);
  		continue;
  	    }
  
  	    if (bc_GetPartitionID(partition, &destPartition)) {
! 		afs_com_err(whoami, 0,
  			"Failed to parse destination partition '%s'",
  			partition);
  		continue;
***************
*** 1517,1523 ****
  
  	    tvol->name = (char *)malloc(VOLSER_MAXVOLNAME + 1);
  	    if (!tvol->name) {
! 		com_err(whoami, BC_NOMEM, "");
  		return BC_NOMEM;
  	    }
  	    strncpy(tvol->name, volume, VOLSER_OLDMAXVOLNAME);
--- 1517,1523 ----
  
  	    tvol->name = (char *)malloc(VOLSER_MAXVOLNAME + 1);
  	    if (!tvol->name) {
! 		afs_com_err(whoami, BC_NOMEM, "");
  		return BC_NOMEM;
  	    }
  	    strncpy(tvol->name, volume, VOLSER_OLDMAXVOLNAME);
***************
*** 1532,1538 ****
  	}
  	fclose(fd);
      } else {
! 	com_err(whoami, 0, "-name or -file option required");
  	return (-1);
      }
  
--- 1532,1538 ----
  	}
  	fclose(fd);
      } else {
! 	afs_com_err(whoami, 0, "-name or -file option required");
  	return (-1);
      }
  
***************
*** 1543,1549 ****
  	    portCount++;
  	ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32));
  	if (!ports) {
! 	    com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  
--- 1543,1549 ----
  	    portCount++;
  	ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32));
  	if (!ports) {
! 	    afs_com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  
***************
*** 1568,1574 ****
  			  bc_Restorer, ports, portCount,
  			  /*dumpSched */ NULL, /*append */ 0, dontExecute);
      if (code)
! 	com_err(whoami, code, "; Failed to queue restore");
  
      return code;
  }
--- 1568,1574 ----
  			  bc_Restorer, ports, portCount,
  			  /*dumpSched */ NULL, /*append */ 0, dontExecute);
      if (code)
! 	afs_com_err(whoami, code, "; Failed to queue restore");
  
      return code;
  }
***************
*** 1631,1647 ****
  
      code = bc_UpdateDumpSchedule();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve dump schedule");
  	return (code);
      }
      code = bc_UpdateVolumeSet();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
--- 1631,1647 ----
  
      code = bc_UpdateDumpSchedule();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve dump schedule");
  	return (code);
      }
      code = bc_UpdateVolumeSet();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
***************
*** 1654,1666 ****
  	loadfile = 1;
  	if (as->parms[0].items || as->parms[1].items || as->parms[2].items
  	    || as->parms[4].items) {
! 	    com_err(whoami, 0, "Invalid option specified with -file option");
  	    return -1;
  	}
      } else {
  	loadfile = 0;
  	if (!as->parms[0].items || !as->parms[1].items) {
! 	    com_err(whoami, 0,
  		    "Must specify volume set name and dump level name");
  	    return -1;
  	}
--- 1654,1666 ----
  	loadfile = 1;
  	if (as->parms[0].items || as->parms[1].items || as->parms[2].items
  	    || as->parms[4].items) {
! 	    afs_com_err(whoami, 0, "Invalid option specified with -file option");
  	    return -1;
  	}
      } else {
  	loadfile = 0;
  	if (!as->parms[0].items || !as->parms[1].items) {
! 	    afs_com_err(whoami, 0,
  		    "Must specify volume set name and dump level name");
  	    return -1;
  	}
***************
*** 1682,1689 ****
  	code = ktime_DateToLong(timeString, &atTime);
  	free(timeString);
  	if (code) {
! 	    com_err(whoami, 0, "Can't parse dump start date and time");
! 	    com_err(whoami, 0, "%s", ktime_GetDateUsage());
  	    return (1);
  	}
      } else
--- 1682,1689 ----
  	code = ktime_DateToLong(timeString, &atTime);
  	free(timeString);
  	if (code) {
! 	    afs_com_err(whoami, 0, "Can't parse dump start date and time");
! 	    afs_com_err(whoami, 0, "%s", ktime_GetDateUsage());
  	    return (1);
  	}
      } else
***************
*** 1703,1709 ****
  	    portCount = 1;
  	    portp = (afs_int32 *) malloc(sizeof(afs_int32));
  	    if (!portp) {
! 		com_err(whoami, BC_NOMEM, "");
  		return BC_NOMEM;
  	    }
  
--- 1703,1709 ----
  	    portCount = 1;
  	    portp = (afs_int32 *) malloc(sizeof(afs_int32));
  	    if (!portp) {
! 		afs_com_err(whoami, BC_NOMEM, "");
  		return BC_NOMEM;
  	    }
  
***************
*** 1719,1731 ****
  	 */
  	tvs = bc_FindVolumeSet(bc_globalConfig, vsName);
  	if (!tvs) {
! 	    com_err(whoami, 0,
  		    "Can't find volume set '%s' in backup database", vsName);
  	    return (-1);
  	}
  	baseds = bc_FindDumpSchedule(bc_globalConfig, dumpPath);
  	if (!baseds) {
! 	    com_err(whoami, 0,
  		    "Can't find dump schedule '%s' in backup database",
  		    dumpPath);
  	    return (-1);
--- 1719,1731 ----
  	 */
  	tvs = bc_FindVolumeSet(bc_globalConfig, vsName);
  	if (!tvs) {
! 	    afs_com_err(whoami, 0,
  		    "Can't find volume set '%s' in backup database", vsName);
  	    return (-1);
  	}
  	baseds = bc_FindDumpSchedule(bc_globalConfig, dumpPath);
  	if (!baseds) {
! 	    afs_com_err(whoami, 0,
  		    "Can't find dump schedule '%s' in backup database",
  		    dumpPath);
  	    return (-1);
***************
*** 1745,1751 ****
       */
      if (doAt) {
  	if (atTime < time(0)) {
! 	    com_err(whoami, 0,
  		    "Time of dump is earlier then current time - not added");
  	} else {
  	    statusPtr = createStatusNode();
--- 1745,1751 ----
       */
      if (doAt) {
  	if (atTime < time(0)) {
! 	    afs_com_err(whoami, 0,
  		    "Time of dump is earlier then current time - not added");
  	} else {
  	    statusPtr = createStatusNode();
***************
*** 1784,1790 ****
  	    statusPtr->scheduledDump = atTime;
  	    statusPtr->cmdLine = (char *)malloc(length);
  	    if (!statusPtr->cmdLine) {
! 		com_err(whoami, BC_NOMEM, "");
  		return BC_NOMEM;
  	    }
  
--- 1784,1790 ----
  	    statusPtr->scheduledDump = atTime;
  	    statusPtr->cmdLine = (char *)malloc(length);
  	    if (!statusPtr->cmdLine) {
! 		afs_com_err(whoami, BC_NOMEM, "");
  		return BC_NOMEM;
  	    }
  
***************
*** 1818,1824 ****
  
  	    printf("Add scheduled dump as job %d\n", statusPtr->jobNumber);
  	    if ((atTime > ttoken.endTime) && (ttoken.endTime != NEVERDATE))
! 		com_err(whoami, 0,
  			"Warning: job %d starts after expiration of AFS token",
  			statusPtr->jobNumber);
  
--- 1818,1824 ----
  
  	    printf("Add scheduled dump as job %d\n", statusPtr->jobNumber);
  	    if ((atTime > ttoken.endTime) && (ttoken.endTime != NEVERDATE))
! 		afs_com_err(whoami, 0,
  			"Warning: job %d starts after expiration of AFS token",
  			statusPtr->jobNumber);
  
***************
*** 1836,1842 ****
      if (loadfile) {
  	loadFile = (char *)malloc(strlen(as->parms[6].items->data) + 1);
  	if (!loadFile) {
! 	    com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  	strcpy(loadFile, as->parms[6].items->data);
--- 1836,1842 ----
      if (loadfile) {
  	loadFile = (char *)malloc(strlen(as->parms[6].items->data) + 1);
  	if (!loadFile) {
! 	    afs_com_err(whoami, BC_NOMEM, "");
  	    return BC_NOMEM;
  	}
  	strcpy(loadFile, as->parms[6].items->data);
***************
*** 1898,1904 ****
       * dump at the level we requested it be done at.
       */
      if (problemFindingDump) {
! 	com_err(whoami, 0,
  		"Warning: Doing level %d dump due to missing higher-level dumps",
  		level);
  	if (parent) {
--- 1898,1904 ----
       * dump at the level we requested it be done at.
       */
      if (problemFindingDump) {
! 	afs_com_err(whoami, 0,
  		"Warning: Doing level %d dump due to missing higher-level dumps",
  		level);
  	if (parent) {
***************
*** 1911,1917 ****
      /* Expand out the volume set into its component list of volumes. */
      code = bc_EvalVolumeSet(bc_globalConfig, tvs, &volsToDump, cstruct);
      if (code) {
! 	com_err(whoami, code, "; Failed to evaluate volume set");
  	return (-1);
      }
      if (!volsToDump) {
--- 1911,1917 ----
      /* Expand out the volume set into its component list of volumes. */
      code = bc_EvalVolumeSet(bc_globalConfig, tvs, &volsToDump, cstruct);
      if (code) {
! 	afs_com_err(whoami, code, "; Failed to evaluate volume set");
  	return (-1);
      }
      if (!volsToDump) {
***************
*** 1941,1947 ****
  		    tve->cloneDate = 0;
  
  		if (tve->cloneDate && (tve->cloneDate == tve->date)) {
! 		    com_err(whoami, 0,
  			    "Warning: Timestamp on volume %s unchanged from previous dump",
  			    tve->name);
  		}
--- 1941,1947 ----
  		    tve->cloneDate = 0;
  
  		if (tve->cloneDate && (tve->cloneDate == tve->date)) {
! 		    afs_com_err(whoami, 0,
  			    "Warning: Timestamp on volume %s unchanged from previous dump",
  			    tve->name);
  		}
***************
*** 1966,1972 ****
  			  parent, level, bc_Dumper, portp, /*portCount */ 1,
  			  baseds, doAppend, dontExecute);
      if (code)
! 	com_err(whoami, code, "; Failed to queue dump");
  
      return (code);
  }				/*bc_DumpCmd */
--- 1966,1972 ----
  			  parent, level, bc_Dumper, portp, /*portCount */ 1,
  			  baseds, doAppend, dontExecute);
      if (code)
! 	afs_com_err(whoami, code, "; Failed to queue dump");
  
      return (code);
  }				/*bc_DumpCmd */
***************
*** 1996,2004 ****
  	statusPtr = (statusP) ptr;
  	if (!(statusPtr->flags & ABORT_REQUEST)) {
  	    unlock_Status();
! 	    com_err(whoami, 0, "Job %d still running (and not aborted)",
  		    statusPtr->jobNumber);
! 	    com_err(whoami, 0,
  		    "You must at least 'kill' all running jobs before quitting");
  	    return -1;
  	}
--- 1996,2004 ----
  	statusPtr = (statusP) ptr;
  	if (!(statusPtr->flags & ABORT_REQUEST)) {
  	    unlock_Status();
! 	    afs_com_err(whoami, 0, "Job %d still running (and not aborted)",
  		    statusPtr->jobNumber);
! 	    afs_com_err(whoami, 0,
  		    "You must at least 'kill' all running jobs before quitting");
  	    return -1;
  	}
***************
*** 2010,2017 ****
       */
      for (td = bc_dumpTasks, i = 0; i < BC_MAXSIMDUMPS; i++, td++) {
  	if (td->flags & BC_DI_INUSE) {
! 	    com_err(whoami, 0, "A job is still running");
! 	    com_err(whoami, 0,
  		    "You must at least 'kill' all running jobs before quitting");
  	    return -1;
  	}
--- 2010,2017 ----
       */
      for (td = bc_dumpTasks, i = 0; i < BC_MAXSIMDUMPS; i++, td++) {
  	if (td->flags & BC_DI_INUSE) {
! 	    afs_com_err(whoami, 0, "A job is still running");
! 	    afs_com_err(whoami, 0,
  		    "You must at least 'kill' all running jobs before quitting");
  	    return -1;
  	}
***************
*** 2042,2067 ****
  
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
      if (as->parms[0].items) {	/* -name */
  	tapename = as->parms[0].items->data;
  	if (strlen(tapename) >= TC_MAXTAPELEN) {
! 	    com_err(whoami, 0, "AFS tape name '%s' is too long", tapename);
  	    return -1;
  	}
      }
  
      if (as->parms[3].items) {	/* -pname */
  	if (tapename) {
! 	    com_err(whoami, 0, "Can only specify -name or -pname");
  	    return -1;
  	}
  	pname = as->parms[3].items->data;
  	if (strlen(pname) >= TC_MAXTAPELEN) {
! 	    com_err(whoami, 0, "Permanent tape name '%s' is too long", pname);
  	    return -1;
  	}
      }
--- 2042,2067 ----
  
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
      if (as->parms[0].items) {	/* -name */
  	tapename = as->parms[0].items->data;
  	if (strlen(tapename) >= TC_MAXTAPELEN) {
! 	    afs_com_err(whoami, 0, "AFS tape name '%s' is too long", tapename);
  	    return -1;
  	}
      }
  
      if (as->parms[3].items) {	/* -pname */
  	if (tapename) {
! 	    afs_com_err(whoami, 0, "Can only specify -name or -pname");
  	    return -1;
  	}
  	pname = as->parms[3].items->data;
  	if (strlen(pname) >= TC_MAXTAPELEN) {
! 	    afs_com_err(whoami, 0, "Permanent tape name '%s' is too long", pname);
  	    return -1;
  	}
      }
***************
*** 2069,2075 ****
      if (as->parms[1].items) {
  	size = bc_FloatATOI(as->parms[1].items->data);
  	if (size == -1) {
! 	    com_err(whoami, 0, "Bad syntax for tape size '%s'",
  		    as->parms[1].items->data);
  	    return -1;
  	}
--- 2069,2075 ----
      if (as->parms[1].items) {
  	size = bc_FloatATOI(as->parms[1].items->data);
  	if (size == -1) {
! 	    afs_com_err(whoami, 0, "Bad syntax for tape size '%s'",
  		    as->parms[1].items->data);
  	    return -1;
  	}
***************
*** 2103,2109 ****
  
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
--- 2103,2109 ----
  
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
***************
*** 2134,2140 ****
  
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
--- 2134,2140 ----
  
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
***************
*** 2275,2281 ****
  		  &host);
  
      if (code) {
! 	com_err(whoami, code, "; Unable to verify database");
  	return (-1);
      }
  
--- 2275,2281 ----
  		  &host);
  
      if (code) {
! 	afs_com_err(whoami, code, "; Unable to verify database");
  	return (-1);
      }
  
***************
*** 2284,2290 ****
      if (status == 0)
  	printf("Database OK\n");
      else
! 	com_err(whoami, status, "; Database is NOT_OK");
  
      if (detail) {
  	printf("Orphan blocks %d\n", orphans);
--- 2284,2290 ----
      if (status == 0)
  	printf("Database OK\n");
      else
! 	afs_com_err(whoami, status, "; Database is NOT_OK");
  
      if (detail) {
  	printf("Orphan blocks %d\n", orphans);
***************
*** 2324,2337 ****
      if (port >= 0) {
  	tcode = bc_UpdateHosts();
  	if (tcode) {
! 	    com_err(whoami, tcode, "; Can't retrieve tape hosts");
  	    ERROR(tcode);
  	}
  
  	/* Find the dump in the backup database */
  	tcode = bcdb_FindDumpByID(dumpid, &dumpEntry);
  	if (tcode) {
! 	    com_err(whoami, tcode, "; Unable to locate dumpID %u in database",
  		    dumpid);
  	    ERROR(tcode);
  	}
--- 2324,2337 ----
      if (port >= 0) {
  	tcode = bc_UpdateHosts();
  	if (tcode) {
! 	    afs_com_err(whoami, tcode, "; Can't retrieve tape hosts");
  	    ERROR(tcode);
  	}
  
  	/* Find the dump in the backup database */
  	tcode = bcdb_FindDumpByID(dumpid, &dumpEntry);
  	if (tcode) {
! 	    afs_com_err(whoami, tcode, "; Unable to locate dumpID %u in database",
  		    dumpid);
  	    ERROR(tcode);
  	}
***************
*** 2351,2357 ****
  	    if (tcode) {
  		if (tcode == RXGEN_OPCODE)
  		    tcode = BC_VERSIONFAIL;
! 		com_err(whoami, tcode,
  			"; Unable to delete dumpID %u via butc", dumpid);
  		ERROR(tcode);
  	    }
--- 2351,2357 ----
  	    if (tcode) {
  		if (tcode == RXGEN_OPCODE)
  		    tcode = BC_VERSIONFAIL;
! 		afs_com_err(whoami, tcode,
  			"; Unable to delete dumpID %u via butc", dumpid);
  		ERROR(tcode);
  	    }
***************
*** 2369,2375 ****
  	    /* Wait for task to finish */
  	    taskflag = waitForTask(taskId);
  	    if (taskflag & (TASK_ERROR | ABORT_DONE)) {
! 		com_err(whoami, BUTX_DELETEOBJFAIL,
  			"; Unable to delete dumpID %u via butc", dumpid);
  		ERROR(BUTX_DELETEOBJFAIL);	/* the task failed */
  	    }
--- 2369,2375 ----
  	    /* Wait for task to finish */
  	    taskflag = waitForTask(taskId);
  	    if (taskflag & (TASK_ERROR | ABORT_DONE)) {
! 		afs_com_err(whoami, BUTX_DELETEOBJFAIL,
  			"; Unable to delete dumpID %u via butc", dumpid);
  		ERROR(BUTX_DELETEOBJFAIL);	/* the task failed */
  	    }
***************
*** 2389,2395 ****
  
  	tcode = bcdb_deleteDump(dumpid, 0, 0, &dumps);
  	if (tcode) {
! 	    com_err(whoami, tcode,
  		    "; Unable to delete dumpID %u from database", dumpid);
  	    dumps.budb_dumpsList_len = 0;
  	    if (!code)
--- 2389,2395 ----
  
  	tcode = bcdb_deleteDump(dumpid, 0, 0, &dumps);
  	if (tcode) {
! 	    afs_com_err(whoami, tcode,
  		    "; Unable to delete dumpID %u from database", dumpid);
  	    dumps.budb_dumpsList_len = 0;
  	    if (!code)
***************
*** 2431,2443 ****
      /* Must specify at least one of -dumpid, -from, or -to */
      if (!as->parms[0].items && !as->parms[1].items && !as->parms[2].items
  	&& !as->parms[4].items) {
! 	com_err(whoami, 0, "Must specify at least one field");
  	return (-1);
      }
  
      /* Must have -to option with -from option */
      if (as->parms[1].items && !as->parms[2].items) {
! 	com_err(whoami, 0, "Must specify '-to' field with '-from' field");
  	return (-1);
      }
  
--- 2431,2443 ----
      /* Must specify at least one of -dumpid, -from, or -to */
      if (!as->parms[0].items && !as->parms[1].items && !as->parms[2].items
  	&& !as->parms[4].items) {
! 	afs_com_err(whoami, 0, "Must specify at least one field");
  	return (-1);
      }
  
      /* Must have -to option with -from option */
      if (as->parms[1].items && !as->parms[2].items) {
! 	afs_com_err(whoami, 0, "Must specify '-to' field with '-from' field");
  	return (-1);
      }
  
***************
*** 2453,2460 ****
  	code = ktime_DateToLong(timeString, &fromTime);
  	free(timeString);
  	if (code) {
! 	    com_err(whoami, 0, "Can't parse 'from' date and time");
! 	    com_err(whoami, 0, "%s", ktime_GetDateUsage());
  	    return (-1);
  	}
  	havetime = 1;
--- 2453,2460 ----
  	code = ktime_DateToLong(timeString, &fromTime);
  	free(timeString);
  	if (code) {
! 	    afs_com_err(whoami, 0, "Can't parse 'from' date and time");
! 	    afs_com_err(whoami, 0, "%s", ktime_GetDateUsage());
  	    return (-1);
  	}
  	havetime = 1;
***************
*** 2485,2492 ****
  	code = ktime_DateToLong(timeString, &toTime);
  	free(timeString);
  	if (code) {
! 	    com_err(whoami, 0, "Can't parse 'to' date and time");
! 	    com_err(whoami, 0, "%s", ktime_GetDateUsage());
  	    return (-1);
  	}
  	toTime += 59;
--- 2485,2492 ----
  	code = ktime_DateToLong(timeString, &toTime);
  	free(timeString);
  	if (code) {
! 	    afs_com_err(whoami, 0, "Can't parse 'to' date and time");
! 	    afs_com_err(whoami, 0, "%s", ktime_GetDateUsage());
  	    return (-1);
  	}
  	toTime += 59;
***************
*** 2494,2500 ****
      }
  
      if (fromTime > toTime) {
! 	com_err(whoami, 0,
  		"'-from' date/time cannot be later than '-to' date/time");
  	return (-1);
      }
--- 2494,2500 ----
      }
  
      if (fromTime > toTime) {
! 	afs_com_err(whoami, 0,
  		"'-from' date/time cannot be later than '-to' date/time");
  	return (-1);
      }
***************
*** 2528,2534 ****
  	code =
  	    bcdb_listDumps(sflags, groupId, fromTime, toTime, &dumps, &flags);
  	if (code) {
! 	    com_err(whoami, code,
  		    "; Error while deleting dumps from %u to %u", fromTime,
  		    toTime);
  	    rcode = -1;
--- 2528,2534 ----
  	code =
  	    bcdb_listDumps(sflags, groupId, fromTime, toTime, &dumps, &flags);
  	if (code) {
! 	    afs_com_err(whoami, code,
  		    "; Error while deleting dumps from %u to %u", fromTime,
  		    toTime);
  	    rcode = -1;
***************
*** 2582,2588 ****
  
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
--- 2582,2588 ----
  
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
***************
*** 2605,2612 ****
  	code = ktime_DateToLong(timeString, &toTime);
  	free(timeString);
  	if (code) {
! 	    com_err(whoami, 0, "Can't parse '-archive' date and time");
! 	    com_err(whoami, 0, "%s", ktime_GetDateUsage());
  	    return (-1);
  	}
  	toTime += 59;
--- 2605,2612 ----
  	code = ktime_DateToLong(timeString, &toTime);
  	free(timeString);
  	if (code) {
! 	    afs_com_err(whoami, 0, "Can't parse '-archive' date and time");
! 	    afs_com_err(whoami, 0, "%s", ktime_GetDateUsage());
  	    return (-1);
  	}
  	toTime += 59;
***************
*** 2619,2625 ****
  
      code = TC_SaveDb(tconn, toTime, &taskId);
      if (code) {
! 	com_err(whoami, code, "; Failed to save database");
  	goto exit;
      }
  
--- 2619,2625 ----
  
      code = TC_SaveDb(tconn, toTime, &taskId);
      if (code) {
! 	afs_com_err(whoami, code, "; Failed to save database");
  	goto exit;
      }
  
***************
*** 2650,2656 ****
  
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
--- 2650,2656 ----
  
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
***************
*** 2666,2672 ****
  
      code = TC_RestoreDb(tconn, &taskId);
      if (code) {
! 	com_err(whoami, code, "; Failed to restore database");
  	goto exit;
      }
  
--- 2666,2672 ----
  
      code = TC_RestoreDb(tconn, &taskId);
      if (code) {
! 	afs_com_err(whoami, code, "; Failed to restore database");
  	goto exit;
      }
  
***************
*** 2833,2839 ****
      }
  
      if (code)
! 	com_err(whoami, code, "");
      return (code);
  }
  
--- 2833,2839 ----
      }
  
      if (code)
! 	afs_com_err(whoami, code, "");
      return (code);
  }
  
***************
*** 2923,2929 ****
      for (tapeNumber = dumpEntry.tapes.b; tapeNumber <= dumpEntry.tapes.maxTapes; tapeNumber++) {	/*f */
  	tapeLinkPtr = (struct tapeLink *)malloc(sizeof(struct tapeLink));
  	if (!tapeLinkPtr) {
! 	    com_err(whoami, BC_NOMEM, "");
  	    ERROR(BC_NOMEM);
  	}
  
--- 2923,2929 ----
      for (tapeNumber = dumpEntry.tapes.b; tapeNumber <= dumpEntry.tapes.maxTapes; tapeNumber++) {	/*f */
  	tapeLinkPtr = (struct tapeLink *)malloc(sizeof(struct tapeLink));
  	if (!tapeLinkPtr) {
! 	    afs_com_err(whoami, BC_NOMEM, "");
  	    ERROR(BC_NOMEM);
  	}
  
***************
*** 2975,2981 ****
  		volumeLinkPtr =
  		    (struct volumeLink *)malloc(sizeof(struct volumeLink));
  		if (!volumeLinkPtr) {
! 		    com_err(whoami, BC_NOMEM, "");
  		    ERROR(BC_NOMEM);
  		}
  		memset(volumeLinkPtr, 0, sizeof(*volumeLinkPtr));
--- 2975,2981 ----
  		volumeLinkPtr =
  		    (struct volumeLink *)malloc(sizeof(struct volumeLink));
  		if (!volumeLinkPtr) {
! 		    afs_com_err(whoami, BC_NOMEM, "");
  		    ERROR(BC_NOMEM);
  		}
  		memset(volumeLinkPtr, 0, sizeof(*volumeLinkPtr));
***************
*** 3044,3050 ****
  
    error_exit:
      if (code)
! 	com_err("dumpInfo", code, "; Can't get dump information");
  
      /* free all allocated structures */
      tapeLinkPtr = head;
--- 3044,3050 ----
  
    error_exit:
      if (code)
! 	afs_com_err("dumpInfo", code, "; Can't get dump information");
  
      /* free all allocated structures */
      tapeLinkPtr = head;
***************
*** 3103,3109 ****
  	if (code) {
  	    if (code == BUDB_ENDOFLIST)
  		return 0;
! 	    com_err("dumpInfo", code, "; Can't get dump information");
  	    return (code);
  	}
  
--- 3103,3109 ----
  	if (code) {
  	    if (code == BUDB_ENDOFLIST)
  		return 0;
! 	    afs_com_err("dumpInfo", code, "; Can't get dump information");
  	    return (code);
  	}
  
***************
*** 3156,3168 ****
  
      if (as->parms[0].items) {
  	if (as->parms[1].items) {
! 	    com_err(whoami, 0,
  		    "These options are exclusive - select only one");
  	    return (BC_BADARG);
  	}
  	ndumps = atoi(as->parms[0].items->data);
  	if (ndumps <= 0) {
! 	    com_err(whoami, 0, "Must provide a positive number");
  	    return -1;
  	}
  
--- 3156,3168 ----
  
      if (as->parms[0].items) {
  	if (as->parms[1].items) {
! 	    afs_com_err(whoami, 0,
  		    "These options are exclusive - select only one");
  	    return (BC_BADARG);
  	}
  	ndumps = atoi(as->parms[0].items->data);
  	if (ndumps <= 0) {
! 	    afs_com_err(whoami, 0, "Must provide a positive number");
  	    return -1;
  	}
  
Index: openafs/src/bucoord/dump.c
diff -c openafs/src/bucoord/dump.c:1.13.6.1 openafs/src/bucoord/dump.c:1.13.6.2
*** openafs/src/bucoord/dump.c:1.13.6.1	Thu Jan  4 22:32:24 2007
--- openafs/src/bucoord/dump.c	Tue Apr 10 14:39:50 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump.c,v 1.13.6.1 2007/01/05 03:32:24 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump.c,v 1.13.6.2 2007/04/10 18:39:50 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
***************
*** 94,100 ****
      volDesc =
  	(struct tc_dumpDesc *)malloc(count * sizeof(struct tc_dumpDesc));
      if (!volDesc) {
! 	com_err(whoami, BC_NOMEM, "");
  	ERROR(BC_NOMEM);
      }
  
--- 94,100 ----
      volDesc =
  	(struct tc_dumpDesc *)malloc(count * sizeof(struct tc_dumpDesc));
      if (!volDesc) {
! 	afs_com_err(whoami, BC_NOMEM, "");
  	ERROR(BC_NOMEM);
      }
  
***************
*** 144,154 ****
      printf("Starting dump\n");
      code = TC_PerformDump(tconn, tcdiPtr, &volArray, &dumpTaskPtr->dumpID);
      if (code) {
! 	com_err(whoami, code, "; Failed to start dump");
  	ERROR(code);
      }
  
!     com_err(whoami, 0, "Task %u: Dump (%s)", dumpTaskPtr->dumpID,
  	    tcdiPtr->dumpName);
  
      /* create status monitor block */
--- 144,154 ----
      printf("Starting dump\n");
      code = TC_PerformDump(tconn, tcdiPtr, &volArray, &dumpTaskPtr->dumpID);
      if (code) {
! 	afs_com_err(whoami, code, "; Failed to start dump");
  	ERROR(code);
      }
  
!     afs_com_err(whoami, 0, "Task %u: Dump (%s)", dumpTaskPtr->dumpID,
  	    tcdiPtr->dumpName);
  
      /* create status monitor block */
***************
*** 266,272 ****
  	    break;
  
      if (i >= BC_MAXSIMDUMPS) {
! 	com_err(whoami, BC_NOTLOCKED,
  		"All of the dump/restore slots are in use, try again later");
  	return (BC_NOTLOCKED);
      }
--- 266,272 ----
  	    break;
  
      if (i >= BC_MAXSIMDUMPS) {
! 	afs_com_err(whoami, BC_NOTLOCKED,
  		"All of the dump/restore slots are in use, try again later");
  	return (BC_NOTLOCKED);
      }
***************
*** 305,311 ****
  			  (void *)i, "helper", &junk);
      if (code) {
  	bc_HandleMisc(code);
! 	com_err(whoami, code, "; Can't start thread");
  
  	/* Cleanup allocated data structures */
  	freeDumpTaskVolumeList(bc_dumpTasks[i].volumes);
--- 305,311 ----
  			  (void *)i, "helper", &junk);
      if (code) {
  	bc_HandleMisc(code);
! 	afs_com_err(whoami, code, "; Can't start thread");
  
  	/* Cleanup allocated data structures */
  	freeDumpTaskVolumeList(bc_dumpTasks[i].volumes);
***************
*** 384,390 ****
  
      code = TC_LabelTape(tconn, &label, &taskId);
      if (code) {
! 	com_err(whoami, code, "; Failed to start labeltape");
  	return (code);
      }
  
--- 384,390 ----
  
      code = TC_LabelTape(tconn, &label, &taskId);
      if (code) {
! 	afs_com_err(whoami, code, "; Failed to start labeltape");
  	return (code);
      }
  
***************
*** 430,436 ****
  	    printf("Tape read was unlabelled\n");
  	    return 0;
  	}
! 	com_err(whoami, code, "; Failed to start readlabel");
  	return (code);
      }
  
--- 430,436 ----
  	    printf("Tape read was unlabelled\n");
  	    return 0;
  	}
! 	afs_com_err(whoami, code, "; Failed to start readlabel");
  	return (code);
      }
  
***************
*** 468,474 ****
  
      code = TC_ScanDumps(tconn, dbAddFlag, &taskId);
      if (code) {
! 	com_err(whoami, code, "; Failed to start scantape");
  	return (code);
      }
  
--- 468,474 ----
  
      code = TC_ScanDumps(tconn, dbAddFlag, &taskId);
      if (code) {
! 	afs_com_err(whoami, code, "; Failed to start scantape");
  	return (code);
      }
  
***************
*** 559,565 ****
  
      code = bc_GetConn(config, port, tconn);
      if (code) {
! 	com_err(whoami, code,
  		"; Can't connect to tape coordinator at port %d", port);
  	return (code);
      }
--- 559,565 ----
  
      code = bc_GetConn(config, port, tconn);
      if (code) {
! 	afs_com_err(whoami, code,
  		"; Can't connect to tape coordinator at port %d", port);
  	return (code);
      }
***************
*** 569,578 ****
  	rx_DestroyConnection(*tconn);
  
  	if (code == BC_VERSIONFAIL)
! 	    com_err(whoami, code,
  		    "; Backup and butc are not the same version");
  	else
! 	    com_err(whoami, code,
  		    "; Can't access tape coordinator at port %d", port);
  
  	return (code);
--- 569,578 ----
  	rx_DestroyConnection(*tconn);
  
  	if (code == BC_VERSIONFAIL)
! 	    afs_com_err(whoami, code,
  		    "; Backup and butc are not the same version");
  	else
! 	    afs_com_err(whoami, code,
  		    "; Can't access tape coordinator at port %d", port);
  
  	return (code);
Index: openafs/src/bucoord/dump_sched.c
diff -c openafs/src/bucoord/dump_sched.c:1.9.6.2 openafs/src/bucoord/dump_sched.c:1.9.6.3
*** openafs/src/bucoord/dump_sched.c:1.9.6.2	Thu Jan  4 22:32:24 2007
--- openafs/src/bucoord/dump_sched.c	Tue Apr 10 14:39:50 2007
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump_sched.c,v 1.9.6.2 2007/01/05 03:32:24 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump_sched.c,v 1.9.6.3 2007/04/10 18:39:50 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 91,97 ****
  
      code = bc_UpdateDumpSchedule();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve dump schedule");
  	return (code);
      }
  
--- 91,97 ----
  
      code = bc_UpdateDumpSchedule();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve dump schedule");
  	return (code);
      }
  
***************
*** 102,110 ****
  
  	/* validate the name dump name length */
  	if (strlen(dname) >= BU_MAX_DUMP_PATH) {
! 	    com_err(whoami, 0, "Dump names must be < %d characters",
  		    BU_MAX_DUMP_PATH);
! 	    com_err(whoami, 0, "Dump %s not added", dname);
  	    code = -1;
  	    continue;
  	}
--- 102,110 ----
  
  	/* validate the name dump name length */
  	if (strlen(dname) >= BU_MAX_DUMP_PATH) {
! 	    afs_com_err(whoami, 0, "Dump names must be < %d characters",
  		    BU_MAX_DUMP_PATH);
! 	    afs_com_err(whoami, 0, "Dump %s not added", dname);
  	    code = -1;
  	    continue;
  	}
***************
*** 113,138 ****
  	    bc_CreateDumpSchedule(bc_globalConfig, dname, expDate, expType);
  	if (code) {
  	    if (code == -1)
! 		com_err(whoami, 0, "Dump already exists");
  	    else if (code == -2)
! 		com_err(whoami, 0, "Invalid path name '%s'", dname);
  	    else if (code == -3)
! 		com_err(whoami, 0, "Name specification error");
  	    else
! 		com_err(whoami, code, "; Failed to create dump schedule");
  	    continue;
  	}
  
  	/* save the new schedule item */
  	code = bc_SaveDumpSchedule();
  	if (code) {
! 	    com_err(whoami, code, "Cannot save dump schedule");
! 	    com_err(whoami, 0,
  		    "Changes are temporary - for this session only");
  	    break;
  	}
  
! 	com_err(whoami, 0, "Created new dump schedule %s", dname);
      }
  
    error_exit:
--- 113,138 ----
  	    bc_CreateDumpSchedule(bc_globalConfig, dname, expDate, expType);
  	if (code) {
  	    if (code == -1)
! 		afs_com_err(whoami, 0, "Dump already exists");
  	    else if (code == -2)
! 		afs_com_err(whoami, 0, "Invalid path name '%s'", dname);
  	    else if (code == -3)
! 		afs_com_err(whoami, 0, "Name specification error");
  	    else
! 		afs_com_err(whoami, code, "; Failed to create dump schedule");
  	    continue;
  	}
  
  	/* save the new schedule item */
  	code = bc_SaveDumpSchedule();
  	if (code) {
! 	    afs_com_err(whoami, code, "Cannot save dump schedule");
! 	    afs_com_err(whoami, 0,
  		    "Changes are temporary - for this session only");
  	    break;
  	}
  
! 	afs_com_err(whoami, 0, "Created new dump schedule %s", dname);
      }
  
    error_exit:
***************
*** 167,173 ****
  
      code = bc_UpdateDumpSchedule();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve dump schedule");
  	return (code);
      }
  
--- 167,173 ----
  
      code = bc_UpdateDumpSchedule();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve dump schedule");
  	return (code);
      }
  
***************
*** 176,184 ****
      code = bc_DeleteDumpSchedule(bc_globalConfig, dname);
      if (code) {
  	if (code == -1)
! 	    com_err(whoami, 0, "No such dump as %s", dname);
  	else
! 	    com_err(whoami, code, "; Failed to delete dump schedule");
  	goto error_exit;
      }
  
--- 176,184 ----
      code = bc_DeleteDumpSchedule(bc_globalConfig, dname);
      if (code) {
  	if (code == -1)
! 	    afs_com_err(whoami, 0, "No such dump as %s", dname);
  	else
! 	    afs_com_err(whoami, code, "; Failed to delete dump schedule");
  	goto error_exit;
      }
  
***************
*** 186,193 ****
      if (code == 0)
  	printf("backup: deleted dump schedule %s\n", dname);
      else {
! 	com_err(whoami, code, "Cannot save dump schedule file");
! 	com_err(whoami, 0, "Deletion is temporary - for this session only");
      }
  
    error_exit:
--- 186,193 ----
      if (code == 0)
  	printf("backup: deleted dump schedule %s\n", dname);
      else {
! 	afs_com_err(whoami, code, "Cannot save dump schedule file");
! 	afs_com_err(whoami, 0, "Deletion is temporary - for this session only");
      }
  
    error_exit:
***************
*** 275,281 ****
      /* first check to see if schedules must be updated */
      code = bc_UpdateDumpSchedule();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve dump schedule");
  	return (code);
      }
  
--- 275,281 ----
      /* first check to see if schedules must be updated */
      code = bc_UpdateDumpSchedule();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve dump schedule");
  	return (code);
      }
  
***************
*** 334,340 ****
  
      code = bc_UpdateDumpSchedule();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve dump schedule");
  	return (code);
      }
  
--- 334,340 ----
  
      code = bc_UpdateDumpSchedule();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve dump schedule");
  	return (code);
      }
  
***************
*** 346,360 ****
  	/* validate the name dump name length */
  	if (strlen(dname) >= BU_MAX_DUMP_PATH) {
  	    code = -1;
! 	    com_err(whoami, 0, "Dump names must be < %d characters",
  		    BU_MAX_DUMP_PATH);
! 	    com_err(whoami, 0, "Dump %s not added", dname);
  	    continue;
  	}
  
  	code = FindDump(bc_globalConfig, dname, &parent, &node);
  	if (code) {
! 	    com_err(whoami, 0, "Dump level %s not found", dname);
  	    continue;
  	}
  
--- 346,360 ----
  	/* validate the name dump name length */
  	if (strlen(dname) >= BU_MAX_DUMP_PATH) {
  	    code = -1;
! 	    afs_com_err(whoami, 0, "Dump names must be < %d characters",
  		    BU_MAX_DUMP_PATH);
! 	    afs_com_err(whoami, 0, "Dump %s not added", dname);
  	    continue;
  	}
  
  	code = FindDump(bc_globalConfig, dname, &parent, &node);
  	if (code) {
! 	    afs_com_err(whoami, 0, "Dump level %s not found", dname);
  	    continue;
  	}
  
***************
*** 364,371 ****
  
      code = bc_SaveDumpSchedule();
      if (code) {
! 	com_err(whoami, code, "Cannot save dump schedule");
! 	com_err(whoami, 0,
  		"Expiration changes effective for this session only");
      }
  
--- 364,371 ----
  
      code = bc_SaveDumpSchedule();
      if (code) {
! 	afs_com_err(whoami, code, "Cannot save dump schedule");
! 	afs_com_err(whoami, 0,
  		"Expiration changes effective for this session only");
      }
  
***************
*** 423,429 ****
  	    || (dsversion != BC_SCHEDULE_VERSION)
  	    ) {
  	    /* invalid or unexpected header - error */
! 	    com_err(whoami, 0, "Unable to understand dump schedule file");
  	    return (BC_INTERNALERROR);
  	}
      }
--- 423,429 ----
  	    || (dsversion != BC_SCHEDULE_VERSION)
  	    ) {
  	    /* invalid or unexpected header - error */
! 	    afs_com_err(whoami, 0, "Unable to understand dump schedule file");
  	    return (BC_INTERNALERROR);
  	}
      }
***************
*** 437,443 ****
  	    sscanf(tbuffer, "%s %s %d %d", dsname, period, &expDate,
  		   &expType);
  	if (code != 4) {
! 	    com_err(whoami, 0,
  		    "Syntax error in dump schedule file, line is: %s",
  		    tbuffer);
  	    return (BC_INTERNALERROR);
--- 437,443 ----
  	    sscanf(tbuffer, "%s %s %d %d", dsname, period, &expDate,
  		   &expType);
  	if (code != 4) {
! 	    afs_com_err(whoami, 0,
  		    "Syntax error in dump schedule file, line is: %s",
  		    tbuffer);
  	    return (BC_INTERNALERROR);
Index: openafs/src/bucoord/main.c
diff -c openafs/src/bucoord/main.c:1.16.14.1 openafs/src/bucoord/main.c:1.16.14.2
*** openafs/src/bucoord/main.c:1.16.14.1	Thu Jan  4 22:32:24 2007
--- openafs/src/bucoord/main.c	Tue Apr 10 14:39:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/main.c,v 1.16.14.1 2007/01/05 03:32:24 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/main.c,v 1.16.14.2 2007/04/10 18:39:50 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 251,264 ****
  
      /* don't run more than once */
      if (initd) {
! 	com_err(whoami, 0, "Backup already initialized.");
  	return 0;
      }
      initd = 1;
  
      code = bc_InitConfig(DefaultConfDir);
      if (code) {
! 	com_err(whoami, code,
  		"Can't initialize from config files in directory '%s'",
  		DefaultConfDir);
  	return (code);
--- 251,264 ----
  
      /* don't run more than once */
      if (initd) {
! 	afs_com_err(whoami, 0, "Backup already initialized.");
  	return 0;
      }
      initd = 1;
  
      code = bc_InitConfig(DefaultConfDir);
      if (code) {
! 	afs_com_err(whoami, code,
  		"Can't initialize from config files in directory '%s'",
  		DefaultConfDir);
  	return (code);
***************
*** 269,281 ****
       */
      code = LWP_InitializeProcessSupport(LWP_NORMAL_PRIORITY, &pid);
      if (code) {
! 	com_err(whoami, code, "; Can't initialize LWP");
  	return (code);
      }
  
      code = rx_Init(htons(0));
      if (code) {
! 	com_err(whoami, code, "; Can't initialize Rx");
  	return (code);
      }
  
--- 269,281 ----
       */
      code = LWP_InitializeProcessSupport(LWP_NORMAL_PRIORITY, &pid);
      if (code) {
! 	afs_com_err(whoami, code, "; Can't initialize LWP");
  	return (code);
      }
  
      code = rx_Init(htons(0));
      if (code) {
! 	afs_com_err(whoami, code, "; Can't initialize Rx");
  	return (code);
      }
  
***************
*** 297,303 ****
  	LWP_CreateProcess(statusWatcher, 20480, LWP_NORMAL_PRIORITY,
  			  (void *)2, "statusWatcher", &watcherPid);
      if (code) {
! 	com_err(whoami, code, "; Can't create status monitor task");
  	return (code);
      }
  
--- 297,303 ----
  	LWP_CreateProcess(statusWatcher, 20480, LWP_NORMAL_PRIORITY,
  			  (void *)2, "statusWatcher", &watcherPid);
      if (code) {
! 	afs_com_err(whoami, code, "; Can't create status monitor task");
  	return (code);
      }
  
***************
*** 341,354 ****
  
  	code = backupInit();
  	if (code) {
! 	    com_err(whoami, code, "; Can't initialize backup");
  	    exit(1);
  	}
  
  	/* Get initial information from the database */
  	code = bc_InitTextConfig();
  	if (code) {
! 	    com_err(whoami, code,
  		    "; Can't obtain configuration text from backup database");
  	    exit(1);
  	}
--- 341,354 ----
  
  	code = backupInit();
  	if (code) {
! 	    afs_com_err(whoami, code, "; Can't initialize backup");
  	    exit(1);
  	}
  
  	/* Get initial information from the database */
  	code = bc_InitTextConfig();
  	if (code) {
! 	    afs_com_err(whoami, code,
  		    "; Can't obtain configuration text from backup database");
  	    exit(1);
  	}
***************
*** 409,415 ****
  
      if (internalLoadFile) {	/* Load a file in */
  	if (dispatchCount > MAXRECURSION) {	/* Beware recursive loops. */
! 	    com_err(whoami, 0, "Potential recursion: will not load file %s",
  		    internalLoadFile);
  	    code = -1;
  	    goto done;
--- 409,415 ----
  
      if (internalLoadFile) {	/* Load a file in */
  	if (dispatchCount > MAXRECURSION) {	/* Beware recursive loops. */
! 	    afs_com_err(whoami, 0, "Potential recursion: will not load file %s",
  		    internalLoadFile);
  	    code = -1;
  	    goto done;
***************
*** 417,423 ****
  
  	fd = fopen(internalLoadFile, "r");	/* Open the load file */
  	if (!fd) {
! 	    com_err(whoami, errno, "; Cannot open file %s", internalLoadFile);
  	    code = -1;
  	    goto done;
  	}
--- 417,423 ----
  
  	fd = fopen(internalLoadFile, "r");	/* Open the load file */
  	if (!fd) {
! 	    afs_com_err(whoami, errno, "; Cannot open file %s", internalLoadFile);
  	    code = -1;
  	    goto done;
  	}
***************
*** 444,450 ****
  		(!noExecute)) {	/*      or no execute */
  		c = cmd_ParseLine(lineBuffer, sargv, &sargc, MAXV);
  		if (c) {
! 		    com_err(whoami, c, "; Can't parse line");
  		} else {
  		    doDispatch(sargc, sargv, dispatchCount + 1);	/* Recursive - ignore error */
  		    cmd_FreeArgv(sargv);	/* Free up arguments */
--- 444,450 ----
  		(!noExecute)) {	/*      or no execute */
  		c = cmd_ParseLine(lineBuffer, sargv, &sargc, MAXV);
  		if (c) {
! 		    afs_com_err(whoami, c, "; Can't parse line");
  		} else {
  		    doDispatch(sargc, sargv, dispatchCount + 1);	/* Recursive - ignore error */
  		    cmd_FreeArgv(sargv);	/* Free up arguments */
***************
*** 796,803 ****
  	if (!LineIsBlank(lineBuffer)) {
  	    code = cmd_ParseLine(lineBuffer, targv, &targc, MAXV);
  	    if (code)
! 		com_err(whoami, code, "; Can't parse line: '%s'",
! 			error_message(code));
  	    else {
  		doDispatch(targc, targv, 1);
  		cmd_FreeArgv(targv);
--- 796,803 ----
  	if (!LineIsBlank(lineBuffer)) {
  	    code = cmd_ParseLine(lineBuffer, targv, &targc, MAXV);
  	    if (code)
! 		afs_com_err(whoami, code, "; Can't parse line: '%s'",
! 			afs_error_message(code));
  	    else {
  		doDispatch(targc, targv, 1);
  		cmd_FreeArgv(targv);
Index: openafs/src/bucoord/restore.c
diff -c openafs/src/bucoord/restore.c:1.10.6.1 openafs/src/bucoord/restore.c:1.10.6.2
*** openafs/src/bucoord/restore.c:1.10.6.1	Thu Jan  4 22:32:24 2007
--- openafs/src/bucoord/restore.c	Tue Apr 10 14:39:50 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/restore.c,v 1.10.6.1 2007/01/05 03:32:24 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/restore.c,v 1.10.6.2 2007/04/10 18:39:50 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 203,209 ****
      volumeEntries = (struct budb_volumeEntry *)
  	malloc(MAXTAPESATONCE * sizeof(struct budb_volumeEntry));
      if (!volumeEntries) {
! 	com_err(whoami, BC_NOMEM, "");
  	ERROR(BC_NOMEM);
      }
  
--- 203,209 ----
      volumeEntries = (struct budb_volumeEntry *)
  	malloc(MAXTAPESATONCE * sizeof(struct budb_volumeEntry));
      if (!volumeEntries) {
! 	afs_com_err(whoami, BC_NOMEM, "");
  	ERROR(BC_NOMEM);
      }
  
***************
*** 236,242 ****
  	}
  
  	if (code) {		/* If FindDump took an error */
! 	    com_err(whoami, code, "; Can't find any dump for volume %s",
  		    tvol->name);
  	    continue;
  	}
--- 236,242 ----
  	}
  
  	if (code) {		/* If FindDump took an error */
! 	    afs_com_err(whoami, code, "; Can't find any dump for volume %s",
  		    tvol->name);
  	    continue;
  	}
***************
*** 255,261 ****
  	if (!di) {
  	    di = (struct dumpinfo *)malloc(sizeof(struct dumpinfo));
  	    if (!di) {
! 		com_err(whoami, BC_NOMEM, "");
  		ERROR(BC_NOMEM);
  	    }
  	    memset(di, 0, sizeof(struct dumpinfo));
--- 255,261 ----
  	if (!di) {
  	    di = (struct dumpinfo *)malloc(sizeof(struct dumpinfo));
  	    if (!di) {
! 		afs_com_err(whoami, BC_NOMEM, "");
  		ERROR(BC_NOMEM);
  	    }
  	    memset(di, 0, sizeof(struct dumpinfo));
***************
*** 277,283 ****
  	/* Create one and thread into list */
  	vi = (struct volinfo *)malloc(sizeof(struct volinfo));
  	if (!vi) {
! 	    com_err(whoami, BC_NOMEM, "");
  	    ERROR(BC_NOMEM);
  	}
  	memset(vi, 0, sizeof(struct volinfo));
--- 277,283 ----
  	/* Create one and thread into list */
  	vi = (struct volinfo *)malloc(sizeof(struct volinfo));
  	if (!vi) {
! 	    afs_com_err(whoami, BC_NOMEM, "");
  	    ERROR(BC_NOMEM);
  	}
  	memset(vi, 0, sizeof(struct volinfo));
***************
*** 285,291 ****
  	vi->volname = (char *)malloc(strlen(vname) + 1);
  	if (!vi->volname) {
  	    free(vi);
! 	    com_err(whoami, BC_NOMEM, "");
  	    ERROR(BC_NOMEM);
  	}
  
--- 285,291 ----
  	vi->volname = (char *)malloc(strlen(vname) + 1);
  	if (!vi->volname) {
  	    free(vi);
! 	    afs_com_err(whoami, BC_NOMEM, "");
  	    ERROR(BC_NOMEM);
  	}
  
***************
*** 317,323 ****
  	    code = bcdb_FindDumpByID(parent, &dumpDescr1);
  	    if (code) {
  		for (vi = di->volinfolist; vi; vi = vi->next) {
! 		    com_err(whoami, code,
  			    "; Can't find parent DumpID %u for volume %s",
  			    parent, vi->volname);
  		}
--- 317,323 ----
  	    code = bcdb_FindDumpByID(parent, &dumpDescr1);
  	    if (code) {
  		for (vi = di->volinfolist; vi; vi = vi->next) {
! 		    afs_com_err(whoami, code,
  			    "; Can't find parent DumpID %u for volume %s",
  			    parent, vi->volname);
  		}
***************
*** 369,375 ****
  			    break;
  			}
  
! 			com_err(whoami, code,
  				"; Can't find volume %s in DumpID %u",
  				vi->volname, dlevels[lv].DumpId);
  			ERROR(code);
--- 369,375 ----
  			    break;
  			}
  
! 			afs_com_err(whoami, code,
  				"; Can't find volume %s in DumpID %u",
  				vi->volname, dlevels[lv].DumpId);
  			ERROR(code);
***************
*** 450,456 ****
  			    tle = (struct bc_tapeList *)
  				malloc(sizeof(struct bc_tapeList));
  			    if (!tle) {
! 				com_err(whoami, BC_NOMEM, "");
  				return (BC_NOMEM);
  			    }
  			    memset(tle, 0, sizeof(struct bc_tapeList));
--- 450,456 ----
  			    tle = (struct bc_tapeList *)
  				malloc(sizeof(struct bc_tapeList));
  			    if (!tle) {
! 				afs_com_err(whoami, BC_NOMEM, "");
  				return (BC_NOMEM);
  			    }
  			    memset(tle, 0, sizeof(struct bc_tapeList));
***************
*** 460,466 ****
  					       + 1);
  			    if (!tle->tapeName) {
  				free(tle);
! 				com_err(whoami, BC_NOMEM, "");
  				return (BC_NOMEM);
  			    }
  
--- 460,466 ----
  					       + 1);
  			    if (!tle->tapeName) {
  				free(tle);
! 				afs_com_err(whoami, BC_NOMEM, "");
  				return (BC_NOMEM);
  			    }
  
***************
*** 505,511 ****
  			    ti = (struct bc_tapeItem *)
  				malloc(sizeof(struct bc_tapeItem));
  			    if (!ti) {
! 				com_err(whoami, BC_NOMEM, "");
  				return (BC_NOMEM);
  			    }
  			    memset(ti, 0, sizeof(struct bc_tapeItem));
--- 505,511 ----
  			    ti = (struct bc_tapeItem *)
  				malloc(sizeof(struct bc_tapeItem));
  			    if (!ti) {
! 				afs_com_err(whoami, BC_NOMEM, "");
  				return (BC_NOMEM);
  			    }
  			    memset(ti, 0, sizeof(struct bc_tapeItem));
***************
*** 515,521 ****
  					       + 1);
  			    if (!ti->volumeName) {
  				free(ti);
! 				com_err(whoami, BC_NOMEM, "");
  				return (BC_NOMEM);
  			    }
  
--- 515,521 ----
  					       + 1);
  			    if (!ti->volumeName) {
  				free(ti);
! 				afs_com_err(whoami, BC_NOMEM, "");
  				return (BC_NOMEM);
  			    }
  
***************
*** 548,554 ****
      }				/* di: For each dump */
  
      if (!nentries) {
! 	com_err(whoami, 0, "No volumes to restore");
  	ERROR(0);
      }
  
--- 548,554 ----
      }				/* di: For each dump */
  
      if (!nentries) {
! 	afs_com_err(whoami, 0, "No volumes to restore");
  	ERROR(0);
      }
  
***************
*** 605,611 ****
  	(struct tc_restoreDesc *)malloc(nentries *
  					sizeof(struct tc_restoreDesc));
      if (!tcarray) {
! 	com_err(whoami, BC_NOMEM, "");
  	ERROR(BC_NOMEM);
      }
      memset(tcarray, 0, nentries * sizeof(struct tc_restoreDesc));
--- 605,611 ----
  	(struct tc_restoreDesc *)malloc(nentries *
  					sizeof(struct tc_restoreDesc));
      if (!tcarray) {
! 	afs_com_err(whoami, BC_NOMEM, "");
  	ERROR(BC_NOMEM);
      }
      memset(tcarray, 0, nentries * sizeof(struct tc_restoreDesc));
***************
*** 687,693 ****
  	    TC_PerformRestore(aconn, "DumpSetName", &rpcArray,
  			      &dumpTaskPtr->dumpID);
  	if (code) {
! 	    com_err(whoami, code, "; Failed to start restore");
  	    break;
  	}
  
--- 687,693 ----
  	    TC_PerformRestore(aconn, "DumpSetName", &rpcArray,
  			      &dumpTaskPtr->dumpID);
  	if (code) {
! 	    afs_com_err(whoami, code, "; Failed to start restore");
  	    break;
  	}
  
Index: openafs/src/bucoord/tape_hosts.c
diff -c openafs/src/bucoord/tape_hosts.c:1.7.14.2 openafs/src/bucoord/tape_hosts.c:1.7.14.3
*** openafs/src/bucoord/tape_hosts.c:1.7.14.2	Thu Jan  4 22:32:24 2007
--- openafs/src/bucoord/tape_hosts.c	Tue Apr 10 14:39:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/tape_hosts.c,v 1.7.14.2 2007/01/05 03:32:24 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/tape_hosts.c,v 1.7.14.3 2007/04/10 18:39:50 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 66,72 ****
  
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
--- 66,72 ----
  
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
***************
*** 85,98 ****
  	    printf("failed\n");
  	    fflush(stdout);
  	    if (code == EEXIST)
! 		com_err(whoami, 0, "Port offset already in tape database");
  	    ERROR(code);
  	}
  
  	code = bc_SaveHosts();
  	if (code) {
! 	    com_err(whoami, code, "Cannot save tape hosts");
! 	    com_err(whoami, 0,
  		    "Changes are temporary - for this session only");
  	    ERROR(code);
  	}
--- 85,98 ----
  	    printf("failed\n");
  	    fflush(stdout);
  	    if (code == EEXIST)
! 		afs_com_err(whoami, 0, "Port offset already in tape database");
  	    ERROR(code);
  	}
  
  	code = bc_SaveHosts();
  	if (code) {
! 	    afs_com_err(whoami, code, "Cannot save tape hosts");
! 	    afs_com_err(whoami, 0,
  		    "Changes are temporary - for this session only");
  	    ERROR(code);
  	}
***************
*** 124,130 ****
  
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
--- 124,130 ----
  
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
***************
*** 150,157 ****
  
  	code = bc_SaveHosts();
  	if (code) {
! 	    com_err(whoami, code, "Cannot save tape hosts");
! 	    com_err(whoami, 0,
  		    "Changes are temporary - for this session only");
  	    ERROR(code);
  	}
--- 150,157 ----
  
  	code = bc_SaveHosts();
  	if (code) {
! 	    afs_com_err(whoami, code, "Cannot save tape hosts");
! 	    afs_com_err(whoami, 0,
  		    "Changes are temporary - for this session only");
  	    ERROR(code);
  	}
***************
*** 184,190 ****
  
      code = bc_UpdateHosts();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
--- 184,190 ----
  
      code = bc_UpdateHosts();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve tape hosts");
  	return (code);
      }
  
***************
*** 264,270 ****
  	sscanf(tbuffer, "%s %u", hostName, &port);
  	th = gethostbyname(hostName);
  	if (th == 0) {
! 	    com_err(whoami, 0,
  		    "can't get host info for %s from nameserver or /etc/hosts.",
  		    hostName);
  	}
--- 264,270 ----
  	sscanf(tbuffer, "%s %u", hostName, &port);
  	th = gethostbyname(hostName);
  	if (th == 0) {
! 	    afs_com_err(whoami, 0,
  		    "can't get host info for %s from nameserver or /etc/hosts.",
  		    hostName);
  	}
***************
*** 378,384 ****
      }
  
      if (ctPtr->textVersion != -1) {
! 	com_err(whoami, 0, "obsolete tapehosts - updating");
  	bc_ClearHosts();
      }
  
--- 378,384 ----
      }
  
      if (ctPtr->textVersion != -1) {
! 	afs_com_err(whoami, 0, "obsolete tapehosts - updating");
  	bc_ClearHosts();
      }
  
Index: openafs/src/bucoord/ubik_db_if.c
diff -c openafs/src/bucoord/ubik_db_if.c:1.10.14.1 openafs/src/bucoord/ubik_db_if.c:1.10.14.2
*** openafs/src/bucoord/ubik_db_if.c:1.10.14.1	Thu Jan  4 22:32:24 2007
--- openafs/src/bucoord/ubik_db_if.c	Tue Apr 10 14:39:50 2007
***************
*** 13,19 ****
  #include <afs/stds.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/ubik_db_if.c,v 1.10.14.1 2007/01/05 03:32:24 shadow Exp $");
  
  #include <sys/types.h>
  #include <fcntl.h>
--- 13,19 ----
  #include <afs/stds.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/ubik_db_if.c,v 1.10.14.2 2007/04/10 18:39:50 shadow Exp $");
  
  #include <sys/types.h>
  #include <fcntl.h>
***************
*** 32,37 ****
--- 32,38 ----
  #include <afs/bubasics.h>
  #include <afs/budb_client.h>
  #include <afs/budb.h>
+ #include <afs/com_err.h>
  #include <errno.h>
  
  #include "bc.h"
***************
*** 727,733 ****
  
  	/* Mention something every 30 seconds */
  	if (++j >= 30) {
! 	    com_err(whoami, code,
  		    "; Waiting for db configuration text unlock");
  	    j = 0;
  	}
--- 728,734 ----
  
  	/* Mention something every 30 seconds */
  	if (++j >= 30) {
! 	    afs_com_err(whoami, code,
  		    "; Waiting for db configuration text unlock");
  	    j = 0;
  	}
***************
*** 823,829 ****
  	afsconf_Open((localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		      AFSDIR_CLIENT_ETC_DIRPATH));
      if (!acdir) {
! 	com_err(whoami, 0, "Can't open configuration directory '%s'",
  		(localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		 AFSDIR_CLIENT_ETC_DIRPATH));
  	ERROR(BC_NOCELLCONFIG);
--- 824,830 ----
  	afsconf_Open((localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		      AFSDIR_CLIENT_ETC_DIRPATH));
      if (!acdir) {
! 	afs_com_err(whoami, 0, "Can't open configuration directory '%s'",
  		(localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		 AFSDIR_CLIENT_ETC_DIRPATH));
  	ERROR(BC_NOCELLCONFIG);
***************
*** 834,840 ****
  
  	code = afsconf_GetLocalCell(acdir, cname, sizeof(cname));
  	if (code) {
! 	    com_err(whoami, code,
  		    "; Can't get the local cell name - check %s/%s",
  		    (localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		     AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_THISCELL_FILE);
--- 835,841 ----
  
  	code = afsconf_GetLocalCell(acdir, cname, sizeof(cname));
  	if (code) {
! 	    afs_com_err(whoami, code,
  		    "; Can't get the local cell name - check %s/%s",
  		    (localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		     AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_THISCELL_FILE);
***************
*** 845,851 ****
  
      code = afsconf_GetCellInfo(acdir, cellName, AFSCONF_VLDBSERVICE, &info);
      if (code) {
! 	com_err(whoami, code, "; Can't find cell %s's hosts in %s/%s",
  		cellName,
  		(localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		 AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_CELLSERVDB_FILE);
--- 846,852 ----
  
      code = afsconf_GetCellInfo(acdir, cellName, AFSCONF_VLDBSERVICE, &info);
      if (code) {
! 	afs_com_err(whoami, code, "; Can't find cell %s's hosts in %s/%s",
  		cellName,
  		(localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		 AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_CELLSERVDB_FILE);
***************
*** 859,870 ****
      if (localauth) {
  	code = afsconf_GetLatestKey(acdir, 0, 0);
  	if (code) {
! 	    com_err(whoami, code, "; Can't get key from local key file");
  	    ERROR(code);
  	} else {
  	    code = afsconf_ClientAuth(acdir, &sc, &scIndex);
  	    if (code) {
! 		com_err(whoami, code, "; Calling ClientAuth");
  		ERROR(code);
  	    }
  
--- 860,871 ----
      if (localauth) {
  	code = afsconf_GetLatestKey(acdir, 0, 0);
  	if (code) {
! 	    afs_com_err(whoami, code, "; Can't get key from local key file");
  	    ERROR(code);
  	} else {
  	    code = afsconf_ClientAuth(acdir, &sc, &scIndex);
  	    if (code) {
! 		afs_com_err(whoami, code, "; Calling ClientAuth");
  		ERROR(code);
  	    }
  
***************
*** 879,889 ****
  	    code =
  		ktc_GetToken(&sname, ttoken, sizeof(struct ktc_token), NULL);
  	    if (code) {
! 		com_err(whoami, code, 0,
  			"; Can't get AFS tokens - running unauthenticated");
  	    } else {
  		if ((ttoken->kvno < 0) || (ttoken->kvno > 255))
! 		    com_err(whoami, 0,
  			    "Funny kvno (%d) in ticket, proceeding",
  			    ttoken->kvno);
  
--- 880,890 ----
  	    code =
  		ktc_GetToken(&sname, ttoken, sizeof(struct ktc_token), NULL);
  	    if (code) {
! 		afs_com_err(whoami, code, 0,
  			"; Can't get AFS tokens - running unauthenticated");
  	    } else {
  		if ((ttoken->kvno < 0) || (ttoken->kvno > 255))
! 		    afs_com_err(whoami, 0,
  			    "Funny kvno (%d) in ticket, proceeding",
  			    ttoken->kvno);
  
***************
*** 903,916 ****
  					      ttoken->ticket);
  	    break;
  	default:
! 	    com_err(whoami, 0, "Unsupported authentication type %d", scIndex);
  	    ERROR(-1);
  	    break;
  	}
      }
  
      if (!sc) {
! 	com_err(whoami, 0,
  		"Can't create a security object with security index %d",
  		scIndex);
  	ERROR(-1);
--- 904,917 ----
  					      ttoken->ticket);
  	    break;
  	default:
! 	    afs_com_err(whoami, 0, "Unsupported authentication type %d", scIndex);
  	    ERROR(-1);
  	    break;
  	}
      }
  
      if (!sc) {
! 	afs_com_err(whoami, 0,
  		"Can't create a security object with security index %d",
  		scIndex);
  	ERROR(-1);
***************
*** 920,926 ****
      UV_SetSecurity(sc, scIndex);
  
      if (info.numServers > VLDB_MAXSERVERS) {
! 	com_err(whoami, 0,
  		"Warning: %d VLDB servers exist for cell '%s', can only remember the first %d",
  		info.numServers, cellName, VLDB_MAXSERVERS);
  	info.numServers = VLDB_MAXSERVERS;
--- 921,927 ----
      UV_SetSecurity(sc, scIndex);
  
      if (info.numServers > VLDB_MAXSERVERS) {
! 	afs_com_err(whoami, 0,
  		"Warning: %d VLDB servers exist for cell '%s', can only remember the first %d",
  		info.numServers, cellName, VLDB_MAXSERVERS);
  	info.numServers = VLDB_MAXSERVERS;
***************
*** 936,942 ****
      *cstruct = 0;
      code = ubik_ClientInit(serverconns, cstruct);
      if (code) {
! 	com_err(whoami, code, "; Can't initialize ubik connection to vldb");
  	ERROR(code);
      }
  
--- 937,943 ----
      *cstruct = 0;
      code = ubik_ClientInit(serverconns, cstruct);
      if (code) {
! 	afs_com_err(whoami, code, "; Can't initialize ubik connection to vldb");
  	ERROR(code);
      }
  
***************
*** 967,973 ****
  	afsconf_Open((localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		      AFSDIR_CLIENT_ETC_DIRPATH));
      if (!acdir) {
! 	com_err(whoami, 0, "Can't open configuration directory '%s'",
  		(localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		 AFSDIR_CLIENT_ETC_DIRPATH));
  	ERROR(BC_NOCELLCONFIG);
--- 968,974 ----
  	afsconf_Open((localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		      AFSDIR_CLIENT_ETC_DIRPATH));
      if (!acdir) {
! 	afs_com_err(whoami, 0, "Can't open configuration directory '%s'",
  		(localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		 AFSDIR_CLIENT_ETC_DIRPATH));
  	ERROR(BC_NOCELLCONFIG);
***************
*** 978,984 ****
  
  	code = afsconf_GetLocalCell(acdir, cname, sizeof(cname));
  	if (code) {
! 	    com_err(whoami, code,
  		    "; Can't get the local cell name - check %s/%s",
  		    (localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		     AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_THISCELL_FILE);
--- 979,985 ----
  
  	code = afsconf_GetLocalCell(acdir, cname, sizeof(cname));
  	if (code) {
! 	    afs_com_err(whoami, code,
  		    "; Can't get the local cell name - check %s/%s",
  		    (localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		     AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_THISCELL_FILE);
***************
*** 989,995 ****
  
      code = afsconf_GetCellInfo(acdir, cellName, 0, &info);
      if (code) {
! 	com_err(whoami, code, "; Can't find cell %s's hosts in %s/%s",
  		cellName,
  		(localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		 AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_CELLSERVDB_FILE);
--- 990,996 ----
  
      code = afsconf_GetCellInfo(acdir, cellName, 0, &info);
      if (code) {
! 	afs_com_err(whoami, code, "; Can't find cell %s's hosts in %s/%s",
  		cellName,
  		(localauth ? AFSDIR_SERVER_ETC_DIRPATH :
  		 AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_CELLSERVDB_FILE);
***************
*** 1001,1014 ****
      if (localauth) {
  	code = afsconf_GetLatestKey(acdir, 0, 0);
  	if (code) {
! 	    com_err(whoami, code, "; Can't get key from local key file");
  	    ERROR(-1);
  	} else {
  	    code =
  		afsconf_ClientAuth(acdir, &udbHandle.uh_secobj,
  				   &udbHandle.uh_scIndex);
  	    if (code) {
! 		com_err(whoami, code, "; Calling ClientAuth");
  		ERROR(-1);
  	    }
  	}
--- 1002,1015 ----
      if (localauth) {
  	code = afsconf_GetLatestKey(acdir, 0, 0);
  	if (code) {
! 	    afs_com_err(whoami, code, "; Can't get key from local key file");
  	    ERROR(-1);
  	} else {
  	    code =
  		afsconf_ClientAuth(acdir, &udbHandle.uh_secobj,
  				   &udbHandle.uh_scIndex);
  	    if (code) {
! 		afs_com_err(whoami, code, "; Calling ClientAuth");
  		ERROR(-1);
  	    }
  	}
***************
*** 1022,1032 ****
  	    /* get token */
  	    code = ktc_GetToken(&principal, &token, sizeof(token), NULL);
  	    if (code) {
! 		com_err(whoami, code,
  			"; Can't get tokens - running unauthenticated");
  	    } else {
  		if ((token.kvno < 0) || (token.kvno > 255))
! 		    com_err(whoami, 0,
  			    "Unexpected kvno (%d) in ticket - proceeding",
  			    token.kvno);
  		udbHandle.uh_scIndex = RX_SCINDEX_KAD;	/* Kerberos */
--- 1023,1033 ----
  	    /* get token */
  	    code = ktc_GetToken(&principal, &token, sizeof(token), NULL);
  	    if (code) {
! 		afs_com_err(whoami, code,
  			"; Can't get tokens - running unauthenticated");
  	    } else {
  		if ((token.kvno < 0) || (token.kvno > 255))
! 		    afs_com_err(whoami, 0,
  			    "Unexpected kvno (%d) in ticket - proceeding",
  			    token.kvno);
  		udbHandle.uh_scIndex = RX_SCINDEX_KAD;	/* Kerberos */
***************
*** 1046,1052 ****
  	    break;
  
  	default:
! 	    com_err(whoami, 0, "Unsupported authentication type %d",
  		    udbHandle.uh_scIndex);
  	    ERROR(-1);
  	    break;
--- 1047,1053 ----
  	    break;
  
  	default:
! 	    afs_com_err(whoami, 0, "Unsupported authentication type %d",
  		    udbHandle.uh_scIndex);
  	    ERROR(-1);
  	    break;
***************
*** 1054,1067 ****
      }
  
      if (!udbHandle.uh_secobj) {
! 	com_err(whoami, 0,
  		"Can't create a security object with security index %d",
  		udbHandle.uh_secobj);
  	ERROR(-1);
      }
  
      if (info.numServers > MAXSERVERS) {
! 	com_err(whoami, 0,
  		"Warning: %d BDB servers exist for cell '%s', can only remember the first %d",
  		info.numServers, cellName, MAXSERVERS);
  	info.numServers = MAXSERVERS;
--- 1055,1068 ----
      }
  
      if (!udbHandle.uh_secobj) {
! 	afs_com_err(whoami, 0,
  		"Can't create a security object with security index %d",
  		udbHandle.uh_secobj);
  	ERROR(-1);
      }
  
      if (info.numServers > MAXSERVERS) {
! 	afs_com_err(whoami, 0,
  		"Warning: %d BDB servers exist for cell '%s', can only remember the first %d",
  		info.numServers, cellName, MAXSERVERS);
  	info.numServers = MAXSERVERS;
***************
*** 1078,1084 ****
  
      code = ubik_ClientInit(udbHandle.uh_serverConn, &udbHandle.uh_client);
      if (code) {
! 	com_err(whoami, code,
  		"; Can't initialize ubik connection to backup database");
  	ERROR(code);
      }
--- 1079,1085 ----
  
      code = ubik_ClientInit(udbHandle.uh_serverConn, &udbHandle.uh_client);
      if (code) {
! 	afs_com_err(whoami, code,
  		"; Can't initialize ubik connection to backup database");
  	ERROR(code);
      }
***************
*** 1100,1106 ****
  	    ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0,
  		      &udbHandle.uh_instanceId);
      if (code) {
! 	com_err(whoami, code, "; Can't access backup database");
  	ERROR(code);
      }
  
--- 1101,1107 ----
  	    ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0,
  		      &udbHandle.uh_instanceId);
      if (code) {
! 	afs_com_err(whoami, code, "; Can't access backup database");
  	ERROR(code);
      }
  
***************
*** 1313,1319 ****
  
      code = ubik_ParseClientList(3, args, serverList);
      if (code) {
! 	com_err(whoami, code, "; udbLocalInit: parsing ubik server list");
  	return (-1);
      }
  
--- 1314,1320 ----
  
      code = ubik_ParseClientList(3, args, serverList);
      if (code) {
! 	afs_com_err(whoami, code, "; udbLocalInit: parsing ubik server list");
  	return (-1);
      }
  
***************
*** 1327,1340 ****
  			     BUDB_SERVICE, udbHandle.uh_secobj,
  			     udbHandle.uh_scIndex);
  	if (udbHandle.uh_serverConn[i] == 0) {
! 	    com_err(whoami, 0, "connection %d failed", i);
  	    continue;
  	}
      }
      udbHandle.uh_serverConn[i] = 0;
      code = ubik_ClientInit(udbHandle.uh_serverConn, &udbHandle.uh_client);
      if (code) {
! 	com_err(whoami, code, "; in ubik_ClientInit");
  	return (code);
      }
  
--- 1328,1341 ----
  			     BUDB_SERVICE, udbHandle.uh_secobj,
  			     udbHandle.uh_scIndex);
  	if (udbHandle.uh_serverConn[i] == 0) {
! 	    afs_com_err(whoami, 0, "connection %d failed", i);
  	    continue;
  	}
      }
      udbHandle.uh_serverConn[i] = 0;
      code = ubik_ClientInit(udbHandle.uh_serverConn, &udbHandle.uh_client);
      if (code) {
! 	afs_com_err(whoami, code, "; in ubik_ClientInit");
  	return (code);
      }
  
***************
*** 1342,1348 ****
  	ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0,
  		  &udbHandle.uh_instanceId);
      if (code) {
! 	com_err(whoami, code, "; Can't estblish instance Id");
  	return (code);
      }
  
--- 1343,1349 ----
  	ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0,
  		  &udbHandle.uh_instanceId);
      if (code) {
! 	afs_com_err(whoami, code, "; Can't estblish instance Id");
  	return (code);
      }
  
Index: openafs/src/bucoord/vol_sets.c
diff -c openafs/src/bucoord/vol_sets.c:1.11.6.2 openafs/src/bucoord/vol_sets.c:1.11.6.3
*** openafs/src/bucoord/vol_sets.c:1.11.6.2	Thu Jan  4 22:32:24 2007
--- openafs/src/bucoord/vol_sets.c	Tue Apr 10 14:39:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/vol_sets.c,v 1.11.6.2 2007/01/05 03:32:24 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/vol_sets.c,v 1.11.6.3 2007/04/10 18:39:50 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 73,79 ****
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
--- 73,79 ----
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
***************
*** 81,87 ****
  
      tset = bc_FindVolumeSet(bc_globalConfig, volSetName);
      if (!tset) {
! 	com_err(whoami, code, "; Volume entry not added");
  	ERROR(code);
      }
  
--- 81,87 ----
  
      tset = bc_FindVolumeSet(bc_globalConfig, volSetName);
      if (!tset) {
! 	afs_com_err(whoami, code, "; Volume entry not added");
  	ERROR(code);
      }
  
***************
*** 93,99 ****
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
--- 93,99 ----
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
***************
*** 101,115 ****
  	bc_AddVolumeItem(bc_globalConfig, volSetName, serverName,
  			 partitionName, volRegExp);
      if (code) {
! 	com_err(whoami, code, "; Volume entry not added");
  	ERROR(code);
      }
  
      if (!(tset->flags & VSFLAG_TEMPORARY)) {
  	code = bc_SaveVolumeSet();
  	if (code) {
! 	    com_err(whoami, code, "Cannot save volume set file");
! 	    com_err(whoami, 0,
  		    "Changes are temporary - for this session only");
  	}
      }
--- 101,115 ----
  	bc_AddVolumeItem(bc_globalConfig, volSetName, serverName,
  			 partitionName, volRegExp);
      if (code) {
! 	afs_com_err(whoami, code, "; Volume entry not added");
  	ERROR(code);
      }
  
      if (!(tset->flags & VSFLAG_TEMPORARY)) {
  	code = bc_SaveVolumeSet();
  	if (code) {
! 	    afs_com_err(whoami, code, "Cannot save volume set file");
! 	    afs_com_err(whoami, 0,
  		    "Changes are temporary - for this session only");
  	}
      }
***************
*** 154,160 ****
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
--- 154,160 ----
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
***************
*** 164,177 ****
  			   flags);
      if (code) {
  	if (code == -1)
! 	    com_err(whoami, 0, "Volume set '%s' already exists", ti->data);
  	else
! 	    com_err(whoami, 0, "Unknown problem");
      } else if (!(flags & VSFLAG_TEMPORARY)) {
  	code = bc_SaveVolumeSet();
  	if (code) {
! 	    com_err(whoami, code, "Cannot save new volume set file");
! 	    com_err(whoami, 0,
  		    "Changes are temporary - for this session only");
  	}
      }
--- 164,177 ----
  			   flags);
      if (code) {
  	if (code == -1)
! 	    afs_com_err(whoami, 0, "Volume set '%s' already exists", ti->data);
  	else
! 	    afs_com_err(whoami, 0, "Unknown problem");
      } else if (!(flags & VSFLAG_TEMPORARY)) {
  	code = bc_SaveVolumeSet();
  	if (code) {
! 	    afs_com_err(whoami, code, "Cannot save new volume set file");
! 	    afs_com_err(whoami, 0,
  		    "Changes are temporary - for this session only");
  	}
      }
***************
*** 205,211 ****
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
--- 205,211 ----
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
***************
*** 214,220 ****
  
      tset = bc_FindVolumeSet(bc_globalConfig, vsname);
      if (!tset) {
! 	com_err(whoami, 0, "No such volume set as '%s'", vsname);
  	ERROR(code);
      }
  
--- 214,220 ----
  
      tset = bc_FindVolumeSet(bc_globalConfig, vsname);
      if (!tset) {
! 	afs_com_err(whoami, 0, "No such volume set as '%s'", vsname);
  	ERROR(code);
      }
  
***************
*** 226,238 ****
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
      entry = bc_SafeATOI(as->parms[1].items->data);
      if (entry < 0) {
! 	com_err(whoami, 0, "Can't parse entry number '%s' as decimal integer",
  		as->parms[1].items->data);
  	ERROR(BC_BADARG);
      }
--- 226,238 ----
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
      entry = bc_SafeATOI(as->parms[1].items->data);
      if (entry < 0) {
! 	afs_com_err(whoami, 0, "Can't parse entry number '%s' as decimal integer",
  		as->parms[1].items->data);
  	ERROR(BC_BADARG);
      }
***************
*** 240,251 ****
      code = bc_DeleteVolumeItem(bc_globalConfig, vsname, entry);
      if (code) {
  	if (code == -1) {
! 	    com_err(whoami, 0, "No such volume set as '%s'", vsname);
  	} else if (code == -2) {
! 	    com_err(whoami, 0,
  		    "There aren't %d volume items for this volume set",
  		    entry);
! 	    com_err(whoami, 0,
  		    "Use the 'listvolsets' command to examine the volume set");
  	}
  	ERROR(code);
--- 240,251 ----
      code = bc_DeleteVolumeItem(bc_globalConfig, vsname, entry);
      if (code) {
  	if (code == -1) {
! 	    afs_com_err(whoami, 0, "No such volume set as '%s'", vsname);
  	} else if (code == -2) {
! 	    afs_com_err(whoami, 0,
  		    "There aren't %d volume items for this volume set",
  		    entry);
! 	    afs_com_err(whoami, 0,
  		    "Use the 'listvolsets' command to examine the volume set");
  	}
  	ERROR(code);
***************
*** 257,264 ****
  	    printf("backup: deleted volume entry %d from volume set %s\n",
  		   entry, vsname);
  	} else {
! 	    com_err(whoami, code, "Cannot save volume set file");
! 	    com_err(whoami, 0,
  		    "Deletion is temporary - for this session only");
  	}
      }
--- 257,264 ----
  	    printf("backup: deleted volume entry %d from volume set %s\n",
  		   entry, vsname);
  	} else {
! 	    afs_com_err(whoami, code, "Cannot save volume set file");
! 	    afs_com_err(whoami, 0,
  		    "Deletion is temporary - for this session only");
  	}
      }
***************
*** 300,306 ****
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
--- 300,306 ----
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
***************
*** 308,316 ****
  	code = bc_DeleteVolumeSet(bc_globalConfig, ti->data, &flags);
  	if (code) {
  	    if (code == -1)
! 		com_err(whoami, 0, "Can't find volume set '%s'", ti->data);
  	    else
! 		com_err(whoami, code,
  			"; Unknown problem deleting volume set '%s'",
  			ti->data);
  	} else {
--- 308,316 ----
  	code = bc_DeleteVolumeSet(bc_globalConfig, ti->data, &flags);
  	if (code) {
  	    if (code == -1)
! 		afs_com_err(whoami, 0, "Can't find volume set '%s'", ti->data);
  	    else
! 		afs_com_err(whoami, code,
  			"; Unknown problem deleting volume set '%s'",
  			ti->data);
  	} else {
***************
*** 326,333 ****
  	if (c) {
  	    if (!code)
  		code = c;
! 	    com_err(whoami, c, "Cannot save updated volume set file");
! 	    com_err(whoami, 0, "Deletion effective for this session only");
  	}
  
      }
--- 326,333 ----
  	if (c) {
  	    if (!code)
  		code = c;
! 	    afs_com_err(whoami, c, "Cannot save updated volume set file");
! 	    afs_com_err(whoami, 0, "Deletion effective for this session only");
  	}
  
      }
***************
*** 374,380 ****
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
--- 374,380 ----
  
      code = bc_UpdateVolumeSet();
      if (code) {
! 	afs_com_err(whoami, code, "; Can't retrieve volume sets");
  	return (code);
      }
  
***************
*** 387,393 ****
  		ListVolSet(tset);
  		printf("\n");
  	    } else {
! 		com_err(whoami, 0, "Can't find volume set '%s'", ti->data);
  		code = 1;
  	    }
  	}
--- 387,393 ----
  		ListVolSet(tset);
  		printf("\n");
  	    } else {
! 		afs_com_err(whoami, 0, "Can't find volume set '%s'", ti->data);
  		code = 1;
  	    }
  	}
***************
*** 495,501 ****
  	    if ((code != 2)
  		|| (strcmp(serverName, "volumeset") != 0)
  		) {
! 		com_err(whoami, 0, "Bad volume header line: '%s'", tbuffer);
  		return (-1);
  	    }
  
--- 495,501 ----
  	    if ((code != 2)
  		|| (strcmp(serverName, "volumeset") != 0)
  		) {
! 		afs_com_err(whoami, 0, "Bad volume header line: '%s'", tbuffer);
  		return (-1);
  	    }
  
***************
*** 534,546 ****
  	    tve = (struct bc_volumeEntry *)
  		malloc(sizeof(struct bc_volumeEntry));
  	    if (!tve) {
! 		com_err(whoami, 0,
  			"Can't malloc() a new volume spec record!");
  		return (-1);
  	    }
  	    memset(tve, 0, sizeof(*tve));
  	    if (bc_ParseHost(serverName, &(tve->server)))
! 		com_err(whoami, 0, "Can't get required info on host '%s'",
  			serverName);
  
  	    /* The above code has filled in the server sockaddr, now fill in
--- 534,546 ----
  	    tve = (struct bc_volumeEntry *)
  		malloc(sizeof(struct bc_volumeEntry));
  	    if (!tve) {
! 		afs_com_err(whoami, 0,
  			"Can't malloc() a new volume spec record!");
  		return (-1);
  	    }
  	    memset(tve, 0, sizeof(*tve));
  	    if (bc_ParseHost(serverName, &(tve->server)))
! 		afs_com_err(whoami, 0, "Can't get required info on host '%s'",
  			serverName);
  
  	    /* The above code has filled in the server sockaddr, now fill in
***************
*** 548,573 ****
  	     */
  	    tve->serverName = (char *)malloc(strlen(serverName) + 1);
  	    if (!tve->serverName) {
! 		com_err(whoami, 0,
  			"Can't malloc() a new volume spec server name field!");
  		return (-1);
  	    }
  	    strcpy(tve->serverName, serverName);
  	    tve->partname = (char *)malloc(strlen(partName) + 1);
  	    if (!tve->partname) {
! 		com_err(whoami, 0,
  			"Can't malloc() a new volume spec partition pattern field!");
  		return (-1);
  	    }
  	    strcpy(tve->partname, partName);
  	    code = bc_GetPartitionID(partName, &tve->partition);
  	    if (code) {
! 		com_err(whoami, 0, "Can't parse partition '%s'", partName);
  		return -1;
  	    }
  	    tp = (char *)malloc(strlen(vsname) + 1);
  	    if (!tp) {
! 		com_err(whoami, 0,
  			"Can't malloc() a new volume spec volume pattern field!");
  		return (-1);
  	    }
--- 548,573 ----
  	     */
  	    tve->serverName = (char *)malloc(strlen(serverName) + 1);
  	    if (!tve->serverName) {
! 		afs_com_err(whoami, 0,
  			"Can't malloc() a new volume spec server name field!");
  		return (-1);
  	    }
  	    strcpy(tve->serverName, serverName);
  	    tve->partname = (char *)malloc(strlen(partName) + 1);
  	    if (!tve->partname) {
! 		afs_com_err(whoami, 0,
  			"Can't malloc() a new volume spec partition pattern field!");
  		return (-1);
  	    }
  	    strcpy(tve->partname, partName);
  	    code = bc_GetPartitionID(partName, &tve->partition);
  	    if (code) {
! 		afs_com_err(whoami, 0, "Can't parse partition '%s'", partName);
  		return -1;
  	    }
  	    tp = (char *)malloc(strlen(vsname) + 1);
  	    if (!tp) {
! 		afs_com_err(whoami, 0,
  			"Can't malloc() a new volume spec volume pattern field!");
  		return (-1);
  	    }
Index: openafs/src/bucoord/volstub.c
diff -c openafs/src/bucoord/volstub.c:1.6.14.2 openafs/src/bucoord/volstub.c:1.6.14.3
*** openafs/src/bucoord/volstub.c:1.6.14.2	Thu Jan  4 22:32:24 2007
--- openafs/src/bucoord/volstub.c	Tue Apr 10 14:39:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/volstub.c,v 1.6.14.2 2007/01/05 03:32:24 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/volstub.c,v 1.6.14.3 2007/04/10 18:39:50 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 27,32 ****
--- 27,33 ----
  #include "volser.h"
  #include "bc.h"
  #include <afs/volint.h>
+ #include <afs/com_err.h>
  
  extern char *whoami;
  
***************
*** 76,82 ****
  
      code = UV_ListOneVolume(htonl(serv), part, volid, &viptr);
      if (code) {
! 	com_err(whoami, code,
  		"Warning: Can't get clone time of volume %u - using 0",
  		volid);
  	*clDatePtr = 0;
--- 77,83 ----
  
      code = UV_ListOneVolume(htonl(serv), part, volid, &viptr);
      if (code) {
! 	afs_com_err(whoami, code,
  		"Warning: Can't get clone time of volume %u - using 0",
  		volid);
  	*clDatePtr = 0;
***************
*** 98,104 ****
  	break;
  
      default:
! 	com_err(whoami, 0,
  		"Can't get clone time of volume %u - unknown volume type",
  		volid);
  	return (-1);
--- 99,105 ----
  	break;
  
      default:
! 	afs_com_err(whoami, 0,
  		"Can't get clone time of volume %u - unknown volume type",
  		volid);
  	return (-1);
Index: openafs/src/budb/server.c
diff -c openafs/src/budb/server.c:1.16.2.3 openafs/src/budb/server.c:1.16.2.4
*** openafs/src/budb/server.c:1.16.2.3	Thu Feb  8 20:00:19 2007
--- openafs/src/budb/server.c	Tue Apr 10 14:39:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/server.c,v 1.16.2.3 2007/02/09 01:00:19 shadow Exp $");
  
  #include <fcntl.h>
  #include <sys/stat.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/server.c,v 1.16.2.4 2007/04/10 18:39:50 shadow Exp $");
  
  #include <fcntl.h>
  #include <sys/stat.h>
***************
*** 409,415 ****
  #ifdef AFS_NT40_ENV
  	ReportErrorEventAlt(AFSEVT_SVR_NO_INSTALL_DIR, 0, argv[0], 0);
  #endif
! 	com_err(whoami, errno, "; Unable to obtain AFS server directory.");
  	exit(2);
      }
  
--- 409,415 ----
  #ifdef AFS_NT40_ENV
  	ReportErrorEventAlt(AFSEVT_SVR_NO_INSTALL_DIR, 0, argv[0], 0);
  #endif
! 	afs_com_err(whoami, errno, "; Unable to obtain AFS server directory.");
  	exit(2);
      }
  
***************
*** 467,473 ****
      BU_conf = afsconf_Open(globalConfPtr->cellConfigdir);
      if (BU_conf == 0) {
  	LogError(code, "Failed getting cell info\n");
! 	com_err(whoami, code, "Failed getting cell info");
  	ERROR(BUDB_NOCELLS);
      }
  
--- 467,473 ----
      BU_conf = afsconf_Open(globalConfPtr->cellConfigdir);
      if (BU_conf == 0) {
  	LogError(code, "Failed getting cell info\n");
! 	afs_com_err(whoami, code, "Failed getting cell info");
  	ERROR(BUDB_NOCELLS);
      }
  
***************
*** 550,556 ****
  
      if (code) {
  	LogError(code, "Ubik init failed\n");
! 	com_err(whoami, code, "Ubik init failed");
  	ERROR(code);
      }
  
--- 550,556 ----
  
      if (code) {
  	LogError(code, "Ubik init failed\n");
! 	afs_com_err(whoami, code, "Ubik init failed");
  	ERROR(code);
      }
  
***************
*** 677,684 ****
  	fprintf(globalConfPtr->log, "%s ", TimeStamp(now));
  
  	if (code)
! 	    fprintf(globalConfPtr->log, "%s: %s\n", error_table_name(code),
! 		    error_message(code));
  	fprintf(globalConfPtr->log, a, b, c, d, e, f, g, h, i);
  	fflush(globalConfPtr->log);
  	fclose(globalConfPtr->log);
--- 677,684 ----
  	fprintf(globalConfPtr->log, "%s ", TimeStamp(now));
  
  	if (code)
! 	    fprintf(globalConfPtr->log, "%s: %s\n", afs_error_table_name(code),
! 		    afs_error_message(code));
  	fprintf(globalConfPtr->log, a, b, c, d, e, f, g, h, i);
  	fflush(globalConfPtr->log);
  	fclose(globalConfPtr->log);
Index: openafs/src/butc/lwps.c
diff -c openafs/src/butc/lwps.c:1.14 openafs/src/butc/lwps.c:1.14.4.1
*** openafs/src/butc/lwps.c:1.14	Sun Jul 10 23:22:20 2005
--- openafs/src/butc/lwps.c	Tue Apr 10 14:39:51 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/lwps.c,v 1.14 2005/07/11 03:22:20 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/lwps.c,v 1.14.4.1 2007/04/10 18:39:51 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 175,182 ****
  	    err1 = "Volume has moved to another server";
  	    break;
  	default:
! 	    err1 = (char *)error_message(error1);
! 	    err2 = (char *)error_table_name(error1);
  	    break;
  	}
  	if (error1 == -1)
--- 175,182 ----
  	    err1 = "Volume has moved to another server";
  	    break;
  	default:
! 	    err1 = (char *)afs_error_message(error1);
! 	    err2 = (char *)afs_error_table_name(error1);
  	    break;
  	}
  	if (error1 == -1)
***************
*** 184,190 ****
  	else
  	    fprintf(log, "     %s: %s", err2, err1);
  	if (error2)
! 	    fprintf(log, ": %s", error_message(error2));
  	fprintf(log, "\n");
      }
      fflush(log);
--- 184,190 ----
  	else
  	    fprintf(log, "     %s: %s", err2, err1);
  	if (error2)
! 	    fprintf(log, ": %s", afs_error_message(error2));
  	fprintf(log, "\n");
      }
      fflush(log);
***************
*** 573,579 ****
  	    }
  	    if (rcpid == -1 && errno != EINTR) {
  		tapemounted = 0;
! 		com_err(whoami, errno,
  			"Error waiting for callout script to terminate.");
  		break;
  	    }
--- 573,579 ----
  	    }
  	    if (rcpid == -1 && errno != EINTR) {
  		tapemounted = 0;
! 		afs_com_err(whoami, errno,
  			"Error waiting for callout script to terminate.");
  		break;
  	    }
***************
*** 737,743 ****
  	    }
  	    /* if waitpid experienced an error, we prompt */
  	    if (rcpid == -1 && errno != EINTR) {
! 		com_err(whoami, errno,
  			"Error waiting for callout script to terminate.");
  		TLog(taskId,
  		     "Can't get exit status from callout script. will prompt\n");
--- 737,743 ----
  	    }
  	    /* if waitpid experienced an error, we prompt */
  	    if (rcpid == -1 && errno != EINTR) {
! 		afs_com_err(whoami, errno,
  			"Error waiting for callout script to terminate.");
  		TLog(taskId,
  		     "Can't get exit status from callout script. will prompt\n");
Index: openafs/src/butm/butm_test.c
diff -c openafs/src/butm/butm_test.c:1.8 openafs/src/butm/butm_test.c:1.8.14.1
*** openafs/src/butm/butm_test.c:1.8	Tue Jul 15 19:14:49 2003
--- openafs/src/butm/butm_test.c	Tue Apr 10 14:39:51 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butm/butm_test.c,v 1.8 2003/07/15 23:14:49 shadow Exp $");
  
  #include <errno.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butm/butm_test.c,v 1.8.14.1 2007/04/10 18:39:51 shadow Exp $");
  
  #include <errno.h>
  #include <sys/types.h>
***************
*** 34,40 ****
                         if (code != err) \
                         { \
                            printf("FAILURE: expected %u; got %u\n", err, code); \
!                           if (code) com_err(whoami, code, ""); \
  		       } \
                         else printf("PASSED; got %u\n", err); \
                         printf("\n");
--- 34,40 ----
                         if (code != err) \
                         { \
                            printf("FAILURE: expected %u; got %u\n", err, code); \
!                           if (code) afs_com_err(whoami, code, ""); \
  		       } \
                         else printf("PASSED; got %u\n", err); \
                         printf("\n");
***************
*** 43,49 ****
                          { \
  			   printf("TEST: %s\n", str); \
                             printf("FAILURE: expected %u; got %u\n", err, code); \
!                            if (code) com_err(whoami, code, ""); \
  			   printf("\n"); \
  		        }
  #define NOREWIND 0
--- 43,49 ----
                          { \
  			   printf("TEST: %s\n", str); \
                             printf("FAILURE: expected %u; got %u\n", err, code); \
!                            if (code) afs_com_err(whoami, code, ""); \
  			   printf("\n"); \
  		        }
  #define NOREWIND 0
Index: openafs/src/butm/file_tm.c
diff -c openafs/src/butm/file_tm.c:1.12 openafs/src/butm/file_tm.c:1.12.6.1
*** openafs/src/butm/file_tm.c:1.12	Sun Apr  3 14:09:27 2005
--- openafs/src/butm/file_tm.c	Tue Apr 10 14:39:51 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butm/file_tm.c,v 1.12 2005/04/03 18:09:27 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butm/file_tm.c,v 1.12.6.1 2007/04/10 18:39:51 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 1752,1758 ****
       struct tapeConfig *file;
  {
      if (!file) {
! 	com_err(whoami, BUTM_BADCONFIG, "device not specified");
  	return BUTM_BADCONFIG;
      }
  
--- 1752,1758 ----
       struct tapeConfig *file;
  {
      if (!file) {
! 	afs_com_err(whoami, BUTM_BADCONFIG, "device not specified");
  	return BUTM_BADCONFIG;
      }
  
***************
*** 1763,1775 ****
  
      /* Tape must be large enough to at least fit a label */
      if (config.tapeSize <= 0) {
! 	com_err(whoami, BUTM_BADCONFIG, "Tape size bogus: %d Kbytes",
  		config.tapeSize);
  	return BUTM_BADCONFIG;
      }
  
      if (strlen(config.tapedir) == 0) {
! 	com_err(whoami, BUTM_BADCONFIG, "no tape device specified");
  	return BUTM_BADCONFIG;
      }
  
--- 1763,1775 ----
  
      /* Tape must be large enough to at least fit a label */
      if (config.tapeSize <= 0) {
! 	afs_com_err(whoami, BUTM_BADCONFIG, "Tape size bogus: %d Kbytes",
  		config.tapeSize);
  	return BUTM_BADCONFIG;
      }
  
      if (strlen(config.tapedir) == 0) {
! 	afs_com_err(whoami, BUTM_BADCONFIG, "no tape device specified");
  	return BUTM_BADCONFIG;
      }
  
Index: openafs/src/butm/test_ftm.c
diff -c openafs/src/butm/test_ftm.c:1.11 openafs/src/butm/test_ftm.c:1.11.8.1
*** openafs/src/butm/test_ftm.c:1.11	Wed Sep  8 17:35:52 2004
--- openafs/src/butm/test_ftm.c	Tue Apr 10 14:39:51 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butm/test_ftm.c,v 1.11 2004/09/08 21:35:52 jaltman Exp $");
  
  #include <sys/types.h>
  #include <fcntl.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butm/test_ftm.c,v 1.11.8.1 2007/04/10 18:39:51 shadow Exp $");
  
  #include <sys/types.h>
  #include <fcntl.h>
***************
*** 131,144 ****
  	    else if (strncmp(argv[i], "-tapename", strlen(argv[i])) == 0)
  		tape = argv[++i];
  	    else {
! 		com_err(whoami, 0, "unexpected command argument: '%s'",
  			argv[i]);
  		goto usage;
  	    }
  	} else {
  	    struct stat buf;
  	    if (stat(argv[i], &buf)) {
! 		com_err(whoami, errno, "can't stat filename parameter %s\n",
  			argv[i]);
  	    } else {
  		if ((buf.st_mode & S_IFREG) && (buf.st_mode & 0444))
--- 131,144 ----
  	    else if (strncmp(argv[i], "-tapename", strlen(argv[i])) == 0)
  		tape = argv[++i];
  	    else {
! 		afs_com_err(whoami, 0, "unexpected command argument: '%s'",
  			argv[i]);
  		goto usage;
  	    }
  	} else {
  	    struct stat buf;
  	    if (stat(argv[i], &buf)) {
! 		afs_com_err(whoami, errno, "can't stat filename parameter %s\n",
  			argv[i]);
  	    } else {
  		if ((buf.st_mode & S_IFREG) && (buf.st_mode & 0444))
***************
*** 152,163 ****
  	goto usage;
  
      if ((strlen(tape) == 0) || (strlen(tape) >= BU_MAXTAPELEN)) {
! 	com_err(whoami, 0, "bogus tape name");
  	goto usage;
      }
      code = GetDeviceInfo(config, &confInfo);
      if (code) {
! 	com_err(whoami, 0, "cant find tape config info");
  	goto usage;
      }
  
--- 152,163 ----
  	goto usage;
  
      if ((strlen(tape) == 0) || (strlen(tape) >= BU_MAXTAPELEN)) {
! 	afs_com_err(whoami, 0, "bogus tape name");
  	goto usage;
      }
      code = GetDeviceInfo(config, &confInfo);
      if (code) {
! 	afs_com_err(whoami, 0, "cant find tape config info");
  	goto usage;
      }
  
***************
*** 169,180 ****
      printf("%s: Beginning Dump Tests\n", whoami);
      code = LWP_InitializeProcessSupport(1, &parent_pid);
      if (code) {
! 	com_err(whoami, code, "Can't init LWP lib");
  	exit(1);
      }
      code = IOMGR_Initialize();
      if (code) {
! 	com_err(whoami, code, "Can't init LWP IOMGR lib");
  	exit(1);
      }
      /* Perform normal test */
--- 169,180 ----
      printf("%s: Beginning Dump Tests\n", whoami);
      code = LWP_InitializeProcessSupport(1, &parent_pid);
      if (code) {
! 	afs_com_err(whoami, code, "Can't init LWP lib");
  	exit(1);
      }
      code = IOMGR_Initialize();
      if (code) {
! 	afs_com_err(whoami, code, "Can't init LWP IOMGR lib");
  	exit(1);
      }
      /* Perform normal test */
***************
*** 182,188 ****
  	LWP_CreateProcess(PerformDumpTest, 100000, 0, (void *)&ti,
  			  "BUTM Tester", &pid);
      if (code) {
! 	com_err(whoami, code, "libbutm.a: Normal Tests failed!. :-( ");
  	exit(code);
      }
      LWP_WaitProcess(&ti.dumpDone);
--- 182,188 ----
  	LWP_CreateProcess(PerformDumpTest, 100000, 0, (void *)&ti,
  			  "BUTM Tester", &pid);
      if (code) {
! 	afs_com_err(whoami, code, "libbutm.a: Normal Tests failed!. :-( ");
  	exit(code);
      }
      LWP_WaitProcess(&ti.dumpDone);
***************
*** 195,201 ****
  	    LWP_CreateProcess(PerformDumpTest, 100000, 0, (void *)&ti,
  			      "BUTM Tester", &pid);
  	if (code) {
! 	    com_err(whoami, code, "libbutm.a: Appended Tests failed!. :-( ");
  	    exit(code);
  	}
  
--- 195,201 ----
  	    LWP_CreateProcess(PerformDumpTest, 100000, 0, (void *)&ti,
  			      "BUTM Tester", &pid);
  	if (code) {
! 	    afs_com_err(whoami, code, "libbutm.a: Appended Tests failed!. :-( ");
  	    exit(code);
  	}
  
***************
*** 228,234 ****
  
      info.structVersion = BUTM_MAJORVERSION;
      if (code = butm_file_Instantiate(&info, tip->tc_Infop)) {
! 	com_err(whoami, code, "instantiating file tape");
  	ERROR_EXIT(2);
      }
  
--- 228,234 ----
  
      info.structVersion = BUTM_MAJORVERSION;
      if (code = butm_file_Instantiate(&info, tip->tc_Infop)) {
! 	afs_com_err(whoami, code, "instantiating file tape");
  	ERROR_EXIT(2);
      }
  
***************
*** 251,269 ****
      strcpy(label.comment, T_COMMENT);
  
      if (code = butm_Mount(&info, tip->tapeName)) {
! 	com_err(whoami, code, "setting up tape");
  	ERROR_EXIT(2);
      }
      if (tip->appended) {	/* This is to be an appended dump */
  	code = butm_SeekEODump(&info, tip->nFiles + 1);
  	if (code) {
! 	    com_err(whoami, code,
  		    "Can't append: Can't position to end of dump on tape\n");
  	    ERROR_EXIT(code);
  	}
      }
      if ((code = butm_Create(&info, &label, !tip->appended /*Rewind */ ))) {
! 	com_err(whoami, code, "Writing tape label");
  	ERROR_EXIT(2);
      }
  
--- 251,269 ----
      strcpy(label.comment, T_COMMENT);
  
      if (code = butm_Mount(&info, tip->tapeName)) {
! 	afs_com_err(whoami, code, "setting up tape");
  	ERROR_EXIT(2);
      }
      if (tip->appended) {	/* This is to be an appended dump */
  	code = butm_SeekEODump(&info, tip->nFiles + 1);
  	if (code) {
! 	    afs_com_err(whoami, code,
  		    "Can't append: Can't position to end of dump on tape\n");
  	    ERROR_EXIT(code);
  	}
      }
      if ((code = butm_Create(&info, &label, !tip->appended /*Rewind */ ))) {
! 	afs_com_err(whoami, code, "Writing tape label");
  	ERROR_EXIT(2);
      }
  
***************
*** 272,305 ****
  	int len;
  	int fid = open(tip->files[i], O_RDONLY, 0);
  	if (fid < 0) {
! 	    com_err(whoami, errno, "opening file to write on tape");
  	    ERROR_EXIT(3);
  	}
  	if (code = butm_WriteFileBegin(&info)) {
! 	    com_err(whoami, code, "beginning butm write file");
  	    ERROR_EXIT(3);
  	}
  	while ((len = read(fid, bufferBlock->data, BUTM_BLKSIZE)) > 0) {
  	    if (code = butm_WriteFileData(&info, bufferBlock->data, 1, len)) {
! 		com_err(whoami, code, "butm writing file data");
  		ERROR_EXIT(3);
  	    }
  	}
  	if (len < 0) {
! 	    com_err(whoami, errno, "reading file data");
  	    ERROR_EXIT(3);
  	}
  	if (code = butm_WriteFileEnd(&info)) {
! 	    com_err(whoami, code, "ending butm write file");
  	    ERROR_EXIT(3);
  	}
  	if (close(fid) < 0) {
! 	    com_err(whoami, errno, "closing file");
  	    ERROR_EXIT(3);
  	}
      }
      if ((code = butm_WriteEOT(&info)) || (code = butm_Dismount(&info))) {
! 	com_err(whoami, code, "finishing up tape");
  	ERROR_EXIT(4);
      }
  
--- 272,305 ----
  	int len;
  	int fid = open(tip->files[i], O_RDONLY, 0);
  	if (fid < 0) {
! 	    afs_com_err(whoami, errno, "opening file to write on tape");
  	    ERROR_EXIT(3);
  	}
  	if (code = butm_WriteFileBegin(&info)) {
! 	    afs_com_err(whoami, code, "beginning butm write file");
  	    ERROR_EXIT(3);
  	}
  	while ((len = read(fid, bufferBlock->data, BUTM_BLKSIZE)) > 0) {
  	    if (code = butm_WriteFileData(&info, bufferBlock->data, 1, len)) {
! 		afs_com_err(whoami, code, "butm writing file data");
  		ERROR_EXIT(3);
  	    }
  	}
  	if (len < 0) {
! 	    afs_com_err(whoami, errno, "reading file data");
  	    ERROR_EXIT(3);
  	}
  	if (code = butm_WriteFileEnd(&info)) {
! 	    afs_com_err(whoami, code, "ending butm write file");
  	    ERROR_EXIT(3);
  	}
  	if (close(fid) < 0) {
! 	    afs_com_err(whoami, errno, "closing file");
  	    ERROR_EXIT(3);
  	}
      }
      if ((code = butm_WriteEOT(&info)) || (code = butm_Dismount(&info))) {
! 	afs_com_err(whoami, code, "finishing up tape");
  	ERROR_EXIT(4);
      }
  
***************
*** 307,325 ****
  
      label.structVersion = BUTM_MAJORVERSION;
      if (code = butm_Mount(&info, tip->tapeName)) {
! 	com_err(whoami, code, "setting up tape");
  	ERROR_EXIT(5);
      }
      if (tip->appended) {	/* This is to be an appended dump */
  	code = butm_SeekEODump(&info, tip->nFiles + 1);
  	if (code) {
! 	    com_err(whoami, code,
  		    "Can't append: Can't position to end of dump on tape\n");
  	    ERROR_EXIT(code);
  	}
      }
      if (code = butm_ReadLabel(&info, &label, !tip->appended /*rewind */ )) {
! 	com_err(whoami, code, "reading tape label");
  	ERROR_EXIT(5);
      }
      past = time(0) - label.creationTime;
--- 307,325 ----
  
      label.structVersion = BUTM_MAJORVERSION;
      if (code = butm_Mount(&info, tip->tapeName)) {
! 	afs_com_err(whoami, code, "setting up tape");
  	ERROR_EXIT(5);
      }
      if (tip->appended) {	/* This is to be an appended dump */
  	code = butm_SeekEODump(&info, tip->nFiles + 1);
  	if (code) {
! 	    afs_com_err(whoami, code,
  		    "Can't append: Can't position to end of dump on tape\n");
  	    ERROR_EXIT(code);
  	}
      }
      if (code = butm_ReadLabel(&info, &label, !tip->appended /*rewind */ )) {
! 	afs_com_err(whoami, code, "reading tape label");
  	ERROR_EXIT(5);
      }
      past = time(0) - label.creationTime;
***************
*** 359,370 ****
  
  	fid = open(tip->files[i], O_RDONLY, 0);
  	if (fid < 0) {
! 	    com_err(whoami, errno, "Opening %dth file to compare with tape",
  		    i + 1);
  	    ERROR_EXIT(6);
  	}
  	if (code = butm_ReadFileBegin(&info)) {
! 	    com_err(whoami, code, "Beginning butm %dth read file", i + 1);
  	    ERROR_EXIT(6);
  	}
  
--- 359,370 ----
  
  	fid = open(tip->files[i], O_RDONLY, 0);
  	if (fid < 0) {
! 	    afs_com_err(whoami, errno, "Opening %dth file to compare with tape",
  		    i + 1);
  	    ERROR_EXIT(6);
  	}
  	if (code = butm_ReadFileBegin(&info)) {
! 	    afs_com_err(whoami, code, "Beginning butm %dth read file", i + 1);
  	    ERROR_EXIT(6);
  	}
  
***************
*** 374,386 ****
  	    code = butm_ReadFileData(&info, tbuffer, BUTM_BLKSIZE, &tlen);
  
  	    if (code && code != BUTM_STATUS_EOF) {
! 		com_err(whoami, code, "Reading %dth tape data", i + 1);
  		ERROR_EXIT(6);
  	    }
  	    memset(fbuffer, 0, BUTM_BLKSIZE);
  	    flen = read(fid, fbuffer, sizeof(fbuffer));
  	    if (flen < 0) {
! 		com_err(whoami, errno, "Reading %dth file data", i + 1);
  		ERROR_EXIT(6);
  	    }
  	    if (code == BUTM_STATUS_EOF)
--- 374,386 ----
  	    code = butm_ReadFileData(&info, tbuffer, BUTM_BLKSIZE, &tlen);
  
  	    if (code && code != BUTM_STATUS_EOF) {
! 		afs_com_err(whoami, code, "Reading %dth tape data", i + 1);
  		ERROR_EXIT(6);
  	    }
  	    memset(fbuffer, 0, BUTM_BLKSIZE);
  	    flen = read(fid, fbuffer, sizeof(fbuffer));
  	    if (flen < 0) {
! 		afs_com_err(whoami, errno, "Reading %dth file data", i + 1);
  		ERROR_EXIT(6);
  	    }
  	    if (code == BUTM_STATUS_EOF)
***************
*** 402,412 ****
  	}
  
  	if (code = butm_ReadFileEnd(&info)) {
! 	    com_err(whoami, code, "Ending butm %dth read file", i + 1);
  	    ERROR_EXIT(7);
  	}
  	if (close(fid) < 0) {
! 	    com_err(whoami, errno, "Closing %dth file", i + 1);
  	    ERROR_EXIT(7);
  	}
      }
--- 402,412 ----
  	}
  
  	if (code = butm_ReadFileEnd(&info)) {
! 	    afs_com_err(whoami, code, "Ending butm %dth read file", i + 1);
  	    ERROR_EXIT(7);
  	}
  	if (close(fid) < 0) {
! 	    afs_com_err(whoami, errno, "Closing %dth file", i + 1);
  	    ERROR_EXIT(7);
  	}
      }
***************
*** 414,425 ****
      if ((info.status & BUTM_STATUS_EOD) == 0) {
  	code = butm_ReadFileBegin(&info);
  	if (code && (code != BUTM_EOD)) {
! 	    com_err(whoami, code, "Should have encountered an 'End Of Tape'");
  	    ERROR_EXIT(8);
  	}
      }
      if (code = butm_Dismount(&info)) {
! 	com_err(whoami, code, "Finishing up tape");
  	ERROR_EXIT(8);
      }
  
--- 414,425 ----
      if ((info.status & BUTM_STATUS_EOD) == 0) {
  	code = butm_ReadFileBegin(&info);
  	if (code && (code != BUTM_EOD)) {
! 	    afs_com_err(whoami, code, "Should have encountered an 'End Of Tape'");
  	    ERROR_EXIT(8);
  	}
      }
      if (code = butm_Dismount(&info)) {
! 	afs_com_err(whoami, code, "Finishing up tape");
  	ERROR_EXIT(8);
      }
  
Index: openafs/src/cf/linux-test4.m4
diff -c openafs/src/cf/linux-test4.m4:1.29.2.22 openafs/src/cf/linux-test4.m4:1.29.2.23
*** openafs/src/cf/linux-test4.m4:1.29.2.22	Mon Feb 26 12:52:04 2007
--- openafs/src/cf/linux-test4.m4	Wed Apr 18 14:20:05 2007
***************
*** 644,649 ****
--- 644,665 ----
    AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
  
  
+ AC_DEFUN([LINUX_IOP_I_PUT_LINK_TAKES_COOKIE], [
+   AC_MSG_CHECKING([whether inode_operations.put_link takes an opaque cookie])
+   AC_CACHE_VAL([ac_cv_linux_func_i_put_link_takes_cookie], [
+     AC_TRY_KBUILD(
+ [#include <linux/fs.h>
+ #include <linux/namei.h>],
+ [struct inode _inode;
+ struct dentry _dentry;
+ struct nameidata _nameidata;
+ void *cookie;
+ (void)_inode.i_op->put_link(&_dentry, &_nameidata, cookie);],
+       ac_cv_linux_func_i_put_link_takes_cookie=yes,
+       ac_cv_linux_func_i_put_link_takes_cookie=no)])
+   AC_MSG_RESULT($ac_cv_linux_func_i_put_link_takes_cookie)])
+ 
+ 
  AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
    AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
    AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
Index: openafs/src/cmd/test/itest.c
diff -c openafs/src/cmd/test/itest.c:1.7 openafs/src/cmd/test/itest.c:1.7.14.1
*** openafs/src/cmd/test/itest.c:1.7	Tue Jul 15 19:14:52 2003
--- openafs/src/cmd/test/itest.c	Tue Apr 10 14:39:51 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/test/itest.c,v 1.7 2003/07/15 23:14:52 shadow Exp $");
  
  #include "cmd.h"
  #include <stdio.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/test/itest.c,v 1.7.14.1 2007/04/10 18:39:51 shadow Exp $");
  
  #include "cmd.h"
  #include <stdio.h>
***************
*** 84,96 ****
  	    break;
  	code = cmd_ParseLine(tline, tv, &tc, 100);
  	if (code) {
! 	    printf("itest: parsing failure: %s\n", error_message(code));
  	    exit(1);
  	}
  	code = cmd_Dispatch(tc, tv);
  	cmd_FreeArgv(tv);
  	if (code) {
! 	    printf("itest: execution failed: %s\n", error_message(code));
  	}
      }
      return 0;
--- 84,96 ----
  	    break;
  	code = cmd_ParseLine(tline, tv, &tc, 100);
  	if (code) {
! 	    printf("itest: parsing failure: %s\n", afs_error_message(code));
  	    exit(1);
  	}
  	code = cmd_Dispatch(tc, tv);
  	cmd_FreeArgv(tv);
  	if (code) {
! 	    printf("itest: execution failed: %s\n", afs_error_message(code));
  	}
      }
      return 0;
Index: openafs/src/comerr/com_err.c
diff -c openafs/src/comerr/com_err.c:1.5 openafs/src/comerr/com_err.c:1.5.14.1
*** openafs/src/comerr/com_err.c:1.5	Tue Jul 15 19:14:53 2003
--- openafs/src/comerr/com_err.c	Tue Apr 10 14:39:51 2007
***************
*** 8,14 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/comerr/com_err.c,v 1.5 2003/07/15 23:14:53 shadow Exp $");
  
  #include "internal.h"
  #include <stdio.h>
--- 8,14 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/comerr/com_err.c,v 1.5.14.1 2007/04/10 18:39:51 shadow Exp $");
  
  #include "internal.h"
  #include <stdio.h>
***************
*** 25,31 ****
  	fputs(": ", stderr);
      }
      if (code) {
! 	fputs(error_message(code), stderr);
  	fputs(" ", stderr);
      }
      if (fmt) {
--- 25,31 ----
  	fputs(": ", stderr);
      }
      if (code) {
! 	fputs(afs_error_message(code), stderr);
  	fputs(" ", stderr);
      }
      if (fmt) {
***************
*** 42,66 ****
  static errf com_err_hook = default_com_err_proc;
  
  void
! com_err_va(const char *whoami, afs_int32 code, const char *fmt, va_list args)
  {
      (*com_err_hook) (whoami, code, fmt, args);
  }
  
  void
! com_err(const char *whoami, afs_int32 code, const char *fmt, ...)
  {
      va_list pvar;
  
      if (!com_err_hook)
  	com_err_hook = default_com_err_proc;
      va_start(pvar, fmt);
!     com_err_va(whoami, code, fmt, pvar);
      va_end(pvar);
  }
  
  errf
! set_com_err_hook(errf new_proc)
  {
      errf x = com_err_hook;
      if (new_proc)
--- 42,66 ----
  static errf com_err_hook = default_com_err_proc;
  
  void
! afs_com_err_va(const char *whoami, afs_int32 code, const char *fmt, va_list args)
  {
      (*com_err_hook) (whoami, code, fmt, args);
  }
  
  void
! afs_com_err(const char *whoami, afs_int32 code, const char *fmt, ...)
  {
      va_list pvar;
  
      if (!com_err_hook)
  	com_err_hook = default_com_err_proc;
      va_start(pvar, fmt);
!     afs_com_err_va(whoami, code, fmt, pvar);
      va_end(pvar);
  }
  
  errf
! afs_set_com_err_hook(errf new_proc)
  {
      errf x = com_err_hook;
      if (new_proc)
***************
*** 71,77 ****
  }
  
  errf
! reset_com_err_hook(void)
  {
      errf x = com_err_hook;
      com_err_hook = default_com_err_proc;
--- 71,77 ----
  }
  
  errf
! afs_reset_com_err_hook(void)
  {
      errf x = com_err_hook;
      com_err_hook = default_com_err_proc;
Index: openafs/src/comerr/com_err.h
diff -c openafs/src/comerr/com_err.h:1.3 openafs/src/comerr/com_err.h:1.3.14.1
*** openafs/src/comerr/com_err.h:1.3	Tue Jul 15 19:14:53 2003
--- openafs/src/comerr/com_err.h	Tue Apr 10 14:39:51 2007
***************
*** 8,28 ****
   * with this package.
   */
  
! #ifndef __COM_ERR_H
  
  #include <stdarg.h>
  
! extern void com_err(const char *, afs_int32, const char *, ...);
! extern void com_err_va(const char *whoami, afs_int32 code, const char *fmt,
  		       va_list args);
! extern const char *error_table_name(afs_int32);
! extern const char *error_message(afs_int32);
  extern
! void (*set_com_err_hook
        (void (*)(const char *, afs_int32, const char *, va_list)))
    (const char *, afs_int32, const char *, va_list);
! extern void (*reset_com_err_hook(void)) (const char *, afs_int32,
  					 const char *, va_list);
  
! #define __COM_ERR_H
! #endif /* ! defined(__COM_ERR_H) */
--- 8,36 ----
   * with this package.
   */
  
! #ifndef __AFS_COM_ERR_H
  
  #include <stdarg.h>
  
! extern void afs_com_err(const char *, afs_int32, const char *, ...);
! extern void afs_com_err_va(const char *whoami, afs_int32 code, const char *fmt,
  		       va_list args);
! extern const char *afs_error_table_name(afs_int32);
! extern const char *afs_error_message(afs_int32);
  extern
! void (*afs_set_com_err_hook
        (void (*)(const char *, afs_int32, const char *, va_list)))
    (const char *, afs_int32, const char *, va_list);
! extern void (*afs_reset_com_err_hook(void)) (const char *, afs_int32,
  					 const char *, va_list);
  
! #define __AFS_COM_ERR_H
! #ifdef AFS_OLD_COM_ERR 
! #define com_err                 afs_com_err
! #define com_err_va              afs_com_err_va
! #define error_table_name        afs_error_table_name
! #define error_message           afs_error_message
! #define set_com_err_hook        afs_set_com_err_hook
! #define reset_com_err_hook      afs_reset_com_err_hook
! #endif /* AFS_OLD_COM_ERR */
! #endif /* ! defined(__AFS_COM_ERR_H) */
Index: openafs/src/comerr/compile_et.c
diff -c openafs/src/comerr/compile_et.c:1.14 openafs/src/comerr/compile_et.c:1.14.14.1
*** openafs/src/comerr/compile_et.c:1.14	Sat Nov 29 17:08:10 2003
--- openafs/src/comerr/compile_et.c	Tue Apr 10 14:39:51 2007
***************
*** 13,19 ****
  #include <afs/afsutil.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/comerr/compile_et.c,v 1.14 2003/11/29 22:08:10 jaltman Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
--- 13,19 ----
  #include <afs/afsutil.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/comerr/compile_et.c,v 1.14.14.1 2007/04/10 18:39:51 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 375,381 ****
  	fputs("static struct et_list etlink = { 0, &et};\n\n", cfile);
  	fprintf(cfile, "void initialize_%s_error_table(void) {\n",
  		table_name);
! 	fputs("    add_to_error_table(&etlink);\n", cfile);
  	fputs("}\n", cfile);
  	fclose(cfile);
  
--- 375,381 ----
  	fputs("static struct et_list etlink = { 0, &et};\n\n", cfile);
  	fprintf(cfile, "void initialize_%s_error_table(void) {\n",
  		table_name);
! 	fputs("    afs_add_to_error_table(&etlink);\n", cfile);
  	fputs("}\n", cfile);
  	fclose(cfile);
  
Index: openafs/src/comerr/error_msg.c
diff -c openafs/src/comerr/error_msg.c:1.6 openafs/src/comerr/error_msg.c:1.6.8.1
*** openafs/src/comerr/error_msg.c:1.6	Wed Aug 18 21:07:42 2004
--- openafs/src/comerr/error_msg.c	Tue Apr 10 14:39:51 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/comerr/error_msg.c,v 1.6 2004/08/19 01:07:42 kolya Exp $");
  
  #include "internal.h"
  #include <stdio.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/comerr/error_msg.c,v 1.6.8.1 2007/04/10 18:39:51 shadow Exp $");
  
  #include "internal.h"
  #include <stdio.h>
***************
*** 45,51 ****
   * Function to initialize the et_list_mutex
   */
  
! void
  et_mutex_once(void)
  {
      assert(!pthread_mutex_init
--- 45,51 ----
   * Function to initialize the et_list_mutex
   */
  
! static void
  et_mutex_once(void)
  {
      assert(!pthread_mutex_init
***************
*** 110,116 ****
  }
  
  const char *
! error_message(afs_int32 code)
  {
      int offset;
      struct et_list *et;
--- 110,116 ----
  }
  
  const char *
! afs_error_message(afs_int32 code)
  {
      int offset;
      struct et_list *et;
***************
*** 147,153 ****
      UNLOCK_ET_LIST;
      strcpy(buffer, "Unknown code ");
      if (table_num) {
! 	strcat(buffer, error_table_name(table_num));
  	strcat(buffer, " ");
      }
      for (cp = buffer; *cp; cp++);
--- 147,153 ----
      UNLOCK_ET_LIST;
      strcpy(buffer, "Unknown code ");
      if (table_num) {
! 	strcat(buffer, afs_error_table_name(table_num));
  	strcat(buffer, " ");
      }
      for (cp = buffer; *cp; cp++);
***************
*** 169,175 ****
  }
  
  void
! add_to_error_table(struct et_list *new_table)
  {
      struct et_list *et;
  
--- 169,175 ----
  }
  
  void
! afs_add_to_error_table(struct et_list *new_table)
  {
      struct et_list *et;
  
Index: openafs/src/comerr/error_table.h
diff -c openafs/src/comerr/error_table.h:1.3 openafs/src/comerr/error_table.h:1.3.14.1
*** openafs/src/comerr/error_table.h:1.3	Tue Jul 15 19:14:53 2003
--- openafs/src/comerr/error_table.h	Tue Apr 10 14:39:51 2007
***************
*** 9,15 ****
  
  #include <errno.h>
  
! #ifndef _ET_H
  
  struct error_table {
      char const *const *msgs;
--- 9,15 ----
  
  #include <errno.h>
  
! #ifndef _AFS_ET_H
  
  struct error_table {
      char const *const *msgs;
***************
*** 25,31 ****
  #define	ERRCODE_RANGE	8	/* # of bits to shift table number */
  #define	BITS_PER_CHAR	6	/* # bits to shift per character in name */
  
! extern char const *error_table_name(afs_int32 num);
! extern void add_to_error_table(struct et_list *new_table);
! #define _ET_H
  #endif
--- 25,35 ----
  #define	ERRCODE_RANGE	8	/* # of bits to shift table number */
  #define	BITS_PER_CHAR	6	/* # bits to shift per character in name */
  
! extern char const *afs_error_table_name(afs_int32 num);
! extern void afs_add_to_error_table(struct et_list *new_table);
! #ifdef AFS_OLD_COM_ERR
! #define error_table_name        afs_error_table_name
! #define add_to_error_table(X) afs_add_to_error_table(X)
! #endif /* AFS_OLD_COM_ERR */
! #define _AFS_ET_H
  #endif
Index: openafs/src/comerr/et_name.c
diff -c openafs/src/comerr/et_name.c:1.5 openafs/src/comerr/et_name.c:1.5.14.1
*** openafs/src/comerr/et_name.c:1.5	Tue Jul 15 19:14:53 2003
--- openafs/src/comerr/et_name.c	Tue Apr 10 14:39:51 2007
***************
*** 9,15 ****
  #include <afs/afsutil.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/comerr/et_name.c,v 1.5 2003/07/15 23:14:53 shadow Exp $");
  
  #include "error_table.h"
  #include "mit-sipb-cr.h"
--- 9,15 ----
  #include <afs/afsutil.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/comerr/et_name.c,v 1.5.14.1 2007/04/10 18:39:51 shadow Exp $");
  
  #include "error_table.h"
  #include "mit-sipb-cr.h"
***************
*** 26,32 ****
  static char buf[6];
  
  const char *
! error_table_name(afs_int32 num)
  {
      int ch;
      int i;
--- 26,32 ----
  static char buf[6];
  
  const char *
! afs_error_table_name(afs_int32 num)
  {
      int ch;
      int i;
Index: openafs/src/comerr/internal.h
diff -c openafs/src/comerr/internal.h:1.4 openafs/src/comerr/internal.h:1.4.14.1
*** openafs/src/comerr/internal.h:1.4	Tue Jul 15 19:14:53 2003
--- openafs/src/comerr/internal.h	Tue Apr 10 14:39:51 2007
***************
*** 1,5 ****
  /*
!  * internal include file for com_err package
   *
   */
  #include "mit-sipb-cr.h"
--- 1,5 ----
  /*
!  * internal include file for afs_com_err package
   *
   */
  #include "mit-sipb-cr.h"
Index: openafs/src/comerr/test/test.c
diff -c openafs/src/comerr/test/test.c:1.6 openafs/src/comerr/test/test.c:1.6.14.1
*** openafs/src/comerr/test/test.c:1.6	Tue Jul 15 19:14:54 2003
--- openafs/src/comerr/test/test.c	Tue Apr 10 14:39:51 2007
***************
*** 2,8 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/comerr/test/test.c,v 1.6 2003/07/15 23:14:54 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
--- 2,8 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/comerr/test/test.c,v 1.6.14.1 2007/04/10 18:39:51 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
***************
*** 18,55 ****
  main()
  {
      printf("Before initiating error table:\n\n");
!     printf("Table name '%s'\n", error_table_name(KRB_MK_AP_TGTEXP));
!     printf("UNIX  name '%s'\n", error_table_name(EPERM));
!     printf("Msg TGT-expired is '%s'\n", error_message(KRB_MK_AP_TGTEXP));
!     printf("Msg EPERM is '%s'\n", error_message(EPERM));
!     printf("Msg FOO_ERR is '%s'\n", error_message(FOO_ERR));
!     printf("Msg {sys_nerr-1} is '%s'\n", error_message(sys_nerr - 1));
!     printf("Msg {sys_nerr} is '%s'\n", error_message(sys_nerr));
  
!     printf("With 0: tgt-expired -> %s\n", error_message(KRB_MK_AP_TGTEXP));
  
      initialize_KRB_error_table();
      initialize_KRB_error_table();
      printf("KRB error table initialized:  base %d (%s), name %s\n",
! 	   ERROR_TABLE_BASE_KRB, error_message(ERROR_TABLE_BASE_KRB),
! 	   error_table_name(ERROR_TABLE_BASE_KRB));
!     printf("With krb: tgt-expired -> %s\n", error_message(KRB_MK_AP_TGTEXP));
  
      initialize_QUUX_error_table();
      printf("QUUX error table initialized: base %d (%s), name %s\n",
! 	   ERROR_TABLE_BASE_QUUX, error_message(ERROR_TABLE_BASE_QUUX),
! 	   error_table_name(ERROR_TABLE_BASE_QUUX));
  
!     printf("Msg for TGT-expired is '%s'\n", error_message(KRB_MK_AP_TGTEXP));
!     printf("Msg {sys_nerr-1} is '%s'\n", error_message(sys_nerr - 1));
!     printf("Msg FOO_ERR is '%s'\n", error_message(FOO_ERR));
!     printf("Msg KRB_SKDC_CANT is '%s'\n", error_message(KRB_SKDC_CANT));
!     printf("Msg 1e6 (8B 64) is '%s'\n", error_message(1000000));
      printf("\n\nCOM_ERR tests:\n");
!     com_err("whoami", FOO_ERR, (char *)NULL);
!     com_err("whoami", FOO_ERR, " -- message goes %s", "here");
!     com_err("whoami", 0, NULL);
!     com_err("whoami", 0, "error number %d\n", 0);
  
      return 0;
  }
--- 18,55 ----
  main()
  {
      printf("Before initiating error table:\n\n");
!     printf("Table name '%s'\n", afs_error_table_name(KRB_MK_AP_TGTEXP));
!     printf("UNIX  name '%s'\n", afs_error_table_name(EPERM));
!     printf("Msg TGT-expired is '%s'\n", afs_error_message(KRB_MK_AP_TGTEXP));
!     printf("Msg EPERM is '%s'\n", afs_error_message(EPERM));
!     printf("Msg FOO_ERR is '%s'\n", afs_error_message(FOO_ERR));
!     printf("Msg {sys_nerr-1} is '%s'\n", afs_error_message(sys_nerr - 1));
!     printf("Msg {sys_nerr} is '%s'\n", afs_error_message(sys_nerr));
  
!     printf("With 0: tgt-expired -> %s\n", afs_error_message(KRB_MK_AP_TGTEXP));
  
      initialize_KRB_error_table();
      initialize_KRB_error_table();
      printf("KRB error table initialized:  base %d (%s), name %s\n",
! 	   ERROR_TABLE_BASE_KRB, afs_error_message(ERROR_TABLE_BASE_KRB),
! 	   afs_error_table_name(ERROR_TABLE_BASE_KRB));
!     printf("With krb: tgt-expired -> %s\n", afs_error_message(KRB_MK_AP_TGTEXP));
  
      initialize_QUUX_error_table();
      printf("QUUX error table initialized: base %d (%s), name %s\n",
! 	   ERROR_TABLE_BASE_QUUX, afs_error_message(ERROR_TABLE_BASE_QUUX),
! 	   afs_error_table_name(ERROR_TABLE_BASE_QUUX));
  
!     printf("Msg for TGT-expired is '%s'\n", afs_error_message(KRB_MK_AP_TGTEXP));
!     printf("Msg {sys_nerr-1} is '%s'\n", afs_error_message(sys_nerr - 1));
!     printf("Msg FOO_ERR is '%s'\n", afs_error_message(FOO_ERR));
!     printf("Msg KRB_SKDC_CANT is '%s'\n", afs_error_message(KRB_SKDC_CANT));
!     printf("Msg 1e6 (8B 64) is '%s'\n", afs_error_message(1000000));
      printf("\n\nCOM_ERR tests:\n");
!     afs_com_err("whoami", FOO_ERR, (char *)NULL);
!     afs_com_err("whoami", FOO_ERR, " -- message goes %s", "here");
!     afs_com_err("whoami", 0, NULL);
!     afs_com_err("whoami", 0, "error number %d\n", 0);
  
      return 0;
  }
Index: openafs/src/config/NTMakefile.amd64_w2k
diff -c openafs/src/config/NTMakefile.amd64_w2k:1.24.2.21 openafs/src/config/NTMakefile.amd64_w2k:1.24.2.22
*** openafs/src/config/NTMakefile.amd64_w2k:1.24.2.21	Tue Apr  3 09:25:42 2007
--- openafs/src/config/NTMakefile.amd64_w2k	Wed Apr 18 12:10:27 2007
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=1800
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=1900
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/NTMakefile.i386_nt40
diff -c openafs/src/config/NTMakefile.i386_nt40:1.84.2.21 openafs/src/config/NTMakefile.i386_nt40:1.84.2.22
*** openafs/src/config/NTMakefile.i386_nt40:1.84.2.21	Tue Apr  3 09:25:42 2007
--- openafs/src/config/NTMakefile.i386_nt40	Wed Apr 18 12:10:27 2007
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=1800
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=1900
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/NTMakefile.i386_w2k
diff -c openafs/src/config/NTMakefile.i386_w2k:1.23.2.21 openafs/src/config/NTMakefile.i386_w2k:1.23.2.22
*** openafs/src/config/NTMakefile.i386_w2k:1.23.2.21	Tue Apr  3 09:25:42 2007
--- openafs/src/config/NTMakefile.i386_w2k	Wed Apr 18 12:10:28 2007
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=1800
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=1900
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/dauth/dlog.c
diff -c openafs/src/dauth/dlog.c:1.9.14.1 openafs/src/dauth/dlog.c:1.9.14.2
*** openafs/src/dauth/dlog.c:1.9.14.1	Mon Jul  3 15:07:14 2006
--- openafs/src/dauth/dlog.c	Tue Apr 10 14:39:51 2007
***************
*** 72,78 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dauth/Attic/dlog.c,v 1.9.14.1 2006/07/03 19:07:14 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 72,78 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dauth/Attic/dlog.c,v 1.9.14.2 2007/04/10 18:39:51 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 548,554 ****
  	ap[1] = "-servers";
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
! 	    com_err(rn, code, "-- could not parse server list");
  	    exit(1);
  	}
      } else {
--- 548,554 ----
  	ap[1] = "-servers";
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
! 	    afs_com_err(rn, code, "-- could not parse server list");
  	    exit(1);
  	}
      } else {
***************
*** 560,566 ****
  	 */
  	code = afsconf_GetCellInfo(cdir, realm, 0, &cellinfo);
  	if (code) {
! 	    com_err(rn, code, "-- unable to get cell info");
  	    exit(1);
  	}
  	strncpy(realm, cellinfo.name, sizeof(realm) - 1);
--- 560,566 ----
  	 */
  	code = afsconf_GetCellInfo(cdir, realm, 0, &cellinfo);
  	if (code) {
! 	    afs_com_err(rn, code, "-- unable to get cell info");
  	    exit(1);
  	}
  	strncpy(realm, cellinfo.name, sizeof(realm) - 1);
***************
*** 688,694 ****
       * Check for simple communication failures.
       */
      if (code) {
! 	com_err(rn, code, "-- failed to contact authentication service");
  	exit(1);
      }
  
--- 688,694 ----
       * Check for simple communication failures.
       */
      if (code) {
! 	afs_com_err(rn, code, "-- failed to contact authentication service");
  	exit(1);
      }
  
***************
*** 719,725 ****
  	} else {
  	    code = des_read_pw_string(passwd, sizeof(passwd), "Password:", 0);
  	    if (code) {
! 		com_err(rn, code, "-- couldn't read password");
  		exit(1);
  	    }
  	}
--- 719,725 ----
  	} else {
  	    code = des_read_pw_string(passwd, sizeof(passwd), "Password:", 0);
  	    if (code) {
! 		afs_com_err(rn, code, "-- couldn't read password");
  		exit(1);
  	    }
  	}
***************
*** 751,757 ****
  			    passwd_key, DECRYPT);
      }
      if (code) {
! 	com_err(rn, code, "-- unable to decrypt reply from the DCE KDC");
  	exit(1);
      }
  
--- 751,757 ----
  			    passwd_key, DECRYPT);
      }
      if (code) {
! 	afs_com_err(rn, code, "-- unable to decrypt reply from the DCE KDC");
  	exit(1);
      }
  
***************
*** 799,805 ****
  			kdcrep.endtime, dosetpag);
  
      if (code) {
! 	com_err("dlog", code, "-- failed to store tickets");
  	exit(1);
      }
  
--- 799,805 ----
  			kdcrep.endtime, dosetpag);
  
      if (code) {
! 	afs_com_err("dlog", code, "-- failed to store tickets");
  	exit(1);
      }
  
Index: openafs/src/finale/translate_et.c
diff -c openafs/src/finale/translate_et.c:1.8.14.1 openafs/src/finale/translate_et.c:1.8.14.2
*** openafs/src/finale/translate_et.c:1.8.14.1	Thu Feb  8 20:00:20 2007
--- openafs/src/finale/translate_et.c	Tue Apr 10 14:39:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/finale/translate_et.c,v 1.8.14.1 2007/02/09 01:00:20 shadow Exp $");
  
  #include <afs/com_err.h>
  #include <rx/rxkad.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/finale/translate_et.c,v 1.8.14.2 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/com_err.h>
  #include <rx/rxkad.h>
***************
*** 73,80 ****
  	code = atoi(argv[i]);
  	offset = code & ((1 << ERRCODE_RANGE) - 1);
  
! 	printf("%d (%s).%d = %s\n", (int)code, error_table_name(code),
! 	       (int)offset, error_message(code));
      }
      return 0;
  }
--- 73,80 ----
  	code = atoi(argv[i]);
  	offset = code & ((1 << ERRCODE_RANGE) - 1);
  
! 	printf("%d (%s).%d = %s\n", (int)code, afs_error_table_name(code),
! 	       (int)offset, afs_error_message(code));
      }
      return 0;
  }
Index: openafs/src/kauth/admin_tools.c
diff -c openafs/src/kauth/admin_tools.c:1.19 openafs/src/kauth/admin_tools.c:1.19.8.1
*** openafs/src/kauth/admin_tools.c:1.19	Wed Dec  8 13:33:48 2004
--- openafs/src/kauth/admin_tools.c	Tue Apr 10 14:39:52 2007
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/admin_tools.c,v 1.19 2004/12/08 18:33:48 rees Exp $");
  
  #include <afs/stds.h>
  #include <afs/debug.h>
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/admin_tools.c,v 1.19.8.1 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/debug.h>
***************
*** 68,74 ****
  	return 0;
      code = ka_ExpandCell(0, cell, 0 /*local */ );
      if (code) {
! 	com_err(whoami, code, "Can't expand cell name");
      }
      return code;
  }
--- 68,74 ----
  	return 0;
      code = ka_ExpandCell(0, cell, 0 /*local */ );
      if (code) {
! 	afs_com_err(whoami, code, "Can't expand cell name");
      }
      return code;
  }
***************
*** 88,94 ****
  
      code = ka_ParseLoginName(user, name, instance, 0);
      if (code) {
! 	com_err(whoami, code, "parsing user's name '%s'", user);
  	return KABADCMD;
      }
  
--- 88,94 ----
  
      code = ka_ParseLoginName(user, name, instance, 0);
      if (code) {
! 	afs_com_err(whoami, code, "parsing user's name '%s'", user);
  	return KABADCMD;
      }
  
***************
*** 97,103 ****
      code =
  	ubik_Call(KAM_GetEntry, conn, 0, name, inst, KAMAJORVERSION, &tentry);
      if (code) {
! 	com_err(whoami, code, "getting information for %s.%s", name, inst);
  	return code;
      }
      if (tentry.minor_version != KAMINORVERSION)
--- 97,103 ----
      code =
  	ubik_Call(KAM_GetEntry, conn, 0, name, inst, KAMAJORVERSION, &tentry);
      if (code) {
! 	afs_com_err(whoami, code, "getting information for %s.%s", name, inst);
  	return code;
      }
      if (tentry.minor_version != KAMINORVERSION)
***************
*** 254,260 ****
  	    ubik_Call(KAM_ListEntry, conn, 0, index, &next_index, &count,
  		      &name);
  	if (code) {
! 	    com_err(whoami, code, "calling KAM_ListEntry");
  	    break;
  	}
  	if (!next_index)
--- 254,260 ----
  	    ubik_Call(KAM_ListEntry, conn, 0, index, &next_index, &count,
  		      &name);
  	if (code) {
! 	    afs_com_err(whoami, code, "calling KAM_ListEntry");
  	    break;
  	}
  	if (!next_index)
***************
*** 300,306 ****
  	}
      }
  
!     printf(" : [%s] %s", error_table_name(code), error_message(code));
      switch (code) {
      case UNOQUORUM:
  	printf(", wait one second\n");
--- 300,306 ----
  	}
      }
  
!     printf(" : [%s] %s", afs_error_table_name(code), afs_error_message(code));
      switch (code) {
      case UNOQUORUM:
  	printf(", wait one second\n");
***************
*** 331,337 ****
  
      code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0);
      if (code) {
! 	com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
--- 331,337 ----
  
      code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0);
      if (code) {
! 	afs_com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
***************
*** 359,365 ****
      OKlist[0].code = 0;
      code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0);
      if (code) {
! 	com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
--- 359,365 ----
      OKlist[0].code = 0;
      code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0);
      if (code) {
! 	afs_com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
***************
*** 431,437 ****
  		ubik_Call(KAM_GetEntry, conn, 0, name, inst, KAMAJORVERSION,
  			  &tentry);
  	    if (code) {
! 		com_err(whoami, code,
  			"could get current flag value for %s.%s", name, inst);
  		return -1;
  	    }
--- 431,437 ----
  		ubik_Call(KAM_GetEntry, conn, 0, name, inst, KAMAJORVERSION,
  			  &tentry);
  	    if (code) {
! 		afs_com_err(whoami, code,
  			"could get current flag value for %s.%s", name, inst);
  		return -1;
  	    }
***************
*** 517,523 ****
  			  0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  	if (code) {
  	    if (seriouserror(code))
! 		com_err(whoami, code, "");
  	} else if (tempwhen) {	/* user is locked */
  	    if (!*when || tempwhen < *when) {
  		*when = tempwhen;
--- 517,523 ----
  			  0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  	if (code) {
  	    if (seriouserror(code))
! 		afs_com_err(whoami, code, "");
  	} else if (tempwhen) {	/* user is locked */
  	    if (!*when || tempwhen < *when) {
  		*when = tempwhen;
***************
*** 542,548 ****
  
      code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0);
      if (code) {
! 	com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
--- 542,548 ----
  
      code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0);
      if (code) {
! 	afs_com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
***************
*** 557,563 ****
  		&& conn->conns[count - 1]->peer) {
  		server = conn->conns[count - 1]->peer->host;
  	    }
! 	    com_err(whoami, code,
  		    "so %s.%s may still be locked (on server %d.%d.%d.%d)",
  		    name, instance, ((server >> 24) & 0xFF),
  		    ((server >> 16) & 0xFF), ((server >> 8) & 0xFF),
--- 557,563 ----
  		&& conn->conns[count - 1]->peer) {
  		server = conn->conns[count - 1]->peer->host;
  	    }
! 	    afs_com_err(whoami, code,
  		    "so %s.%s may still be locked (on server %d.%d.%d.%d)",
  		    name, instance, ((server >> 24) & 0xFF),
  		    ((server >> 16) & 0xFF), ((server >> 8) & 0xFF),
***************
*** 589,595 ****
  
      code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0);
      if (code) {
! 	com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
--- 589,595 ----
  
      code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0);
      if (code) {
! 	afs_com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
***************
*** 729,735 ****
  	return KABADCMD;
      }
      if (code)
! 	com_err(whoami, code, "calling KAM_SetFields for %s.%s", name,
  		instance);
      return code;
  }
--- 729,735 ----
  	return KABADCMD;
      }
      if (code)
! 	afs_com_err(whoami, code, "calling KAM_SetFields for %s.%s", name,
  		instance);
      return code;
  }
***************
*** 744,750 ****
      if (as->parms[1].items) {
  	code = ka_ExpandCell(as->parms[1].items->data, realm, 0 /*local */ );
  	if (code) {
! 	    com_err(whoami, code,
  		    "expanding %s as cell name, attempting to continue",
  		    as->parms[1].items->data);
  	}
--- 744,750 ----
      if (as->parms[1].items) {
  	code = ka_ExpandCell(as->parms[1].items->data, realm, 0 /*local */ );
  	if (code) {
! 	    afs_com_err(whoami, code,
  		    "expanding %s as cell name, attempting to continue",
  		    as->parms[1].items->data);
  	}
***************
*** 783,789 ****
  
      code = ka_ParseLoginName(as->parms[0].items->data, name, instance, realm);
      if (code) {
! 	com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
--- 783,789 ----
  
      code = ka_ParseLoginName(as->parms[0].items->data, name, instance, realm);
      if (code) {
! 	afs_com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
***************
*** 824,830 ****
      code = ubik_Call(KAM_SetPassword, conn, 0, name, instance, kvno, key);
  #endif
      if (code)
! 	com_err(whoami, code, "so can't set password for %s.%s", name,
  		instance);
      return code;
  }
--- 824,830 ----
      code = ubik_Call(KAM_SetPassword, conn, 0, name, instance, kvno, key);
  #endif
      if (code)
! 	afs_com_err(whoami, code, "so can't set password for %s.%s", name,
  		instance);
      return code;
  }
***************
*** 849,855 ****
      if (left) {
        bad_name:
  	code = KABADNAME;
! 	com_err(whoami, code, "PrintName: principal name was '%s'.'%s'@'%s'",
  		name, inst, acell);
  	return code;
      }
--- 849,855 ----
      if (left) {
        bad_name:
  	code = KABADNAME;
! 	afs_com_err(whoami, code, "PrintName: principal name was '%s'.'%s'@'%s'",
  		name, inst, acell);
  	return code;
      }
***************
*** 919,925 ****
      /* get the ticket info itself */
      code = ktc_GetToken(server, &token, sizeof(token), &client);
      if (code) {
! 	com_err(whoami, code, "failed to get token info for server %s",
  		PrintedPrincipal(server));
  	return code;
      }
--- 919,925 ----
      /* get the ticket info itself */
      code = ktc_GetToken(server, &token, sizeof(token), &client);
      if (code) {
! 	afs_com_err(whoami, code, "failed to get token info for server %s",
  		PrintedPrincipal(server));
  	return code;
      }
***************
*** 980,986 ****
  	ka_ParseLoginName(as->parms[0].items->data, server.name,
  			  server.instance, server.cell);
      if (code) {
! 	com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
--- 980,986 ----
  	ka_ParseLoginName(as->parms[0].items->data, server.name,
  			  server.instance, server.cell);
      if (code) {
! 	afs_com_err(whoami, code, "parsing user's name '%s'",
  		as->parms[0].items->data);
  	return KABADCMD;
      }
***************
*** 991,997 ****
      } else {
  	code = ka_ExpandCell(server.cell, server.cell, 0 /*local */ );
  	if (code) {
! 	    com_err(whoami, code, "Can't expand cell name");
  	    return code;
  	}
      }
--- 991,997 ----
      } else {
  	code = ka_ExpandCell(server.cell, server.cell, 0 /*local */ );
  	if (code) {
! 	    afs_com_err(whoami, code, "Can't expand cell name");
  	    return code;
  	}
      }
***************
*** 1001,1007 ****
  	ka_GetServerToken(server.name, server.instance, server.cell, life,
  			  &token, /*new */ 1, /*dosetpag */ 0);
      if (code)
! 	com_err(whoami, code, "getting ticket for %s",
  		PrintedPrincipal(&server));
      else {
  	code = ListTicket(&server, /*verbose */ 1);
--- 1001,1007 ----
  	ka_GetServerToken(server.name, server.instance, server.cell, life,
  			  &token, /*new */ 1, /*dosetpag */ 0);
      if (code)
! 	afs_com_err(whoami, code, "getting ticket for %s",
  		PrintedPrincipal(&server));
      else {
  	code = ListTicket(&server, /*verbose */ 1);
***************
*** 1021,1027 ****
      code = ka_ParseLoginName(as->parms[0].items->data, name, 0, 0);
      if (code) {
        abort:
! 	com_err(whoami, code,
  		"getting %s's password via loopback connection to GetPassword",
  		name);
  	/* if we got a timeout, print a clarification, too */
--- 1021,1027 ----
      code = ka_ParseLoginName(as->parms[0].items->data, name, 0, 0);
      if (code) {
        abort:
! 	afs_com_err(whoami, code,
  		"getting %s's password via loopback connection to GetPassword",
  		name);
  	/* if we got a timeout, print a clarification, too */
***************
*** 1069,1075 ****
  
      code = ubik_Call(KAM_GetRandomKey, conn, 0, &key);
      if (code)
! 	com_err(whoami, code, "so can't get random key");
      else {
  	int i;
  	printf("Key: ");
--- 1069,1075 ----
  
      code = ubik_Call(KAM_GetRandomKey, conn, 0, &key);
      if (code)
! 	afs_com_err(whoami, code, "so can't get random key");
      else {
  	int i;
  	printf("Key: ");
***************
*** 1159,1169 ****
  	if (code) {
  	    struct afsconf_cell cellinfo;
  
! 	    com_err(whoami, code, "couldn't find host %s in cell %s",
  		    as->parms[0].items->data, cell);
  	    code = ka_GetServers(cell, &cellinfo);
  	    if (code)
! 		com_err(whoami, code, "getting servers in cell %s", cell);
  	    else {
  		printf("Servers in cell %s, are:\n", cell);
  		for (i = 0; i < cellinfo.numServers; i++)
--- 1159,1169 ----
  	if (code) {
  	    struct afsconf_cell cellinfo;
  
! 	    afs_com_err(whoami, code, "couldn't find host %s in cell %s",
  		    as->parms[0].items->data, cell);
  	    code = ka_GetServers(cell, &cellinfo);
  	    if (code)
! 		afs_com_err(whoami, code, "getting servers in cell %s", cell);
  	    else {
  		printf("Servers in cell %s, are:\n", cell);
  		for (i = 0; i < cellinfo.numServers; i++)
***************
*** 1177,1183 ****
  	code = ubik_Call(KAM_Debug, conn, 0, KAMAJORVERSION, 0, &info);
  
      if (code) {
! 	com_err(whoami, code, "call to Debug failed");
  	return code;
      }
      now = time(0);
--- 1177,1183 ----
  	code = ubik_Call(KAM_Debug, conn, 0, KAMAJORVERSION, 0, &info);
  
      if (code) {
! 	afs_com_err(whoami, code, "call to Debug failed");
  	return code;
      }
      now = time(0);
***************
*** 1332,1338 ****
  		ka_ParseLoginName(as->parms[12].items->data, name, instance,
  				  newCell);
  	    if (code) {
! 		com_err(whoami, code, "parsing user's name '%s'",
  			as->parms[12].items->data);
  		return code;
  	    }
--- 1332,1338 ----
  		ka_ParseLoginName(as->parms[12].items->data, name, instance,
  				  newCell);
  	    if (code) {
! 		afs_com_err(whoami, code, "parsing user's name '%s'",
  			as->parms[12].items->data);
  		return code;
  	    }
***************
*** 1363,1369 ****
  	}
  	code = ka_ExpandCell(newCell, newCell, 0 /*local */ );
  	if (code) {
! 	    com_err(whoami, code, "Can't expand cell name");
  	    return code;
  	}
  	strcpy(cell, newCell);
--- 1363,1369 ----
  	}
  	code = ka_ExpandCell(newCell, newCell, 0 /*local */ );
  	if (code) {
! 	    afs_com_err(whoami, code, "Can't expand cell name");
  	    return code;
  	}
  	strcpy(cell, newCell);
***************
*** 1378,1384 ****
  		ap[i] = ip->data;
  	    code = ubik_ParseClientList(i, ap, serverList);
  	    if (code) {
! 		com_err(whoami, code, "could not parse server list");
  		return code;
  	    }
  	    ka_ExplicitCell(cell, serverList);
--- 1378,1384 ----
  		ap[i] = ip->data;
  	    code = ubik_ParseClientList(i, ap, serverList);
  	    if (code) {
! 		afs_com_err(whoami, code, "could not parse server list");
  		return code;
  	    }
  	    ka_ExplicitCell(cell, serverList);
***************
*** 1412,1418 ****
  		else if (strlen(passwd) == 0)
  		    code = KANULLPASSWORD;
  		if (code) {
! 		    com_err(whoami, code, "reading password");
  		    return code;
  		}
  	    }
--- 1412,1418 ----
  		else if (strlen(passwd) == 0)
  		    code = KANULLPASSWORD;
  		if (code) {
! 		    afs_com_err(whoami, code, "reading password");
  		    return code;
  		}
  	    }
***************
*** 1453,1459 ****
  		    reason = "Authentication Server was unavailable";
  		    break;
  		default:
! 		    reason = (char *)error_message(code);
  		}
  		fprintf(stderr,
  			"%s: Auth. as %s to AuthServer failed: %s\nProceeding w/o authentication\n",
--- 1453,1459 ----
  		    reason = "Authentication Server was unavailable";
  		    break;
  		default:
! 		    reason = (char *)afs_error_message(code);
  		}
  		fprintf(stderr,
  			"%s: Auth. as %s to AuthServer failed: %s\nProceeding w/o authentication\n",
***************
*** 1474,1480 ****
  				    /*Don't need pwd expiration info here */
  		    );
  		if (acode && (acode != code))	/* codes are usually the same */
! 		    com_err(whoami, code,
  			    "getting Authentication token for %s",
  			    PrintedName(name, instance, cell));
  	    }
--- 1474,1480 ----
  				    /*Don't need pwd expiration info here */
  		    );
  		if (acode && (acode != code))	/* codes are usually the same */
! 		    afs_com_err(whoami, code,
  			    "getting Authentication token for %s",
  			    PrintedName(name, instance, cell));
  	    }
***************
*** 1485,1499 ****
      pToken = ((token.ticketLen == 0) ? 0 : &token);
      code = ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, pToken, &conn);
      if (code && pToken) {
! 	com_err(whoami, code,
  		"connecting to AuthServer: now trying w/o authentication");
  	code = ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, 0, &conn);
  	if (code)
! 	    com_err(whoami, code,
  		    "making unauthenticated connection to AuthServer");
      }
      if (code) {
! 	com_err(whoami, code,
  		"Couldn't establish connection to Authentication Server");
  	return code;
      }
--- 1485,1499 ----
      pToken = ((token.ticketLen == 0) ? 0 : &token);
      code = ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, pToken, &conn);
      if (code && pToken) {
! 	afs_com_err(whoami, code,
  		"connecting to AuthServer: now trying w/o authentication");
  	code = ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, 0, &conn);
  	if (code)
! 	    afs_com_err(whoami, code,
  		    "making unauthenticated connection to AuthServer");
      }
      if (code) {
! 	afs_com_err(whoami, code,
  		"Couldn't establish connection to Authentication Server");
  	return code;
      }
***************
*** 1518,1524 ****
  		    else if (strlen(password) == 0)
  			code = KANULLPASSWORD;
  		    if (code) {
! 			com_err(whoami, code, "prompting for %s", p + 1);
  			return code;
  		    }
  		    ip = (struct cmd_item *)malloc(sizeof(struct cmd_item));
--- 1518,1524 ----
  		    else if (strlen(password) == 0)
  			code = KANULLPASSWORD;
  		    if (code) {
! 			afs_com_err(whoami, code, "prompting for %s", p + 1);
  			return code;
  		    }
  		    ip = (struct cmd_item *)malloc(sizeof(struct cmd_item));
***************
*** 1552,1558 ****
  	    ka_ParseLoginName(name, server.name, server.instance,
  			      server.cell);
  	if (code) {
! 	    com_err(whoami, code, "couldn't interpret name '%s'", name);
  	    return code;
  	}
  	if (server.cell[0] == 0) {
--- 1552,1558 ----
  	    ka_ParseLoginName(name, server.name, server.instance,
  			      server.cell);
  	if (code) {
! 	    afs_com_err(whoami, code, "couldn't interpret name '%s'", name);
  	    return code;
  	}
  	if (server.cell[0] == 0) {
***************
*** 1562,1574 ****
  	} else {
  	    code = ka_ExpandCell(server.cell, server.cell, 0 /*local */ );
  	    if (code) {
! 		com_err(whoami, code, "Can't expand cell name");
  		return code;
  	    }
  	}
  	code = ktc_ForgetToken(&server);
  	if (code) {
! 	    com_err(whoami, code, "couldn't remove tokens for %s",
  		    PrintedPrincipal(&server));
  	    return code;
  	}
--- 1562,1574 ----
  	} else {
  	    code = ka_ExpandCell(server.cell, server.cell, 0 /*local */ );
  	    if (code) {
! 		afs_com_err(whoami, code, "Can't expand cell name");
  		return code;
  	    }
  	}
  	code = ktc_ForgetToken(&server);
  	if (code) {
! 	    afs_com_err(whoami, code, "couldn't remove tokens for %s",
  		    PrintedPrincipal(&server));
  	    return code;
  	}
***************
*** 1579,1592 ****
  	}
  	code = ktc_ForgetAllTokens();
  	if (code) {
! 	    com_err(whoami, code, "couldn't delete all tokens");
  	    return code;
  	}
      }
  #endif
      code = ktc_ForgetAllTokens();
      if (code) {
! 	com_err(whoami, code, "couldn't delete all tokens");
  	return code;
      }
      return 0;
--- 1579,1592 ----
  	}
  	code = ktc_ForgetAllTokens();
  	if (code) {
! 	    afs_com_err(whoami, code, "couldn't delete all tokens");
  	    return code;
  	}
      }
  #endif
      code = ktc_ForgetAllTokens();
      if (code) {
! 	afs_com_err(whoami, code, "couldn't delete all tokens");
  	return code;
      }
      return 0;
***************
*** 1608,1614 ****
  	    ka_ParseLoginName(name, server.name, server.instance,
  			      server.cell);
  	if (code) {
! 	    com_err(whoami, code, "couldn't interpret name '%s'", name);
  	    return code;
  	}
  	if (server.cell[0] == 0) {
--- 1608,1614 ----
  	    ka_ParseLoginName(name, server.name, server.instance,
  			      server.cell);
  	if (code) {
! 	    afs_com_err(whoami, code, "couldn't interpret name '%s'", name);
  	    return code;
  	}
  	if (server.cell[0] == 0) {
***************
*** 1618,1624 ****
  	} else {
  	    code = ka_ExpandCell(server.cell, server.cell, 0 /*local */ );
  	    if (code) {
! 		com_err(whoami, code, "Can't expand cell name");
  		return code;
  	    }
  	}
--- 1618,1624 ----
  	} else {
  	    code = ka_ExpandCell(server.cell, server.cell, 0 /*local */ );
  	    if (code) {
! 		afs_com_err(whoami, code, "Can't expand cell name");
  		return code;
  	    }
  	}
***************
*** 1833,1839 ****
  	code =
  	    cmd_ParseLine(line, argv, &argc, sizeof(argv) / sizeof(argv[0]));
  	if (code) {
! 	    com_err(whoami, code, "parsing line: '%s'", line);
  	    return code;
  	}
  	code = cmd_Dispatch(argc, argv);
--- 1833,1839 ----
  	code =
  	    cmd_ParseLine(line, argv, &argc, sizeof(argv) / sizeof(argv[0]));
  	if (code) {
! 	    afs_com_err(whoami, code, "parsing line: '%s'", line);
  	    return code;
  	}
  	code = cmd_Dispatch(argc, argv);
Index: openafs/src/kauth/decode_ticket.c
diff -c openafs/src/kauth/decode_ticket.c:1.6 openafs/src/kauth/decode_ticket.c:1.6.14.1
*** openafs/src/kauth/decode_ticket.c:1.6	Tue Jul 15 19:15:16 2003
--- openafs/src/kauth/decode_ticket.c	Tue Apr 10 14:39:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/decode_ticket.c,v 1.6 2003/07/15 23:15:16 shadow Exp $");
  
  #include <des.h>
  #include <afs/com_err.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/decode_ticket.c,v 1.6.14.1 2007/04/10 18:39:52 shadow Exp $");
  
  #include <des.h>
  #include <afs/com_err.h>
***************
*** 45,51 ****
      if (ka_ReadBytes(argv[1], key, sizeof(key)) != 8)
  	printf("Key must be 8 bytes long\n");
      if (!des_check_key_parity(key) || des_is_weak_key(key)) {
! 	com_err(whoami, KABADKEY, "server's key for decoding ticket is bad");
  	exit(1);
      }
      ticketLen = ka_ReadBytes(argv[2], ticket, sizeof(ticket));
--- 45,51 ----
      if (ka_ReadBytes(argv[1], key, sizeof(key)) != 8)
  	printf("Key must be 8 bytes long\n");
      if (!des_check_key_parity(key) || des_is_weak_key(key)) {
! 	afs_com_err(whoami, KABADKEY, "server's key for decoding ticket is bad");
  	exit(1);
      }
      ticketLen = ka_ReadBytes(argv[2], ticket, sizeof(ticket));
***************
*** 55,68 ****
  	tkt_DecodeTicket(ticket, ticketLen, key, client.name, client.instance,
  			 client.cell, &sessionkey, &host, &start, &end);
      if (code) {
! 	com_err(whoami, code, "decoding ticket");
  	if (code = tkt_CheckTimes(start, end, time(0)) <= 0)
! 	    com_err(whoami, 0, "because of start or end times");
  	exit(1);
      }
  
      if (!des_check_key_parity(&sessionkey) || des_is_weak_key(&sessionkey)) {
! 	com_err(whoami, KABADKEY, "checking ticket's session key");
  	exit(1);
      }
  
--- 55,68 ----
  	tkt_DecodeTicket(ticket, ticketLen, key, client.name, client.instance,
  			 client.cell, &sessionkey, &host, &start, &end);
      if (code) {
! 	afs_com_err(whoami, code, "decoding ticket");
  	if (code = tkt_CheckTimes(start, end, time(0)) <= 0)
! 	    afs_com_err(whoami, 0, "because of start or end times");
  	exit(1);
      }
  
      if (!des_check_key_parity(&sessionkey) || des_is_weak_key(&sessionkey)) {
! 	afs_com_err(whoami, KABADKEY, "checking ticket's session key");
  	exit(1);
      }
  
Index: openafs/src/kauth/kaprocs.c
diff -c openafs/src/kauth/kaprocs.c:1.17 openafs/src/kauth/kaprocs.c:1.17.8.1
*** openafs/src/kauth/kaprocs.c:1.17	Wed Aug 18 21:07:47 2004
--- openafs/src/kauth/kaprocs.c	Tue Apr 10 14:39:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaprocs.c,v 1.17 2004/08/19 01:07:47 kolya Exp $");
  
  #include <afs/stds.h>
  #include <errno.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaprocs.c,v 1.17.8.1 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <errno.h>
***************
*** 40,45 ****
--- 40,46 ----
  #include <des.h>
  #include <afs/cellconfig.h>
  #include <afs/auth.h>
+ #include <afs/com_err.h>
  #include "kautils.h"
  #include "kaserver.h"
  #include "kalog.h"
***************
*** 176,182 ****
  		} else {
  		    es_Report
  			("in get_time: set_password failed because: %s\n",
! 			 error_message(code));
  		    return code;
  		}
  	    }
--- 177,183 ----
  		} else {
  		    es_Report
  			("in get_time: set_password failed because: %s\n",
! 			 afs_error_message(code));
  		    return code;
  		}
  	    }
Index: openafs/src/kauth/kas.c
diff -c openafs/src/kauth/kas.c:1.7 openafs/src/kauth/kas.c:1.7.14.1
*** openafs/src/kauth/kas.c:1.7	Tue Jul 15 19:15:16 2003
--- openafs/src/kauth/kas.c	Tue Apr 10 14:39:52 2007
***************
*** 12,18 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kas.c,v 1.7 2003/07/15 23:15:16 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
--- 12,18 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kas.c,v 1.7.14.1 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 82,88 ****
  
      code = ka_Init(0);
      if (code) {
! 	com_err(whoami, code, "Can't get cell info");
  	exit(1);
      }
  
--- 82,88 ----
  
      code = ka_Init(0);
      if (code) {
! 	afs_com_err(whoami, code, "Can't get cell info");
  	exit(1);
      }
  
Index: openafs/src/kauth/kaserver.c
diff -c openafs/src/kauth/kaserver.c:1.19.2.3 openafs/src/kauth/kaserver.c:1.19.2.4
*** openafs/src/kauth/kaserver.c:1.19.2.3	Sat Dec 30 12:04:11 2006
--- openafs/src/kauth/kaserver.c	Tue Apr 10 14:39:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaserver.c,v 1.19.2.3 2006/12/30 17:04:11 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaserver.c,v 1.19.2.4 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 47,52 ****
--- 47,53 ----
  #include <afs/cellconfig.h>
  #include <lock.h>
  #include <afs/afsutil.h>
+ #include <afs/com_err.h>
  #include <ubik.h>
  #include <sys/stat.h>
  #include "kauth.h"
***************
*** 330,336 ****
      if (!KA_conf) {
  	code = KANOCELLS;
        abort:
! 	com_err(whoami, code, "Failed getting cell info");
  	exit(1);
      }
  #ifdef        AUTH_DBM_LOG
--- 331,337 ----
      if (!KA_conf) {
  	code = KANOCELLS;
        abort:
! 	afs_com_err(whoami, code, "Failed getting cell info");
  	exit(1);
      }
  #ifdef        AUTH_DBM_LOG
***************
*** 356,362 ****
  				    &cellinfo, &clones);
      if (servers) {
  	if (code = ubik_ParseServerList(argc, argv, &myHost, serverList)) {
! 	    com_err(whoami, code, "Couldn't parse server list");
  	    exit(1);
  	}
  	cellinfo.hostAddr[0].sin_addr.s_addr = myHost;
--- 357,363 ----
  				    &cellinfo, &clones);
      if (servers) {
  	if (code = ubik_ParseServerList(argc, argv, &myHost, serverList)) {
! 	    afs_com_err(whoami, code, "Couldn't parse server list");
  	    exit(1);
  	}
  	cellinfo.hostAddr[0].sin_addr.s_addr = myHost;
***************
*** 424,430 ****
  				  &clones, dbpath, &KA_dbase);
  
      if (code) {
! 	com_err(whoami, code, "Ubik init failed");
  	exit(2);
      }
  
--- 425,431 ----
  				  &clones, dbpath, &KA_dbase);
  
      if (code) {
! 	afs_com_err(whoami, code, "Ubik init failed");
  	exit(2);
      }
  
Index: openafs/src/kauth/kautils.p.h
diff -c openafs/src/kauth/kautils.p.h:1.10 openafs/src/kauth/kautils.p.h:1.10.14.1
*** openafs/src/kauth/kautils.p.h:1.10	Sun Dec  7 17:49:26 2003
--- openafs/src/kauth/kautils.p.h	Tue Apr 10 14:39:52 2007
***************
*** 291,297 ****
  };
  
  #ifndef ERROR_TABLE_BASE_KA
! #define ka_ErrorString error_message
  #undef  KAMINERROR
  #define KAMINERROR ERROR_TABLE_BASE_KA
  #define KAMAXERROR (KAMINERROR+255)
--- 291,297 ----
  };
  
  #ifndef ERROR_TABLE_BASE_KA
! #define ka_ErrorString afs_error_message
  #undef  KAMINERROR
  #define KAMINERROR ERROR_TABLE_BASE_KA
  #define KAMAXERROR (KAMINERROR+255)
Index: openafs/src/kauth/klog.c
diff -c openafs/src/kauth/klog.c:1.8.14.1 openafs/src/kauth/klog.c:1.8.14.2
*** openafs/src/kauth/klog.c:1.8.14.1	Thu Feb  8 20:00:20 2007
--- openafs/src/kauth/klog.c	Tue Apr 10 14:39:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/klog.c,v 1.8.14.1 2007/02/09 01:00:20 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/klog.c,v 1.8.14.2 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 221,227 ****
      if (code || !(lcell = ka_LocalCell())) {
        nocell:
  	if (!Silent)
! 	    com_err(rn, code, "Can't get local cell name!");
  	KLOGEXIT(code);
      }
      if (code = ka_CellToRealm(lcell, lrealm, 0))
--- 221,227 ----
      if (code || !(lcell = ka_LocalCell())) {
        nocell:
  	if (!Silent)
! 	    afs_com_err(rn, code, "Can't get local cell name!");
  	KLOGEXIT(code);
      }
      if (code = ka_CellToRealm(lcell, lrealm, 0))
***************
*** 254,260 ****
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
  	    if (!Silent) {
! 		com_err(rn, code, "could not parse server list");
  	    }
  	    return code;
  	}
--- 254,260 ----
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
  	    if (!Silent) {
! 		afs_com_err(rn, code, "could not parse server list");
  	    }
  	    return code;
  	}
***************
*** 353,359 ****
  	strcpy(realm, lcell);
      if (code = ka_CellToRealm(realm, realm, &local)) {
  	if (!Silent)
! 	    com_err(rn, code, "Can't convert cell to realm");
  	KLOGEXIT(code);
      }
  
--- 353,359 ----
  	strcpy(realm, lcell);
      if (code = ka_CellToRealm(realm, realm, &local)) {
  	if (!Silent)
! 	    afs_com_err(rn, code, "Can't convert cell to realm");
  	KLOGEXIT(code);
      }
  
***************
*** 391,397 ****
  	code = krb_write_ticket_file(realm);
  	if (!Silent) {
  	    if (code)
! 		com_err(rn, code, "writing Kerberos ticket file");
  	    else
  		fprintf(stderr, "Wrote ticket file to /tmp\n");
  	}
--- 391,397 ----
  	code = krb_write_ticket_file(realm);
  	if (!Silent) {
  	    if (code)
! 		afs_com_err(rn, code, "writing Kerberos ticket file");
  	    else
  		fprintf(stderr, "Wrote ticket file to /tmp\n");
  	}
Index: openafs/src/kauth/kpasswd.c
diff -c openafs/src/kauth/kpasswd.c:1.15 openafs/src/kauth/kpasswd.c:1.15.8.1
*** openafs/src/kauth/kpasswd.c:1.15	Wed Aug 18 21:07:47 2004
--- openafs/src/kauth/kpasswd.c	Tue Apr 10 14:39:52 2007
***************
*** 12,18 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kpasswd.c,v 1.15 2004/08/19 01:07:47 kolya Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 12,18 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kpasswd.c,v 1.15.8.1 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 262,268 ****
      if (code || !(lcell = ka_LocalCell())) {
  #ifndef AFS_FREELANCE_CLIENT
  	if (!Pipe)
! 	    com_err(rn, code, "Can't get local cell name!");
  	exit(1);
  #endif
      }
--- 262,268 ----
      if (code || !(lcell = ka_LocalCell())) {
  #ifndef AFS_FREELANCE_CLIENT
  	if (!Pipe)
! 	    afs_com_err(rn, code, "Can't get local cell name!");
  	exit(1);
  #endif
      }
***************
*** 270,276 ****
      code = rx_Init(0);
      if (code) {
  	if (!Pipe)
! 	    com_err(rn, code, "Failed to initialize Rx");
  	exit(1);
      }
  
--- 270,276 ----
      code = rx_Init(0);
      if (code) {
  	if (!Pipe)
! 	    afs_com_err(rn, code, "Failed to initialize Rx");
  	exit(1);
      }
  
***************
*** 301,307 ****
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
  	    if (!Pipe)
! 		com_err(rn, code, "could not parse server list");
  	    return code;
  	}
  	lexplicit = 1;
--- 301,307 ----
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
  	    if (!Pipe)
! 		afs_com_err(rn, code, "could not parse server list");
  	    return code;
  	}
  	lexplicit = 1;
***************
*** 382,388 ****
  #ifdef AFS_FREELANCE_CLIENT
      if (!foundExplicitCell && !lcell) {
  	if (!Pipe)
! 	    com_err(rn, code, "no cell name provided");
  	exit(1);
      }
  #else
--- 382,388 ----
  #ifdef AFS_FREELANCE_CLIENT
      if (!foundExplicitCell && !lcell) {
  	if (!Pipe)
! 	    afs_com_err(rn, code, "no cell name provided");
  	exit(1);
      }
  #else
***************
*** 392,398 ****
  
      if (code = ka_CellToRealm(realm, realm, &local)) {
  	if (!Pipe)
! 	    com_err(rn, code, "Can't convert cell to realm");
  	exit(1);
      }
      lcstring(cell, realm, sizeof(cell));
--- 392,398 ----
  
      if (code = ka_CellToRealm(realm, realm, &local)) {
  	if (!Pipe)
! 	    afs_com_err(rn, code, "Can't convert cell to realm");
  	exit(1);
      }
      lcstring(cell, realm, sizeof(cell));
***************
*** 413,419 ****
  		memset(&key, 0, sizeof(key));
  		memset(passwd, 0, sizeof(passwd));
  		if (code)
! 		    com_err(rn, code, "reading password");
  		exit(1);
  	    }
  	}
--- 413,419 ----
  		memset(&key, 0, sizeof(key));
  		memset(passwd, 0, sizeof(passwd));
  		if (code)
! 		    afs_com_err(rn, code, "reading password");
  		exit(1);
  	    }
  	}
***************
*** 522,538 ****
      memset(&mitkey, 0, sizeof(mitkey));
      memset(&key, 0, sizeof(key));
      if (code == KAUBIKCALL)
! 	com_err(rn, code, "(Authentication Server unavailable, try later)");
      else if (code) {
  	if (code == KABADREQUEST)
  	    fprintf(stderr, "%s: Incorrect old password.\n", rn);
  	else
! 	    com_err(rn, code, "so couldn't change password");
      } else {
  	code =
  	    ka_AuthServerConn(realm, KA_MAINTENANCE_SERVICE, &token, &conn);
  	if (code)
! 	    com_err(rn, code, "contacting Admin Server");
  	else {
  	    if (dess2k == 1)
  		code =
--- 522,538 ----
      memset(&mitkey, 0, sizeof(mitkey));
      memset(&key, 0, sizeof(key));
      if (code == KAUBIKCALL)
! 	afs_com_err(rn, code, "(Authentication Server unavailable, try later)");
      else if (code) {
  	if (code == KABADREQUEST)
  	    fprintf(stderr, "%s: Incorrect old password.\n", rn);
  	else
! 	    afs_com_err(rn, code, "so couldn't change password");
      } else {
  	code =
  	    ka_AuthServerConn(realm, KA_MAINTENANCE_SERVICE, &token, &conn);
  	if (code)
! 	    afs_com_err(rn, code, "contacting Admin Server");
  	else {
  	    if (dess2k == 1)
  		code =
***************
*** 546,552 ****
  	    memset(&newmitkey, 0, sizeof(newmitkey));
  	    if (code) {
  		char *reason;
! 		reason = (char *)error_message(code);
  		fprintf(stderr, "%s: Password was not changed because %s\n",
  			rn, reason);
  	    } else
--- 546,552 ----
  	    memset(&newmitkey, 0, sizeof(newmitkey));
  	    if (code) {
  		char *reason;
! 		reason = (char *)afs_error_message(code);
  		fprintf(stderr, "%s: Password was not changed because %s\n",
  			rn, reason);
  	    } else
***************
*** 567,573 ****
  
    no_change:			/* yuck, yuck, yuck */
      if (code)
! 	com_err(rn, code, "getting new password");
    no_change_no_msg:
      memset(&key, 0, sizeof(key));
      memset(npasswd, 0, sizeof(npasswd));
--- 567,573 ----
  
    no_change:			/* yuck, yuck, yuck */
      if (code)
! 	afs_com_err(rn, code, "getting new password");
    no_change_no_msg:
      memset(&key, 0, sizeof(key));
      memset(npasswd, 0, sizeof(npasswd));
Index: openafs/src/kauth/krb_udp.c
diff -c openafs/src/kauth/krb_udp.c:1.23 openafs/src/kauth/krb_udp.c:1.23.14.1
*** openafs/src/kauth/krb_udp.c:1.23	Sun Dec  7 17:49:27 2003
--- openafs/src/kauth/krb_udp.c	Tue Apr 10 14:39:52 2007
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/krb_udp.c,v 1.23 2003/12/07 22:49:27 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/krb_udp.c,v 1.23.14.1 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 735,746 ****
      if (code) {
  	if (code == KANOENT) {
  	    code = KERB_ERR_PRINCIPAL_UNKNOWN;
! 	    err_packet(ksoc, pkt, code, (char *)error_message(code));
  	} else if (code == KAPWEXPIRED) {
  	    code = KERB_ERR_NAME_EXP;
  	    err_packet(ksoc, pkt, code, "password has expired");
  	} else
! 	    err_packet(ksoc, pkt, code, (char *)error_message(code));
      }
      return 0;
  }
--- 735,746 ----
      if (code) {
  	if (code == KANOENT) {
  	    code = KERB_ERR_PRINCIPAL_UNKNOWN;
! 	    err_packet(ksoc, pkt, code, (char *)afs_error_message(code));
  	} else if (code == KAPWEXPIRED) {
  	    code = KERB_ERR_NAME_EXP;
  	    err_packet(ksoc, pkt, code, "password has expired");
  	} else
! 	    err_packet(ksoc, pkt, code, (char *)afs_error_message(code));
      }
      return 0;
  }
***************
*** 784,790 ****
      if (code) {
  	if (code == KANOENT)
  	    code = KERB_ERR_PRINCIPAL_UNKNOWN;
! 	err_packet(ksoc, pkt, code, (char *)error_message(code));
  	return -1;
      }
      return 0;
--- 784,790 ----
      if (code) {
  	if (code == KANOENT)
  	    code = KERB_ERR_PRINCIPAL_UNKNOWN;
! 	err_packet(ksoc, pkt, code, (char *)afs_error_message(code));
  	return -1;
      }
      return 0;
Index: openafs/src/kauth/manyklog.c
diff -c openafs/src/kauth/manyklog.c:1.7.14.1 openafs/src/kauth/manyklog.c:1.7.14.2
*** openafs/src/kauth/manyklog.c:1.7.14.1	Thu Feb  8 20:00:20 2007
--- openafs/src/kauth/manyklog.c	Tue Apr 10 14:39:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/manyklog.c,v 1.7.14.1 2007/02/09 01:00:20 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/manyklog.c,v 1.7.14.2 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 213,219 ****
      p if (code || !(lcell = ka_LocalCell())) {
        nocell:
  	if (!Silent)
! 	    com_err(rn, code, "Can't get local cell name!");
  	KLOGEXIT(code);
      }
      if (code = ka_CellToRealm(lcell, lrealm, 0))
--- 213,219 ----
      p if (code || !(lcell = ka_LocalCell())) {
        nocell:
  	if (!Silent)
! 	    afs_com_err(rn, code, "Can't get local cell name!");
  	KLOGEXIT(code);
      }
      if (code = ka_CellToRealm(lcell, lrealm, 0))
***************
*** 250,256 ****
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
  	    if (!Silent) {
! 		com_err(rn, code, "could not parse server list");
  	    }
  	    return code;
  	}
--- 250,256 ----
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
  	    if (!Silent) {
! 		afs_com_err(rn, code, "could not parse server list");
  	    }
  	    return code;
  	}
***************
*** 349,355 ****
  	strcpy(realm, lcell);
      if (code = ka_CellToRealm(realm, realm, &local)) {
  	if (!Silent)
! 	    com_err(rn, code, "Can't convert cell to realm");
  	KLOGEXIT(code);
      }
  
--- 349,355 ----
  	strcpy(realm, lcell);
      if (code = ka_CellToRealm(realm, realm, &local)) {
  	if (!Silent)
! 	    afs_com_err(rn, code, "Can't convert cell to realm");
  	KLOGEXIT(code);
      }
  
Index: openafs/src/kauth/rebuild.c
diff -c openafs/src/kauth/rebuild.c:1.13 openafs/src/kauth/rebuild.c:1.13.2.1
*** openafs/src/kauth/rebuild.c:1.13	Tue Apr  4 16:51:16 2006
--- openafs/src/kauth/rebuild.c	Tue Apr 10 14:39:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/rebuild.c,v 1.13 2006/04/04 20:51:16 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/rebuild.c,v 1.13.2.1 2007/04/10 18:39:52 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
***************
*** 394,405 ****
      offset += UBIK_HEADERSIZE;
      code = lseek(fd, offset, SEEK_SET);
      if (code != offset) {
! 	com_err(whoami, errno, "skipping Ubik header");
  	exit(2);
      }
      code = read(fd, buffer, size);
      if (code != size) {
! 	com_err(whoami, errno, "reading db got %d bytes", code);
  	exit(3);
      }
  }
--- 394,405 ----
      offset += UBIK_HEADERSIZE;
      code = lseek(fd, offset, SEEK_SET);
      if (code != offset) {
! 	afs_com_err(whoami, errno, "skipping Ubik header");
  	exit(2);
      }
      code = read(fd, buffer, size);
      if (code != size) {
! 	afs_com_err(whoami, errno, "reading db got %d bytes", code);
  	exit(3);
      }
  }
***************
*** 430,436 ****
      if (outFile) {
  	out = fopen(outFile, "w");
  	if (!out) {
! 	    com_err(whoami, errno, "opening output file %s", outFile);
  	    exit(7);
  	}
      } else
--- 430,436 ----
      if (outFile) {
  	out = fopen(outFile, "w");
  	if (!out) {
! 	    afs_com_err(whoami, errno, "opening output file %s", outFile);
  	    exit(7);
  	}
      } else
***************
*** 438,449 ****
  
      fd = open(dbFile, O_RDONLY, 0);
      if (fd < 0) {
! 	com_err(whoami, errno, "opening database file %s", dbFile);
  	exit(6);
      }
      code = fstat(fd, &info);
      if (code) {
! 	com_err(whoami, errno, "stat'ing file %s", dbFile);
  	exit(6);
      }
      if ((info.st_size - UBIK_HEADERSIZE) % UBIK_BUFFERSIZE)
--- 438,449 ----
  
      fd = open(dbFile, O_RDONLY, 0);
      if (fd < 0) {
! 	afs_com_err(whoami, errno, "opening database file %s", dbFile);
  	exit(6);
      }
      code = fstat(fd, &info);
      if (code) {
! 	afs_com_err(whoami, errno, "stat'ing file %s", dbFile);
  	exit(6);
      }
      if ((info.st_size - UBIK_HEADERSIZE) % UBIK_BUFFERSIZE)
Index: openafs/src/kauth/user.c
diff -c openafs/src/kauth/user.c:1.12 openafs/src/kauth/user.c:1.12.8.1
*** openafs/src/kauth/user.c:1.12	Wed Aug 18 21:07:47 2004
--- openafs/src/kauth/user.c	Tue Apr 10 14:39:52 2007
***************
*** 18,24 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/user.c,v 1.12 2004/08/19 01:07:47 kolya Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 18,24 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/user.c,v 1.12.8.1 2007/04/10 18:39:52 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 111,117 ****
  	    return code;
  	code = pr_Initialize(0, AFSDIR_CLIENT_ETC_DIRPATH, server.cell);
  	if (code) {
! 	    com_err(whoami, code, "initializing ptserver in cell '%s'",
  		    server.cell);
  	    return 0;
  	}
--- 111,117 ----
  	    return code;
  	code = pr_Initialize(0, AFSDIR_CLIENT_ETC_DIRPATH, server.cell);
  	if (code) {
! 	    afs_com_err(whoami, code, "initializing ptserver in cell '%s'",
  		    server.cell);
  	    return 0;
  	}
***************
*** 134,140 ****
  	if ((code == 0) && (viceId == ANONYMOUSID))
  	    code = PRNOENT;
  	if (code) {
! 	    com_err(whoami, code, "translating %s to id", username);
  	    return 0;
  	}
  
--- 134,140 ----
  	if ((code == 0) && (viceId == ANONYMOUSID))
  	    code = PRNOENT;
  	if (code) {
! 	    afs_com_err(whoami, code, "translating %s to id", username);
  	    return 0;
  	}
  
***************
*** 285,291 ****
  	    *reasonP = "Authentication Server was unavailable";
  	    break;
  	default:
! 	    *reasonP = (char *)error_message(code);
  	}
      return code;
  }
--- 285,291 ----
  	    *reasonP = "Authentication Server was unavailable";
  	    break;
  	default:
! 	    *reasonP = (char *)afs_error_message(code);
  	}
      return code;
  }
***************
*** 322,328 ****
  	return 0;
  
      if (reasonP) {
! 	*reasonP = (char *)error_message(code);
      }
      return code;
  }
--- 322,328 ----
  	return 0;
  
      if (reasonP) {
! 	*reasonP = (char *)afs_error_message(code);
      }
      return code;
  }
Index: openafs/src/kauth/test/multiklog.c
diff -c openafs/src/kauth/test/multiklog.c:1.7.14.1 openafs/src/kauth/test/multiklog.c:1.7.14.2
*** openafs/src/kauth/test/multiklog.c:1.7.14.1	Thu Feb  8 20:00:20 2007
--- openafs/src/kauth/test/multiklog.c	Tue Apr 10 14:39:52 2007
***************
*** 18,24 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/multiklog.c,v 1.7.14.1 2007/02/09 01:00:20 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 18,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/multiklog.c,v 1.7.14.2 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 176,182 ****
      if (code || !(lcell = ka_LocalCell())) {
        nocell:
  	if (!Silent)
! 	    com_err(rn, code, "Can't get local cell name!");
  	exit(code);
      }
      if (code = ka_CellToRealm(lcell, lrealm, 0))
--- 176,182 ----
      if (code || !(lcell = ka_LocalCell())) {
        nocell:
  	if (!Silent)
! 	    afs_com_err(rn, code, "Can't get local cell name!");
  	exit(code);
      }
      if (code = ka_CellToRealm(lcell, lrealm, 0))
***************
*** 213,219 ****
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
  	    if (!Silent) {
! 		com_err(rn, code, "could not parse server list");
  	    }
  	    return code;
  	}
--- 213,219 ----
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
  	    if (!Silent) {
! 		afs_com_err(rn, code, "could not parse server list");
  	    }
  	    return code;
  	}
***************
*** 316,322 ****
  	strcpy(realm, lcell);
      if (code = ka_CellToRealm(realm, realm, &local)) {
  	if (!Silent)
! 	    com_err(rn, code, "Can't convert cell to realm");
  	exit(code);
      }
  
--- 316,322 ----
  	strcpy(realm, lcell);
      if (code = ka_CellToRealm(realm, realm, &local)) {
  	if (!Silent)
! 	    afs_com_err(rn, code, "Can't convert cell to realm");
  	exit(code);
      }
  
***************
*** 362,368 ****
  	code = krb_write_ticket_file(realm);
  	if (!Silent) {
  	    if (code)
! 		com_err(rn, code, "writing Kerberos ticket file");
  	    else
  		fprintf(stderr, "Wrote ticket file to /tmp\n");
  	}
--- 362,368 ----
  	code = krb_write_ticket_file(realm);
  	if (!Silent) {
  	    if (code)
! 		afs_com_err(rn, code, "writing Kerberos ticket file");
  	    else
  		fprintf(stderr, "Wrote ticket file to /tmp\n");
  	}
Index: openafs/src/kauth/test/test_badtix.c
diff -c openafs/src/kauth/test/test_badtix.c:1.7 openafs/src/kauth/test/test_badtix.c:1.7.14.1
*** openafs/src/kauth/test/test_badtix.c:1.7	Tue Jul 15 19:15:18 2003
--- openafs/src/kauth/test/test_badtix.c	Tue Apr 10 14:39:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_badtix.c,v 1.7 2003/07/15 23:15:18 shadow Exp $");
  
  #include <sys/types.h>
  #include <des.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_badtix.c,v 1.7.14.1 2007/04/10 18:39:52 shadow Exp $");
  
  #include <sys/types.h>
  #include <des.h>
***************
*** 170,176 ****
  			      &adminConn))
  	) {
        abort:
! 	com_err(whoami, code, "testing old keys");
  	exit(1);
      }
  
--- 170,176 ----
  			      &adminConn))
  	) {
        abort:
! 	afs_com_err(whoami, code, "testing old keys");
  	exit(1);
      }
  
***************
*** 275,281 ****
  	}
  	if (code) {
  	  abort_1:
! 	    com_err(whoami, code, "at %d seconds: calling server with v=%x",
  		    sleep, v);
  	    exit(2);
  	}
--- 275,281 ----
  	}
  	if (code) {
  	  abort_1:
! 	    afs_com_err(whoami, code, "at %d seconds: calling server with v=%x",
  		    sleep, v);
  	    exit(2);
  	}
***************
*** 296,302 ****
  			      &adminTokens[i], &conn);
  	if (code) {
  	  abort_ta:
! 	    com_err(whoami, code, "Checking admin token #%d with kvno %d\n",
  		    i, (int)adminTokens[i].kvno);
  	    exit(5);
  	}
--- 296,302 ----
  			      &adminTokens[i], &conn);
  	if (code) {
  	  abort_ta:
! 	    afs_com_err(whoami, code, "Checking admin token #%d with kvno %d\n",
  		    i, (int)adminTokens[i].kvno);
  	    exit(5);
  	}
***************
*** 321,327 ****
  	    ka_GetToken(name, inst, localCell, name, inst, tgsConn, now,
  			now + 3600, &tgsTokens[i], "", &token);
  	if (code) {
! 	    com_err(whoami, code, "Checking tgs token #%d with kvno %d\n", i,
  		    (int)tgsTokens[i].kvno);
  	    exit(6);
  	}
--- 321,327 ----
  	    ka_GetToken(name, inst, localCell, name, inst, tgsConn, now,
  			now + 3600, &tgsTokens[i], "", &token);
  	if (code) {
! 	    afs_com_err(whoami, code, "Checking tgs token #%d with kvno %d\n", i,
  		    (int)tgsTokens[i].kvno);
  	    exit(6);
  	}
***************
*** 329,335 ****
  
      code = ubik_Call(KAM_DeleteUser, adminConn, 0, aaname, aainst);
      if (code) {
! 	com_err(whoami, code, "Deleting alternate admin user");
  	exit(3);
      }
      return;
--- 329,335 ----
  
      code = ubik_Call(KAM_DeleteUser, adminConn, 0, aaname, aainst);
      if (code) {
! 	afs_com_err(whoami, code, "Deleting alternate admin user");
  	exit(3);
      }
      return;
***************
*** 414,420 ****
  
      code = ka_CellConfig(AFSCONF_CLIENTNAME);
      if (code)
! 	com_err(whoami, code, "calling cell config");
      localCell = ka_LocalCell();
  
      for (i = 0; i < (sizeof(truncate) / sizeof(int)); i++) {
--- 414,420 ----
  
      code = ka_CellConfig(AFSCONF_CLIENTNAME);
      if (code)
! 	afs_com_err(whoami, code, "calling cell config");
      localCell = ka_LocalCell();
  
      for (i = 0; i < (sizeof(truncate) / sizeof(int)); i++) {
***************
*** 453,467 ****
  
      code = rx_Init(0);
      if (code) {
! 	com_err(whoami, code, "rx_Init'ing");
  	exit(1);
      }
      if (code = ka_Init(0)) {
! 	com_err(whoami, code, "ka_Init'ing");
  	exit(1);
      }
      if (code = ubik_ParseClientList(3, args, serverList)) {
! 	com_err(whoami, code, "parsing Ubik server list");
  	exit(1);
      }
      ka_ExplicitCell(localCell, serverList);
--- 453,467 ----
  
      code = rx_Init(0);
      if (code) {
! 	afs_com_err(whoami, code, "rx_Init'ing");
  	exit(1);
      }
      if (code = ka_Init(0)) {
! 	afs_com_err(whoami, code, "ka_Init'ing");
  	exit(1);
      }
      if (code = ubik_ParseClientList(3, args, serverList)) {
! 	afs_com_err(whoami, code, "parsing Ubik server list");
  	exit(1);
      }
      ka_ExplicitCell(localCell, serverList);
***************
*** 480,486 ****
  	code = ubik_ClientInit(conns, &lpbkConn);
  	if (code) {
  	  abort_4:
! 	    com_err(whoami, code,
  		    "getting %s's password via loopback connection to GetPassword",
  		    name);
  	    exit(1);
--- 480,486 ----
  	code = ubik_ClientInit(conns, &lpbkConn);
  	if (code) {
  	  abort_4:
! 	    afs_com_err(whoami, code,
  		    "getting %s's password via loopback connection to GetPassword",
  		    name);
  	    exit(1);
***************
*** 497,503 ****
      code = ka_AuthServerConn(localCell, KA_AUTHENTICATION_SERVICE, 0, &aconn);
      if (code) {
        abort:
! 	com_err(whoami, code, "connecting to authentication service");
  	exit(1);
      }
      end = now + 100 * 3600 + 2;
--- 497,503 ----
      code = ka_AuthServerConn(localCell, KA_AUTHENTICATION_SERVICE, 0, &aconn);
      if (code) {
        abort:
! 	afs_com_err(whoami, code, "connecting to authentication service");
  	exit(1);
      }
      end = now + 100 * 3600 + 2;
***************
*** 522,528 ****
  			&token, 0);
      if (code) {
        abort_1:
! 	com_err(whoami, code, "using admin ticket with time jitter");
  	exit(1);
      }
  
--- 522,528 ----
  			&token, 0);
      if (code) {
        abort_1:
! 	afs_com_err(whoami, code, "using admin ticket with time jitter");
  	exit(1);
      }
  
***************
*** 544,550 ****
  	code = ubik_Call(KAM_SetPassword, conn, 0, name, inst, 0, badkey);
  	if (code != KABADKEY) {
  	  abort_5:
! 	    com_err(whoami, code, "Trying to set bad key");
  	    exit(1);
  	}
  	memset(&badkey, 0, sizeof(badkey));
--- 544,550 ----
  	code = ubik_Call(KAM_SetPassword, conn, 0, name, inst, 0, badkey);
  	if (code != KABADKEY) {
  	  abort_5:
! 	    afs_com_err(whoami, code, "Trying to set bad key");
  	    exit(1);
  	}
  	memset(&badkey, 0, sizeof(badkey));
***************
*** 566,572 ****
  	code = ubik_Call(KAM_SetPassword, conn, 0, aname, ainst, 0, akey);
  	if (code) {
  	  abort_6:
! 	    com_err(whoami, code, "Checking SetPassword");
  	    exit(2);
  	}
  	code =
--- 566,572 ----
  	code = ubik_Call(KAM_SetPassword, conn, 0, aname, ainst, 0, akey);
  	if (code) {
  	  abort_6:
! 	    afs_com_err(whoami, code, "Checking SetPassword");
  	    exit(2);
  	}
  	code =
***************
*** 595,601 ****
  			   &atoken.sessionKey, 0, aname, ainst);
  	if (code) {
  	  abort_3:
! 	    com_err(whoami, code, "faking up AuthServer ticket");
  	    exit(1);
  	}
  	{
--- 595,601 ----
  			   &atoken.sessionKey, 0, aname, ainst);
  	if (code) {
  	  abort_3:
! 	    afs_com_err(whoami, code, "faking up AuthServer ticket");
  	    exit(1);
  	}
  	{
***************
*** 644,656 ****
      code =
  	ka_AuthServerConn(localCell, KA_MAINTENANCE_SERVICE, &atoken, &conn);
      if (code) {
! 	com_err(whoami, code, "contacting admin server with bashed ticket");
  	exit(0);		/* this is supposed to happen */
      }
      code =
  	ubik_Call(KAM_GetEntry, conn, 0, name, inst, KAMAJORVERSION, &tentry);
      if (code != RXKADBADTICKET) {
! 	com_err(whoami, code,
  		"GetEntry failed to fail even with damaged ticket!!!!\n");
  	exit(1);
      }
--- 644,656 ----
      code =
  	ka_AuthServerConn(localCell, KA_MAINTENANCE_SERVICE, &atoken, &conn);
      if (code) {
! 	afs_com_err(whoami, code, "contacting admin server with bashed ticket");
  	exit(0);		/* this is supposed to happen */
      }
      code =
  	ubik_Call(KAM_GetEntry, conn, 0, name, inst, KAMAJORVERSION, &tentry);
      if (code != RXKADBADTICKET) {
! 	afs_com_err(whoami, code,
  		"GetEntry failed to fail even with damaged ticket!!!!\n");
  	exit(1);
      }
***************
*** 661,667 ****
      if (argc == 2) {
  	code = setpag();
  	if (code)
! 	    com_err(whoami, code, "calling SetPAG");
  	else
  	    printf("Calling SetPAG and exec'ing %s\n", argv[1]);
  	execve(argv[1], argv + 1, 0);
--- 661,667 ----
      if (argc == 2) {
  	code = setpag();
  	if (code)
! 	    afs_com_err(whoami, code, "calling SetPAG");
  	else
  	    printf("Calling SetPAG and exec'ing %s\n", argv[1]);
  	execve(argv[1], argv + 1, 0);
Index: openafs/src/kauth/test/test_getticket.c
diff -c openafs/src/kauth/test/test_getticket.c:1.8 openafs/src/kauth/test/test_getticket.c:1.8.4.1
*** openafs/src/kauth/test/test_getticket.c:1.8	Mon May 30 00:55:22 2005
--- openafs/src/kauth/test/test_getticket.c	Tue Apr 10 14:39:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_getticket.c,v 1.8 2005/05/30 04:55:22 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_getticket.c,v 1.8.4.1 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 130,136 ****
  		  lifetime, -1,
  		  /* spares */ 0, 0);
      if (code) {
! 	com_err(whoami, code, "calling set fields on %s", name);
  	CRASH();
      }
  }
--- 130,136 ----
  		  lifetime, -1,
  		  /* spares */ 0, 0);
      if (code) {
! 	afs_com_err(whoami, code, "calling set fields on %s", name);
  	CRASH();
      }
  }
***************
*** 201,207 ****
      }
      code = ktc_GetToken(&afs, &t, sizeof(t), 0);
      if (code) {
! 	com_err(whoami, code, "getting afs token from ktc");
  	CRASH();
      }
      CheckLife(t.endTime, t.startTime, expectedLife, match);
--- 201,207 ----
      }
      code = ktc_GetToken(&afs, &t, sizeof(t), 0);
      if (code) {
! 	afs_com_err(whoami, code, "getting afs token from ktc");
  	CRASH();
      }
      CheckLife(t.endTime, t.startTime, expectedLife, match);
***************
*** 243,249 ****
  	    ka_ParseLoginName(as->parms[12].items->data, name, instance,
  			      newCell);
  	if (code) {
! 	    com_err(whoami, code, "parsing user's name '%s'",
  		    as->parms[12].items->data);
  	    return code;
  	}
--- 243,249 ----
  	    ka_ParseLoginName(as->parms[12].items->data, name, instance,
  			      newCell);
  	if (code) {
! 	    afs_com_err(whoami, code, "parsing user's name '%s'",
  		    as->parms[12].items->data);
  	    return code;
  	}
***************
*** 273,285 ****
  
      code = ka_ExpandCell(newCell, newCell, 0 /*local */ );
      if (code) {
! 	com_err(whoami, code, "Can't expand cell name");
  	return code;
      }
      cell = newCell;
      code = ka_CellToRealm(cell, realm, 0);
      if (code) {
! 	com_err(whoami, code, "Can't get realm from cell name");
  	return code;
      }
  
--- 273,285 ----
  
      code = ka_ExpandCell(newCell, newCell, 0 /*local */ );
      if (code) {
! 	afs_com_err(whoami, code, "Can't expand cell name");
  	return code;
      }
      cell = newCell;
      code = ka_CellToRealm(cell, realm, 0);
      if (code) {
! 	afs_com_err(whoami, code, "Can't get realm from cell name");
  	return code;
      }
  
***************
*** 299,305 ****
  	else if (strlen(passwd) == 0)
  	    code = KANULLPASSWORD;
  	if (code) {
! 	    com_err(whoami, code, "reading password");
  	    return code;
  	}
      }
--- 299,305 ----
  	else if (strlen(passwd) == 0)
  	    code = KANULLPASSWORD;
  	if (code) {
! 	    afs_com_err(whoami, code, "reading password");
  	    return code;
  	}
      }
***************
*** 313,319 ****
  	ap[1] = "-servers";
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
! 	    com_err(whoami, code, "could not parse server list");
  	    return code;
  	}
  	ka_ExplicitCell(cell, serverList);
--- 313,319 ----
  	ap[1] = "-servers";
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
! 	    afs_com_err(whoami, code, "could not parse server list");
  	    return code;
  	}
  	ka_ExplicitCell(cell, serverList);
***************
*** 326,332 ****
      strcpy(afs.cell, cell);
      code = ktc_GetToken(&afs, &oldAFSToken, sizeof(oldAFSToken), &oldClient);
      if (code) {
! 	com_err(whoami, code, "saving existing afs token");
  	return code;
      }
  
--- 326,332 ----
      strcpy(afs.cell, cell);
      code = ktc_GetToken(&afs, &oldAFSToken, sizeof(oldAFSToken), &oldClient);
      if (code) {
! 	afs_com_err(whoami, code, "saving existing afs token");
  	return code;
      }
  
***************
*** 345,351 ****
  	    ka_GetAdminToken(name, instance, cell, &key, 3600, &token,
  			     1 /*new */ );
  	if (code) {
! 	    com_err(whoami, code, "getting admin token");
  	    return code;
  	}
  	pToken = &token;
--- 345,351 ----
  	    ka_GetAdminToken(name, instance, cell, &key, 3600, &token,
  			     1 /*new */ );
  	if (code) {
! 	    afs_com_err(whoami, code, "getting admin token");
  	    return code;
  	}
  	pToken = &token;
***************
*** 358,364 ****
  	    ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, pToken,
  			      &ubikConn);
  	if (code) {
! 	    com_err(whoami, code, "Getting AuthServer ubik conn");
  	    return code;
  	}
  
--- 358,364 ----
  	    ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, pToken,
  			      &ubikConn);
  	if (code) {
! 	    afs_com_err(whoami, code, "Getting AuthServer ubik conn");
  	    return code;
  	}
  
***************
*** 383,389 ****
  	    ktc_GetToken(&tgs_server, &tgs_token, sizeof(tgs_token),
  			 &tgs_client);
  	if (code) {
! 	    com_err(whoami, code, "saving tgs token");
  	    return code;
  	}
  
--- 383,389 ----
  	    ktc_GetToken(&tgs_server, &tgs_token, sizeof(tgs_token),
  			 &tgs_client);
  	if (code) {
! 	    afs_com_err(whoami, code, "saving tgs token");
  	    return code;
  	}
  
***************
*** 418,424 ****
  	/* since the rest should be errors, restore good AFS ticket */
  	code = ktc_SetToken(&afs, &oldAFSToken, &oldClient, 0);
  	if (code) {
! 	    com_err(whoami, code, "restoring old afs token");
  	    return code;
  	}
  
--- 418,424 ----
  	/* since the rest should be errors, restore good AFS ticket */
  	code = ktc_SetToken(&afs, &oldAFSToken, &oldClient, 0);
  	if (code) {
! 	    afs_com_err(whoami, code, "restoring old afs token");
  	    return code;
  	}
  
***************
*** 439,451 ****
  	/* restore old tgs, since GetTicket are prohibited too. */
  	code = ktc_SetToken(&tgs_server, &tgs_token, &tgs_client, 0);
  	if (code) {
! 	    com_err(whoami, code, "restoring old tgs token");
  	    return code;
  	}
  	printf("Restoring TGT obtained before NOTGS set\n");
  	code = ka_GetServerToken(AUTH_SUPERUSER, "", cell, 100, 0, 1);
  	if (code != KABADUSER) {
! 	    com_err(whoami, code,
  		    "expected BADUSER error, getting AFS token w/ old tgs token but with NOTGS set");
  	    CRASH();
  	} else
--- 439,451 ----
  	/* restore old tgs, since GetTicket are prohibited too. */
  	code = ktc_SetToken(&tgs_server, &tgs_token, &tgs_client, 0);
  	if (code) {
! 	    afs_com_err(whoami, code, "restoring old tgs token");
  	    return code;
  	}
  	printf("Restoring TGT obtained before NOTGS set\n");
  	code = ka_GetServerToken(AUTH_SUPERUSER, "", cell, 100, 0, 1);
  	if (code != KABADUSER) {
! 	    afs_com_err(whoami, code,
  		    "expected BADUSER error, getting AFS token w/ old tgs token but with NOTGS set");
  	    CRASH();
  	} else
***************
*** 456,462 ****
  	    struct ktc_token afsToken;
  	    code = ktc_SetToken(&afs, &oldAFSToken, &oldClient, 0);
  	    if (code) {
! 		com_err(whoami, code, "restoring old afs token");
  		return code;
  	    }
  	    fprintf(stdout, "Waiting for TGS ticket to age (about 5 min)...");
--- 456,462 ----
  	    struct ktc_token afsToken;
  	    code = ktc_SetToken(&afs, &oldAFSToken, &oldClient, 0);
  	    if (code) {
! 		afs_com_err(whoami, code, "restoring old afs token");
  		return code;
  	    }
  	    fprintf(stdout, "Waiting for TGS ticket to age (about 5 min)...");
***************
*** 472,485 ****
  	    /* restore old tgs */
  	    code = ktc_SetToken(&tgs_server, &tgs_token, &tgs_client, 0);
  	    if (code) {
! 		com_err(whoami, code, "restoring old tgs token");
  		return code;
  	    }
  	    code =
  		ka_GetServerToken(AUTH_SUPERUSER, "", cell,
  				  MAXKTCTICKETLIFETIME, &afsToken, 1);
  	    if (code) {
! 		com_err(whoami, code, "getting AFS token w/ old tgs token");
  		CRASH();
  	    }
  	    CheckLife(afsToken.endTime, afsToken.startTime, 3600 - (5 * 60),
--- 472,485 ----
  	    /* restore old tgs */
  	    code = ktc_SetToken(&tgs_server, &tgs_token, &tgs_client, 0);
  	    if (code) {
! 		afs_com_err(whoami, code, "restoring old tgs token");
  		return code;
  	    }
  	    code =
  		ka_GetServerToken(AUTH_SUPERUSER, "", cell,
  				  MAXKTCTICKETLIFETIME, &afsToken, 1);
  	    if (code) {
! 		afs_com_err(whoami, code, "getting AFS token w/ old tgs token");
  		CRASH();
  	    }
  	    CheckLife(afsToken.endTime, afsToken.startTime, 3600 - (5 * 60),
Index: openafs/src/kauth/test/test_interim_ktc.c
diff -c openafs/src/kauth/test/test_interim_ktc.c:1.7 openafs/src/kauth/test/test_interim_ktc.c:1.7.14.1
*** openafs/src/kauth/test/test_interim_ktc.c:1.7	Tue Jul 15 19:15:18 2003
--- openafs/src/kauth/test/test_interim_ktc.c	Tue Apr 10 14:39:52 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_interim_ktc.c,v 1.7 2003/07/15 23:15:18 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/com_err.h>
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_interim_ktc.c,v 1.7.14.1 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/com_err.h>
***************
*** 117,123 ****
  
      code = ktc_SetToken(server, token, client, 0);
      if (code) {
! 	com_err(whoami, code, "using SetToken to set vice id");
  	return 1;
      }
      sprintf(name_buf, "Unix UID %d", getuid());
--- 117,123 ----
  
      code = ktc_SetToken(server, token, client, 0);
      if (code) {
! 	afs_com_err(whoami, code, "using SetToken to set vice id");
  	return 1;
      }
      sprintf(name_buf, "Unix UID %d", getuid());
***************
*** 128,140 ****
  	fprintf(stderr, "GetToken returned bad client: '");
  	PrintPrincipal(stderr, &nclient);
  	fprintf(stderr, "'\n");
! 	com_err(whoami, code, "should have gotten '%s'", name_buf);
  	return 1;
      }
      lifetime =
  	(unsigned long)ntoken.endTime - (unsigned long)ntoken.startTime;
      if ((lifetime & 1) == 1) {
! 	com_err(whoami, code, "GetToken returned even lifetime (%d)",
  		lifetime);
  	return 1;
      }
--- 128,140 ----
  	fprintf(stderr, "GetToken returned bad client: '");
  	PrintPrincipal(stderr, &nclient);
  	fprintf(stderr, "'\n");
! 	afs_com_err(whoami, code, "should have gotten '%s'", name_buf);
  	return 1;
      }
      lifetime =
  	(unsigned long)ntoken.endTime - (unsigned long)ntoken.startTime;
      if ((lifetime & 1) == 1) {
! 	afs_com_err(whoami, code, "GetToken returned even lifetime (%d)",
  		lifetime);
  	return 1;
      }
***************
*** 157,163 ****
      viceId = atoi((client->name) + 7);
      code = ktc_SetToken(server, token, client, 0);
      if (code) {
! 	com_err(whoami, code, "using SetToken to set vice id to %d", viceId);
  	return 1;
      }
      code = ktc_GetToken(server, &ntoken, sizeof(ntoken), &nclient);
--- 157,163 ----
      viceId = atoi((client->name) + 7);
      code = ktc_SetToken(server, token, client, 0);
      if (code) {
! 	afs_com_err(whoami, code, "using SetToken to set vice id to %d", viceId);
  	return 1;
      }
      code = ktc_GetToken(server, &ntoken, sizeof(ntoken), &nclient);
***************
*** 169,181 ****
  	fprintf(stderr, "' should have gotten '");
  	PrintPrincipal(stderr, client);
  	fprintf(stderr, "'\n");
! 	com_err(whoami, code, "didn't preserve AFS ID");
  	return 1;
      }
      lifetime =
  	(unsigned long)ntoken.endTime - (unsigned long)ntoken.startTime;
      if ((lifetime & 1) == 0) {
! 	com_err(whoami, code, "GetToken returned even lifetime (%d)",
  		lifetime);
  	return 1;
      }
--- 169,181 ----
  	fprintf(stderr, "' should have gotten '");
  	PrintPrincipal(stderr, client);
  	fprintf(stderr, "'\n");
! 	afs_com_err(whoami, code, "didn't preserve AFS ID");
  	return 1;
      }
      lifetime =
  	(unsigned long)ntoken.endTime - (unsigned long)ntoken.startTime;
      if ((lifetime & 1) == 0) {
! 	afs_com_err(whoami, code, "GetToken returned even lifetime (%d)",
  		lifetime);
  	return 1;
      }
***************
*** 265,271 ****
      buffer.out_size = 0;
      code = pioctl(0, _VICEIOCTL(3), &buffer, 1);
      if (code) {
! 	com_err(whoami, errno, "setting old-style token");
  	return 1;
      }
  
--- 265,271 ----
      buffer.out_size = 0;
      code = pioctl(0, _VICEIOCTL(3), &buffer, 1);
      if (code) {
! 	afs_com_err(whoami, errno, "setting old-style token");
  	return 1;
      }
  
***************
*** 322,328 ****
  	    if (errno == EDOM)
  		break;		/* done with the list */
  	    else {
! 		com_err(whoami, code, "getting cell list");
  		exit(1);
  	    }
  	}
--- 322,328 ----
  	    if (errno == EDOM)
  		break;		/* done with the list */
  	    else {
! 		afs_com_err(whoami, code, "getting cell list");
  		exit(1);
  	    }
  	}
***************
*** 494,500 ****
      blob.out = space;
      code = pioctl(pathname, VIOCGETAL, &blob, 1);
      if (code) {
! 	com_err(whoami, errno, "getting acl for %s", pathname);
  	return 1;
      }
      if (verbose > 1)
--- 494,500 ----
      blob.out = space;
      code = pioctl(pathname, VIOCGETAL, &blob, 1);
      if (code) {
! 	afs_com_err(whoami, errno, "getting acl for %s", pathname);
  	return 1;
      }
      if (verbose > 1)
***************
*** 538,544 ****
      blob.in_size = 1 + strlen(blob.in);
      code = pioctl(pathname, VIOCSETAL, &blob, 1);
      if (code) {
! 	com_err(whoami, errno, "setting acl on %s to %s", pathname, blob.in);
  	return 1;
      }
      if (verbose > 1) {
--- 538,544 ----
      blob.in_size = 1 + strlen(blob.in);
      code = pioctl(pathname, VIOCSETAL, &blob, 1);
      if (code) {
! 	afs_com_err(whoami, errno, "setting acl on %s to %s", pathname, blob.in);
  	return 1;
      }
      if (verbose > 1) {
***************
*** 566,572 ****
      token.endTime = 0;
      code = ktc_SetToken(&server, &token, &client, 0);
      if (code) {
! 	com_err(whoami, code, "freeing cell");
  	exit(1);
      }
  }
--- 566,572 ----
      token.endTime = 0;
      code = ktc_SetToken(&server, &token, &client, 0);
      if (code) {
! 	afs_com_err(whoami, code, "freeing cell");
  	exit(1);
      }
  }
***************
*** 596,602 ****
      strcpy(server.cell, cell);
      code = ktc_GetToken(&server, &token, sizeof(token), &client);
      if (code) {
! 	com_err(whoami, code, "so couldn't get %s's afs token in %s", name,
  		cell);
  	return code;
      }
--- 596,602 ----
      strcpy(server.cell, cell);
      code = ktc_GetToken(&server, &token, sizeof(token), &client);
      if (code) {
! 	afs_com_err(whoami, code, "so couldn't get %s's afs token in %s", name,
  		cell);
  	return code;
      }
***************
*** 648,670 ****
      strcpy(server.cell, ka_LocalCell());
      code = ktc_GetToken(&server, &token, sizeof(token), &client);
      if (code) {
! 	com_err(whoami, code, "so couldn't get afs token");
  	return code;
      }
  
      code = mkdir(tdpath, 0777);
      if (code && (errno != EEXIST)) {
! 	com_err(whoami, errno, "making test dir %s", tdpath);
  	return code;
      }
      fd = open(tfpath, O_WRONLY + O_CREAT + O_TRUNC, 0777);
      if (fd == -1) {
! 	com_err(whoami, errno, "making test file %s", tfpath);
  	goto failed;
      }
      code = close(fd);
      if (code) {
! 	com_err(whoami, errno, "failed to close %s after create", tfpath);
  	goto failed;
      }
  
--- 648,670 ----
      strcpy(server.cell, ka_LocalCell());
      code = ktc_GetToken(&server, &token, sizeof(token), &client);
      if (code) {
! 	afs_com_err(whoami, code, "so couldn't get afs token");
  	return code;
      }
  
      code = mkdir(tdpath, 0777);
      if (code && (errno != EEXIST)) {
! 	afs_com_err(whoami, errno, "making test dir %s", tdpath);
  	return code;
      }
      fd = open(tfpath, O_WRONLY + O_CREAT + O_TRUNC, 0777);
      if (fd == -1) {
! 	afs_com_err(whoami, errno, "making test file %s", tfpath);
  	goto failed;
      }
      code = close(fd);
      if (code) {
! 	afs_com_err(whoami, errno, "failed to close %s after create", tfpath);
  	goto failed;
      }
  
***************
*** 678,684 ****
  	goto failed;
      code = ktc_GetToken(&server, &ntoken, sizeof(ntoken), &nclient);
      if (code) {
! 	com_err(whoami, code, "getting new local afs token");
  	goto failed;
      }
  
--- 678,684 ----
  	goto failed;
      code = ktc_GetToken(&server, &ntoken, sizeof(ntoken), &nclient);
      if (code) {
! 	afs_com_err(whoami, code, "getting new local afs token");
  	goto failed;
      }
  
***************
*** 705,733 ****
  
      code = open(tfpath, O_RDONLY, 0);	/* check for read access */
      if (!((code == -1) && ((errno == ENOENT) || (errno == EACCES)))) {
! 	com_err(whoami, errno, "didn't fail to open %s for read", tfpath);
  	goto failed;
      }
  
      /* as tester we should have read but not write */
      code = ktc_SetToken(&server, &ntoken, &nclient, 0);
      if (code) {
! 	com_err(whoami, code, "restoring new local afs token");
  	goto failed;
      }
      code = open(tfpath, O_RDWR + O_TRUNC, 0);
      if ((code != -1) || (errno != EACCES)) {
! 	com_err(whoami, errno, "didn't fail to open %s for write", tfpath);
  	goto failed;
      }
      fd = open(tfpath, O_RDONLY, 0);
      if (fd == -1) {
! 	com_err(whoami, errno, "failed to open %s for read", tfpath);
  	goto failed;
      }
      code = close(fd);
      if (code) {
! 	com_err(whoami, errno, "failed to close %s after open", tfpath);
  	goto failed;
      }
  
--- 705,733 ----
  
      code = open(tfpath, O_RDONLY, 0);	/* check for read access */
      if (!((code == -1) && ((errno == ENOENT) || (errno == EACCES)))) {
! 	afs_com_err(whoami, errno, "didn't fail to open %s for read", tfpath);
  	goto failed;
      }
  
      /* as tester we should have read but not write */
      code = ktc_SetToken(&server, &ntoken, &nclient, 0);
      if (code) {
! 	afs_com_err(whoami, code, "restoring new local afs token");
  	goto failed;
      }
      code = open(tfpath, O_RDWR + O_TRUNC, 0);
      if ((code != -1) || (errno != EACCES)) {
! 	afs_com_err(whoami, errno, "didn't fail to open %s for write", tfpath);
  	goto failed;
      }
      fd = open(tfpath, O_RDONLY, 0);
      if (fd == -1) {
! 	afs_com_err(whoami, errno, "failed to open %s for read", tfpath);
  	goto failed;
      }
      code = close(fd);
      if (code) {
! 	afs_com_err(whoami, errno, "failed to close %s after open", tfpath);
  	goto failed;
      }
  
***************
*** 735,745 ****
      /* go back to original privileges */
      code = ktc_SetToken(&server, &token, &client, 0);
      if (code) {
! 	com_err(whoami, code, "so couldn't set afs token in new pag");
  	exit(1);
      }
      if (unlink(tfpath) || rmdir(tdpath)) {
! 	com_err(whoami, errno, "removing test dir %s", tdpath);
  	return 1;
      }
      return exitCode;
--- 735,745 ----
      /* go back to original privileges */
      code = ktc_SetToken(&server, &token, &client, 0);
      if (code) {
! 	afs_com_err(whoami, code, "so couldn't set afs token in new pag");
  	exit(1);
      }
      if (unlink(tfpath) || rmdir(tdpath)) {
! 	afs_com_err(whoami, errno, "removing test dir %s", tdpath);
  	return 1;
      }
      return exitCode;
***************
*** 765,771 ****
  
      srandom(1);
  
!     /* Initialize com_err error code hacking */
      initialize_U_error_table();
      initialize_KA_error_table();
      initialize_RXK_error_table();
--- 765,771 ----
  
      srandom(1);
  
!     /* Initialize afs_com_err error code hacking */
      initialize_U_error_table();
      initialize_KA_error_table();
      initialize_RXK_error_table();
***************
*** 824,833 ****
      /* expand requested cell name */
      code = ka_CellConfig(AFSCONF_CLIENTNAME);
      if (code)
! 	com_err(whoami, code, "calling cell config");
      code = ka_ExpandCell(cell, cell, 0);
      if (code) {
! 	com_err(whoami, code, "expanding cell %s", cell);
  	exit(1);
      }
  
--- 824,833 ----
      /* expand requested cell name */
      code = ka_CellConfig(AFSCONF_CLIENTNAME);
      if (code)
! 	afs_com_err(whoami, code, "calling cell config");
      code = ka_ExpandCell(cell, cell, 0);
      if (code) {
! 	afs_com_err(whoami, code, "expanding cell %s", cell);
  	exit(1);
      }
  
***************
*** 837,843 ****
      if (printToken) {
  	code = ktc_GetToken(&server, &token, sizeof(token), &client);
  	if (code) {
! 	    com_err(whoami, code, "so couldn't get afs token");
  	    exit(1);
  	}
  	PrintAuthentication(stdout, &server, &token, &client);
--- 837,843 ----
      if (printToken) {
  	code = ktc_GetToken(&server, &token, sizeof(token), &client);
  	if (code) {
! 	    afs_com_err(whoami, code, "so couldn't get afs token");
  	    exit(1);
  	}
  	PrintAuthentication(stdout, &server, &token, &client);
***************
*** 867,873 ****
      memcpy(&ntoken, &token, sizeof(ntoken));
      code = ktc_SetToken(&server, &ntoken, &client, 0);
      if (code != KTC_NOCELL) {
! 	com_err(whoami, code,
  		"should have gotten bad pioctl error calling SetToken with bogus cell name");
  	goto failed;
      }
--- 867,873 ----
      memcpy(&ntoken, &token, sizeof(ntoken));
      code = ktc_SetToken(&server, &ntoken, &client, 0);
      if (code != KTC_NOCELL) {
! 	afs_com_err(whoami, code,
  		"should have gotten bad pioctl error calling SetToken with bogus cell name");
  	goto failed;
      }
***************
*** 876,882 ****
      ntoken.ticketLen = 0;
      code = ktc_SetToken(&server, &ntoken, &client, 0);
      if ((code != KTC_TOOBIG) && (code != KTC_PIOCTLFAIL)) {
! 	com_err(whoami, code,
  		"should have gotten error calling SetToken with zero ticket length");
  	goto failed;
      }
--- 876,882 ----
      ntoken.ticketLen = 0;
      code = ktc_SetToken(&server, &ntoken, &client, 0);
      if ((code != KTC_TOOBIG) && (code != KTC_PIOCTLFAIL)) {
! 	afs_com_err(whoami, code,
  		"should have gotten error calling SetToken with zero ticket length");
  	goto failed;
      }
***************
*** 884,890 ****
      ntoken.endTime = 0;
      code = ktc_SetToken(&server, &ntoken, &client, 0);
      if (code) {
! 	com_err(whoami, code, "calling SetToken with zero expiration time");
  	goto failed;
      }
      strcpy(nclient.name, "foo");
--- 884,890 ----
      ntoken.endTime = 0;
      code = ktc_SetToken(&server, &ntoken, &client, 0);
      if (code) {
! 	afs_com_err(whoami, code, "calling SetToken with zero expiration time");
  	goto failed;
      }
      strcpy(nclient.name, "foo");
***************
*** 892,898 ****
      strcpy(nclient.cell, "foo.bar.baz");
      code = ktc_SetToken(&server, &ntoken, &nclient, 0);
      if (code) {
! 	com_err(whoami, code, "calling SetToken with bogus client cell");
  	goto failed;
      }
      memcpy(&ntoken, &token, sizeof(ntoken));
--- 892,898 ----
      strcpy(nclient.cell, "foo.bar.baz");
      code = ktc_SetToken(&server, &ntoken, &nclient, 0);
      if (code) {
! 	afs_com_err(whoami, code, "calling SetToken with bogus client cell");
  	goto failed;
      }
      memcpy(&ntoken, &token, sizeof(ntoken));
Index: openafs/src/kauth/test/test_rxkad_free.c
diff -c openafs/src/kauth/test/test_rxkad_free.c:1.8 openafs/src/kauth/test/test_rxkad_free.c:1.8.4.1
*** openafs/src/kauth/test/test_rxkad_free.c:1.8	Mon May 30 00:55:22 2005
--- openafs/src/kauth/test/test_rxkad_free.c	Tue Apr 10 14:39:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_rxkad_free.c,v 1.8 2005/05/30 04:55:22 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_rxkad_free.c,v 1.8.4.1 2007/04/10 18:39:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 111,117 ****
  	    ka_ParseLoginName(as->parms[12].items->data, name, instance,
  			      newCell);
  	if (code) {
! 	    com_err(whoami, code, "parsing user's name '%s'",
  		    as->parms[12].items->data);
  	    return code;
  	}
--- 111,117 ----
  	    ka_ParseLoginName(as->parms[12].items->data, name, instance,
  			      newCell);
  	if (code) {
! 	    afs_com_err(whoami, code, "parsing user's name '%s'",
  		    as->parms[12].items->data);
  	    return code;
  	}
***************
*** 139,145 ****
  
      code = ka_ExpandCell(newCell, newCell, 0 /*local */ );
      if (code) {
! 	com_err(whoami, code, "Can't expand cell name");
  	return code;
      }
      cell = newCell;
--- 139,145 ----
  
      code = ka_ExpandCell(newCell, newCell, 0 /*local */ );
      if (code) {
! 	afs_com_err(whoami, code, "Can't expand cell name");
  	return code;
      }
      cell = newCell;
***************
*** 160,166 ****
  	else if (strlen(passwd) == 0)
  	    code = KANULLPASSWORD;
  	if (code) {
! 	    com_err(whoami, code, "reading password");
  	    return code;
  	}
      }
--- 160,166 ----
  	else if (strlen(passwd) == 0)
  	    code = KANULLPASSWORD;
  	if (code) {
! 	    afs_com_err(whoami, code, "reading password");
  	    return code;
  	}
      }
***************
*** 174,180 ****
  	ap[1] = "-servers";
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
! 	    com_err(whoami, code, "could not parse server list");
  	    return code;
  	}
  	ka_ExplicitCell(cell, serverList);
--- 174,180 ----
  	ap[1] = "-servers";
  	code = ubik_ParseClientList(i, ap, serverList);
  	if (code) {
! 	    afs_com_err(whoami, code, "could not parse server list");
  	    return code;
  	}
  	ka_ExplicitCell(cell, serverList);
***************
*** 212,218 ****
  		ka_GetAdminToken(name, instance, cell, &key, 3600, &token,
  				 1 /*new */ );
  	    if (code) {
! 		com_err(whoami, code, "getting admin token");
  		return code;
  	    }
  	    pToken = &token;
--- 212,218 ----
  		ka_GetAdminToken(name, instance, cell, &key, 3600, &token,
  				 1 /*new */ );
  	    if (code) {
! 		afs_com_err(whoami, code, "getting admin token");
  		return code;
  	    }
  	    pToken = &token;
***************
*** 225,231 ****
  		ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, pToken,
  				  &ubikConn);
  	    if (code) {
! 		com_err(whoami, code, "Getting AuthServer ubik conn");
  		return code;
  	    }
  
--- 225,231 ----
  		ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, pToken,
  				  &ubikConn);
  	    if (code) {
! 		afs_com_err(whoami, code, "Getting AuthServer ubik conn");
  		return code;
  	    }
  
***************
*** 247,253 ****
  		ubik_Call(KAM_GetEntry, ubikConn, 0, name, instance,
  			  KAMAJORVERSION, &tentry);
  	    if (code) {
! 		com_err(whoami, code, "getting information for %s.%s", name,
  			instance);
  		return code;
  	    }
--- 247,253 ----
  		ubik_Call(KAM_GetEntry, ubikConn, 0, name, instance,
  			  KAMAJORVERSION, &tentry);
  	    if (code) {
! 		afs_com_err(whoami, code, "getting information for %s.%s", name,
  			instance);
  		return code;
  	    }
Index: openafs/src/libadmin/adminutil/afs_utilAdmin.c
diff -c openafs/src/libadmin/adminutil/afs_utilAdmin.c:1.9 openafs/src/libadmin/adminutil/afs_utilAdmin.c:1.9.4.1
*** openafs/src/libadmin/adminutil/afs_utilAdmin.c:1.9	Tue Jul  5 19:43:38 2005
--- openafs/src/libadmin/adminutil/afs_utilAdmin.c	Tue Apr 10 14:39:53 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/adminutil/afs_utilAdmin.c,v 1.9 2005/07/05 23:43:38 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/afs_Admin.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/adminutil/afs_utilAdmin.c,v 1.9.4.1 2007/04/10 18:39:53 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/afs_Admin.h>
***************
*** 104,110 ****
      if (!error_init_done)
  	pthread_once(&error_init_once, init_once);
      code = (afs_int32) errorCode;
!     *errorTextP = error_message(code);
      rc = 1;
  
    fail_util_AdminErrorCodeTranslate:
--- 104,110 ----
      if (!error_init_done)
  	pthread_once(&error_init_once, init_once);
      code = (afs_int32) errorCode;
!     *errorTextP = afs_error_message(code);
      rc = 1;
  
    fail_util_AdminErrorCodeTranslate:
Index: openafs/src/libafs/afs.ppc_darwin_70.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.14 openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.15
*** openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.14	Tue Apr  3 15:46:23 2007
--- openafs/src/libafs/afs.ppc_darwin_70.plist.in	Thu Apr 19 00:04:31 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.18</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.18</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.19</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.19</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
Index: openafs/src/libafs/afs.ppc_darwin_80.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.2.4.14 openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.2.4.15
*** openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.2.4.14	Tue Apr  3 15:46:23 2007
--- openafs/src/libafs/afs.ppc_darwin_80.plist.in	Thu Apr 19 00:04:31 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.18</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.18</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.19</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.19</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafs/afs.ppc_darwin_90.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.6.14 openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.6.15
*** openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.6.14	Tue Apr  3 15:46:23 2007
--- openafs/src/libafs/afs.ppc_darwin_90.plist.in	Thu Apr 19 00:04:31 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.18</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.18</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.19</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.19</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafs/afs.x86_darwin_80.plist.in
diff -c openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.6.14 openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.6.15
*** openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.6.14	Tue Apr  3 15:46:23 2007
--- openafs/src/libafs/afs.x86_darwin_80.plist.in	Thu Apr 19 00:04:31 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.18</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.18</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.19</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.19</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafs/afs.x86_darwin_90.plist.in
diff -c openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.6.14 openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.6.15
*** openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.6.14	Tue Apr  3 15:46:23 2007
--- openafs/src/libafs/afs.x86_darwin_90.plist.in	Thu Apr 19 00:04:31 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.18</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.18</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.19</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.19</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafsrpc/afsrpc.def
diff -c openafs/src/libafsrpc/afsrpc.def:1.11.4.3 openafs/src/libafsrpc/afsrpc.def:1.11.4.5
*** openafs/src/libafsrpc/afsrpc.def:1.11.4.3	Sat Dec 16 20:23:30 2006
--- openafs/src/libafsrpc/afsrpc.def	Tue Apr 10 18:09:18 2007
***************
*** 68,75 ****
  	xdrrx_create				@72
  	hton_syserr_conv			@73
  	rxkad_global_stats			@74 DATA
! 	com_err					@75
! 	error_message				@76
  	rx_socket				@77 DATA
  ;	AssertionFailed				@79
  	afs_winsockInit				@80
--- 68,75 ----
  	xdrrx_create				@72
  	hton_syserr_conv			@73
  	rxkad_global_stats			@74 DATA
! 	afs_com_err					@75
! 	afs_error_message				@76
  	rx_socket				@77 DATA
  ;	AssertionFailed				@79
  	afs_winsockInit				@80
***************
*** 92,98 ****
  	multi_Select				@97
  	multi_Init				@98
  	multi_Finalize_Ignore			@99
! 	add_to_error_table			@100
  	xdr_afsUUID				@101
  	rx_GetSpecific				@102
  	rx_SetSpecific				@103
--- 92,98 ----
  	multi_Select				@97
  	multi_Init				@98
  	multi_Finalize_Ignore			@99
! 	afs_add_to_error_table			@100
  	xdr_afsUUID				@101
  	rx_GetSpecific				@102
  	rx_SetSpecific				@103
Index: openafs/src/libafsrpc/afsrpc.exp
diff -c openafs/src/libafsrpc/afsrpc.exp:1.3 openafs/src/libafsrpc/afsrpc.exp:1.3.4.1
*** openafs/src/libafsrpc/afsrpc.exp:1.3	Mon May 30 00:55:24 2005
--- openafs/src/libafsrpc/afsrpc.exp	Tue Apr 10 14:39:53 2007
***************
*** 84,91 ****
  rxkad_stats_key
  _et_list
  et_list_mutex
! com_err
! error_message
  rx_socket
  des_pcbc_init
  rx_BusyError
--- 84,91 ----
  rxkad_stats_key
  _et_list
  et_list_mutex
! afs_com_err
! afs_error_message
  rx_socket
  des_pcbc_init
  rx_BusyError
Index: openafs/src/package/package.c
diff -c openafs/src/package/package.c:1.5 openafs/src/package/package.c:1.5.14.1
*** openafs/src/package/package.c:1.5	Wed Jun 23 10:27:40 2004
--- openafs/src/package/package.c	Tue Apr 10 14:39:54 2007
***************
*** 341,347 ****
       */
      code = cmd_Dispatch(argc, argv);
      if (code) {
! 	com_err(argv[0], code, "while dispatching command line");
  	exit(-1);
      }
  
--- 341,347 ----
       */
      code = cmd_Dispatch(argc, argv);
      if (code) {
! 	afs_com_err(argv[0], code, "while dispatching command line");
  	exit(-1);
      }
  
Index: openafs/src/packaging/MacOS/OpenAFS.Info.plist
diff -c openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.10.15 openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.10.16
*** openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.10.15	Tue Apr  3 15:46:23 2007
--- openafs/src/packaging/MacOS/OpenAFS.Info.plist	Thu Apr 19 00:04:31 2007
***************
*** 3,15 ****
  <plist version="1.0">
  <dict>
  	<key>CFBundleGetInfoString</key>
! 	<string>OpenAFS 1.5.18</string>
  	<key>CFBundleIdentifier</key>
  	<string>org.openafs.OpenAFS.pkg</string>
  	<key>CFBundleName</key>
  	<string>OpenAFS</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.18</string>
  	<key>IFMajorVersion</key>
  	<integer>1</integer>
  	<key>IFMinorVersion</key>
--- 3,15 ----
  <plist version="1.0">
  <dict>
  	<key>CFBundleGetInfoString</key>
! 	<string>OpenAFS 1.5.19</string>
  	<key>CFBundleIdentifier</key>
  	<string>org.openafs.OpenAFS.pkg</string>
  	<key>CFBundleName</key>
  	<string>OpenAFS</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.19</string>
  	<key>IFMajorVersion</key>
  	<integer>1</integer>
  	<key>IFMinorVersion</key>
Index: openafs/src/packaging/MacOS/OpenAFS.info
diff -c openafs/src/packaging/MacOS/OpenAFS.info:1.1.12.14 openafs/src/packaging/MacOS/OpenAFS.info:1.1.12.15
*** openafs/src/packaging/MacOS/OpenAFS.info:1.1.12.14	Tue Apr  3 15:46:23 2007
--- openafs/src/packaging/MacOS/OpenAFS.info	Thu Apr 19 00:04:31 2007
***************
*** 1,5 ****
  Title OpenAFS
! Version 1.5.18
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
--- 1,5 ----
  Title OpenAFS
! Version 1.5.19
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
Index: openafs/src/ptserver/db_verify.c
diff -c openafs/src/ptserver/db_verify.c:1.16 openafs/src/ptserver/db_verify.c:1.16.14.1
*** openafs/src/ptserver/db_verify.c:1.16	Wed Jun 23 10:27:41 2004
--- openafs/src/ptserver/db_verify.c	Tue Apr 10 14:39:54 2007
***************
*** 12,18 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/db_verify.c,v 1.16 2004/06/23 14:27:41 shadow Exp $");
  
  /*
   *                      (3) Define a structure, idused, instead of an
--- 12,18 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/db_verify.c,v 1.16.14.1 2007/04/10 18:39:54 shadow Exp $");
  
  /*
   *                      (3) Define a structure, idused, instead of an
***************
*** 57,62 ****
--- 57,63 ----
  #include <afs/afsutil.h>
  #include <ubik.h>
  #include <afs/cmd.h>
+ #include <afs/com_err.h>
  
  #include "ptint.h"
  #include "pterror.h"
***************
*** 121,127 ****
  
      code = pr_Read(0, (char *)&cheader, sizeof(cheader));
      if (code) {
! 	com_err(whoami, code, "couldn't read header");
  	return code;
      }
      /* Check and see if database exists and is approximately OK. */
--- 122,128 ----
  
      code = pr_Read(0, (char *)&cheader, sizeof(cheader));
      if (code) {
! 	afs_com_err(whoami, code, "couldn't read header");
  	return code;
      }
      /* Check and see if database exists and is approximately OK. */
***************
*** 129,135 ****
  	|| ntohl(cheader.eofPtr) == 0) {
  	if (code)
  	    return code;
! 	com_err(whoami, PRDBBAD, "header is bad");
  	return PRDBBAD;
      }
      return 0;
--- 130,136 ----
  	|| ntohl(cheader.eofPtr) == 0) {
  	if (code)
  	    return code;
! 	afs_com_err(whoami, PRDBBAD, "header is bad");
  	return PRDBBAD;
      }
      return 0;
***************
*** 1301,1307 ****
      n = eof / sizeof(struct prentry);
      if ((eof < 0) || (n * sizeof(struct prentry) != eof)) {
  	code = PRDBBAD;
! 	com_err(whoami, code, "eof ptr no good: eof=%d, sizeof(prentry)=%d",
  		eof, sizeof(struct prentry));
        abort:
  	return code;
--- 1302,1308 ----
      n = eof / sizeof(struct prentry);
      if ((eof < 0) || (n * sizeof(struct prentry) != eof)) {
  	code = PRDBBAD;
! 	afs_com_err(whoami, code, "eof ptr no good: eof=%d, sizeof(prentry)=%d",
  		eof, sizeof(struct prentry));
        abort:
  	return code;
***************
*** 1318,1324 ****
      }
      code = WalkHashTable(cheader.nameHash, MAP_NAMEHASH, map, misc);
      if (code) {
! 	com_err(whoami, code, "walking name hash");
  	goto abort;
      }
      if (misc->verbose) {
--- 1319,1325 ----
      }
      code = WalkHashTable(cheader.nameHash, MAP_NAMEHASH, map, misc);
      if (code) {
! 	afs_com_err(whoami, code, "walking name hash");
  	goto abort;
      }
      if (misc->verbose) {
***************
*** 1327,1333 ****
      }
      code = WalkHashTable(cheader.idHash, MAP_IDHASH, map, misc);
      if (code) {
! 	com_err(whoami, code, "walking id hash");
  	goto abort;
      }
  
--- 1328,1334 ----
      }
      code = WalkHashTable(cheader.idHash, MAP_IDHASH, map, misc);
      if (code) {
! 	afs_com_err(whoami, code, "walking id hash");
  	goto abort;
      }
  
***************
*** 1339,1345 ****
      misc->idRange = n - misc->minId + 1;
      misc->idmap = (afs_int32 *) malloc(misc->idRange * sizeof(afs_int32));
      if (!misc->idmap) {
! 	com_err(whoami, 0, "Unable to malloc space for max ids of %d",
  		misc->idRange);
  	code = -1;
  	goto abort;
--- 1340,1346 ----
      misc->idRange = n - misc->minId + 1;
      misc->idmap = (afs_int32 *) malloc(misc->idRange * sizeof(afs_int32));
      if (!misc->idmap) {
! 	afs_com_err(whoami, 0, "Unable to malloc space for max ids of %d",
  		misc->idRange);
  	code = -1;
  	goto abort;
***************
*** 1353,1359 ****
      }
      code = WalkChains(map, misc);
      if (code) {
! 	com_err(whoami, code, "walking chains");
  	goto abort;
      }
      if (misc->verbose) {
--- 1354,1360 ----
      }
      code = WalkChains(map, misc);
      if (code) {
! 	afs_com_err(whoami, code, "walking chains");
  	goto abort;
      }
      if (misc->verbose) {
***************
*** 1362,1368 ****
      }
      code = WalkNextChain(map, misc, 0, 0);
      if (code) {
! 	com_err(whoami, code, "walking free list");
  	goto abort;
      }
      if (misc->verbose) {
--- 1363,1369 ----
      }
      code = WalkNextChain(map, misc, 0, 0);
      if (code) {
! 	afs_com_err(whoami, code, "walking free list");
  	goto abort;
      }
      if (misc->verbose) {
***************
*** 1371,1377 ****
      }
      code = WalkOwnedChain(map, misc, 0, 0);
      if (code) {
! 	com_err(whoami, code, "walking orphan list");
  	goto abort;
      }
  
--- 1372,1378 ----
      }
      code = WalkOwnedChain(map, misc, 0, 0);
      if (code) {
! 	afs_com_err(whoami, code, "walking orphan list");
  	goto abort;
      }
  
***************
*** 1381,1387 ****
      }
      code = GC(map, misc);
      if (code) {
! 	com_err(whoami, code, "looking for unreferenced entries");
  	goto abort;
      }
  
--- 1382,1388 ----
      }
      code = GC(map, misc);
      if (code) {
! 	afs_com_err(whoami, code, "looking for unreferenced entries");
  	goto abort;
      }
  
***************
*** 1453,1459 ****
  
      fd = open(pr_dbaseName, O_RDONLY, 0);
      if (fd == -1) {
! 	com_err(whoami, errno, "Open failed on db %s", pr_dbaseName);
  	exit(2);
      }
  
--- 1454,1460 ----
  
      fd = open(pr_dbaseName, O_RDONLY, 0);
      if (fd == -1) {
! 	afs_com_err(whoami, errno, "Open failed on db %s", pr_dbaseName);
  	exit(2);
      }
  
***************
*** 1471,1477 ****
      if (recreateFile) {
  	misc.recreate = fopen(recreateFile, "w");
  	if (misc.recreate == 0) {
! 	    com_err(whoami, errno,
  		    "can't create file for recreation instructions: %s",
  		    recreateFile);
  	    exit(4);
--- 1472,1478 ----
      if (recreateFile) {
  	misc.recreate = fopen(recreateFile, "w");
  	if (misc.recreate == 0) {
! 	    afs_com_err(whoami, errno,
  		    "can't create file for recreation instructions: %s",
  		    recreateFile);
  	    exit(4);
***************
*** 1479,1485 ****
      }
      code = CheckPrDatabase(&misc);
      if (code) {
! 	com_err(whoami, code, "Checking prserver database");
  	exit(3);
      }
      exit(0);
--- 1480,1486 ----
      }
      code = CheckPrDatabase(&misc);
      if (code) {
! 	afs_com_err(whoami, code, "Checking prserver database");
  	exit(3);
      }
      exit(0);
Index: openafs/src/ptserver/pt_util.c
diff -c openafs/src/ptserver/pt_util.c:1.11 openafs/src/ptserver/pt_util.c:1.11.4.1
*** openafs/src/ptserver/pt_util.c:1.11	Fri Jul 15 15:16:27 2005
--- openafs/src/ptserver/pt_util.c	Tue Apr 10 14:39:54 2007
***************
*** 1,4 ****
! /* $Id: pt_util.c,v 1.11 2005/07/15 19:16:27 shadow Exp $ */
  
  /*
   *
--- 1,4 ----
! /* $Id: pt_util.c,v 1.11.4.1 2007/04/10 18:39:54 shadow Exp $ */
  
  /*
   *
***************
*** 23,29 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/pt_util.c,v 1.11 2005/07/15 19:16:27 shadow Exp $");
  
  #include <afs/cmd.h>		/*Command line parsing */
  #include <errno.h>
--- 23,29 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/pt_util.c,v 1.11.4.1 2007/04/10 18:39:54 shadow Exp $");
  
  #include <afs/cmd.h>		/*Command line parsing */
  #include <errno.h>
***************
*** 242,248 ****
  			    if (code)
  				fprintf(stderr,
  					"Error setting group count on %s: %s\n",
! 					name, error_message(code));
  			}
  			code = CreateEntry(0, u->name, &uid, 1 /*idflag */ ,
  					   1 /*gflag */ ,
--- 242,248 ----
  			    if (code)
  				fprintf(stderr,
  					"Error setting group count on %s: %s\n",
! 					name, afs_error_message(code));
  			}
  			code = CreateEntry(0, u->name, &uid, 1 /*idflag */ ,
  					   1 /*gflag */ ,
***************
*** 251,257 ****
  		    }
  		    if (code)
  			fprintf(stderr, "Error while creating %s: %s\n",
! 				u->name, error_message(code));
  		    continue;
  		}
  		/* Add user to group */
--- 251,257 ----
  		    }
  		    if (code)
  			fprintf(stderr, "Error while creating %s: %s\n",
! 				u->name, afs_error_message(code));
  		    continue;
  		}
  		/* Add user to group */
***************
*** 271,277 ****
  
  		if (code)
  		    fprintf(stderr, "Error while adding %s to %s: %s\n", mem,
! 			    name, error_message(code));
  	    } else {
  		sscanf(buffer, "%s %d/%d %d %d %d", name, &flags, &quota, &id,
  		       &oid, &cid);
--- 271,277 ----
  
  		if (code)
  		    fprintf(stderr, "Error while adding %s to %s: %s\n", mem,
! 			    name, afs_error_message(code));
  	    } else {
  		sscanf(buffer, "%s %d/%d %d %d %d", name, &flags, &quota, &id,
  		       &oid, &cid);
***************
*** 289,295 ****
  		    usr_head = u;
  		} else if (code) {
  		    fprintf(stderr, "Error while creating %s: %s\n", name,
! 			    error_message(code));
  		} else if ((flags & PRACCESS)
  			   || (flags & (PRGRP | PRQUOTA)) ==
  			   (PRGRP | PRQUOTA)) {
--- 289,295 ----
  		    usr_head = u;
  		} else if (code) {
  		    fprintf(stderr, "Error while creating %s: %s\n", name,
! 			    afs_error_message(code));
  		} else if ((flags & PRACCESS)
  			   || (flags & (PRGRP | PRQUOTA)) ==
  			   (PRGRP | PRQUOTA)) {
***************
*** 303,316 ****
  		    if (code)
  			fprintf(stderr,
  				"Error while setting flags on %s: %s\n", name,
! 				error_message(code));
  		}
  	    }
  	}
  	for (u = usr_head; u; u = u->next)
  	    if (u->uid)
  		fprintf(stderr, "Error while creating %s: %s\n", u->name,
! 			error_message(PRBADNAM));
      } else {
  	for (i = 0; i < HASHSIZE; i++) {
  	    upos = nflag ? ntohl(prh.nameHash[i]) : ntohl(prh.idHash[i]);
--- 303,316 ----
  		    if (code)
  			fprintf(stderr,
  				"Error while setting flags on %s: %s\n", name,
! 				afs_error_message(code));
  		}
  	    }
  	}
  	for (u = usr_head; u; u = u->next)
  	    if (u->uid)
  		fprintf(stderr, "Error while creating %s: %s\n", u->name,
! 			afs_error_message(PRBADNAM));
      } else {
  	for (i = 0; i < HASHSIZE; i++) {
  	    upos = nflag ? ntohl(prh.nameHash[i]) : ntohl(prh.idHash[i]);
Index: openafs/src/ptserver/ptclient.c
diff -c openafs/src/ptserver/ptclient.c:1.12.14.2 openafs/src/ptserver/ptclient.c:1.12.14.3
*** openafs/src/ptserver/ptclient.c:1.12.14.2	Tue Jul  4 02:28:25 2006
--- openafs/src/ptserver/ptclient.c	Tue Apr 10 14:39:54 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptclient.c,v 1.12.14.2 2006/07/04 06:28:25 jaltman Exp $");
  
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptclient.c,v 1.12.14.3 2007/04/10 18:39:54 shadow Exp $");
  
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
***************
*** 237,243 ****
  
      code = pr_Initialize(security, confdir, cell);
      if (code) {
! 	com_err(whoami, code, "Couldn't initialize protection library");
  	exit(1);
      }
  
--- 237,243 ----
  
      code = pr_Initialize(security, confdir, cell);
      if (code) {
! 	afs_com_err(whoami, code, "Couldn't initialize protection library");
  	exit(1);
      }
  
***************
*** 252,258 ****
  
  	code = GetString(op, sizeof(op));
  	if (code) {
! 	    com_err(whoami, PRBADARG,
  		    "error reading opcode in line '%s', got '%.*s'", line,
  		    sizeof(op), op);
  	    exit(1);
--- 252,258 ----
  
  	code = GetString(op, sizeof(op));
  	if (code) {
! 	    afs_com_err(whoami, PRBADARG,
  		    "error reading opcode in line '%s', got '%.*s'", line,
  		    sizeof(op), op);
  	    exit(1);
***************
*** 269,275 ****
  	    else
  		code = ubik_PR_INewEntry(pruclient, 0, name, id, oid);
  	    if (CodeOk(code))
! 		com_err(whoami, code, "on %s %s %d %d", op, name, id, oid);
  	} else if (!strcmp(op, "sf")) {
  	    afs_int32 mask, access, gq, uq;
  	    if (GetInt32(&id) || GetXInt32(&mask) || GetXInt32(&access)
--- 269,275 ----
  	    else
  		code = ubik_PR_INewEntry(pruclient, 0, name, id, oid);
  	    if (CodeOk(code))
! 		afs_com_err(whoami, code, "on %s %s %d %d", op, name, id, oid);
  	} else if (!strcmp(op, "sf")) {
  	    afs_int32 mask, access, gq, uq;
  	    if (GetInt32(&id) || GetXInt32(&mask) || GetXInt32(&access)
***************
*** 280,286 ****
  		    ubik_PR_SetFieldsEntry(pruclient, 0, id, mask,
  			      access, gq, uq, 0, 0);
  	    if (CodeOk(code))
! 		com_err(whoami, code, "on %s %d %x %x %d %d", op, id, mask,
  			access, gq, uq);
  	} else if (!strcmp(op, "ce")) {
  	    char newname[PR_MAXNAMELEN];
--- 280,286 ----
  		    ubik_PR_SetFieldsEntry(pruclient, 0, id, mask,
  			      access, gq, uq, 0, 0);
  	    if (CodeOk(code))
! 		afs_com_err(whoami, code, "on %s %d %x %x %d %d", op, id, mask,
  			access, gq, uq);
  	} else if (!strcmp(op, "ce")) {
  	    char newname[PR_MAXNAMELEN];
***************
*** 293,299 ****
  		    ubik_PR_ChangeEntry(pruclient, 0, id, newname, oid,
  			      newid);
  	    if (CodeOk(code))
! 		com_err(whoami, code, "on %s %d %s %d %d", op, id, newname,
  			oid, newid);
  	} else if (!strcmp(op, "wh")) {
  	    /* scanf("%d",&id); */
--- 293,299 ----
  		    ubik_PR_ChangeEntry(pruclient, 0, id, newname, oid,
  			      newid);
  	    if (CodeOk(code))
! 		afs_com_err(whoami, code, "on %s %d %s %d %d", op, id, newname,
  			oid, newid);
  	} else if (!strcmp(op, "wh")) {
  	    /* scanf("%d",&id); */
***************
*** 334,340 ****
  	    else
  		code = ubik_PR_AddToGroup(pruclient, 0, id, gid);
  	    if (CodeOk(code))
! 		com_err(whoami, code, "on %s %d %d", op, id, gid);
  	} else if (!strcmp(op, "iton")) {
  	    lid.idlist_val = (afs_int32 *) malloc(20 * sizeof(afs_int32));
  	    ptr = lid.idlist_val;
--- 334,340 ----
  	    else
  		code = ubik_PR_AddToGroup(pruclient, 0, id, gid);
  	    if (CodeOk(code))
! 		afs_com_err(whoami, code, "on %s %d %d", op, id, gid);
  	} else if (!strcmp(op, "iton")) {
  	    lid.idlist_val = (afs_int32 *) malloc(20 * sizeof(afs_int32));
  	    ptr = lid.idlist_val;
Index: openafs/src/ptserver/ptclient.h
diff -c openafs/src/ptserver/ptclient.h:1.4 openafs/src/ptserver/ptclient.h:1.4.14.1
*** openafs/src/ptserver/ptclient.h:1.4	Tue Jan 14 23:30:25 2003
--- openafs/src/ptserver/ptclient.h	Tue Apr 10 14:39:54 2007
***************
*** 46,49 ****
  extern int PR_ListSuperGroups();
  #endif
  
! #define pr_ErrorMsg error_message
--- 46,49 ----
  extern int PR_ListSuperGroups();
  #endif
  
! #define pr_ErrorMsg afs_error_message
Index: openafs/src/ptserver/pts.c
diff -c openafs/src/ptserver/pts.c:1.15 openafs/src/ptserver/pts.c:1.15.2.1
*** openafs/src/ptserver/pts.c:1.15	Mon Mar 13 18:15:44 2006
--- openafs/src/ptserver/pts.c	Tue Apr 10 14:39:54 2007
***************
*** 23,29 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/pts.c,v 1.15 2006/03/13 23:15:44 rees Exp $");
  
  #include <stdio.h>
  #include <string.h>
--- 23,29 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/pts.c,v 1.15.2.1 2007/04/10 18:39:54 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
***************
*** 46,51 ****
--- 46,52 ----
  #include "ptclient.h"
  #include "pterror.h"
  #include <afs/afsutil.h>
+ #include <afs/com_err.h>
  
  #undef FOREIGN
  
***************
*** 176,182 ****
  	code = pr_Initialize(sec, AFSDIR_CLIENT_ETC_DIRPATH, cell);
      }
      if (code) {
! 	com_err(whoami, code, "while initializing");
  	return code;
      }
      if (as->parms[19].items)
--- 177,183 ----
  	code = pr_Initialize(sec, AFSDIR_CLIENT_ETC_DIRPATH, cell);
      }
      if (code) {
! 	afs_com_err(whoami, code, "while initializing");
  	return code;
      }
      if (as->parms[19].items)
***************
*** 226,238 ****
  	if (idi) {
  	    code = util_GetInt32(idi->data, &id);
  	    if (code) {
! 		com_err(whoami, code, "because group id was: '%s'",
  			idi->data);
  		return code;
  	    }
  	    if (id >= 0) {
  		code = PRBADARG;
! 		com_err(whoami, code, "because group id %d was not negative",
  			id);
  		return code;
  	    }
--- 227,239 ----
  	if (idi) {
  	    code = util_GetInt32(idi->data, &id);
  	    if (code) {
! 		afs_com_err(whoami, code, "because group id was: '%s'",
  			idi->data);
  		return code;
  	    }
  	    if (id >= 0) {
  		code = PRBADARG;
! 		afs_com_err(whoami, code, "because group id %d was not negative",
  			id);
  		return code;
  	    }
***************
*** 249,261 ****
  	code = pr_CreateGroup(namei->data, owner, &id);
  	if (code) {
  	    if (owner || id)
! 		com_err(whoami, code,
  			"; unable to create group %s with id %d%s%s%s%s",
  			namei->data, id, owner ? " owned by '" : "",
  			owner ? owner : "", owner ? "'" : "",
  			(force ? " (ignored)" : ""));
  	    else
! 		com_err(whoami, code, "; unable to create group %s %s",
  			namei->data, (force ? "(ignored)" : ""));
  	    if (!force)
  		return code;
--- 250,262 ----
  	code = pr_CreateGroup(namei->data, owner, &id);
  	if (code) {
  	    if (owner || id)
! 		afs_com_err(whoami, code,
  			"; unable to create group %s with id %d%s%s%s%s",
  			namei->data, id, owner ? " owned by '" : "",
  			owner ? owner : "", owner ? "'" : "",
  			(force ? " (ignored)" : ""));
  	    else
! 		afs_com_err(whoami, code, "; unable to create group %s %s",
  			namei->data, (force ? "(ignored)" : ""));
  	    if (!force)
  		return code;
***************
*** 281,287 ****
  	if (idi) {
  	    code = util_GetInt32(idi->data, &id);
  	    if (code) {
! 		com_err(whoami, code, "because id was: '%s'", idi->data);
  		return code;
  	    }
  	    if (id == 0) {
--- 282,288 ----
  	if (idi) {
  	    code = util_GetInt32(idi->data, &id);
  	    if (code) {
! 		afs_com_err(whoami, code, "because id was: '%s'", idi->data);
  		return code;
  	    }
  	    if (id == 0) {
***************
*** 295,305 ****
  	code = pr_CreateUser(namei->data, &id);
  	if (code) {
  	    if (id)
! 		com_err(whoami, code,
  			"; unable to create user %s with id %d %s",
  			namei->data, id, (force ? "(ignored)" : ""));
  	    else
! 		com_err(whoami, code, "; unable to create user %s %s",
  			namei->data, (force ? "(ignored)" : ""));
  	    if (!force)
  		return code;
--- 296,306 ----
  	code = pr_CreateUser(namei->data, &id);
  	if (code) {
  	    if (id)
! 		afs_com_err(whoami, code,
  			"; unable to create user %s with id %d %s",
  			namei->data, id, (force ? "(ignored)" : ""));
  	    else
! 		afs_com_err(whoami, code, "; unable to create user %s %s",
  			namei->data, (force ? "(ignored)" : ""));
  	    if (!force)
  		return code;
***************
*** 321,331 ****
      int goodCount;
  
      if (!(as->parms[0].items || as->parms[1].items)) {
! 	com_err(whoami, 0, "must specify either a name or an id.");
  	return -1;
      }
      if (as->parms[0].items && as->parms[1].items) {
! 	com_err(whoami, 0, "can't specify both a name and id.");
  	return -1;
      }
  
--- 322,332 ----
      int goodCount;
  
      if (!(as->parms[0].items || as->parms[1].items)) {
! 	afs_com_err(whoami, 0, "must specify either a name or an id.");
  	return -1;
      }
      if (as->parms[0].items && as->parms[1].items) {
! 	afs_com_err(whoami, 0, "can't specify both a name and id.");
  	return -1;
      }
  
***************
*** 354,364 ****
  
  	code = pr_NameToId(nl, lids);
  	if (code)
! 	    com_err(whoami, code, "so couldn't look up names");
  	else {
  	    for (n = 0; n < lids->idlist_len; n++) {
  		if ((lids->idlist_val[n] == ANONYMOUSID)) {
! 		    com_err(whoami, PRNOENT, "so couldn't look up id for %s",
  			    nl->namelist_val[n]);
  		} else
  		    goodCount++;
--- 355,365 ----
  
  	code = pr_NameToId(nl, lids);
  	if (code)
! 	    afs_com_err(whoami, code, "so couldn't look up names");
  	else {
  	    for (n = 0; n < lids->idlist_len; n++) {
  		if ((lids->idlist_val[n] == ANONYMOUSID)) {
! 		    afs_com_err(whoami, PRNOENT, "so couldn't look up id for %s",
  			    nl->namelist_val[n]);
  		} else
  		    goodCount++;
***************
*** 380,386 ****
  	for (i = as->parms[1].items; i; i = i->next) {
  	    code = util_GetInt32(i->data, &lids->idlist_val[n]);
  	    if (code)
! 		com_err(whoami, code =
  			PRNOENT, "because a bogus id '%s' was specified",
  			i->data);
  	    n++;
--- 381,387 ----
  	for (i = as->parms[1].items; i; i = i->next) {
  	    code = util_GetInt32(i->data, &lids->idlist_val[n]);
  	    if (code)
! 		afs_com_err(whoami, code =
  			PRNOENT, "because a bogus id '%s' was specified",
  			i->data);
  	    n++;
***************
*** 390,396 ****
  	    lnames->namelist_len = 0;
  	    code = pr_IdToName(lids, lnames);
  	    if (code)
! 		com_err(whoami, code, "translating ids");
  	}
      }
      if (code) {
--- 391,397 ----
  	    lnames->namelist_len = 0;
  	    code = pr_IdToName(lids, lnames);
  	    if (code)
! 		afs_com_err(whoami, code, "translating ids");
  	}
      }
      if (code) {
***************
*** 447,457 ****
      tids.idlist_val = 0;
      code = pr_NameToId(&names, &tids);
      if (code)
! 	com_err(whoami, code, "so couldn't look up names");
      else {
  	for (n = 0; n < tids.idlist_len; n++) {
  	    if ((tids.idlist_val[n] == ANONYMOUSID)) {
! 		com_err(whoami, PRNOENT, "so couldn't look up id for %s",
  			names.namelist_val[n]);
  	    } else
  		goodCount++;
--- 448,458 ----
      tids.idlist_val = 0;
      code = pr_NameToId(&names, &tids);
      if (code)
! 	afs_com_err(whoami, code, "so couldn't look up names");
      else {
  	for (n = 0; n < tids.idlist_len; n++) {
  	    if ((tids.idlist_val[n] == ANONYMOUSID)) {
! 		afs_com_err(whoami, PRNOENT, "so couldn't look up id for %s",
  			names.namelist_val[n]);
  	    } else
  		goodCount++;
***************
*** 470,476 ****
  	tnames.namelist_len = 0;
  	code = pr_IdToName(&ids, &tnames);
  	if (code)
! 	    com_err(whoami, code, "translating ids");
  	else
  	    goodCount++;
  	if (lnames) {
--- 471,477 ----
  	tnames.namelist_len = 0;
  	code = pr_IdToName(&ids, &tnames);
  	if (code)
! 	    afs_com_err(whoami, code, "translating ids");
  	else
  	    goodCount++;
  	if (lnames) {
***************
*** 501,507 ****
  	for (g = as->parms[1].items; g; g = g->next) {
  	    code = pr_AddToGroup(u->data, g->data);
  	    if (code) {
! 		com_err(whoami, code,
  			"; unable to add user %s to group %s %s", u->data,
  			g->data, (force ? "(ignored)" : ""));
  		if (!force)
--- 502,508 ----
  	for (g = as->parms[1].items; g; g = g->next) {
  	    code = pr_AddToGroup(u->data, g->data);
  	    if (code) {
! 		afs_com_err(whoami, code,
  			"; unable to add user %s to group %s %s", u->data,
  			g->data, (force ? "(ignored)" : ""));
  		if (!force)
***************
*** 522,528 ****
  	for (g = as->parms[1].items; g; g = g->next) {
  	    code = pr_RemoveUserFromGroup(u->data, g->data);
  	    if (code) {
! 		com_err(whoami, code,
  			"; unable to remove user %s from group %s %s",
  			u->data, g->data, (force ? "(ignored)" : ""));
  		if (!force)
--- 523,529 ----
  	for (g = as->parms[1].items; g; g = g->next) {
  	    code = pr_RemoveUserFromGroup(u->data, g->data);
  	    if (code) {
! 		afs_com_err(whoami, code,
  			"; unable to remove user %s from group %s %s",
  			u->data, g->data, (force ? "(ignored)" : ""));
  		if (!force)
***************
*** 557,563 ****
  	list.namelist_len = 0;
  	code = pr_IDListMembers(ids.idlist_val[i], &list);
  	if (code) {
! 	    com_err(whoami, code, "; unable to get membership of %s (id: %d)",
  		    name, id);
  	    continue;
  	}
--- 558,564 ----
  	list.namelist_len = 0;
  	code = pr_IDListMembers(ids.idlist_val[i], &list);
  	if (code) {
! 	    afs_com_err(whoami, code, "; unable to get membership of %s (id: %d)",
  		    name, id);
  	    continue;
  	}
***************
*** 598,604 ****
  
  	code = pr_DeleteByID(id);
  	if (code) {
! 	    com_err(whoami, code, "deleting %s (id: %d) %s", name, id,
  		    (force ? "(ignored)" : ""));
  	    if (!force)
  		return code;
--- 599,605 ----
  
  	code = pr_DeleteByID(id);
  	if (code) {
! 	    afs_com_err(whoami, code, "deleting %s (id: %d) %s", name, id,
  		    (force ? "(ignored)" : ""));
  	    if (!force)
  		return code;
***************
*** 646,652 ****
  	code = pr_ListEntry(id, &aentry);
  	if (code) {
  	    rcode = code;
! 	    com_err(whoami, code, "; unable to find entry for (id: %d)", id);
  	    continue;
  	}
  
--- 647,653 ----
  	code = pr_ListEntry(id, &aentry);
  	if (code) {
  	    rcode = code;
! 	    afs_com_err(whoami, code, "; unable to find entry for (id: %d)", id);
  	    continue;
  	}
  
***************
*** 655,661 ****
  	code = pr_IdToName(&lids, &lnames);
  	if (code) {
  	    rcode = code;
! 	    com_err(whoami, code,
  		    "translating owner (%d) and creator (%d) ids",
  		    aentry.owner, aentry.creator);
  	    continue;
--- 656,662 ----
  	code = pr_IdToName(&lids, &lnames);
  	if (code) {
  	    rcode = code;
! 	    afs_com_err(whoami, code,
  		    "translating owner (%d) and creator (%d) ids",
  		    aentry.owner, aentry.creator);
  	    continue;
***************
*** 736,742 ****
  	    pr_ListEntries(flag, startindex, &nentries, &entriesp,
  			   &nextstartindex);
  	if (code) {
! 	    com_err(whoami, code, "; unable to list entries\n");
  	    if (entriesp)
  		free(entriesp);
  	    break;
--- 737,743 ----
  	    pr_ListEntries(flag, startindex, &nentries, &entriesp,
  			   &nextstartindex);
  	if (code) {
! 	    afs_com_err(whoami, code, "; unable to list entries\n");
  	    if (entriesp)
  		free(entriesp);
  	    break;
***************
*** 764,770 ****
      owner = as->parms[1].items->data;
      code = pr_ChangeEntry(name, "", 0, owner);
      if (code)
! 	com_err(whoami, code, "; unable to change owner of %s to %s", name,
  		owner);
      return code;
  }
--- 765,771 ----
      owner = as->parms[1].items->data;
      code = pr_ChangeEntry(name, "", 0, owner);
      if (code)
! 	afs_com_err(whoami, code, "; unable to change owner of %s to %s", name,
  		owner);
      return code;
  }
***************
*** 780,786 ****
      newname = as->parms[1].items->data;
      code = pr_ChangeEntry(oldname, newname, 0, "");
      if (code)
! 	com_err(whoami, code, "; unable to change name of %s to %s", oldname,
  		newname);
      return code;
  }
--- 781,787 ----
      newname = as->parms[1].items->data;
      code = pr_ChangeEntry(oldname, newname, 0, "");
      if (code)
! 	afs_com_err(whoami, code, "; unable to change name of %s to %s", oldname,
  		newname);
      return code;
  }
***************
*** 793,803 ****
  
      code = pr_ListMaxUserId(&maxUser);
      if (code)
! 	com_err(whoami, code, "getting maximum user id");
      else {
  	code = pr_ListMaxGroupId(&maxGroup);
  	if (code)
! 	    com_err(whoami, code, "getting maximum group id");
  	else {
  	    printf("Max user id is %d and max group id is %d.\n", maxUser,
  		   maxGroup);
--- 794,804 ----
  
      code = pr_ListMaxUserId(&maxUser);
      if (code)
! 	afs_com_err(whoami, code, "getting maximum user id");
      else {
  	code = pr_ListMaxGroupId(&maxGroup);
  	if (code)
! 	    afs_com_err(whoami, code, "getting maximum group id");
  	else {
  	    printf("Max user id is %d and max group id is %d.\n", maxUser,
  		   maxGroup);
***************
*** 817,828 ****
  	/* set user max */
  	code = util_GetInt32(as->parms[1].items->data, &maxid);
  	if (code) {
! 	    com_err(whoami, code, "because id was: '%s'",
  		    as->parms[1].items->data);
  	} else {
  	    code = pr_SetMaxUserId(maxid);
  	    if (code)
! 		com_err(whoami, code, "so couldn't set Max User Id to %d",
  			maxid);
  	}
      }
--- 818,829 ----
  	/* set user max */
  	code = util_GetInt32(as->parms[1].items->data, &maxid);
  	if (code) {
! 	    afs_com_err(whoami, code, "because id was: '%s'",
  		    as->parms[1].items->data);
  	} else {
  	    code = pr_SetMaxUserId(maxid);
  	    if (code)
! 		afs_com_err(whoami, code, "so couldn't set Max User Id to %d",
  			maxid);
  	}
      }
***************
*** 830,841 ****
  	/* set group max */
  	code = util_GetInt32(as->parms[0].items->data, &maxid);
  	if (code) {
! 	    com_err(whoami, code, "because id was: '%s'",
  		    as->parms[0].items->data);
  	} else {
  	    code = pr_SetMaxGroupId(maxid);
  	    if (code)
! 		com_err(whoami, code, "so couldn't set Max Group Id to %d",
  			maxid);
  	}
      }
--- 831,842 ----
  	/* set group max */
  	code = util_GetInt32(as->parms[0].items->data, &maxid);
  	if (code) {
! 	    afs_com_err(whoami, code, "because id was: '%s'",
  		    as->parms[0].items->data);
  	} else {
  	    code = pr_SetMaxGroupId(maxid);
  	    if (code)
! 		afs_com_err(whoami, code, "so couldn't set Max Group Id to %d",
  			maxid);
  	}
      }
***************
*** 904,910 ****
      if (as->parms[2].items) {	/* limitgroups */
  	code = util_GetInt32(as->parms[2].items->data, &ngroups);
  	if (code) {
! 	    com_err(whoami, code, "because ngroups was: '%s'",
  		    as->parms[2].items->data);
  	    return code;
  	}
--- 905,911 ----
      if (as->parms[2].items) {	/* limitgroups */
  	code = util_GetInt32(as->parms[2].items->data, &ngroups);
  	if (code) {
! 	    afs_com_err(whoami, code, "because ngroups was: '%s'",
  		    as->parms[2].items->data);
  	    return code;
  	}
***************
*** 914,920 ****
      if (as->parms[3].items) {	/* limitgroups */
  	code = util_GetInt32(as->parms[3].items->data, &nusers);
  	if (code) {
! 	    com_err(whoami, code, "because nusers was: '%s'",
  		    as->parms[3].items->data);
  	    return code;
  	}
--- 915,921 ----
      if (as->parms[3].items) {	/* limitgroups */
  	code = util_GetInt32(as->parms[3].items->data, &nusers);
  	if (code) {
! 	    afs_com_err(whoami, code, "because nusers was: '%s'",
  		    as->parms[3].items->data);
  	    return code;
  	}
***************
*** 929,935 ****
  	    continue;
  	code = pr_SetFieldsEntry(id, mask, flags, ngroups, nusers);
  	if (code) {
! 	    com_err(whoami, code, "; unable to set fields for %s (id: %d)",
  		    name, id);
  	    return code;
  	}
--- 930,936 ----
  	    continue;
  	code = pr_SetFieldsEntry(id, mask, flags, ngroups, nusers);
  	if (code) {
! 	    afs_com_err(whoami, code, "; unable to set fields for %s (id: %d)",
  		    name, id);
  	    return code;
  	}
***************
*** 971,977 ****
  	    list.namelist_len = 0;
  	    code = pr_ListOwned(oid, &list, &more);
  	    if (code) {
! 		com_err(whoami, code,
  			"; unable to get owner list for %s (id: %d)", name,
  			oid);
  		break;
--- 972,978 ----
  	    list.namelist_len = 0;
  	    code = pr_ListOwned(oid, &list, &more);
  	    if (code) {
! 		afs_com_err(whoami, code,
  			"; unable to get owner list for %s (id: %d)", name,
  			oid);
  		break;
***************
*** 1188,1194 ****
  	    cmd_ParseLine(line, parsev, &parsec,
  			  sizeof(parsev) / sizeof(*parsev));
  	if (code) {
! 	    com_err(whoami, code, "parsing line: <%s>", line);
  	    exit(2);
  	}
  	savec = parsev[0];
--- 1189,1195 ----
  	    cmd_ParseLine(line, parsev, &parsec,
  			  sizeof(parsev) / sizeof(*parsev));
  	if (code) {
! 	    afs_com_err(whoami, code, "parsing line: <%s>", line);
  	    exit(2);
  	}
  	savec = parsev[0];
Index: openafs/src/ptserver/ptserver.c
diff -c openafs/src/ptserver/ptserver.c:1.25.2.3 openafs/src/ptserver/ptserver.c:1.25.2.4
*** openafs/src/ptserver/ptserver.c:1.25.2.3	Tue Jun 20 16:37:11 2006
--- openafs/src/ptserver/ptserver.c	Tue Apr 10 14:39:54 2007
***************
*** 112,118 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptserver.c,v 1.25.2.3 2006/06/20 20:37:11 jaltman Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
--- 112,118 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptserver.c,v 1.25.2.4 2007/04/10 18:39:54 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 148,153 ****
--- 148,154 ----
  #include "error_macros.h"
  #include "afs/audit.h"
  #include <afs/afsutil.h>
+ #include <afs/com_err.h>
  
  
  /* make	all of these into a structure if you want */
***************
*** 459,465 ****
      code =
  	afsconf_GetExtendedCellInfo(prdir, NULL, "afsprot", &info, &clones);
      if (code) {
! 	com_err(whoami, code, "Couldn't get server list");
  	PT_EXIT(2);
      }
      pr_realmName = info.name;
--- 460,466 ----
      code =
  	afsconf_GetExtendedCellInfo(prdir, NULL, "afsprot", &info, &clones);
      if (code) {
! 	afs_com_err(whoami, code, "Couldn't get server list");
  	PT_EXIT(2);
      }
      pr_realmName = info.name;
***************
*** 469,475 ****
      /* get keys */
      code = afsconf_GetKey(prdir, 999, &tkey);
      if (code) {
! 	com_err(whoami, code,
  		"couldn't get bcrypt keys from key file, ignoring.");
      }
  #endif
--- 470,476 ----
      /* get keys */
      code = afsconf_GetKey(prdir, 999, &tkey);
      if (code) {
! 	afs_com_err(whoami, code,
  		"couldn't get bcrypt keys from key file, ignoring.");
      }
  #endif
***************
*** 527,533 ****
  	ubik_ServerInitByInfo(myHost, htons(AFSCONF_PROTPORT), &info, &clones,
  			      pr_dbaseName, &dbase);
      if (code) {
! 	com_err(whoami, code, "Ubik init failed");
  	PT_EXIT(2);
      }
  #if defined(SUPERGROUPS)
--- 528,534 ----
  	ubik_ServerInitByInfo(myHost, htons(AFSCONF_PROTPORT), &info, &clones,
  			      pr_dbaseName, &dbase);
      if (code) {
! 	afs_com_err(whoami, code, "Ubik init failed");
  	PT_EXIT(2);
      }
  #if defined(SUPERGROUPS)
Index: openafs/src/ptserver/ptuser.c
diff -c openafs/src/ptserver/ptuser.c:1.25.2.9 openafs/src/ptserver/ptuser.c:1.25.2.10
*** openafs/src/ptserver/ptuser.c:1.25.2.9	Thu Feb  8 20:00:21 2007
--- openafs/src/ptserver/ptuser.c	Tue Apr 10 14:39:54 2007
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptuser.c,v 1.25.2.9 2007/02/09 01:00:21 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptuser.c,v 1.25.2.10 2007/04/10 18:39:54 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 52,57 ****
--- 52,58 ----
  #include <afs/auth.h>
  #include <afs/cellconfig.h>
  #include <afs/afsutil.h>
+ #include <afs/com_err.h>
  #include "ptclient.h"
  #include "ptuser.h"
  #include "pterror.h"
***************
*** 185,191 ****
  	if (code)
  	    fprintf(stderr,
  		    "libprot: clientauthsecure returns %d %s"
! 		    " (so trying noauth)\n", code, error_message(code));
  	if (code)
  	    scIndex = 0;	/* use noauth */
  	if (scIndex != 2)
--- 186,192 ----
  	if (code)
  	    fprintf(stderr,
  		    "libprot: clientauthsecure returns %d %s"
! 		    " (so trying noauth)\n", code, afs_error_message(code));
  	if (code)
  	    scIndex = 0;	/* use noauth */
  	if (scIndex != 2)
***************
*** 221,227 ****
      if ((scIndex == 0) && (sc[0] == 0))
  	sc[0] = rxnull_NewClientSecurityObject();
      if ((scIndex == 0) && (secLevel != 0))
! 	com_err(whoami, code,
  		"Could not get afs tokens, running unauthenticated.");
  
      memset(serverconns, 0, sizeof(serverconns));	/* terminate list!!! */
--- 222,228 ----
      if ((scIndex == 0) && (sc[0] == 0))
  	sc[0] = rxnull_NewClientSecurityObject();
      if ((scIndex == 0) && (secLevel != 0))
! 	afs_com_err(whoami, code,
  		"Could not get afs tokens, running unauthenticated.");
  
      memset(serverconns, 0, sizeof(serverconns));	/* terminate list!!! */
***************
*** 233,239 ****
  
      code = ubik_ClientInit(serverconns, &pruclient);
      if (code) {
! 	com_err(whoami, code, "ubik client init failed.");
  	return code;
      }
      lastLevel = scIndex;
--- 234,240 ----
  
      code = ubik_ClientInit(serverconns, &pruclient);
      if (code) {
! 	afs_com_err(whoami, code, "ubik client init failed.");
  	return code;
      }
      lastLevel = scIndex;
Index: openafs/src/ptserver/ptutils.c
diff -c openafs/src/ptserver/ptutils.c:1.19 openafs/src/ptserver/ptutils.c:1.19.6.1
*** openafs/src/ptserver/ptutils.c:1.19	Fri Apr 15 15:39:34 2005
--- openafs/src/ptserver/ptutils.c	Tue Apr 10 14:39:54 2007
***************
*** 24,30 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptutils.c,v 1.19 2005/04/15 19:39:34 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 24,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptutils.c,v 1.19.6.1 2007/04/10 18:39:54 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 1697,1703 ****
  
      code = pr_Read(tt, 0, 0, (char *)&cheader, sizeof(cheader));
      if (code != 0) {
! 	com_err(whoami, code, "Couldn't read header");
      }
      return code;
  }
--- 1697,1703 ----
  
      code = pr_Read(tt, 0, 0, (char *)&cheader, sizeof(cheader));
      if (code != 0) {
! 	afs_com_err(whoami, code, "Couldn't read header");
      }
      return code;
  }
***************
*** 1735,1741 ****
      len = sizeof(cheader);
      code = pr_Read(tt, 0, 0, (char *)&cheader, len);
      if (code != 0) {
! 	com_err(whoami, code, "couldn't read header");
  	ubik_AbortTrans(tt);
  	return code;
      }
--- 1735,1741 ----
      len = sizeof(cheader);
      code = pr_Read(tt, 0, 0, (char *)&cheader, len);
      if (code != 0) {
! 	afs_com_err(whoami, code, "couldn't read header");
  	ubik_AbortTrans(tt);
  	return code;
      }
***************
*** 1762,1775 ****
  	for (i = 0; i < sizeof(cheader); i++)
  	    if (bp[i]) {
  		code = PRDBBAD;
! 		com_err(whoami, code,
  			"Can't rebuild database because it is not empty");
  		return code;
  	    }
      }
      if (!pr_noAuth) {
  	code = PRDBBAD;
! 	com_err(whoami, code,
  		"Can't rebuild database because not running NoAuth");
  	return code;
      }
--- 1762,1775 ----
  	for (i = 0; i < sizeof(cheader); i++)
  	    if (bp[i]) {
  		code = PRDBBAD;
! 		afs_com_err(whoami, code,
  			"Can't rebuild database because it is not empty");
  		return code;
  	    }
      }
      if (!pr_noAuth) {
  	code = PRDBBAD;
! 	afs_com_err(whoami, code,
  		"Can't rebuild database because not running NoAuth");
  	return code;
      }
***************
*** 1804,1810 ****
      if ((code = set_header_word(tt, version, htonl(PRDBVERSION)))
  	|| (code = set_header_word(tt, headerSize, htonl(sizeof(cheader))))
  	|| (code = set_header_word(tt, eofPtr, cheader.headerSize))) {
! 	com_err(whoami, code, "couldn't write header words");
  	ubik_AbortTrans(tt);
  	return code;
      }
--- 1804,1810 ----
      if ((code = set_header_word(tt, version, htonl(PRDBVERSION)))
  	|| (code = set_header_word(tt, headerSize, htonl(sizeof(cheader))))
  	|| (code = set_header_word(tt, eofPtr, cheader.headerSize))) {
! 	afs_com_err(whoami, code, "couldn't write header words");
  	ubik_AbortTrans(tt);
  	return code;
      }
***************
*** 1814,1820 ****
      code = CreateEntry		      \
  	(tt, (name), &temp, /*idflag*/1, flag, SYSADMINID, SYSADMINID); \
      if (code) {			      \
! 	com_err (whoami, code, "couldn't create %s with id %di.", 	\
  		 (name), (id));	      \
  	ubik_AbortTrans(tt);	      \
  	return code;		      \
--- 1814,1820 ----
      code = CreateEntry		      \
  	(tt, (name), &temp, /*idflag*/1, flag, SYSADMINID, SYSADMINID); \
      if (code) {			      \
! 	afs_com_err (whoami, code, "couldn't create %s with id %di.", 	\
  		 (name), (id));	      \
  	ubik_AbortTrans(tt);	      \
  	return code;		      \
***************
*** 1832,1838 ****
       * it back to 0 */
      code = set_header_word(tt, maxID, 0);	/* correct in any byte order */
      if (code) {
! 	com_err(whoami, code, "couldn't reset max id");
  	ubik_AbortTrans(tt);
  	return code;
      }
--- 1832,1838 ----
       * it back to 0 */
      code = set_header_word(tt, maxID, 0);	/* correct in any byte order */
      if (code) {
! 	afs_com_err(whoami, code, "couldn't reset max id");
  	ubik_AbortTrans(tt);
  	return code;
      }
Index: openafs/src/ptserver/readgroup.c
diff -c openafs/src/ptserver/readgroup.c:1.10 openafs/src/ptserver/readgroup.c:1.10.14.1
*** openafs/src/ptserver/readgroup.c:1.10	Wed Jun 23 10:27:42 2004
--- openafs/src/ptserver/readgroup.c	Tue Apr 10 14:39:54 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/readgroup.c,v 1.10 2004/06/23 14:27:42 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/readgroup.c,v 1.10.14.1 2007/04/10 18:39:54 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
***************
*** 29,34 ****
--- 29,35 ----
  #include <rx/xdr.h>
  #include <afs/cellconfig.h>
  #include <afs/afsutil.h>
+ #include <afs/com_err.h>
  #include "ptclient.h"
  #include "pterror.h"
  
Index: openafs/src/ptserver/readpwd.c
diff -c openafs/src/ptserver/readpwd.c:1.9 openafs/src/ptserver/readpwd.c:1.9.14.1
*** openafs/src/ptserver/readpwd.c:1.9	Wed Jun 23 10:27:42 2004
--- openafs/src/ptserver/readpwd.c	Tue Apr 10 14:39:54 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/readpwd.c,v 1.9 2004/06/23 14:27:42 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/readpwd.c,v 1.9.14.1 2007/04/10 18:39:54 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
***************
*** 28,33 ****
--- 28,34 ----
  #include <rx/xdr.h>
  #include <afs/cellconfig.h>
  #include <afs/afsutil.h>
+ #include <afs/com_err.h>
  #include "ptclient.h"
  
  int
Index: openafs/src/ptserver/testpt.c
diff -c openafs/src/ptserver/testpt.c:1.14 openafs/src/ptserver/testpt.c:1.14.14.1
*** openafs/src/ptserver/testpt.c:1.14	Wed Jun 23 10:27:42 2004
--- openafs/src/ptserver/testpt.c	Tue Apr 10 14:39:54 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/testpt.c,v 1.14 2004/06/23 14:27:42 shadow Exp $");
  
  #include <ctype.h>
  #include <errno.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/testpt.c,v 1.14.14.1 2007/04/10 18:39:54 shadow Exp $");
  
  #include <ctype.h>
  #include <errno.h>
***************
*** 49,54 ****
--- 49,55 ----
  #include "ptclient.h"
  #include "pterror.h"
  #include <afs/afsutil.h>
+ #include <afs/com_err.h>
  
  static char *whoami = "testpr";
  static struct afsconf_dir *conf;	/* cell info, set by MyBeforeProc */
***************
*** 78,84 ****
  
      code = pr_Initialize(1, conf_dir, NULL);
      if (code) {
! 	com_err(whoami, code, "initializing pruser");
  	exit(1);
      }
      if (startId < 0) {
--- 79,85 ----
  
      code = pr_Initialize(1, conf_dir, NULL);
      if (code) {
! 	afs_com_err(whoami, code, "initializing pruser");
  	exit(1);
      }
      if (startId < 0) {
***************
*** 86,92 ****
  	code = pr_ListMaxGroupId(&maxId);
  	if (code) {
  	  bad_max:
! 	    com_err(whoami, code, "getting maximum id");
  	    exit(2);
  	}
  	if (startId < maxId) {
--- 87,93 ----
  	code = pr_ListMaxGroupId(&maxId);
  	if (code) {
  	  bad_max:
! 	    afs_com_err(whoami, code, "getting maximum id");
  	    exit(2);
  	}
  	if (startId < maxId) {
***************
*** 132,138 ****
  	lids.idlist_len = i;
  	code = pr_IdToName(&lids, &lnames);
  	if (code) {
! 	    com_err(whoami, code, "converting id to name");
  	    exit(2);
  	}
  	for (j = 0; j < lnames.namelist_len; j++) {
--- 133,139 ----
  	lids.idlist_len = i;
  	code = pr_IdToName(&lids, &lnames);
  	if (code) {
! 	    afs_com_err(whoami, code, "converting id to name");
  	    exit(2);
  	}
  	for (j = 0; j < lnames.namelist_len; j++) {
***************
*** 255,261 ****
  		}
  	    }
  	}
! 	com_err(whoami, code, "couldn't create %s", name);
  	exit(12);
      }
    done:
--- 256,262 ----
  		}
  	    }
  	}
! 	afs_com_err(whoami, code, "couldn't create %s", name);
  	exit(12);
      }
    done:
***************
*** 323,329 ****
  		}
  	    }
  	}
! 	com_err(whoami, code, "couldn't create %s w/ owner=%d", name, owner);
  	exit(13);
      }
    done:
--- 324,330 ----
  		}
  	    }
  	}
! 	afs_com_err(whoami, code, "couldn't create %s w/ owner=%d", name, owner);
  	exit(13);
      }
    done:
***************
*** 352,358 ****
  	if (id = list[m]) {
  	    code = ubik_Call(PR_Delete, pruclient, 0, id);
  	    if (code) {
! 		com_err(whoami, code, "Couldn't delete %di", id);
  		exit(22);
  	    }
  	    list[m] = 0;
--- 353,359 ----
  	if (id = list[m]) {
  	    code = ubik_Call(PR_Delete, pruclient, 0, id);
  	    if (code) {
! 		afs_com_err(whoami, code, "Couldn't delete %di", id);
  		exit(22);
  	    }
  	    list[m] = 0;
***************
*** 380,386 ****
      gi = groups[g];
      code = ubik_Call(PR_AddToGroup, pruclient, 0, ui, gi);
      if (code) {
! 	com_err(whoami, code, "couldn't add %d to %d", ui, gi);
  	exit(14);
      }
      if (verbose)
--- 381,387 ----
      gi = groups[g];
      code = ubik_Call(PR_AddToGroup, pruclient, 0, ui, gi);
      if (code) {
! 	afs_com_err(whoami, code, "couldn't add %d to %d", ui, gi);
  	exit(14);
      }
      if (verbose)
***************
*** 399,405 ****
      gi = groups[g];
      code = ubik_Call(PR_RemoveFromGroup, pruclient, 0, ui, gi);
      if (code) {
! 	com_err(whoami, code, "couldn't remove %d from %d", ui, gi);
  	exit(14);
      }
      if (verbose)
--- 400,406 ----
      gi = groups[g];
      code = ubik_Call(PR_RemoveFromGroup, pruclient, 0, ui, gi);
      if (code) {
! 	afs_com_err(whoami, code, "couldn't remove %d from %d", ui, gi);
  	exit(14);
      }
      if (verbose)
***************
*** 424,430 ****
  
      code = pr_Initialize(1, conf_dir, NULL);
      if (code) {
! 	com_err(whoami, code, "initializing pruser");
  	exit(1);
      }
      /* get name of person running command */
--- 425,431 ----
  
      code = pr_Initialize(1, conf_dir, NULL);
      if (code) {
! 	afs_com_err(whoami, code, "initializing pruser");
  	exit(1);
      }
      /* get name of person running command */
***************
*** 439,445 ****
  	    exit(2);
  	code = ktc_GetToken(&afs, &token, sizeof(token), &user);
  	if (code) {
! 	    com_err(whoami, code, "getting afs tokens");
  	    exit(3);
  	}
  	if (strlen(user.instance) > 0) {
--- 440,446 ----
  	    exit(2);
  	code = ktc_GetToken(&afs, &token, sizeof(token), &user);
  	if (code) {
! 	    afs_com_err(whoami, code, "getting afs tokens");
  	    exit(3);
  	}
  	if (strlen(user.instance) > 0) {
***************
*** 451,457 ****
  	    callerId = atoi(user.name + 7);
  	    code = pr_SIdToName(callerId, callerName);
  	    if (code) {
! 		com_err(whoami, code, "call get name for id %d", callerId);
  		exit(6);
  	    }
  	} else {
--- 452,458 ----
  	    callerId = atoi(user.name + 7);
  	    code = pr_SIdToName(callerId, callerName);
  	    if (code) {
! 		afs_com_err(whoami, code, "call get name for id %d", callerId);
  		exit(6);
  	    }
  	} else {
***************
*** 465,471 ****
  	    callerId = 0;
  	    code = pr_CreateUser(callerName, &callerId);
  	    if (code) {
! 		com_err(whoami, code, "can't create caller %s", callerName);
  		exit(5);
  	    }
  	    printf("Creating caller %s (%di)\n", callerName, callerId);
--- 466,472 ----
  	    callerId = 0;
  	    code = pr_CreateUser(callerName, &callerId);
  	    if (code) {
! 		afs_com_err(whoami, code, "can't create caller %s", callerName);
  		exit(5);
  	    }
  	    printf("Creating caller %s (%di)\n", callerName, callerId);
***************
*** 473,479 ****
  	/* else */
  #endif
  	if (code) {
! 	    com_err(whoami, code, "can't find caller %s", callerName);
  	    exit(6);
  	} else
  	    printf("Assuming caller is %s (%di)\n", callerName, callerId);
--- 474,480 ----
  	/* else */
  #endif
  	if (code) {
! 	    afs_com_err(whoami, code, "can't find caller %s", callerName);
  	    exit(6);
  	} else
  	    printf("Assuming caller is %s (%di)\n", callerName, callerId);
***************
*** 599,605 ****
  		proc = PR_GetCPS;
  	    code = ubik_Call(proc, pruclient, 0, ui, &alist, &over);
  	    if (code) {
! 		com_err(whoami, code,
  			"getting membership list of (%di) using %s", ui,
  			((proc == PR_GetCPS) ? "GetCPR" : "ListElements"));
  		exit(24);
--- 600,606 ----
  		proc = PR_GetCPS;
  	    code = ubik_Call(proc, pruclient, 0, ui, &alist, &over);
  	    if (code) {
! 		afs_com_err(whoami, code,
  			"getting membership list of (%di) using %s", ui,
  			((proc == PR_GetCPS) ? "GetCPR" : "ListElements"));
  		exit(24);
***************
*** 657,663 ****
    (xlist).prlist_val = 0; (xlist).prlist_len = 0; \
    code = ubik_Call (PR_ListOwned, pruclient, 0, (xid), &(xlist), &over); \
    if (code) { \
!       com_err (whoami, code, "getting owner list of (%di)", (xid)); \
        exit (23); } \
    if (over) \
        { fprintf (stderr, "membership of id %di too long\n", (xid)); }
--- 658,664 ----
    (xlist).prlist_val = 0; (xlist).prlist_len = 0; \
    code = ubik_Call (PR_ListOwned, pruclient, 0, (xid), &(xlist), &over); \
    if (code) { \
!       afs_com_err (whoami, code, "getting owner list of (%di)", (xid)); \
        exit (23); } \
    if (over) \
        { fprintf (stderr, "membership of id %di too long\n", (xid)); }
***************
*** 778,784 ****
  
      code = pr_Initialize(1, conf_dir, NULL);
      if (code) {
! 	com_err(whoami, code, "initializing pruser");
  	exit(1);
      }
  
--- 779,785 ----
  
      code = pr_Initialize(1, conf_dir, NULL);
      if (code) {
! 	afs_com_err(whoami, code, "initializing pruser");
  	exit(1);
      }
  
***************
*** 789,795 ****
      id = 0;
      code = pr_CreateUser(name, &id);
      if ((code != RXGEN_CC_MARSHAL) && (code != PRBADNAM)) {
! 	com_err(whoami, code, "succeeded creating %s", name);
  	exit(2);
      }
      name[i] = 0;
--- 790,796 ----
      id = 0;
      code = pr_CreateUser(name, &id);
      if ((code != RXGEN_CC_MARSHAL) && (code != PRBADNAM)) {
! 	afs_com_err(whoami, code, "succeeded creating %s", name);
  	exit(2);
      }
      name[i] = 0;
***************
*** 799,815 ****
  	fprintf(stderr, "group already exists, skipping\n");
  	pr_SNameToId(name, &id);
      } else if (code) {
! 	com_err(whoami, code, "failed creating %s", name);
  	exit(3);
      }
      if ((code = pr_ListEntry(id, &ent))
  	|| (code = pr_SIdToName(ent.creator, creator))) {
! 	com_err(whoami, code, "getting creator's name");
  	exit(5);
      }
      code = pr_DeleteByID(id);
      if (code) {
! 	com_err(whoami, code, "deleting %s", name);
  	exit(6);
      }
      /* now make sure the illegal chars are detected */
--- 800,816 ----
  	fprintf(stderr, "group already exists, skipping\n");
  	pr_SNameToId(name, &id);
      } else if (code) {
! 	afs_com_err(whoami, code, "failed creating %s", name);
  	exit(3);
      }
      if ((code = pr_ListEntry(id, &ent))
  	|| (code = pr_SIdToName(ent.creator, creator))) {
! 	afs_com_err(whoami, code, "getting creator's name");
  	exit(5);
      }
      code = pr_DeleteByID(id);
      if (code) {
! 	afs_com_err(whoami, code, "deleting %s", name);
  	exit(6);
      }
      /* now make sure the illegal chars are detected */
***************
*** 820,826 ****
  	    id = 0;
  	    code = pr_CreateUser(name, &id);
  	    if (code != PRBADNAM) {
! 		com_err(whoami, code, "succeeded creating %s", name);
  		exit(8);
  	    }
  	}
--- 821,827 ----
  	    id = 0;
  	    code = pr_CreateUser(name, &id);
  	    if (code != PRBADNAM) {
! 		afs_com_err(whoami, code, "succeeded creating %s", name);
  		exit(8);
  	    }
  	}
***************
*** 842,853 ****
  	} else if (code) {
  	    char ascii[BUFSIZ];
  	    ka_ConvertBytes(ascii, sizeof(ascii), name, strlen(name));
! 	    com_err(whoami, code, "failed creating %s", ascii);
  	    exit(4);
  	}
  	code = pr_DeleteByID(id);
  	if (code) {
! 	    com_err(whoami, code, "deleting %s", name);
  	    exit(7);
  	}
      }
--- 843,854 ----
  	} else if (code) {
  	    char ascii[BUFSIZ];
  	    ka_ConvertBytes(ascii, sizeof(ascii), name, strlen(name));
! 	    afs_com_err(whoami, code, "failed creating %s", ascii);
  	    exit(4);
  	}
  	code = pr_DeleteByID(id);
  	if (code) {
! 	    afs_com_err(whoami, code, "deleting %s", name);
  	    exit(7);
  	}
      }
***************
*** 859,865 ****
      id = 0;
      code = pr_CreateGroup(name, &id);
      if (code != PRNOENT) {	/* owner doesn't exist */
! 	com_err(whoami, code, "succeeded creating %s", name);
  	exit(9);
      }
      name[0] = creator[0];	/* fix owner */
--- 860,866 ----
      id = 0;
      code = pr_CreateGroup(name, &id);
      if (code != PRNOENT) {	/* owner doesn't exist */
! 	afs_com_err(whoami, code, "succeeded creating %s", name);
  	exit(9);
      }
      name[0] = creator[0];	/* fix owner */
***************
*** 871,877 ****
  	    id = 0;
  	    code = pr_CreateGroup(name, creator, &id);
  	    if (code != PRBADNAM) {
! 		com_err(whoami, code, "succeeded creating %s", name);
  		exit(10);
  	    }
  	}
--- 872,878 ----
  	    id = 0;
  	    code = pr_CreateGroup(name, creator, &id);
  	    if (code != PRBADNAM) {
! 		afs_com_err(whoami, code, "succeeded creating %s", name);
  		exit(10);
  	    }
  	}
***************
*** 892,903 ****
  	} else if (code) {
  	    char ascii[BUFSIZ];
  	    ka_ConvertBytes(ascii, sizeof(ascii), name, strlen(name));
! 	    com_err(whoami, code, "failed creating %s", ascii);
  	    exit(4);
  	}
  	code = pr_DeleteByID(id);
  	if (code) {
! 	    com_err(whoami, code, "deleting %s", name);
  	    exit(7);
  	}
      }
--- 893,904 ----
  	} else if (code) {
  	    char ascii[BUFSIZ];
  	    ka_ConvertBytes(ascii, sizeof(ascii), name, strlen(name));
! 	    afs_com_err(whoami, code, "failed creating %s", ascii);
  	    exit(4);
  	}
  	code = pr_DeleteByID(id);
  	if (code) {
! 	    afs_com_err(whoami, code, "deleting %s", name);
  	    exit(7);
  	}
      }
***************
*** 1003,1009 ****
  		(unsigned long)getpid());
  	code = mkdir(tmp_conf_dir, 0777);
  	if ((code < 0) && (errno != EEXIST)) {
! 	    com_err(whoami, errno, "can't create temporary afsconf dir: %s",
  		    cdir);
  	    return errno;
  	}
--- 1004,1010 ----
  		(unsigned long)getpid());
  	code = mkdir(tmp_conf_dir, 0777);
  	if ((code < 0) && (errno != EEXIST)) {
! 	    afs_com_err(whoami, errno, "can't create temporary afsconf dir: %s",
  		    cdir);
  	    return errno;
  	}
***************
*** 1013,1019 ****
  	f = fopen(tmp_conf_file, "w");
  	if (f == 0) {
  	  cantcreate:
! 	    com_err(whoami, errno, "can't create conf file %s",
  		    tmp_conf_file);
  	    return errno;
  	}
--- 1014,1020 ----
  	f = fopen(tmp_conf_file, "w");
  	if (f == 0) {
  	  cantcreate:
! 	    afs_com_err(whoami, errno, "can't create conf file %s",
  		    tmp_conf_file);
  	    return errno;
  	}
***************
*** 1026,1032 ****
  	}
  	if (fclose(f) == EOF) {
  	  cantclose:
! 	    com_err(whoami, errno, "can't write to conf file %s",
  		    tmp_conf_file);
  	    return errno;
  	}
--- 1027,1033 ----
  	}
  	if (fclose(f) == EOF) {
  	  cantclose:
! 	    afs_com_err(whoami, errno, "can't write to conf file %s",
  		    tmp_conf_file);
  	    return errno;
  	}
***************
*** 1135,1140 ****
  
      code = cmd_Dispatch(argc, argv);
      if (code)
! 	com_err(whoami, code, "calling cmd_Dispatch");
      exit(code);
  }
--- 1136,1141 ----
  
      code = cmd_Dispatch(argc, argv);
      if (code)
! 	afs_com_err(whoami, code, "calling cmd_Dispatch");
      exit(code);
  }
Index: openafs/src/rx/test/generator.c
diff -c openafs/src/rx/test/generator.c:1.8 openafs/src/rx/test/generator.c:1.8.14.1
*** openafs/src/rx/test/generator.c:1.8	Tue Jul 15 19:16:37 2003
--- openafs/src/rx/test/generator.c	Tue Apr 10 14:39:54 2007
***************
*** 53,59 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/test/generator.c,v 1.8 2003/07/15 23:16:37 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
--- 53,59 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/test/generator.c,v 1.8.14.1 2007/04/10 18:39:54 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
***************
*** 75,88 ****
  /* all one string */
      "LIBS = $(DESTDIR)lib/libafsrpc.so \\\n"
  	"\t$(DESTDIR)lib/afs/libcmd.a \\\n"
! 	"\t$(DESTDIR)lib/afs/libcom_err.a \\\n"
  	"\t$(DESTDIR)lib/afs/util.a \n",
  
  /* all one string */
      "LIBS = $(DESTDIR)lib/librxkad.a \\\n" "\t$(DESTDIR)lib/libdes.a \\\n"
  	"\t$(DESTDIR)lib/librx.a \\\n" "\t$(DESTDIR)lib/liblwp.a \\\n"
  	"\t$(DESTDIR)lib/afs/libcmd.a \\\n"
! 	"\t$(DESTDIR)lib/afs/libcom_err.a \\\n"
  	"\t$(DESTDIR)lib/afs/util.a \\\n" "\t/usr/ucblib/libucb.a \n",
  
  /* all one string */
--- 75,88 ----
  /* all one string */
      "LIBS = $(DESTDIR)lib/libafsrpc.so \\\n"
  	"\t$(DESTDIR)lib/afs/libcmd.a \\\n"
! 	"\t$(DESTDIR)lib/afs/libafs_com_err.a \\\n"
  	"\t$(DESTDIR)lib/afs/util.a \n",
  
  /* all one string */
      "LIBS = $(DESTDIR)lib/librxkad.a \\\n" "\t$(DESTDIR)lib/libdes.a \\\n"
  	"\t$(DESTDIR)lib/librx.a \\\n" "\t$(DESTDIR)lib/liblwp.a \\\n"
  	"\t$(DESTDIR)lib/afs/libcmd.a \\\n"
! 	"\t$(DESTDIR)lib/afs/libafs_com_err.a \\\n"
  	"\t$(DESTDIR)lib/afs/util.a \\\n" "\t/usr/ucblib/libucb.a \n",
  
  /* all one string */
***************
*** 102,108 ****
  /* all one string */
      "LIBS = $(DESTDIR)/lib/afsrpc.lib \\\n"
  	"\t$(DESTDIR)/lib/afs/afscmd.lib \\\n"
! 	"\t$(DESTDIR)/lib/afs/afscom_err.lib \\\n"
  	"\t$(DESTDIR)/lib/afs/afsutil.lib \\\n"
  	"\t$(DESTDIR)/lib/pthread.lib \\\n" "\t$(DESTDIR)/lib/afsreg.lib \\\n"
  	"\t$(XLIBS)\n",
--- 102,108 ----
  /* all one string */
      "LIBS = $(DESTDIR)/lib/afsrpc.lib \\\n"
  	"\t$(DESTDIR)/lib/afs/afscmd.lib \\\n"
! 	"\t$(DESTDIR)/lib/afs/afsafs_com_err.lib \\\n"
  	"\t$(DESTDIR)/lib/afs/afsutil.lib \\\n"
  	"\t$(DESTDIR)/lib/pthread.lib \\\n" "\t$(DESTDIR)/lib/afsreg.lib \\\n"
  	"\t$(XLIBS)\n",
***************
*** 112,118 ****
  	"\t$(DESTDIR)/lib/afsdes.lib \\\n" "\t$(DESTDIR)/lib/afsrx.lib \\\n"
  	"\t$(DESTDIR)/lib/afslwp.lib \\\n"
  	"\t$(DESTDIR)/lib/afs/afscmd.lib \\\n"
! 	"\t$(DESTDIR)/lib/afs/afscom_err.lib \\\n"
  	"\t$(DESTDIR)/lib/afs/afsutil.lib \\\n"
  	"\t$(DESTDIR)/lib/afsreg.lib \n",
  
--- 112,118 ----
  	"\t$(DESTDIR)/lib/afsdes.lib \\\n" "\t$(DESTDIR)/lib/afsrx.lib \\\n"
  	"\t$(DESTDIR)/lib/afslwp.lib \\\n"
  	"\t$(DESTDIR)/lib/afs/afscmd.lib \\\n"
! 	"\t$(DESTDIR)/lib/afs/afsafs_com_err.lib \\\n"
  	"\t$(DESTDIR)/lib/afs/afsutil.lib \\\n"
  	"\t$(DESTDIR)/lib/afsreg.lib \n",
  
Index: openafs/src/rxkad/test/stress.c
diff -c openafs/src/rxkad/test/stress.c:1.9 openafs/src/rxkad/test/stress.c:1.9.14.1
*** openafs/src/rxkad/test/stress.c:1.9	Tue Jul 15 19:16:47 2003
--- openafs/src/rxkad/test/stress.c	Tue Apr 10 14:39:55 2007
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/test/stress.c,v 1.9 2003/07/15 23:16:47 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/test/stress.c,v 1.9.14.1 2007/04/10 18:39:55 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 154,160 ****
  	/* These options not compatible with -server */
  	if (cParms->stopServer) {
  	    code = RXKST_BADARGS;
! 	    com_err(whoami, code, "stop server not compatible with -client");
  	    return code;
  	}
  
--- 154,160 ----
  	/* These options not compatible with -server */
  	if (cParms->stopServer) {
  	    code = RXKST_BADARGS;
! 	    afs_com_err(whoami, code, "stop server not compatible with -client");
  	    return code;
  	}
  
***************
*** 176,182 ****
  
  	    code = pthread_attr_init(&tattr);
  	    if (code) {
! 		com_err(whoami, code,
  			"can't pthread_attr_init server process");
  		return code;
  	    }
--- 176,182 ----
  
  	    code = pthread_attr_init(&tattr);
  	    if (code) {
! 		afs_com_err(whoami, code,
  			"can't pthread_attr_init server process");
  		return code;
  	    }
***************
*** 184,190 ****
  	    code =
  		pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
  	    if (code) {
! 		com_err(whoami, code,
  			"can't pthread_attr_setdetachstate server process");
  		return code;
  	    }
--- 184,190 ----
  	    code =
  		pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
  	    if (code) {
! 		afs_com_err(whoami, code,
  			"can't pthread_attr_setdetachstate server process");
  		return code;
  	    }
***************
*** 199,205 ****
  			      (opaque) sParms, "Server Process", &pid);
  #endif
  	if (code) {
! 	    com_err(whoami, code, "can't create server process");
  	    return code;
  	}
      } else {
--- 199,205 ----
  			      (opaque) sParms, "Server Process", &pid);
  #endif
  	if (code) {
! 	    afs_com_err(whoami, code, "can't create server process");
  	    return code;
  	}
      } else {
***************
*** 258,264 ****
  
  	code = rxkst_StartClient(cParms);
  	if (code) {
! 	    com_err(whoami, code, "StartClient returned");
  	    return code;
  	}
      } else {
--- 258,264 ----
  
  	code = rxkst_StartClient(cParms);
  	if (code) {
! 	    afs_com_err(whoami, code, "StartClient returned");
  	    return code;
  	}
      } else {
***************
*** 266,272 ****
  	    || as->parms[aFASTCALLS].items || as->parms[aSLOWCALLS].items
  	    || as->parms[aCOPIOUSCALLS].items) {
  	    code = RXKST_BADARGS;
! 	    com_err(whoami, code,
  		    "send/recv len and # calls are client options");
  	    return code;
  	}
--- 266,272 ----
  	    || as->parms[aFASTCALLS].items || as->parms[aSLOWCALLS].items
  	    || as->parms[aCOPIOUSCALLS].items) {
  	    code = RXKST_BADARGS;
! 	    afs_com_err(whoami, code,
  		    "send/recv len and # calls are client options");
  	    return code;
  	}
***************
*** 299,312 ****
      code = rx_Init(0);
      rx_SetRxDeadTime(120);
      if (code < 0) {
! 	com_err(whoami, code, "can't init Rx");
  	exit(1);
      }
  #ifndef AFS_PTHREAD_ENV
      initialProcess = 0;
      code = LWP_CurrentProcess(&initialProcess);
      if (code) {
! 	com_err(whoami, code, "LWP initialization failed");
  	exit(1);
      }
  #endif
--- 299,312 ----
      code = rx_Init(0);
      rx_SetRxDeadTime(120);
      if (code < 0) {
! 	afs_com_err(whoami, code, "can't init Rx");
  	exit(1);
      }
  #ifndef AFS_PTHREAD_ENV
      initialProcess = 0;
      code = LWP_CurrentProcess(&initialProcess);
      if (code) {
! 	afs_com_err(whoami, code, "LWP initialization failed");
  	exit(1);
      }
  #endif
Index: openafs/src/rxkad/test/stress_c.c
diff -c openafs/src/rxkad/test/stress_c.c:1.9 openafs/src/rxkad/test/stress_c.c:1.9.14.1
*** openafs/src/rxkad/test/stress_c.c:1.9	Tue Jul 15 19:16:47 2003
--- openafs/src/rxkad/test/stress_c.c	Tue Apr 10 14:39:55 2007
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/test/stress_c.c,v 1.9 2003/07/15 23:16:47 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/test/stress_c.c,v 1.9.14.1 2007/04/10 18:39:55 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 318,324 ****
  
  	    code = pthread_attr_init(&tattr);
  	    if (code) {
! 		com_err(whoami, code,
  			"can't pthread_attr_init worker process");
  		return code;
  	    }
--- 318,324 ----
  
  	    code = pthread_attr_init(&tattr);
  	    if (code) {
! 		afs_com_err(whoami, code,
  			"can't pthread_attr_init worker process");
  		return code;
  	    }
***************
*** 326,332 ****
  	    code =
  		pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
  	    if (code) {
! 		com_err(whoami, code,
  			"can't pthread_attr_setdetachstate worker process");
  		return code;
  	    }
--- 326,332 ----
  	    code =
  		pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
  	    if (code) {
! 		afs_com_err(whoami, code,
  			"can't pthread_attr_setdetachstate worker process");
  		return code;
  	    }
***************
*** 339,345 ****
  			      (opaque) w, "Worker Process", &pid);
  #endif
  	if (code) {
! 	    com_err(whoami, code, "can't create worker process");
  	    return code;
  	}
      }
--- 339,345 ----
  			      (opaque) w, "Worker Process", &pid);
  #endif
  	if (code) {
! 	    afs_com_err(whoami, code, "can't create worker process");
  	    return code;
  	}
      }
***************
*** 428,434 ****
      start = ftime();
      code = CallSimultaneously(parms->threads, &c, DoClient);
      if (code) {
! 	com_err(whoami, code, "in DoClient");
  	return code;
      }
      interval = ftime() - start;
--- 428,434 ----
      start = ftime();
      code = CallSimultaneously(parms->threads, &c, DoClient);
      if (code) {
! 	afs_com_err(whoami, code, "in DoClient");
  	return code;
      }
      interval = ftime() - start;
***************
*** 611,620 ****
      code = CallSimultaneously(RX_MAXCALLS, &mc, UniChannelCall);
      if (((expectedCode == RXKST_INCFAILED) || (expectedCode == -1)) && ((code == expectedCode) || (code == -3)));	/* strange cases */
      else if (code != expectedCode) {
! 	com_err(whoami, code,
  		"problem making multichannel call, expected '%s'",
  		((expectedCode == 0)
! 		 ? "no error" : (char *)error_message(expectedCode)));
      }
      return code;
  }
--- 611,620 ----
      code = CallSimultaneously(RX_MAXCALLS, &mc, UniChannelCall);
      if (((expectedCode == RXKST_INCFAILED) || (expectedCode == -1)) && ((code == expectedCode) || (code == -3)));	/* strange cases */
      else if (code != expectedCode) {
! 	afs_com_err(whoami, code,
  		"problem making multichannel call, expected '%s'",
  		((expectedCode == 0)
! 		 ? "no error" : (char *)afs_error_message(expectedCode)));
      }
      return code;
  }
***************
*** 646,659 ****
  		    someZero++;
  		    fprintf(stderr, "  %d no error\n", i);
  		} else
! 		    fprintf(stderr, "  %d %s\n", i, error_message(codes[i]));
  	    }
  	    if (someZero) {
  		char buf[100];
  		sprintf(buf, "connection dead following %s", msg);
  		code = FastCall(conn);
  		if (code)
! 		    com_err(whoami, code, buf);
  	    }
  	}
      }
--- 646,659 ----
  		    someZero++;
  		    fprintf(stderr, "  %d no error\n", i);
  		} else
! 		    fprintf(stderr, "  %d %s\n", i, afs_error_message(codes[i]));
  	    }
  	    if (someZero) {
  		char buf[100];
  		sprintf(buf, "connection dead following %s", msg);
  		code = FastCall(conn);
  		if (code)
! 		    afs_com_err(whoami, code, buf);
  	    }
  	}
      }
***************
*** 674,680 ****
  #ifndef rx_GetPacketCksum
  
      code = RXKST_BADARGS;
!     com_err(whoami, code,
  	    "Older versions of Rx don't support Get/Set callNumber Vector procedures: can't run this CallTest");
      return code;
  
--- 674,680 ----
  #ifndef rx_GetPacketCksum
  
      code = RXKST_BADARGS;
!     afs_com_err(whoami, code,
  	    "Older versions of Rx don't support Get/Set callNumber Vector procedures: can't run this CallTest");
      return code;
  
***************
*** 1049,1055 ****
  #ifndef rx_GetPacketCksum
  
      code = RXKST_BADARGS;
!     com_err(whoami, code,
  	    "Older versions of Rx don't export packet tracing routines: can't run this HijackTest");
      return code;
  
--- 1049,1055 ----
  #ifndef rx_GetPacketCksum
  
      code = RXKST_BADARGS;
!     afs_com_err(whoami, code,
  	    "Older versions of Rx don't export packet tracing routines: can't run this HijackTest");
      return code;
  
***************
*** 1095,1101 ****
      outgoingOps.op = OO_ZEROCKSUM;
      code = FastCall(conn);
      if (code) {
! 	com_err(whoami, code, "doing FastCall with ZEROCKSUM");
  	return code;
      }
      /* The server thinks we're an old style client.  Now start sending cksums.
--- 1095,1101 ----
      outgoingOps.op = OO_ZEROCKSUM;
      code = FastCall(conn);
      if (code) {
! 	afs_com_err(whoami, code, "doing FastCall with ZEROCKSUM");
  	return code;
      }
      /* The server thinks we're an old style client.  Now start sending cksums.
***************
*** 1103,1109 ****
      outgoingOps.op = OO_NOOP;
      code = FastCall(conn);
      if (code) {
! 	com_err(whoami, code, "doing FastCall with non-ZEROCKSUM");
  	return code;
      }
      /* The server now thinks we're a new style client, we can't go back now. */
--- 1103,1109 ----
      outgoingOps.op = OO_NOOP;
      code = FastCall(conn);
      if (code) {
! 	afs_com_err(whoami, code, "doing FastCall with non-ZEROCKSUM");
  	return code;
      }
      /* The server now thinks we're a new style client, we can't go back now. */
***************
*** 1112,1122 ****
      if (code == 0)
  	code = RXKST_NOBADCKSUM;
      if (code != RXKADSEALEDINCON) {
! 	com_err(whoami, code, "doing FastCall with ZEROCKSUM");
  	return code;
      } else if (!conn->error) {
  	code = RXKST_NOCONNERROR;
! 	com_err(whoami, code, "doing FastCall with ZEROCKSUM");
  	return code;
      } else
  	code = 0;
--- 1112,1122 ----
      if (code == 0)
  	code = RXKST_NOBADCKSUM;
      if (code != RXKADSEALEDINCON) {
! 	afs_com_err(whoami, code, "doing FastCall with ZEROCKSUM");
  	return code;
      } else if (!conn->error) {
  	code = RXKST_NOCONNERROR;
! 	afs_com_err(whoami, code, "doing FastCall with ZEROCKSUM");
  	return code;
      } else
  	code = 0;
***************
*** 1130,1140 ****
      if (code == 0)
  	code = RXKST_NOBADCKSUM;
      if (code != RXKADSEALEDINCON) {
! 	com_err(whoami, code, "doing FastCall with ZEROCKSUM");
  	return code;
      } else if (!conn->error) {
  	code = RXKST_NOCONNERROR;
! 	com_err(whoami, code, "doing FastCall with ZEROCKSUM");
  	return code;
      } else
  	code = 0;
--- 1130,1140 ----
      if (code == 0)
  	code = RXKST_NOBADCKSUM;
      if (code != RXKADSEALEDINCON) {
! 	afs_com_err(whoami, code, "doing FastCall with ZEROCKSUM");
  	return code;
      } else if (!conn->error) {
  	code = RXKST_NOCONNERROR;
! 	afs_com_err(whoami, code, "doing FastCall with ZEROCKSUM");
  	return code;
      } else
  	code = 0;
***************
*** 1172,1178 ****
      if (outgoingOps.counts[RX_PACKET_TYPE_RESPONSE] > 0) {
        oracle:
  	code = RXKST_CHALLENGEORACLE;
! 	com_err(whoami, code, "misdirecting challenge");
  	return code;
      }
      code = FastCall(otherConn);	/* generate some activity here */
--- 1172,1178 ----
      if (outgoingOps.counts[RX_PACKET_TYPE_RESPONSE] > 0) {
        oracle:
  	code = RXKST_CHALLENGEORACLE;
! 	afs_com_err(whoami, code, "misdirecting challenge");
  	return code;
      }
      code = FastCall(otherConn);	/* generate some activity here */
***************
*** 1206,1219 ****
  
  	code = pthread_attr_init(&tattr);
  	if (code) {
! 	    com_err(whoami, code,
  		    "can't pthread_attr_init slow call process");
  	    return code;
  	}
  
  	code = pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
  	if (code) {
! 	    com_err(whoami, code,
  		    "can't pthread_attr_setdetachstate slow call process");
  	    return code;
  	}
--- 1206,1219 ----
  
  	code = pthread_attr_init(&tattr);
  	if (code) {
! 	    afs_com_err(whoami, code,
  		    "can't pthread_attr_init slow call process");
  	    return code;
  	}
  
  	code = pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
  	if (code) {
! 	    afs_com_err(whoami, code,
  		    "can't pthread_attr_setdetachstate slow call process");
  	    return code;
  	}
***************
*** 1226,1232 ****
  			  (opaque) otherConn, "Slow Call Process", &pid);
  #endif
      if (code) {
! 	com_err(whoami, code, "can't create slow call process");
  	return code;
      }
  #ifdef AFS_PTHREAD_ENV
--- 1226,1232 ----
  			  (opaque) otherConn, "Slow Call Process", &pid);
  #endif
      if (code) {
! 	afs_com_err(whoami, code, "can't create slow call process");
  	return code;
      }
  #ifdef AFS_PTHREAD_ENV
***************
*** 1339,1345 ****
  	if (conn) {
  	    code = RXKST_Kill(conn);
  	    if (code) {
! 		com_err(whoami, code, "trying to stop server");
  	    }
  	    rx_DestroyConnection(conn);
  	} else
--- 1339,1345 ----
  	if (conn) {
  	    code = RXKST_Kill(conn);
  	    if (code) {
! 		afs_com_err(whoami, code, "trying to stop server");
  	    }
  	    rx_DestroyConnection(conn);
  	} else
***************
*** 1357,1363 ****
      rxs_Release(sc);
      rx_Finalize();
      if (code) {
! 	com_err(parms->whoami, code, "test fails");
  	exit(13);
      } else {
  	printf("Test Okay\n");
--- 1357,1363 ----
      rxs_Release(sc);
      rx_Finalize();
      if (code) {
! 	afs_com_err(parms->whoami, code, "test fails");
  	exit(13);
      } else {
  	printf("Test Okay\n");
Index: openafs/src/shlibafsrpc/afsrpc.exp
diff -c openafs/src/shlibafsrpc/afsrpc.exp:1.2 openafs/src/shlibafsrpc/afsrpc.exp:1.2.4.1
*** openafs/src/shlibafsrpc/afsrpc.exp:1.2	Mon May 30 00:55:41 2005
--- openafs/src/shlibafsrpc/afsrpc.exp	Tue Apr 10 14:39:55 2007
***************
*** 84,91 ****
  rxkad_stats_key
  _et_list
  et_list_mutex
! com_err
! error_message
  rx_socket
  des_pcbc_init
  rx_BusyError
--- 84,91 ----
  rxkad_stats_key
  _et_list
  et_list_mutex
! afs_com_err
! afs_error_message
  rx_socket
  des_pcbc_init
  rx_BusyError
Index: openafs/src/shlibafsrpc/mapfile
diff -c openafs/src/shlibafsrpc/mapfile:1.5.4.1 openafs/src/shlibafsrpc/mapfile:1.5.4.2
*** openafs/src/shlibafsrpc/mapfile:1.5.4.1	Wed Jul  5 14:36:14 2006
--- openafs/src/shlibafsrpc/mapfile	Tue Apr 10 14:39:55 2007
***************
*** 57,64 ****
  	rxkad_global_stats;
  	rxkad_global_stats_lock;
  	rxkad_stats_key;
! 	com_err;
! 	error_message;
  	rx_socket;
  	rxevent_debugFile;
  	rx_debugFile;
--- 57,64 ----
  	rxkad_global_stats;
  	rxkad_global_stats_lock;
  	rxkad_stats_key;
! 	afs_com_err;
! 	afs_error_message;
  	rx_socket;
  	rxevent_debugFile;
  	rx_debugFile;
Index: openafs/src/shlibafsrpc/mapfile.afs_xdr
diff -c openafs/src/shlibafsrpc/mapfile.afs_xdr:1.1.2.1 openafs/src/shlibafsrpc/mapfile.afs_xdr:1.1.2.2
*** openafs/src/shlibafsrpc/mapfile.afs_xdr:1.1.2.1	Sun Aug 20 18:23:06 2006
--- openafs/src/shlibafsrpc/mapfile.afs_xdr	Tue Apr 10 14:39:55 2007
***************
*** 57,64 ****
  	rxkad_global_stats;
  	rxkad_global_stats_lock;
  	rxkad_stats_key;
! 	com_err;
! 	error_message;
  	rx_socket;
  	rxevent_debugFile;
  	rx_debugFile;
--- 57,64 ----
  	rxkad_global_stats;
  	rxkad_global_stats_lock;
  	rxkad_stats_key;
! 	afs_com_err;
! 	afs_error_message;
  	rx_socket;
  	rxevent_debugFile;
  	rx_debugFile;
Index: openafs/src/tests/afscp.c
diff -c openafs/src/tests/afscp.c:1.4 openafs/src/tests/afscp.c:1.4.14.1
*** openafs/src/tests/afscp.c:1.4	Tue Nov 18 23:02:29 2003
--- openafs/src/tests/afscp.c	Tue Apr 10 14:39:55 2007
***************
*** 351,362 ****
  	    dfd = open(destpath, O_RDWR | O_TRUNC, 0666);
  	    if (dfd < 0) {
  		fprintf(stderr, "Cannot open %s (%s)\n", destpath,
! 			error_message(errno));
  		goto Fail_dconn;
  	    }
  	} else if (dfd < 0) {
  	    fprintf(stderr, "Cannot open %s (%s)\n", destpath,
! 		    error_message(errno));
  	    goto Fail_dconn;
  	}
      } else {
--- 351,362 ----
  	    dfd = open(destpath, O_RDWR | O_TRUNC, 0666);
  	    if (dfd < 0) {
  		fprintf(stderr, "Cannot open %s (%s)\n", destpath,
! 			afs_error_message(errno));
  		goto Fail_dconn;
  	    }
  	} else if (dfd < 0) {
  	    fprintf(stderr, "Cannot open %s (%s)\n", destpath,
! 		    afs_error_message(errno));
  	    goto Fail_dconn;
  	}
      } else {
***************
*** 372,378 ****
  		    code = 0;
  	    } else {
  		printf("Cannot create %s (%s)\n", destpath,
! 		       error_message(code));
  		if (code)
  		    goto Fail_dconn;
  	    }
--- 372,378 ----
  		    code = 0;
  	    } else {
  		printf("Cannot create %s (%s)\n", destpath,
! 		       afs_error_message(code));
  		if (code)
  		    goto Fail_dconn;
  	    }
***************
*** 383,401 ****
  	sfd = open(srcf, O_RDONLY, 0);
  	if (sfd < 0) {
  	    fprintf(stderr, "Cannot open %s (%s)\n", srcf,
! 		    error_message(errno));
  	    goto Fail_dconn;
  	}
  	if (fstat(sfd, &statbuf) < 0) {
  	    fprintf(stderr, "Cannot stat %s (%s)\n", srcf,
! 		    error_message(errno));
  	    close(sfd);
  	    goto Fail_dconn;
  	}
      } else {
  	if ((code = RXAFS_FetchStatus(sconn, &sf, &fst, &scb, &vs))) {
  	    printf("Cannot fetchstatus of %d.%d (%s)\n", sf.Volume, sf.Vnode,
! 		   error_message(code));
  	    goto Fail_dconn;
  	}
      }
--- 383,401 ----
  	sfd = open(srcf, O_RDONLY, 0);
  	if (sfd < 0) {
  	    fprintf(stderr, "Cannot open %s (%s)\n", srcf,
! 		    afs_error_message(errno));
  	    goto Fail_dconn;
  	}
  	if (fstat(sfd, &statbuf) < 0) {
  	    fprintf(stderr, "Cannot stat %s (%s)\n", srcf,
! 		    afs_error_message(errno));
  	    close(sfd);
  	    goto Fail_dconn;
  	}
      } else {
  	if ((code = RXAFS_FetchStatus(sconn, &sf, &fst, &scb, &vs))) {
  	    printf("Cannot fetchstatus of %d.%d (%s)\n", sf.Volume, sf.Vnode,
! 		   afs_error_message(code));
  	    goto Fail_dconn;
  	}
      }
***************
*** 420,426 ****
      if (!slcl) {
  	if ((code = StartRXAFS_FetchData(scall, &sf, 0, filesz))) {
  	    printf("Unable to fetch data from %s (%s)\n", srcf,
! 		   error_message(code));
  	    goto Fail_call;
  	}
      }
--- 420,426 ----
      if (!slcl) {
  	if ((code = StartRXAFS_FetchData(scall, &sf, 0, filesz))) {
  	    printf("Unable to fetch data from %s (%s)\n", srcf,
! 		   afs_error_message(code));
  	    goto Fail_call;
  	}
      }
***************
*** 441,447 ****
  	if ((code =
  	     StartRXAFS_StoreData(dcall, &df, &sst, 0, filesz, filesz))) {
  	    printf("Unable to store data to %s (%s)\n", destpath,
! 		   error_message(code));
  	    goto Fail_call;
  	}
      }
--- 441,447 ----
  	if ((code =
  	     StartRXAFS_StoreData(dcall, &df, &sst, 0, filesz, filesz))) {
  	    printf("Unable to store data to %s (%s)\n", destpath,
! 		   afs_error_message(code));
  	    goto Fail_call;
  	}
      }
***************
*** 500,506 ****
  	fetchcode = rx_EndCall(scall, fetchcode);
      }
      if (fetchcode && printcallerrs)
! 	printf("Error returned from fetch: %s\n", error_message(fetchcode));
  
      if (dlcl) {
  	if (close(dfd) && !storecode)
--- 500,506 ----
  	fetchcode = rx_EndCall(scall, fetchcode);
      }
      if (fetchcode && printcallerrs)
! 	printf("Error returned from fetch: %s\n", afs_error_message(fetchcode));
  
      if (dlcl) {
  	if (close(dfd) && !storecode)
***************
*** 509,515 ****
  	storecode = rx_EndCall(dcall, storecode);
      }
      if (storecode && printcallerrs)
! 	printf("Error returned from store: %s\n", error_message(storecode));
  
      gettimeofday(&finish, &tz);
  
--- 509,515 ----
  	storecode = rx_EndCall(dcall, storecode);
      }
      if (storecode && printcallerrs)
! 	printf("Error returned from store: %s\n", afs_error_message(storecode));
  
      gettimeofday(&finish, &tz);
  
***************
*** 521,527 ****
  	scb.CallBackType = CB_DROPPED;
  	if ((code = RXAFS_GiveUpCallBacks(sconn, &theFids, &theCBs)))
  	    printf("Could not give up source callback: %s\n",
! 		   error_message(code));
      }
  
      if (!dlcl) {
--- 521,527 ----
  	scb.CallBackType = CB_DROPPED;
  	if ((code = RXAFS_GiveUpCallBacks(sconn, &theFids, &theCBs)))
  	    printf("Could not give up source callback: %s\n",
! 		   afs_error_message(code));
      }
  
      if (!dlcl) {
***************
*** 532,538 ****
  	dcb.CallBackType = CB_DROPPED;
  	if ((code = RXAFS_GiveUpCallBacks(dconn, &theFids, &theCBs)))
  	    printf("Could not give up target callback: %s\n",
! 		   error_message(code));
      }
  
      if (code == 0)
--- 532,538 ----
  	dcb.CallBackType = CB_DROPPED;
  	if ((code = RXAFS_GiveUpCallBacks(dconn, &theFids, &theCBs)))
  	    printf("Could not give up target callback: %s\n",
! 		   afs_error_message(code));
      }
  
      if (code == 0)
Index: openafs/src/tests/afsdump_dirlist.c
diff -c openafs/src/tests/afsdump_dirlist.c:1.2 openafs/src/tests/afsdump_dirlist.c:1.2.14.1
*** openafs/src/tests/afsdump_dirlist.c:1.2	Tue Jul 15 19:16:55 2003
--- openafs/src/tests/afsdump_dirlist.c	Tue Apr 10 14:39:55 2007
***************
*** 114,120 ****
      error_count++;
      if (!quiet) {
  	va_start(alist, msg);
! 	com_err_va(argv0, code, msg, alist);
  	va_end(alist);
      }
  }
--- 114,120 ----
      error_count++;
      if (!quiet) {
  	va_start(alist, msg);
! 	afs_com_err_va(argv0, code, msg, alist);
  	va_end(alist);
      }
  }
***************
*** 137,143 ****
      initialize_xFil_error_table();
      r = xfopen(&input_file, O_RDONLY, input_path);
      if (r) {
! 	com_err(argv0, r, "opening %s", input_path);
  	exit(2);
      }
  
--- 137,143 ----
      initialize_xFil_error_table();
      r = xfopen(&input_file, O_RDONLY, input_path);
      if (r) {
! 	afs_com_err(argv0, r, "opening %s", input_path);
  	exit(2);
      }
  
***************
*** 153,158 ****
      if (verbose && error_count)
  	fprintf(stderr, "*** %d errors\n", error_count);
      if (r && !quiet)
! 	fprintf(stderr, "*** FAILED: %s\n", error_message(r));
      exit(0);
  }
--- 153,158 ----
      if (verbose && error_count)
  	fprintf(stderr, "*** %d errors\n", error_count);
      if (r && !quiet)
! 	fprintf(stderr, "*** FAILED: %s\n", afs_error_message(r));
      exit(0);
  }
Index: openafs/src/tests/afsdump_extract.c
diff -c openafs/src/tests/afsdump_extract.c:1.2 openafs/src/tests/afsdump_extract.c:1.2.14.1
*** openafs/src/tests/afsdump_extract.c:1.2	Tue Jul 15 19:16:55 2003
--- openafs/src/tests/afsdump_extract.c	Tue Apr 10 14:39:55 2007
***************
*** 320,326 ****
      error_count++;
      if (!quiet) {
  	va_start(alist, msg);
! 	com_err_va(argv0, code, msg, alist);
  	va_end(alist);
      }
  }
--- 320,326 ----
      error_count++;
      if (!quiet) {
  	va_start(alist, msg);
! 	afs_com_err_va(argv0, code, msg, alist);
  	va_end(alist);
      }
  }
***************
*** 547,553 ****
      initialize_xFil_error_table();
      r = xfopen(&input_file, O_RDONLY, input_path);
      if (r) {
! 	com_err(argv0, r, "opening %s", input_path);
  	exit(2);
      }
  
--- 547,553 ----
      initialize_xFil_error_table();
      r = xfopen(&input_file, O_RDONLY, input_path);
      if (r) {
! 	afs_com_err(argv0, r, "opening %s", input_path);
  	exit(2);
      }
  
***************
*** 568,574 ****
  	if ((r = xftell(&input_file, &where))
  	    || (r = Path_PreScan(&input_file, &phi, 1))
  	    || (r = xfseek(&input_file, &where))) {
! 	    com_err(argv0, r, "- path initialization failed");
  	    xfclose(&input_file);
  	    exit(1);
  	}
--- 568,574 ----
  	if ((r = xftell(&input_file, &where))
  	    || (r = Path_PreScan(&input_file, &phi, 1))
  	    || (r = xfseek(&input_file, &where))) {
! 	    afs_com_err(argv0, r, "- path initialization failed");
  	    xfclose(&input_file);
  	    exit(1);
  	}
***************
*** 596,601 ****
      if (verbose && error_count)
  	fprintf(stderr, "*** %d errors\n", error_count);
      if (r && !quiet)
! 	fprintf(stderr, "*** FAILED: %s\n", error_message(r));
      exit(0);
  }
--- 596,601 ----
      if (verbose && error_count)
  	fprintf(stderr, "*** %d errors\n", error_count);
      if (r && !quiet)
! 	fprintf(stderr, "*** FAILED: %s\n", afs_error_message(r));
      exit(0);
  }
Index: openafs/src/tests/afsdump_scan.c
diff -c openafs/src/tests/afsdump_scan.c:1.2 openafs/src/tests/afsdump_scan.c:1.2.14.1
*** openafs/src/tests/afsdump_scan.c:1.2	Tue Jul 15 19:16:56 2003
--- openafs/src/tests/afsdump_scan.c	Tue Apr 10 14:39:55 2007
***************
*** 223,229 ****
      error_count++;
      if (!quiet) {
  	va_start(alist, msg);
! 	com_err_va(argv0, code, msg, alist);
  	va_end(alist);
      }
  }
--- 223,229 ----
      error_count++;
      if (!quiet) {
  	va_start(alist, msg);
! 	afs_com_err_va(argv0, code, msg, alist);
  	va_end(alist);
      }
  }
***************
*** 290,296 ****
      initialize_xFil_error_table();
      r = xfopen(&input_file, O_RDONLY, input_path);
      if (r) {
! 	com_err(argv0, r, "opening %s", input_path);
  	exit(2);
      }
  
--- 290,296 ----
      initialize_xFil_error_table();
      r = xfopen(&input_file, O_RDONLY, input_path);
      if (r) {
! 	afs_com_err(argv0, r, "opening %s", input_path);
  	exit(2);
      }
  
***************
*** 311,317 ****
      }
  
      if (gendump_path && (r = setup_repair())) {
! 	com_err(argv0, r, "setting up repair output");
  	xfclose(&input_file);
  	exit(2);
      }
--- 311,317 ----
      }
  
      if (gendump_path && (r = setup_repair())) {
! 	afs_com_err(argv0, r, "setting up repair output");
  	xfclose(&input_file);
  	exit(2);
      }
***************
*** 326,332 ****
  	if ((r = xftell(&input_file, &where))
  	    || (r = Path_PreScan(&input_file, &phi, 0))
  	    || (r = xfseek(&input_file, &where))) {
! 	    com_err(argv0, r, "- path initialization failed");
  	    xfclose(&input_file);
  	    exit(2);
  	}
--- 326,332 ----
  	if ((r = xftell(&input_file, &where))
  	    || (r = Path_PreScan(&input_file, &phi, 0))
  	    || (r = xfseek(&input_file, &where))) {
! 	    afs_com_err(argv0, r, "- path initialization failed");
  	    xfclose(&input_file);
  	    exit(2);
  	}
***************
*** 353,358 ****
      if (verbose && error_count)
  	fprintf(stderr, "*** %d errors\n", error_count);
      if (r && !quiet)
! 	fprintf(stderr, "*** FAILED: %s\n", error_message(r));
      exit(0);
  }
--- 353,358 ----
      if (verbose && error_count)
  	fprintf(stderr, "*** %d errors\n", error_count);
      if (r && !quiet)
! 	fprintf(stderr, "*** FAILED: %s\n", afs_error_message(r));
      exit(0);
  }
Index: openafs/src/tests/afsdump_xsed.c
diff -c openafs/src/tests/afsdump_xsed.c:1.2 openafs/src/tests/afsdump_xsed.c:1.2.14.1
*** openafs/src/tests/afsdump_xsed.c:1.2	Tue Jul 15 19:16:56 2003
--- openafs/src/tests/afsdump_xsed.c	Tue Apr 10 14:39:55 2007
***************
*** 229,235 ****
      error_count++;
      if (!quiet) {
  	va_start(alist, msg);
! 	com_err_va(argv0, code, msg, alist);
  	va_end(alist);
      }
  }
--- 229,235 ----
      error_count++;
      if (!quiet) {
  	va_start(alist, msg);
! 	afs_com_err_va(argv0, code, msg, alist);
  	va_end(alist);
      }
  }
***************
*** 335,341 ****
      initialize_AVds_error_table();
      r = xfopen(&X, input_path, O_RDONLY, 0);
      if (r) {
! 	com_err(argv0, r, "opening %s", input_path);
  	exit(2);
      }
  
--- 335,341 ----
      initialize_AVds_error_table();
      r = xfopen(&X, input_path, O_RDONLY, 0);
      if (r) {
! 	afs_com_err(argv0, r, "opening %s", input_path);
  	exit(2);
      }
  
***************
*** 356,362 ****
      }
  
      if (gendump_path && (r = setup_repair())) {
! 	com_err(argv0, r, "setting up repair output");
  	xfclose(X);
  	exit(2);
      }
--- 356,362 ----
      }
  
      if (gendump_path && (r = setup_repair())) {
! 	afs_com_err(argv0, r, "setting up repair output");
  	xfclose(X);
  	exit(2);
      }
***************
*** 371,377 ****
  	if ((r = xftell(X, &where))
  	    || (r = Path_PreScan(X, &phi, 0))
  	    || (r = xfseek(X, &where))) {
! 	    com_err(argv0, r, "- path initialization failed");
  	    xfclose(X);
  	    exit(2);
  	}
--- 371,377 ----
  	if ((r = xftell(X, &where))
  	    || (r = Path_PreScan(X, &phi, 0))
  	    || (r = xfseek(X, &where))) {
! 	    afs_com_err(argv0, r, "- path initialization failed");
  	    xfclose(X);
  	    exit(2);
  	}
***************
*** 401,406 ****
      if (verbose && error_count)
  	fprintf(stderr, "*** %d errors\n", error_count);
      if (r && !quiet)
! 	fprintf(stderr, "*** FAILED: %s\n", error_message(r));
      exit(0);
  }
--- 401,406 ----
      if (verbose && error_count)
  	fprintf(stderr, "*** %d errors\n", error_count);
      if (r && !quiet)
! 	fprintf(stderr, "*** FAILED: %s\n", afs_error_message(r));
      exit(0);
  }
Index: openafs/src/tests/null-search.c
diff -c openafs/src/tests/null-search.c:1.2 openafs/src/tests/null-search.c:1.2.14.1
*** openafs/src/tests/null-search.c:1.2	Tue Jul 15 19:17:01 2003
--- openafs/src/tests/null-search.c	Tue Apr 10 14:39:55 2007
***************
*** 71,77 ****
      error_count++;
      if (!quiet) {
  	va_start(alist, msg);
! 	com_err_va(argv0, code, msg, alist);
  	va_end(alist);
      }
  }
--- 71,77 ----
      error_count++;
      if (!quiet) {
  	va_start(alist, msg);
! 	afs_com_err_va(argv0, code, msg, alist);
  	va_end(alist);
      }
  }
***************
*** 139,145 ****
      initialize_xFil_error_table();
      r = xfopen(&input_file, O_RDONLY, input_path);
      if (r) {
! 	com_err(argv0, r, "opening %s", input_path);
  	exit(2);
      }
  
--- 139,145 ----
      initialize_xFil_error_table();
      r = xfopen(&input_file, O_RDONLY, input_path);
      if (r) {
! 	afs_com_err(argv0, r, "opening %s", input_path);
  	exit(2);
      }
  
***************
*** 156,162 ****
  	if ((r = xftell(&input_file, &where))
  	    || (r = Path_PreScan(&input_file, &phi, 0))
  	    || (r = xfseek(&input_file, &where))) {
! 	    com_err(argv0, r, "- path initialization failed");
  	    xfclose(&input_file);
  	    exit(2);
  	}
--- 156,162 ----
  	if ((r = xftell(&input_file, &where))
  	    || (r = Path_PreScan(&input_file, &phi, 0))
  	    || (r = xfseek(&input_file, &where))) {
! 	    afs_com_err(argv0, r, "- path initialization failed");
  	    xfclose(&input_file);
  	    exit(2);
  	}
***************
*** 171,175 ****
      if (bad_count)
  	printf("*** %d bad files\n", bad_count);
      if (r && !quiet)
! 	printf("*** FAILED: %s\n", error_message(r));
  }
--- 171,175 ----
      if (bad_count)
  	printf("*** %d bad files\n", bad_count);
      if (r && !quiet)
! 	printf("*** FAILED: %s\n", afs_error_message(r));
  }
Index: openafs/src/update/client.c
diff -c openafs/src/update/client.c:1.12 openafs/src/update/client.c:1.12.14.1
*** openafs/src/update/client.c:1.12	Wed Jun 23 10:27:46 2004
--- openafs/src/update/client.c	Tue Apr 10 14:39:55 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/client.c,v 1.12 2004/06/23 14:27:46 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/client.c,v 1.12.14.1 2007/04/10 18:39:55 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 218,224 ****
      errcode = rx_Init(0);
      if (errcode) {
  	printf("Rx initialize failed \n");
! 	com_err(whoami, errcode, "calling Rx init");
  	exit(1);
      }
  
--- 218,224 ----
      errcode = rx_Init(0);
      if (errcode) {
  	printf("Rx initialize failed \n");
! 	afs_com_err(whoami, errcode, "calling Rx init");
  	exit(1);
      }
  
***************
*** 238,244 ****
  	exit(1);
      }
      if (errcode) {
! 	com_err(whoami, errcode, "Couldn't get security obect for localAuth");
  	exit(1);
      }
  
--- 238,244 ----
  	exit(1);
      }
      if (errcode) {
! 	afs_com_err(whoami, errcode, "Couldn't get security obect for localAuth");
  	exit(1);
      }
  
***************
*** 260,266 ****
  
  	    /* construct local path from canonical (wire-format) path */
  	    if ((errcode = ConstructLocalPath(df->name, "/", &curDir))) {
! 		com_err(whoami, errcode, "Unable to construct local path");
  		return errcode;
  	    }
  
--- 260,266 ----
  
  	    /* construct local path from canonical (wire-format) path */
  	    if ((errcode = ConstructLocalPath(df->name, "/", &curDir))) {
! 		afs_com_err(whoami, errcode, "Unable to construct local path");
  		return errcode;
  	    }
  
***************
*** 271,277 ****
  #else
  		if (mkdir(curDir, 0700) < 0) {
  #endif
! 		    com_err(whoami, errno, "can't create dir");
  		    printf("upclient: Can't update dir %s\n", curDir);
  		    return -1;
  		}
--- 271,277 ----
  #else
  		if (mkdir(curDir, 0700) < 0) {
  #endif
! 		    afs_com_err(whoami, errno, "can't create dir");
  		    printf("upclient: Can't update dir %s\n", curDir);
  		    return -1;
  		}
***************
*** 290,303 ****
  	    error = rx_EndCall(call, 0);
  	    if (error && !errcode) {
  		printf("could not end rx call \n");
! 		com_err(whoami, error, "calling EndCall");
  		goto fail;
  	    }
  	    if (errcode) {
  		printf
  		    ("warning: could not fetch the contents of directory %s \n",
  		     df->name);
! 		com_err(whoami, errcode, "calling FetchFile");
  		cnt++;
  		goto fail;
  	    }
--- 290,303 ----
  	    error = rx_EndCall(call, 0);
  	    if (error && !errcode) {
  		printf("could not end rx call \n");
! 		afs_com_err(whoami, error, "calling EndCall");
  		goto fail;
  	    }
  	    if (errcode) {
  		printf
  		    ("warning: could not fetch the contents of directory %s \n",
  		     df->name);
! 		afs_com_err(whoami, errcode, "calling FetchFile");
  		cnt++;
  		goto fail;
  	    }
***************
*** 305,311 ****
  	    stream = fopen(dirbuf, "r");
  	    if (stream == NULL) {
  		printf("fopen failed on %s \n", dirbuf);
! 		com_err(whoami, errno, "fopen");
  		goto fail;
  	    }
  	    umask(00);
--- 305,311 ----
  	    stream = fopen(dirbuf, "r");
  	    if (stream == NULL) {
  		printf("fopen failed on %s \n", dirbuf);
! 		afs_com_err(whoami, errno, "fopen");
  		goto fail;
  	    }
  	    umask(00);
***************
*** 354,360 ****
  
  		dirp = opendir(curDir);
  		if (dirp == 0) {
! 		    com_err(whoami, errno, "Can't open local dir %s", curDir);
  		    goto fail;
  		}
  
--- 354,360 ----
  
  		dirp = opendir(curDir);
  		if (dirp == 0) {
! 		    afs_com_err(whoami, errno, "Can't open local dir %s", curDir);
  		    goto fail;
  		}
  
***************
*** 373,379 ****
  			errcode = unlink(filename);
  			if (errcode) {
  			    printf("could not delete file %s \n", filename);
! 			    com_err(whoami, errno, "could not delete file %s",
  				    filename);
  			}
  		    }
--- 373,379 ----
  			errcode = unlink(filename);
  			if (errcode) {
  			    printf("could not delete file %s \n", filename);
! 			    afs_com_err(whoami, errno, "could not delete file %s",
  				    filename);
  			}
  		    }
***************
*** 415,421 ****
  
      /* construct a local path from canonical (wire-format) path */
      if ((error = ConstructLocalPath(filename, "/", &localname))) {
! 	com_err(whoami, error, "Unable to construct local path");
  	return error;
      }
  
--- 415,421 ----
  
      /* construct a local path from canonical (wire-format) path */
      if ((error = ConstructLocalPath(filename, "/", &localname))) {
! 	afs_com_err(whoami, error, "Unable to construct local path");
  	return error;
      }
  
***************
*** 448,459 ****
      fd = open(localFile, O_CREAT | O_TRUNC | O_WRONLY, 0666);
      if (fd < 0) {
  	printf("Could not create %s\n", localFile);
! 	com_err(whoami, errno, "Could not create %s", localFile);
  	error = UPDATE_ERROR;
  	return error;
      }
      if (fstat(fd, &status) < 0) {
! 	com_err(whoami, errno, "Could not stat %s", localFile);
  	close(fd);
  	printf("could not stast %s\n", localFile);
  	return UPDATE_ERROR;
--- 448,459 ----
      fd = open(localFile, O_CREAT | O_TRUNC | O_WRONLY, 0666);
      if (fd < 0) {
  	printf("Could not create %s\n", localFile);
! 	afs_com_err(whoami, errno, "Could not create %s", localFile);
  	error = UPDATE_ERROR;
  	return error;
      }
      if (fstat(fd, &status) < 0) {
! 	afs_com_err(whoami, errno, "Could not stat %s", localFile);
  	close(fd);
  	printf("could not stast %s\n", localFile);
  	return UPDATE_ERROR;
***************
*** 503,509 ****
  	if (!nbytes)
  	    error = UPDATE_ERROR;
  	if (write(fd, buffer, nbytes) != nbytes) {
! 	    com_err(whoami, errno, "File system write failed!");
  	    printf("File system write failed!\n");
  	    error = UPDATE_ERROR;
  	}
--- 503,509 ----
  	if (!nbytes)
  	    error = UPDATE_ERROR;
  	if (write(fd, buffer, nbytes) != nbytes) {
! 	    afs_com_err(whoami, errno, "File system write failed!");
  	    printf("File system write failed!\n");
  	    error = UPDATE_ERROR;
  	}
***************
*** 586,592 ****
      for (tf = okhostfiles; tf; tf = tf->next) {
  	/* construct local path from canonical (wire-format) path */
  	if ((rc = ConstructLocalPath(tf->name, "/", &hostfile))) {
! 	    com_err(whoami, rc, "Unable to construct local path");
  	    return -1;
  	}
  	if (PathsAreEquivalent(hostfile, filename)) {
--- 586,592 ----
      for (tf = okhostfiles; tf; tf = tf->next) {
  	/* construct local path from canonical (wire-format) path */
  	if ((rc = ConstructLocalPath(tf->name, "/", &hostfile))) {
! 	    afs_com_err(whoami, rc, "Unable to construct local path");
  	    return -1;
  	}
  	if (PathsAreEquivalent(hostfile, filename)) {
***************
*** 613,619 ****
      for (tf = modFiles; tf; tf = tf->next) {
  	/* construct local path from canonical (wire-format) path */
  	if ((errcode = ConstructLocalPath(tf->name, "/", &fname))) {
! 	    com_err(whoami, errcode, "Unable to construct local path");
  	    return errcode;
  	}
  	strcpy(newname, fname);
--- 613,619 ----
      for (tf = modFiles; tf; tf = tf->next) {
  	/* construct local path from canonical (wire-format) path */
  	if ((errcode = ConstructLocalPath(tf->name, "/", &fname))) {
! 	    afs_com_err(whoami, errcode, "Unable to construct local path");
  	    return errcode;
  	}
  	strcpy(newname, fname);
***************
*** 623,629 ****
  	errcode = renamefile(newname, fname);
  	if (errcode) {
  	    printf("could not rename %s to %s\n", newname, fname);
! 	    com_err(whoami, errno, "could not rename %s to %s", newname,
  		    fname);
  	}
  	free(fname);
--- 623,629 ----
  	errcode = renamefile(newname, fname);
  	if (errcode) {
  	    printf("could not rename %s to %s\n", newname, fname);
! 	    afs_com_err(whoami, errno, "could not rename %s to %s", newname,
  		    fname);
  	}
  	free(fname);
***************
*** 664,670 ****
      /* construct local path from canonical (wire-format) path */
      errcode = ConstructLocalPath(filename, "/", &lfile);
      if (errcode) {
! 	com_err(whoami, errcode, "Unable to construct local path");
  	return -1;
      }
      strcpy(newfile, lfile);
--- 664,670 ----
      /* construct local path from canonical (wire-format) path */
      errcode = ConstructLocalPath(filename, "/", &lfile);
      if (errcode) {
! 	afs_com_err(whoami, errcode, "Unable to construct local path");
  	return -1;
      }
      strcpy(newfile, lfile);
***************
*** 681,687 ****
  
      if (errcode) {
  	printf("failed to fetch file %s \n", filename);
! 	com_err(whoami, errcode, "fetching file");
  	return 1;
      }
  
--- 681,687 ----
  
      if (errcode) {
  	printf("failed to fetch file %s \n", filename);
! 	afs_com_err(whoami, errcode, "fetching file");
  	return 1;
      }
  
***************
*** 690,696 ****
      if (errcode) {
  	printf("could not change protection on %s to %u\n", newfile,
  	       (unsigned int)mode);
! 	com_err(whoami, errno, "could not change protection on %s to %u",
  		newfile, mode);
  	return 1;
      }
--- 690,696 ----
      if (errcode) {
  	printf("could not change protection on %s to %u\n", newfile,
  	       (unsigned int)mode);
! 	afs_com_err(whoami, errno, "could not change protection on %s to %u",
  		newfile, mode);
  	return 1;
      }
***************
*** 703,709 ****
      if (errcode) {
  	printf("warning: could not change uid and gid on %s to %u and %u \n",
  	       newfile, gid, uid);
! 	com_err(whoami, errno,
  		"warning: could not change uid and gid on %s to %u and %u",
  		newfile, gid, uid);
      }
--- 703,709 ----
      if (errcode) {
  	printf("warning: could not change uid and gid on %s to %u and %u \n",
  	       newfile, gid, uid);
! 	afs_com_err(whoami, errno,
  		"warning: could not change uid and gid on %s to %u and %u",
  		newfile, gid, uid);
      }
***************
*** 716,722 ****
      if (errcode) {
  	printf("could not change access and modify times on %s to %u %u\n",
  	       newfile, (unsigned int)atime, (unsigned int)mtime);
! 	com_err(whoami, errno,
  		"could not change access and modify times on %s to %u %u",
  		newfile, atime, mtime);
  	return 1;
--- 716,722 ----
      if (errcode) {
  	printf("could not change access and modify times on %s to %u %u\n",
  	       newfile, (unsigned int)atime, (unsigned int)mtime);
! 	afs_com_err(whoami, errno,
  		"could not change access and modify times on %s to %u %u",
  		newfile, atime, mtime);
  	return 1;
Index: openafs/src/update/server.c
diff -c openafs/src/update/server.c:1.13.14.2 openafs/src/update/server.c:1.13.14.3
*** openafs/src/update/server.c:1.13.14.2	Tue Jun 20 16:37:12 2006
--- openafs/src/update/server.c	Tue Apr 10 14:39:55 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/server.c,v 1.13.14.2 2006/06/20 20:37:12 jaltman Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/server.c,v 1.13.14.3 2007/04/10 18:39:55 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 50,55 ****
--- 50,56 ----
  #include <afs/cellconfig.h>
  #include <afs/afsutil.h>
  #include <afs/fileutil.h>
+ #include <afs/com_err.h>
  #ifdef	AFS_AIX_ENV
  #include <sys/statfs.h>
  #endif
***************
*** 352,358 ****
  
      /* construct a local path from a canonical (wire-format) path */
      if ((error = ConstructLocalPath(name, "/", &reqObject))) {
! 	com_err(whoami, error, "Unable to construct local path");
  	return UPDATE_ERROR;
      }
  
--- 353,359 ----
  
      /* construct a local path from a canonical (wire-format) path */
      if ((error = ConstructLocalPath(name, "/", &reqObject))) {
! 	afs_com_err(whoami, error, "Unable to construct local path");
  	return UPDATE_ERROR;
      }
  
***************
*** 384,390 ****
  
      /* construct a local path from a canonical (wire-format) path */
      if ((error = ConstructLocalPath(name, "/", &reqObject))) {
! 	com_err(whoami, error, "Unable to construct local path");
  	return UPDATE_ERROR;
      }
  
--- 385,391 ----
  
      /* construct a local path from a canonical (wire-format) path */
      if ((error = ConstructLocalPath(name, "/", &reqObject))) {
! 	afs_com_err(whoami, error, "Unable to construct local path");
  	return UPDATE_ERROR;
      }
  
***************
*** 559,572 ****
  
      /* construct a local path from a canonical (wire-format) path */
      if ((error = ConstructLocalPath(dir, "/", expPath))) {
! 	com_err(whoami, error, "Unable to construct local path");
  	return error;
      }
  
      /* stat the object */
      error = stat(*expPath, &statbuf);
      if (error) {
! 	com_err(whoami, error, ";Can't stat object.");
  	return error;
      }
      /* now check if the object has an exportable (file/dir)  type */
--- 560,573 ----
  
      /* construct a local path from a canonical (wire-format) path */
      if ((error = ConstructLocalPath(dir, "/", expPath))) {
! 	afs_com_err(whoami, error, "Unable to construct local path");
  	return error;
      }
  
      /* stat the object */
      error = stat(*expPath, &statbuf);
      if (error) {
! 	afs_com_err(whoami, error, ";Can't stat object.");
  	return error;
      }
      /* now check if the object has an exportable (file/dir)  type */
Index: openafs/src/uss/uss_acl.c
diff -c openafs/src/uss/uss_acl.c:1.6 openafs/src/uss/uss_acl.c:1.6.14.1
*** openafs/src/uss/uss_acl.c:1.6	Tue Jul 15 19:17:12 2003
--- openafs/src/uss/uss_acl.c	Tue Apr 10 14:39:55 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_acl.c,v 1.6 2003/07/15 23:17:12 shadow Exp $");
  
  #include "uss_acl.h"
  #include "uss_common.h"
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_acl.c,v 1.6.14.1 2007/04/10 18:39:55 shadow Exp $");
  
  #include "uss_acl.h"
  #include "uss_common.h"
***************
*** 604,610 ****
       */
      code = uss_fs_GetACL(path_field, tmp_str, MAXSIZE);
      if (code) {
! 	com_err(uss_whoami, code, "while getting access list for %s",
  		path_field);
  #ifdef USS_ACL_DB
  	printf("%s: Error code from uss_fs_GetACL %d, errno %d\n", rn, code,
--- 604,610 ----
       */
      code = uss_fs_GetACL(path_field, tmp_str, MAXSIZE);
      if (code) {
! 	afs_com_err(uss_whoami, code, "while getting access list for %s",
  		path_field);
  #ifdef USS_ACL_DB
  	printf("%s: Error code from uss_fs_GetACL %d, errno %d\n", rn, code,
***************
*** 674,680 ****
  	    printf("\t3. Non-existent user or group on ACL.\n");
  	    return (code);
  	} else {
! 	    com_err(uss_whoami, code, "while setting the access list");
  	    return (code);
  	}
      }
--- 674,680 ----
  	    printf("\t3. Non-existent user or group on ACL.\n");
  	    return (code);
  	} else {
! 	    afs_com_err(uss_whoami, code, "while setting the access list");
  	    return (code);
  	}
      }
***************
*** 724,730 ****
  
      code = uss_fs_SetVolStat(a_path, tmp_str, sizeof(*status) + 3);
      if (code) {
! 	com_err(uss_whoami, code, "while setting disk quota");
  #ifdef USS_ACL_DB
  	printf("%s: uss_fs_SetVolStat() error code: %d, errno is %d\n", rn,
  	       code, errno);
--- 724,730 ----
  
      code = uss_fs_SetVolStat(a_path, tmp_str, sizeof(*status) + 3);
      if (code) {
! 	afs_com_err(uss_whoami, code, "while setting disk quota");
  #ifdef USS_ACL_DB
  	printf("%s: uss_fs_SetVolStat() error code: %d, errno is %d\n", rn,
  	       code, errno);
Index: openafs/src/uss/uss_kauth.c
diff -c openafs/src/uss/uss_kauth.c:1.10 openafs/src/uss/uss_kauth.c:1.10.14.1
*** openafs/src/uss/uss_kauth.c:1.10	Mon Mar 15 13:51:04 2004
--- openafs/src/uss/uss_kauth.c	Tue Apr 10 14:39:55 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_kauth.c,v 1.10 2004/03/15 18:51:04 shadow Exp $");
  
  #include "uss_kauth.h"		/*Module interface */
  #include "uss_common.h"		/*Common defs & operations */
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_kauth.c,v 1.10.14.1 2007/04/10 18:39:55 shadow Exp $");
  
  #include "uss_kauth.h"		/*Module interface */
  #include "uss_common.h"		/*Common defs & operations */
***************
*** 205,211 ****
  				       sizeof(longPassBuff),	/*Size of above */
  				       &reasonString);
  	    if (code) {
! 		com_err(uss_whoami, code, "while getting password ");
  #ifdef USS_KAUTH_DB
  		printf("%s: Error code from ka_UserReadPassword(): %d\n", rn,
  		       code);
--- 205,211 ----
  				       sizeof(longPassBuff),	/*Size of above */
  				       &reasonString);
  	    if (code) {
! 		afs_com_err(uss_whoami, code, "while getting password ");
  #ifdef USS_KAUTH_DB
  		printf("%s: Error code from ka_UserReadPassword(): %d\n", rn,
  		       code);
***************
*** 226,232 ****
  		 * to truncate the password to generate the appropriate
  		 * key.
  		 */
! 		com_err(uss_whoami, code,
  			"while getting administrator token (trying shortened password next...)");
  #ifdef USS_KAUTH_DB
  		printf("%s: Error code from ka_GetAdminToken: %d\n", rn,
--- 226,232 ----
  		 * to truncate the password to generate the appropriate
  		 * key.
  		 */
! 		afs_com_err(uss_whoami, code,
  			"while getting administrator token (trying shortened password next...)");
  #ifdef USS_KAUTH_DB
  		printf("%s: Error code from ka_GetAdminToken: %d\n", rn,
***************
*** 240,246 ****
  				     uss_Cell, &key, 24 * 60 * 60, &token,
  				     0 /*new */ );
  		if (code) {
! 		    com_err(uss_whoami, code,
  			    "while getting administrator token (possibly wrong password, or not an administrative account)");
  #ifdef USS_KAUTH_DB
  		    printf("%s: Error code from ka_GetAdminToken: %d\n", rn,
--- 240,246 ----
  				     uss_Cell, &key, 24 * 60 * 60, &token,
  				     0 /*new */ );
  		if (code) {
! 		    afs_com_err(uss_whoami, code,
  			    "while getting administrator token (possibly wrong password, or not an administrative account)");
  #ifdef USS_KAUTH_DB
  		    printf("%s: Error code from ka_GetAdminToken: %d\n", rn,
***************
*** 262,268 ****
  		 * We failed to get an admin token, but the password is
  		 * of a reasonable length, so we're just hosed.
  		 */
! 		com_err(uss_whoami, code,
  			"while getting administrator token (possibly wrong password, or not an administrative account)");
  #ifdef USS_KAUTH_DB
  		printf("%s: Error code from ka_GetAdminToken: %d\n", rn,
--- 262,268 ----
  		 * We failed to get an admin token, but the password is
  		 * of a reasonable length, so we're just hosed.
  		 */
! 		afs_com_err(uss_whoami, code,
  			"while getting administrator token (possibly wrong password, or not an administrative account)");
  #ifdef USS_KAUTH_DB
  		printf("%s: Error code from ka_GetAdminToken: %d\n", rn,
***************
*** 291,297 ****
  	ka_AuthServerConn(uss_Cell, KA_MAINTENANCE_SERVICE, &token,
  			  &uconn_kauthP);
      if (code) {
! 	com_err(uss_whoami, code,
  		"while establishing Authentication Server connection");
  #ifdef USS_KAUTH_DB
  	printf("%s: Error code from ka_AuthServerConn: %d\n", rn, code);
--- 291,297 ----
  	ka_AuthServerConn(uss_Cell, KA_MAINTENANCE_SERVICE, &token,
  			  &uconn_kauthP);
      if (code) {
! 	afs_com_err(uss_whoami, code,
  		"while establishing Authentication Server connection");
  #ifdef USS_KAUTH_DB
  	printf("%s: Error code from ka_AuthServerConn: %d\n", rn, code);
***************
*** 399,405 ****
  			    "%s: Warning: User '%s' already in Authentication DB\n",
  			    uss_whoami, a_user);
  	    } else {
! 		com_err(uss_whoami, code,
  			"while adding user '%s' to Authentication DB",
  			a_user);
  #ifdef USS_KAUTH_DB
--- 399,405 ----
  			    "%s: Warning: User '%s' already in Authentication DB\n",
  			    uss_whoami, a_user);
  	    } else {
! 		afs_com_err(uss_whoami, code,
  			"while adding user '%s' to Authentication DB",
  			a_user);
  #ifdef USS_KAUTH_DB
***************
*** 481,487 ****
  			 uss_whoami, a_user);
  		return (0);
  	    } else {
! 		com_err(uss_whoami, code,
  			"while deleting entry in Authentication DB\n");
  #ifdef USS_KAUTH_DB
  		printf("%s: Error code from KAM_DeleteUser: %d\n", rn, code);
--- 481,487 ----
  			 uss_whoami, a_user);
  		return (0);
  	    } else {
! 		afs_com_err(uss_whoami, code,
  			"while deleting entry in Authentication DB\n");
  #ifdef USS_KAUTH_DB
  		printf("%s: Error code from KAM_DeleteUser: %d\n", rn, code);
***************
*** 712,718 ****
  		    "Must specify one of the optional parameters. Continuing...\n");
  
  	if (code) {
! 	    com_err(uss_whoami, code, "calling KAM_SetFields for %s.%s",
  		    username, instance);
  
  	    return (code);
--- 712,718 ----
  		    "Must specify one of the optional parameters. Continuing...\n");
  
  	if (code) {
! 	    afs_com_err(uss_whoami, code, "calling KAM_SetFields for %s.%s",
  		    username, instance);
  
  	    return (code);
Index: openafs/src/uss/uss_ptserver.c
diff -c openafs/src/uss/uss_ptserver.c:1.7 openafs/src/uss/uss_ptserver.c:1.7.14.1
*** openafs/src/uss/uss_ptserver.c:1.7	Tue Jul 15 19:17:12 2003
--- openafs/src/uss/uss_ptserver.c	Tue Apr 10 14:39:55 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_ptserver.c,v 1.7 2003/07/15 23:17:12 shadow Exp $");
  
  #include "uss_ptserver.h"	/*Module interface */
  #include <afs/ptclient.h>	/*Protection Server client interface */
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_ptserver.c,v 1.7.14.1 2007/04/10 18:39:55 shadow Exp $");
  
  #include "uss_ptserver.h"	/*Module interface */
  #include <afs/ptclient.h>	/*Protection Server client interface */
***************
*** 90,96 ****
  			 uss_ConfDir,	/*Config directory */
  			 uss_Cell);	/*Cell to touch */
      if (code) {
! 	com_err(uss_whoami, code,
  		"while initializing Protection Server library");
  	return (code);
      }
--- 90,96 ----
  			 uss_ConfDir,	/*Config directory */
  			 uss_Cell);	/*Cell to touch */
      if (code) {
! 	afs_com_err(uss_whoami, code,
  		"while initializing Protection Server library");
  	return (code);
      }
***************
*** 176,182 ****
  	     */
  	    mappedUserID = id;
  	    if (code = pr_SNameToId(a_user, &mappedUserID)) {
! 		com_err(uss_whoami, code,
  			"while getting uid from Protection Server");
  		return (code);
  	    }
--- 176,182 ----
  	     */
  	    mappedUserID = id;
  	    if (code = pr_SNameToId(a_user, &mappedUserID)) {
! 		afs_com_err(uss_whoami, code,
  			"while getting uid from Protection Server");
  		return (code);
  	    }
***************
*** 198,204 ****
  	    /*
  	     * Got a fatal error.
  	     */
! 	    com_err(uss_whoami, code, "while accessing Protection Server");
  	    return (code);
  	}
      }
--- 198,204 ----
  	    /*
  	     * Got a fatal error.
  	     */
! 	    afs_com_err(uss_whoami, code, "while accessing Protection Server");
  	    return (code);
  	}
      }
***************
*** 268,274 ****
  		    uss_whoami, a_name);
  	} /*User not registered */
  	else {
! 	    com_err(uss_whoami, code,
  		    "while deleting user from Protection DB");
  	    return (code);
  	}			/*Fatal PTS error */
--- 268,274 ----
  		    uss_whoami, a_name);
  	} /*User not registered */
  	else {
! 	    afs_com_err(uss_whoami, code,
  		    "while deleting user from Protection DB");
  	    return (code);
  	}			/*Fatal PTS error */
***************
*** 326,332 ****
      *a_uidP = 0;
      code = pr_SNameToId(a_user, a_uidP);
      if (code) {
! 	com_err(uss_whoami, code, "while getting uid from Protection DB");
  	return (code);
      }
      if (*a_uidP == ANONYMOUSID) {
--- 326,332 ----
      *a_uidP = 0;
      code = pr_SNameToId(a_user, a_uidP);
      if (code) {
! 	afs_com_err(uss_whoami, code, "while getting uid from Protection DB");
  	return (code);
      }
      if (*a_uidP == ANONYMOUSID) {
Index: openafs/src/uss/uss_vol.c
diff -c openafs/src/uss/uss_vol.c:1.10.14.1 openafs/src/uss/uss_vol.c:1.10.14.2
*** openafs/src/uss/uss_vol.c:1.10.14.1	Thu Feb  8 20:00:22 2007
--- openafs/src/uss/uss_vol.c	Tue Apr 10 14:39:55 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_vol.c,v 1.10.14.1 2007/02/09 01:00:22 shadow Exp $");
  
  #include "uss_vol.h"		/*Interface to this module */
  #include "uss_common.h"		/*Common definitions */
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_vol.c,v 1.10.14.2 2007/04/10 18:39:55 shadow Exp $");
  
  #include "uss_vol.h"		/*Interface to this module */
  #include "uss_common.h"		/*Common definitions */
***************
*** 739,745 ****
      if (!initDone) {
  	code = InitThisModule(NoAuthFlag, uss_ConfDir, uss_Cell);
  	if (code) {
! 	    com_err(uss_whoami, code,
  		    "while inititializing VLDB connection(s)\n");
  	    return (code);
  	}
--- 739,745 ----
      if (!initDone) {
  	code = InitThisModule(NoAuthFlag, uss_ConfDir, uss_Cell);
  	if (code) {
! 	    afs_com_err(uss_whoami, code,
  		    "while inititializing VLDB connection(s)\n");
  	    return (code);
  	}
Index: openafs/src/venus/cmdebug.c
diff -c openafs/src/venus/cmdebug.c:1.19.4.2 openafs/src/venus/cmdebug.c:1.19.4.3
*** openafs/src/venus/cmdebug.c:1.19.4.2	Thu Feb  1 08:25:33 2007
--- openafs/src/venus/cmdebug.c	Tue Apr 10 14:39:56 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/cmdebug.c,v 1.19.4.2 2007/02/01 13:25:33 jaltman Exp $");
  
  
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/cmdebug.c,v 1.19.4.3 2007/04/10 18:39:56 shadow Exp $");
  
  
  #include <sys/types.h>
***************
*** 58,64 ****
      code = RXAFSCB_GetCacheConfig(aconn, 1, &srv_ver, &conflen, &c);
      if (code) {
  	printf("cmdebug: error checking cache config: %s\n",
! 	       error_message(code));
  	return 0;
      }
  
--- 58,64 ----
      code = RXAFSCB_GetCacheConfig(aconn, 1, &srv_ver, &conflen, &c);
      if (code) {
  	printf("cmdebug: error checking cache config: %s\n",
! 	       afs_error_message(code));
  	return 0;
      }
  
***************
*** 113,119 ****
          code = RXAFSCB_WhoAreYou(aconn, &addr);
      if (code) {
  	printf("cmdebug: error checking interfaces: %s\n",
! 	       error_message(code));
  	return 0;
      }
  
--- 113,119 ----
          code = RXAFSCB_WhoAreYou(aconn, &addr);
      if (code) {
  	printf("cmdebug: error checking interfaces: %s\n",
! 	       afs_error_message(code));
  	return 0;
      }
  
***************
*** 204,210 ****
  		break;
  	    /* otherwise we have an unrecognized error */
  	    printf("cmdebug: error checking locks: %s\n",
! 		   error_message(code));
  	    return code;
  	}
  	/* here we have the lock information, so display it, perhaps */
--- 204,210 ----
  		break;
  	    /* otherwise we have an unrecognized error */
  	    printf("cmdebug: error checking locks: %s\n",
! 		   afs_error_message(code));
  	    return code;
  	}
  	/* here we have the lock information, so display it, perhaps */
***************
*** 275,281 ****
  	    if (code == 1)
  		break;
  	    printf("cmdebug: failed to get cache entry %d (%s)\n", i,
! 		   error_message(code));
  	    return code;
  	}
  
--- 275,281 ----
  	    if (code == 1)
  		break;
  	    printf("cmdebug: failed to get cache entry %d (%s)\n", i,
! 		   afs_error_message(code));
  	    return code;
  	}
  
***************
*** 367,373 ****
  	    if (code == 1)
  		break;
  	    printf("cmdebug: failed to get cache entry %d (%s)\n", i,
! 		   error_message(code));
  	    return code;
  	}
  
--- 367,373 ----
  	    if (code == 1)
  		break;
  	    printf("cmdebug: failed to get cache entry %d (%s)\n", i,
! 		   afs_error_message(code));
  	    return code;
  	}
  
Index: openafs/src/venus/dedebug.c
diff -c openafs/src/venus/dedebug.c:1.1.4.1 openafs/src/venus/dedebug.c:1.1.4.2
*** openafs/src/venus/dedebug.c:1.1.4.1	Thu Feb  1 08:25:33 2007
--- openafs/src/venus/dedebug.c	Tue Apr 10 14:39:56 2007
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /cvs/openafs/src/venus/dedebug.c,v 1.1.4.1 2007/02/01 13:25:33 jaltman Exp $");
  
  
  #include <sys/types.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /cvs/openafs/src/venus/dedebug.c,v 1.1.4.2 2007/04/10 18:39:56 shadow Exp $");
  
  
  #include <sys/types.h>
***************
*** 41,47 ****
  	if (code) {
  	    if (code == 1) break;
  	    printf("cmdebug: failed to get cache entry %d (%s)\n", i,
! 		   error_message(code));
  	    return code;
  	}
  
--- 41,47 ----
  	if (code) {
  	    if (code == 1) break;
  	    printf("cmdebug: failed to get cache entry %d (%s)\n", i,
! 		   afs_error_message(code));
  	    return code;
  	}
  
Index: openafs/src/venus/fs.c
diff -c openafs/src/venus/fs.c:1.30.2.7 openafs/src/venus/fs.c:1.30.2.8
*** openafs/src/venus/fs.c:1.30.2.7	Thu Feb  8 20:00:22 2007
--- openafs/src/venus/fs.c	Tue Apr 10 14:39:56 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/fs.c,v 1.30.2.7 2007/02/09 01:00:22 shadow Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/fs.c,v 1.30.2.8 2007/04/10 18:39:56 shadow Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
***************
*** 3665,3671 ****
  	    fprintf(stderr, "%s:'%s'", pn, filename);
  	else
  	    fprintf(stderr, "%s", pn);
! 	fprintf(stderr, ": %s\n", error_message(errnum));
  	break;
      }
  }
--- 3665,3671 ----
  	    fprintf(stderr, "%s:'%s'", pn, filename);
  	else
  	    fprintf(stderr, "%s", pn);
! 	fprintf(stderr, ": %s\n", afs_error_message(errnum));
  	break;
      }
  }
Index: openafs/src/venus/livesys.c
diff -c openafs/src/venus/livesys.c:1.4.14.1 openafs/src/venus/livesys.c:1.4.14.2
*** openafs/src/venus/livesys.c:1.4.14.1	Thu Feb  1 08:25:33 2007
--- openafs/src/venus/livesys.c	Tue Apr 10 14:39:56 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/livesys.c,v 1.4.14.1 2007/02/01 13:25:33 jaltman Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/livesys.c,v 1.4.14.2 2007/04/10 18:39:56 shadow Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
***************
*** 72,78 ****
      memcpy(space, &setp, sizeof(afs_int32));
      code = pioctl(0, VIOC_AFS_SYSNAME, &blob, 1);
      if (code) {
! 	fprintf(stderr, "livesys: %s\n", error_message(code));
  	return 1;
      }
      input = space;
--- 72,78 ----
      memcpy(space, &setp, sizeof(afs_int32));
      code = pioctl(0, VIOC_AFS_SYSNAME, &blob, 1);
      if (code) {
! 	fprintf(stderr, "livesys: %s\n", afs_error_message(code));
  	return 1;
      }
      input = space;
Index: openafs/src/venus/twiddle.c
diff -c openafs/src/venus/twiddle.c:1.7.14.2 openafs/src/venus/twiddle.c:1.7.14.3
*** openafs/src/venus/twiddle.c:1.7.14.2	Thu Feb  8 20:00:22 2007
--- openafs/src/venus/twiddle.c	Tue Apr 10 14:39:56 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/twiddle.c,v 1.7.14.2 2007/02/09 01:00:22 shadow Exp $");
  
  #include <rx/xdr.h>
  #include <sys/ioctl.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/twiddle.c,v 1.7.14.3 2007/04/10 18:39:56 shadow Exp $");
  
  #include <rx/xdr.h>
  #include <sys/ioctl.h>
***************
*** 205,210 ****
  	    fprintf(stderr, "%s:'%s'", pn, filename);
  	else
  	    fprintf(stderr, "%s", pn);
! 	fprintf(stderr, ": %s\n", error_message(errno));
      }
  }				/*Die */
--- 205,210 ----
  	    fprintf(stderr, "%s:'%s'", pn, filename);
  	else
  	    fprintf(stderr, "%s", pn);
! 	fprintf(stderr, ": %s\n", afs_error_message(errno));
      }
  }				/*Die */
Index: openafs/src/venus/whatfid.c
diff -c openafs/src/venus/whatfid.c:1.5.14.1 openafs/src/venus/whatfid.c:1.5.14.2
*** openafs/src/venus/whatfid.c:1.5.14.1	Thu Feb  8 20:00:22 2007
--- openafs/src/venus/whatfid.c	Tue Apr 10 14:39:56 2007
***************
*** 14,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/whatfid.c,v 1.5.14.1 2007/02/09 01:00:22 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
--- 14,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/whatfid.c,v 1.5.14.2 2007/04/10 18:39:56 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
***************
*** 148,153 ****
  	    fprintf(stderr, "%s:'%s'", pn, filename);
  	else
  	    fprintf(stderr, "%s", pn);
! 	fprintf(stderr, ": %s\n", error_message(errno));
      }
  }				/*Die */
--- 148,153 ----
  	    fprintf(stderr, "%s:'%s'", pn, filename);
  	else
  	    fprintf(stderr, "%s", pn);
! 	fprintf(stderr, ": %s\n", afs_error_message(errno));
      }
  }				/*Die */
Index: openafs/src/viced/host.c
diff -c openafs/src/viced/host.c:1.93.2.14 openafs/src/viced/host.c:1.93.2.15
*** openafs/src/viced/host.c:1.93.2.14	Fri Jan  5 18:06:56 2007
--- openafs/src/viced/host.c	Tue Apr 10 14:39:56 2007
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/host.c,v 1.93.2.14 2007/01/05 23:06:56 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/host.c,v 1.93.2.15 2007/04/10 18:39:56 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
***************
*** 55,60 ****
--- 55,61 ----
  #include <afs/prs_fs.h>
  #include <afs/auth.h>
  #include <afs/afsutil.h>
+ #include <afs/com_err.h>
  #include <rx/rx.h>
  #include <afs/cellconfig.h>
  #include <stdlib.h>
***************
*** 321,327 ****
      if ((afsconf_GetLatestKey(tdir, 0, 0) == 0)) {
          code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex);
          if (code)
! 	    ViceLog(0, ("hpr_Initialize: clientauthsecure returns %d %s (so trying noauth)", code, error_message(code)));
          if (code)
              scIndex = 0;        /* use noauth */
          if (scIndex != 2)
--- 322,328 ----
      if ((afsconf_GetLatestKey(tdir, 0, 0) == 0)) {
          code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex);
          if (code)
! 	    ViceLog(0, ("hpr_Initialize: clientauthsecure returns %d %s (so trying noauth)", code, afs_error_message(code)));
          if (code)
              scIndex = 0;        /* use noauth */
          if (scIndex != 2)
Index: openafs/src/volser/common.c
diff -c openafs/src/volser/common.c:1.10 openafs/src/volser/common.c:1.10.14.1
*** openafs/src/volser/common.c:1.10	Fri Nov 14 23:59:16 2003
--- openafs/src/volser/common.c	Tue Apr 10 14:39:56 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/common.c,v 1.10 2003/11/15 04:59:16 shadow Exp $");
  
  #include <stdio.h>
  #include <afs/afsutil.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/common.c,v 1.10.14.1 2007/04/10 18:39:56 shadow Exp $");
  
  #include <stdio.h>
  #include <afs/afsutil.h>
***************
*** 33,39 ****
  LogError(afs_int32 errcode)
  {
      ViceLog(0,
! 	    ("%s: %s\n", error_table_name(errcode), error_message(errcode)));
  }
  
  #ifndef AFS_PTHREAD_ENV
--- 33,39 ----
  LogError(afs_int32 errcode)
  {
      ViceLog(0,
! 	    ("%s: %s\n", afs_error_table_name(errcode), afs_error_message(errcode)));
  }
  
  #ifndef AFS_PTHREAD_ENV
Index: openafs/src/volser/vsprocs.c
diff -c openafs/src/volser/vsprocs.c:1.38.2.1 openafs/src/volser/vsprocs.c:1.38.2.2
*** openafs/src/volser/vsprocs.c:1.38.2.1	Thu Feb  8 20:00:23 2007
--- openafs/src/volser/vsprocs.c	Tue Apr 10 14:39:56 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vsprocs.c,v 1.38.2.1 2007/02/09 01:00:23 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vsprocs.c,v 1.38.2.2 2007/04/10 18:39:56 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 398,405 ****
  	    initialize_VL_error_table();
  
  	    offset = errcode & ((1 << ERRCODE_RANGE) - 1);
! 	    fprintf(STDERR, "%s: %s\n", error_table_name(errcode),
! 		    error_message(errcode));
  	    break;
  	}
      }
--- 398,405 ----
  	    initialize_VL_error_table();
  
  	    offset = errcode & ((1 << ERRCODE_RANGE) - 1);
! 	    fprintf(STDERR, "%s: %s\n", afs_error_table_name(errcode),
! 		    afs_error_message(errcode));
  	    break;
  	}
      }
