[932] in testers

home help back first fref pref prev next nref lref last post

7.1B attach: a few error messages still aren't fixed...

daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Thu Jul 26 23:57:53 1990

Date: Thu, 26 Jul 90 23:55:58 -0400
From: "Jonathan I. Kamens" <jik@pit-manager.MIT.EDU>
To: testers@ATHENA.MIT.EDU


pit-manager% attach -w charon:site
charon:site: Already mounted, continuing...
attach: filesystem charon:site (charon.MIT.EDU:/site) mounted on /charon/site (read-write)

pit-manager% detach -e charon:/site
charon:/site: Directory /charon/site appears to already be unmounted
detach: charon:/site detached

Note that there are two lines above that should start with "attach: "
and "detach: " respectively that don't.  The patches below will fix
this problem.  They also fix at least one call to fprintf with too few
arguments, and at least one case of a hard-coded program name in an
error message.  Frankly, I'm surprised this wasn't fixed by jfc for
the release, since it took me less than an hour to generate these
patches by doing a tags-search for "stderr".

I would very much like to see this get into 7.1.  This has been a bug
for too long, and it's too cosmetic a change (and too easy to audit)
for it not to make it into the release.

*** /tmp/,RCSt1000717	Thu Jul 26 23:36:07 1990
--- afs.c	Thu Jul 26 22:39:37 1990
***************
*** 53,60 ****
  	setreuid(effective_uid, real_uid);
  	if (stat(at->hostdir, &statbuf)) {
  		if (errno == ENOENT)
! 			fprintf(stderr, "%s: %s does not exist\n",
! 				at->hesiodname, at->hostdir);
  		else
  			perror(at->hostdir);
  		error_status = ERR_ATTACHNOFILSYS;
--- 53,60 ----
  	setreuid(effective_uid, real_uid);
  	if (stat(at->hostdir, &statbuf)) {
  		if (errno == ENOENT)
! 			fprintf(stderr, "%s: %s: %s does not exist\n",
! 				progname, at->hesiodname, at->hostdir);
  		else
  			perror(at->hostdir);
  		error_status = ERR_ATTACHNOFILSYS;
***************
*** 62,69 ****
  		return(FAILURE);
  	}
  	if ((statbuf.st_mode & S_IFMT) != S_IFDIR) {
! 		fprintf(stderr, "%s: %s is not a directory\n",
! 			at->hesiodname, at->hostdir);
  		setreuid(real_uid, effective_uid);
  		error_status = ERR_ATTACHNOFILSYS;
  		return(FAILURE);
--- 62,69 ----
  		return(FAILURE);
  	}
  	if ((statbuf.st_mode & S_IFMT) != S_IFDIR) {
! 		fprintf(stderr, "%s: %s: %s is not a directory\n",
! 			progname, at->hesiodname, at->hostdir);
  		setreuid(real_uid, effective_uid);
  		error_status = ERR_ATTACHNOFILSYS;
  		return(FAILURE);
***************
*** 80,87 ****
  			if (!strcmp(buf, path_canon(at->hostdir))) {
  				if (!print_path)
  				    fprintf(stderr,
! 					    "%s: %s already sym linked%s\n",
! 					    at->hesiodname, at->hostdir,
  					    (afs_auth_flags & AFSAUTH_DOAUTH) ?
  					    ", authenticating..." : "");
  				if (keep_mount)
--- 80,88 ----
  			if (!strcmp(buf, path_canon(at->hostdir))) {
  				if (!print_path)
  				    fprintf(stderr,
! 					   "%s: %s: %s already sym linked%s\n",
! 					    progname, at->hesiodname,
! 					    at->hostdir,
  					    (afs_auth_flags & AFSAUTH_DOAUTH) ?
  					    ", authenticating..." : "");
  				if (keep_mount)
***************
*** 90,104 ****
  			} else {
  				if (keep_mount) {
  					fprintf(stderr,
! 	"%s: Couldn't attach; symlink from %s to %s already exists.\n",
! 			at->hesiodname, at->mntpt, buf);
  					error_status = ERR_ATTACHINUSE;
  					return(FAILURE);
  				}
  				if (unlink(at->mntpt)) {
  					fprintf(stderr,
! 	"%s: Couldn't remove existing symlink from %s to %s: %s\n",
! 			at->hesiodname, at->mntpt, buf, sys_errlist[errno]);
  					error_status = ERR_ATTACHINUSE;
  					return(FAILURE);
  				}
--- 91,108 ----
  			} else {
  				if (keep_mount) {
  					fprintf(stderr,
! 	    "%s: %s: Couldn't attach; symlink from %s to %s already exists.\n",
! 						progname, at->hesiodname,
! 						at->mntpt, buf);
  					error_status = ERR_ATTACHINUSE;
  					return(FAILURE);
  				}
  				if (unlink(at->mntpt)) {
  					fprintf(stderr,
! 		"%s: %s: Couldn't remove existing symlink from %s to %s: %s\n",
! 						progname, at->hesiodname,
! 						at->mntpt, buf,
! 						sys_errlist[errno]);
  					error_status = ERR_ATTACHINUSE;
  					return(FAILURE);
  				}
***************
*** 107,126 ****
  			if (rmdir(at->mntpt)) {
  				if (errno == ENOTEMPTY)
  					fprintf(stderr,
! 				"%s: %s is a non-empty directory.\n",
! 						at->hesiodname, at->mntpt);
  				else
  					fprintf(stderr,
! 						"%s: Couldn't rmdir %s (%s)\n",
! 						at->hesiodname, at->mntpt,
! 						sys_errlist[errno]);
  				error_status = ERR_ATTACHINUSE;
  				return(FAILURE);
  			}
  		} else {
  			fprintf(stderr,
! 				"%s: Couldn't attach; %s already exists.\n",
! 				at->hesiodname, at->mntpt);
  			error_status = ERR_ATTACHINUSE;
  			return(FAILURE);
  		}
--- 111,131 ----
  			if (rmdir(at->mntpt)) {
  				if (errno == ENOTEMPTY)
  					fprintf(stderr,
! 				      "%s: %s: %s is a non-empty directory.\n",
! 						progname, at->hesiodname,
! 						at->mntpt);
  				else
  					fprintf(stderr,
! 					    "%s: %s: Couldn't rmdir %s (%s)\n",
! 						progname, at->hesiodname,
! 						at->mntpt, sys_errlist[errno]);
  				error_status = ERR_ATTACHINUSE;
  				return(FAILURE);
  			}
  		} else {
  			fprintf(stderr,
! 			       "%s: %s: Couldn't attach; %s already exists.\n",
! 				progname, at->hesiodname, at->mntpt);
  			error_status = ERR_ATTACHINUSE;
  			return(FAILURE);
  		}
***************
*** 142,148 ****
  	if (debug_flag)
  		printf("symlinking %s to %s\n", at->hostdir, at->mntpt);
  	if (symlink(at->hostdir, at->mntpt) < 0) {
! 		fprintf(stderr, "%s: ", at->hesiodname);
  		perror(at->hostdir);
  /*		error_status = ERR_; */
  		return(FAILURE);
--- 147,153 ----
  	if (debug_flag)
  		printf("symlinking %s to %s\n", at->hostdir, at->mntpt);
  	if (symlink(at->hostdir, at->mntpt) < 0) {
! 		fprintf(stderr, "%s: %s: ", progname, at->hesiodname);
  		perror(at->hostdir);
  /*		error_status = ERR_; */
  		return(FAILURE);
***************
*** 249,256 ****
  	
  	if (error_ret = waitb.w_retcode) {
  		fprintf(stderr,
! 			"%s: aklog returned a bad exit status (%d)\n",
! 			errorname, error_ret);
  		error_status = ERR_AUTHFAIL;
  		return (FAILURE);
  	}
--- 254,261 ----
  	
  	if (error_ret = waitb.w_retcode) {
  		fprintf(stderr,
! 			"%s: %s: aklog returned a bad exit status (%d)\n",
! 			progname, errorname, error_ret);
  		error_status = ERR_AUTHFAIL;
  		return (FAILURE);
  	}
*** /tmp/,RCSt1000717	Thu Jul 26 23:36:19 1990
--- config.c	Thu Jul 26 22:52:07 1990
***************
*** 84,90 ****
  
  static void config_abort()
  {
! 	fprintf(stderr, " Aborting...\n");
  	exit(ERR_BADCONF);
  }
  
--- 84,90 ----
  
  static void config_abort()
  {
! 	fprintf(stderr, "%s: Aborting...\n", progname);
  	exit(ERR_BADCONF);
  }
  
***************
*** 129,136 ****
  		}
  		if (!kp->key) {
  			if (debug_flag)
! 		fprintf(stderr, "%s: bad keyword in config file\n",
! 					keyword);
  		}
  	}
  	return(SUCCESS);
--- 129,136 ----
  		}
  		if (!kp->key) {
  			if (debug_flag)
! 		fprintf(stderr, "%s: %s: bad keyword in config file\n",
! 			progname, keyword);
  		}
  	}
  	return(SUCCESS);
***************
*** 148,155 ****
  	else {
  		if (arg == -1)
  			fprintf(stderr,
! 				"%s: Argument to %s must be on or off!\n",
! 				argument, keyword);
  		else
  			* (int *) variable = arg;	/* Default */
  	}
--- 148,155 ----
  	else {
  		if (arg == -1)
  			fprintf(stderr,
! 				"%s: %s: Argument to %s must be on or off!\n",
! 				progname, argument, keyword);
  		else
  			* (int *) variable = arg;	/* Default */
  	}
***************
*** 162,169 ****
  {
  	if (!argument || !*argument) {
  		fprintf(stderr,
! 			"%s: missing argument in config file!\n",
! 			keyword);
  		config_abort();
  	}
  	if (* (char **) variable)
--- 162,169 ----
  {
  	if (!argument || !*argument) {
  		fprintf(stderr,
! 			"%s: %s: missing argument in config file!\n",
! 			progname, keyword);
  		config_abort();
  	}
  	if (* (char **) variable)
***************
*** 181,188 ****
  	fslist = (struct filesys_tab *) variable;
  	while (argument && *argument) {
  		if (fslist->idx >= MAXFILTAB) {
! 			fprintf(stderr, "Exceeded filesystem table for %s!\n",
! 				keyword);
  			config_abort();
  		}
  		fslist->tab[fslist->idx].fs_type = get_fstype(&argument,
--- 181,189 ----
  	fslist = (struct filesys_tab *) variable;
  	while (argument && *argument) {
  		if (fslist->idx >= MAXFILTAB) {
! 			fprintf(stderr,
! 				"%s: Exceeded filesystem table for %s!\n",
! 				progname, keyword);
  			config_abort();
  		}
  		fslist->tab[fslist->idx].fs_type = get_fstype(&argument,
***************
*** 206,213 ****
  	
  	fslist = (struct filesys_tab *) variable;
  	if (fslist->idx >= MAXFILTAB) {
! 		fprintf(stderr, "Exceeded filesystem table for %s!\n",
! 			keyword);
  		config_abort();
  	}
  	fslist->tab[fslist->idx].fs_type = get_fstype(&argument,
--- 207,214 ----
  	
  	fslist = (struct filesys_tab *) variable;
  	if (fslist->idx >= MAXFILTAB) {
! 		fprintf(stderr, "%s: Exceeded filesystem table for %s!\n",
! 			progname, keyword);
  		config_abort();
  	}
  	fslist->tab[fslist->idx].fs_type = get_fstype(&argument,
***************
*** 224,230 ****
  		fslist->tab[fslist->idx].tab_data = strdup(cp);
  	} else {
  		fprintf(stderr,
! 			"%s: missing filesystem definition in config file\n");
  		config_abort();
  	}
  	fslist->idx++;
--- 225,232 ----
  		fslist->tab[fslist->idx].tab_data = strdup(cp);
  	} else {
  		fprintf(stderr,
! 		      "%s: %s: missing filesystem definition in config file\n",
! 			progname);
  		config_abort();
  	}
  	fslist->idx++;
***************
*** 265,272 ****
  	if (explicit)
  		*explicit = exp;
  	if (!index(cp, '}')) {
! 		fprintf(stderr,"Error in filesystem specification:\n{%s\n",
! 			cp);
  		config_abort();
  	}
  	if (*cp == '^') {
--- 267,274 ----
  	if (explicit)
  		*explicit = exp;
  	if (!index(cp, '}')) {
! 		fprintf(stderr,"%s: Error in filesystem specification:\n{%s\n",
! 			progname, cp);
  		config_abort();
  	}
  	if (*cp == '^') {
***************
*** 285,292 ****
  		fs = get_fs(ptrstart);
  		if (!fs) {
  			fprintf(stderr,
! 				"%s: Illegal filesystem type in config file\n",
! 				ptrstart);
  			config_abort();
  		}
  		type += fs->type;
--- 287,294 ----
  		fs = get_fs(ptrstart);
  		if (!fs) {
  			fprintf(stderr,
! 			    "%s: %s: Illegal filesystem type in config file\n",
! 				progname, ptrstart);
  			config_abort();
  		}
  		type += fs->type;
***************
*** 311,318 ****
  	ul = (struct uid_tab *) variable;
  	while (argument && *argument) {
  		if (ul->idx >= MAXTRUIDTAB) {
! 			fprintf(stderr, "Exceeded user table for %s!\n",
! 				keyword);
  			config_abort();
  		}
  		if (isnumber(argument))
--- 313,320 ----
  	ul = (struct uid_tab *) variable;
  	while (argument && *argument) {
  		if (ul->idx >= MAXTRUIDTAB) {
! 			fprintf(stderr, "%s: Exceeded user table for %s!\n",
! 				progname, keyword);
  			config_abort();
  		}
  		if (isnumber(argument))
***************
*** 323,330 ****
  			else {
  				if (debug_flag) 
  					fprintf(stderr,
! 					"Unknown user %s in config file\n",
! 						argument);
  				argument = strtok(NULL, TOKSEP);
  				continue;
  			}
--- 325,332 ----
  			else {
  				if (debug_flag) 
  					fprintf(stderr,
! 					"%s: Unknown user %s in config file\n",
! 						progname, argument);
  				argument = strtok(NULL, TOKSEP);
  				continue;
  			}
***************
*** 363,370 ****
  		if (!(fp->fs_type & type))
  			continue;
  		if (err=re_comp(fp->regexp)) {
! 			fprintf(stderr, "Nosetuid config: %s: %s",
! 				err, fp->regexp);
  			return(default_suid);
  		}
  		if (re_exec(name))
--- 365,372 ----
  		if (!(fp->fs_type & type))
  			continue;
  		if (err=re_comp(fp->regexp)) {
! 			fprintf(stderr, "%s: Nosetuid config: %s: %s",
! 				progname, err, fp->regexp);
  			return(default_suid);
  		}
  		if (re_exec(name))
***************
*** 387,394 ****
  		if (!(fp->fs_type & type))
  			continue;
  		if (err=re_comp(fp->regexp)) {
! 			fprintf(stderr, "Allow config: %s: %s",
! 				err, fp->regexp);
  			return(1); 
  		}
  		if (re_exec(name))
--- 389,396 ----
  		if (!(fp->fs_type & type))
  			continue;
  		if (err=re_comp(fp->regexp)) {
! 			fprintf(stderr, "%s: Allow config: %s: %s",
! 				progname, err, fp->regexp);
  			return(1); 
  		}
  		if (re_exec(name))
***************
*** 411,418 ****
  		if (!(fp->fs_type & type))
  			continue;
  		if (err=re_comp(fp->regexp)) {
! 			fprintf(stderr, "Mountpoint config: %s: %s",
! 				err, fp->regexp);
  			return(1);
  		}
  		if (re_exec(name))
--- 413,420 ----
  		if (!(fp->fs_type & type))
  			continue;
  		if (err=re_comp(fp->regexp)) {
! 			fprintf(stderr, "%s: Mountpoint config: %s: %s",
! 				progname, err, fp->regexp);
  			return(1);
  		}
  		if (re_exec(name))
***************
*** 475,482 ****
  		if (!(fp->fs_type & type))
  			continue;
  		if (err=re_comp(fp->regexp)) {
! 			fprintf(stderr, "Mountpoint config: %s: %s",
! 				err, fp->regexp);
  			config_abort();
  		}
  		if (re_exec(name))
--- 477,484 ----
  		if (!(fp->fs_type & type))
  			continue;
  		if (err=re_comp(fp->regexp)) {
! 			fprintf(stderr, "%s: Mountpoint config: %s: %s",
! 				progname, err, fp->regexp);
  			config_abort();
  		}
  		if (re_exec(name))
*** /tmp/,RCSt1000717	Thu Jul 26 23:36:22 1990
--- main.c	Thu Jul 26 22:55:48 1990
***************
*** 132,138 ****
  			    argc -= 2;
  		    } else {
  			    fprintf(stderr,
! 				    "Must specify attach, detach or nfsid!\n");
  			    exit(ERR_BADARGS);
  		    } 
  	    } 
--- 132,139 ----
  			    argc -= 2;
  		    } else {
  			    fprintf(stderr,
! 				 "%s: Must specify attach, detach or nfsid!\n",
! 				    argv[0]);
  			    exit(ERR_BADARGS);
  		    } 
  	    } 
***************
*** 158,164 ****
  	exit(zinitcmd(argc, argv));
  #endif
  
!     fprintf(stderr, "Not invoked with attach, detach, nfsid, or zinit!\n");
      exit(ERR_BADARGS);
  }
  
--- 159,166 ----
  	exit(zinitcmd(argc, argv));
  #endif
  
!     fprintf(stderr, "%s: Not invoked with attach, detach, nfsid, or zinit!\n",
! 	    progname);
      exit(ERR_BADARGS);
  }
  
*** /tmp/,RCSt1000717	Thu Jul 26 23:36:26 1990
--- mount.c	Thu Jul 26 23:04:42 1990
***************
*** 64,71 ****
  	/* Already mounted? Why lose? */
  	if (mounted(&mnt)) {
  		fprintf(stderr,
! 			"%s: Already mounted, continuing...\n",
! 			at->hesiodname);
  		if (keep_mount)
  			at->flags |= FLAG_PERMANENT;
  		return (SUCCESS);
--- 64,71 ----
  	/* Already mounted? Why lose? */
  	if (mounted(&mnt)) {
  		fprintf(stderr,
! 			"%s: %s: Already mounted, continuing...\n",
! 			progname, at->hesiodname);
  		if (keep_mount)
  			at->flags |= FLAG_PERMANENT;
  		return (SUCCESS);
***************
*** 84,91 ****
  		if (nfs_mount(mnt.mnt_dir, &data.nfs_args, mopt->flags) != 0) {
  			if (errorout)
  				fprintf(stderr,
! 					"%s: Can't mount %s on %s - %s\n",
! 					at->hesiodname, fsname, mnt.mnt_dir,
  					sys_errlist[errno]);
  			return (FAILURE);
  		} else {
--- 84,92 ----
  		if (nfs_mount(mnt.mnt_dir, &data.nfs_args, mopt->flags) != 0) {
  			if (errorout)
  				fprintf(stderr,
! 					"%s: %s: Can't mount %s on %s - %s\n",
! 					progname, at->hesiodname,
! 					fsname, mnt.mnt_dir,
  					sys_errlist[errno]);
  			return (FAILURE);
  		} else {
***************
*** 94,101 ****
  		  if(dstat(mnt.mnt_dir, &st_buf, sizeof(st_buf)) != 0) {
  		    if (errorout)
  		      fprintf(stderr,
! 			      "%s: Can't stat %s to verify mount: %s\n",
! 			      at->hesiodname, mnt.mnt_dir, sys_errlist[errno]);
  		    return (FAILURE);
  		  } else {
  		    mnt.mnt_gfs = st_buf.dst_gfs;
--- 95,103 ----
  		  if(dstat(mnt.mnt_dir, &st_buf, sizeof(st_buf)) != 0) {
  		    if (errorout)
  		      fprintf(stderr,
! 			      "%s: %s: Can't stat %s to verify mount: %s\n",
! 			      progname, at->hesiodname, mnt.mnt_dir,
! 			      sys_errlist[errno]);
  		    return (FAILURE);
  		  } else {
  		    mnt.mnt_gfs = st_buf.dst_gfs;
***************
*** 114,121 ****
  #endif /* ultrix */
  		if (errorout) {
  			fprintf(stderr,
! 				"%s: Can't mount %s on %s - %s\n",
! 				at->hesiodname, fsname, mnt.mnt_dir,
  				sys_errlist[errno]);
  			error_status = ERR_SOMETHING;
  		}
--- 116,123 ----
  #endif /* ultrix */
  		if (errorout) {
  			fprintf(stderr,
! 				"%s: %s: Can't mount %s on %s - %s\n",
! 				progname, at->hesiodname, fsname, mnt.mnt_dir,
  				sys_errlist[errno]);
  			error_status = ERR_SOMETHING;
  		}
***************
*** 166,180 ****
  	if (errored_out(at->hostaddr)) {
  		if (errorout)
  			fprintf(stderr,
! 		"%s: Ignoring %s due to previous host errors\n",
! 				at->hesiodname, at->host);
  		return (FAILURE);
  	}
      
  	if ((client = rpc_create(at->hostaddr, &sin)) == NULL) {
  		if (errorout)
! 			fprintf(stderr, "%s: Server %s not responding\n",
! 				at->hesiodname, at->host);
  		return (FAILURE);
  	}
      
--- 168,182 ----
  	if (errored_out(at->hostaddr)) {
  		if (errorout)
  			fprintf(stderr,
! 			   "%s: %s: Ignoring %s due to previous host errors\n",
! 				progname, at->hesiodname, at->host);
  		return (FAILURE);
  	}
      
  	if ((client = rpc_create(at->hostaddr, &sin)) == NULL) {
  		if (errorout)
! 			fprintf(stderr, "%s: %s: Server %s not responding\n",
! 				progname, at->hesiodname, at->host);
  		return (FAILURE);
  	}
      
***************
*** 193,219 ****
  		switch (rpc_stat) {
  		case RPC_TIMEDOUT:
  			fprintf(stderr,
! 			"%s: Timeout while contacting mount daemon on %s\n",
! 				at->hesiodname, at->host);
  			break;
  		case RPC_AUTHERROR:
! 			fprintf(stderr, "%s: Authentication failed\n",
! 				at->hesiodname, at->host);
  			break;
  		case RPC_PMAPFAILURE:
! 			fprintf(stderr, "%s: Can't find mount daemon on %s\n",
! 				at->hesiodname, at->host);
  			break;
  		case RPC_PROGUNAVAIL:
  		case RPC_PROGNOTREGISTERED:
  			fprintf(stderr,
! 				"%s: Mount daemon not available on %s\n",
! 				at->hesiodname, at->host);
  			break;
  		default:
  			fprintf(stderr,
! 				"%s: System error contacting server %s\n",
! 				at->hesiodname, at->host);
  			break;
  		} 
  		return (FAILURE);
--- 195,222 ----
  		switch (rpc_stat) {
  		case RPC_TIMEDOUT:
  			fprintf(stderr,
! 		       "%s: %s: Timeout while contacting mount daemon on %s\n",
! 				progname, at->hesiodname, at->host);
  			break;
  		case RPC_AUTHERROR:
! 			fprintf(stderr, "%s: %s: Authentication failed\n",
! 				progname, at->hesiodname, at->host);
  			break;
  		case RPC_PMAPFAILURE:
! 			fprintf(stderr,
! 				"%s: %s: Can't find mount daemon on %s\n",
! 				progname, at->hesiodname, at->host);
  			break;
  		case RPC_PROGUNAVAIL:
  		case RPC_PROGNOTREGISTERED:
  			fprintf(stderr,
! 				"%s: %s: Mount daemon not available on %s\n",
! 				progname, at->hesiodname, at->host);
  			break;
  		default:
  			fprintf(stderr,
! 				"%s: %s: System error contacting server %s\n",
! 				progname, at->hesiodname, at->host);
  			break;
  		} 
  		return (FAILURE);
***************
*** 223,243 ****
  		if (errorout) {
  			if (errno == EACCES) {
  				fprintf(stderr,
! 				"%s: Mount access denied by server %s\n",
! 					at->hesiodname, at->host);
  				error_status = ERR_ATTACHNOTALLOWED;
  			} else if (errno < sys_nerr) {
  				error_status = (errno == ENOENT) ? 
  				  ERR_ATTACHNOFILSYS : ERR_ATTACHNOTALLOWED;
  				fprintf(stderr,
! 			"%s: Error message returned from server %s: %s\n",
! 					at->hesiodname, at->host,
  					sys_errlist[errno]);
  			} else {
  				error_status = ERR_ATTACHNOTALLOWED;
  				fprintf(stderr,
! 			"%s: Error status %d returned from server %s\n",
! 					at->hesiodname, errno, at->host);
  			}
  		}
  		return (FAILURE);
--- 226,247 ----
  		if (errorout) {
  			if (errno == EACCES) {
  				fprintf(stderr,
! 				  "%s: %s: Mount access denied by server %s\n",
! 					progname, at->hesiodname, at->host);
  				error_status = ERR_ATTACHNOTALLOWED;
  			} else if (errno < sys_nerr) {
  				error_status = (errno == ENOENT) ? 
  				  ERR_ATTACHNOFILSYS : ERR_ATTACHNOTALLOWED;
  				fprintf(stderr,
! 			 "%s: %s: Error message returned from server %s: %s\n",
! 					progname, at->hesiodname, at->host,
  					sys_errlist[errno]);
  			} else {
  				error_status = ERR_ATTACHNOTALLOWED;
  				fprintf(stderr,
! 			   "%s: %s: Error status %d returned from server %s\n",
! 					progname, at->hesiodname, errno,
! 					at->host);
  			}
  		}
  		return (FAILURE);
***************
*** 316,322 ****
      lock_mtab();
      mnted = setmntent(mtab_fn, "r+");
      if (!mnted || addmntent(mnted, mnt)) {
! 	    fprintf(stderr, "Can't append to %s: %s\n", mtab_fn,
  		    sys_errlist[errno]);
  	    unlock_mtab();
  	    exit(ERR_FATAL);
--- 320,326 ----
      lock_mtab();
      mnted = setmntent(mtab_fn, "r+");
      if (!mnted || addmntent(mnted, mnt)) {
! 	    fprintf(stderr, "%s: Can't append to %s: %s\n", progname, mtab_fn,
  		    sys_errlist[errno]);
  	    unlock_mtab();
  	    exit(ERR_FATAL);
***************
*** 335,341 ****
      lock_mtab();
      mnttab = setmntent(mtab_fn, "r");
      if (!mnttab) {
! 	    fprintf(stderr, "Can't open %s for read\n", mtab_fn);
  	    exit(ERR_FATAL);
      }
      while (mnt = getmntent(mnttab)) {
--- 339,345 ----
      lock_mtab();
      mnttab = setmntent(mtab_fn, "r");
      if (!mnttab) {
! 	    fprintf(stderr, "%s: Can't open %s for read\n", progname, mtab_fn);
  	    exit(ERR_FATAL);
      }
      while (mnt = getmntent(mnttab)) {
*** /tmp/,RCSt1000717	Thu Jul 26 23:36:31 1990
--- pathcan.c	Mon Jul 16 09:21:28 1990
***************
*** 1,11 ****
  /*
!  *	$Source: /afs/rel-eng.athena.mit.edu/project/release/future/source/athena/bin.athena/attach/RCS/pathcan.c,v $
   *	$Author: jfc $
!  *	$Header: /afs/rel-eng.athena.mit.edu/project/release/future/source/athena/bin.athena/attach/RCS/pathcan.c,v 1.1 90/04/19 12:24:50 jfc Exp Locker: jfc $
   */
  
  #ifndef lint
! static char *rcsid_pathcan_c = "$Header: /afs/rel-eng.athena.mit.edu/project/release/future/source/athena/bin.athena/attach/RCS/pathcan.c,v 1.1 90/04/19 12:24:50 jfc Exp Locker: jfc $";
  #endif lint
  
  #include <stdio.h>
--- 1,11 ----
  /*
!  *	$Source: /afs/rel-eng.athena.mit.edu/project/release/current/source/athena/bin.athena/attach/RCS/pathcan.c,v $
   *	$Author: jfc $
!  *	$Header: /afs/rel-eng.athena.mit.edu/project/release/current/source/athena/bin.athena/attach/RCS/pathcan.c,v 1.1 90/04/19 12:24:50 jfc Exp Locker: jfc $
   */
  
  #ifndef lint
! static char *rcsid_pathcan_c = "$Header: /afs/rel-eng.athena.mit.edu/project/release/current/source/athena/bin.athena/attach/RCS/pathcan.c,v 1.1 90/04/19 12:24:50 jfc Exp Locker: jfc $";
  #endif lint
  
  #include <stdio.h>
*** /tmp/,RCSt1000717	Thu Jul 26 23:36:33 1990
--- rpc.c	Thu Jul 26 23:08:03 1990
***************
*** 308,315 ****
  		fprintf(stderr,
  			"%s: (warning) Host %s isn't registered with kerberos\n",
  			progname, host);
! 		fprintf(stderr, "\tmapping failed for filesystem %s.\n",
! 			errname);
  		return(SUCCESS);
  	      } else {
  		fprintf(stderr, "%s: Host %s isn't registered with kerberos\n",
--- 308,315 ----
  		fprintf(stderr,
  			"%s: (warning) Host %s isn't registered with kerberos\n",
  			progname, host);
! 		fprintf(stderr, "%s: \tmapping failed for filesystem %s.\n",
! 			progname, errname);
  		return(SUCCESS);
  	      } else {
  		fprintf(stderr, "%s: Host %s isn't registered with kerberos\n",
***************
*** 321,327 ****
  		  fprintf(stderr, "%s: Could not get Kerberos ticket for filesystem %s\n",
  			  progname, errname);
  		  fprintf(stderr, "%s: realm %s instance %s, kerberos error is: %s\n",
! 			  realm, instance,
  			  krb_err_txt[status]);
  		}
  	    }
--- 321,327 ----
  		  fprintf(stderr, "%s: Could not get Kerberos ticket for filesystem %s\n",
  			  progname, errname);
  		  fprintf(stderr, "%s: realm %s instance %s, kerberos error is: %s\n",
! 			  progname, realm, instance,
  			  krb_err_txt[status]);
  		}
  	    }
***************
*** 362,369 ****
  		fprintf(stderr, "%s: timeout while contacting mount daemon on %s (for filesystem %s)\n",
  			progname, host, errname);
  		if (inattach)
! 		    fprintf(stderr, "\twhile mapping - try attach -n\n",
! 			    errname);
  		error_status = ERR_HOST;
  		break;
  	    case RPC_AUTHERROR:
--- 362,369 ----
  		fprintf(stderr, "%s: timeout while contacting mount daemon on %s (for filesystem %s)\n",
  			progname, host, errname);
  		if (inattach)
! 		    fprintf(stderr, "%s: \twhile mapping - try attach -n\n",
! 			    progname, errname);
  		error_status = ERR_HOST;
  		break;
  	    case RPC_AUTHERROR:
*** /tmp/,RCSt1000717	Thu Jul 26 23:36:35 1990
--- rvd.c	Thu Jul 26 23:09:21 1990
***************
*** 34,40 ****
      
      if (avail_drive(at->hostaddr, at->hostdir, &vddrive) == FAILURE) {
  	if (errorout)
! 	    fprintf(stderr, "%s: No free RVD drives\n", at->hesiodname);
  	return (FAILURE);
      }
  
--- 34,41 ----
      
      if (avail_drive(at->hostaddr, at->hostdir, &vddrive) == FAILURE) {
  	if (errorout)
! 	    fprintf(stderr, "%s: %s: No free RVD drives\n", progname,
! 		    at->hesiodname);
  	return (FAILURE);
      }
  
***************
*** 48,55 ****
      while (rvd_spinup(at->hostaddr, at->hostdir,
  		      vddrive, at->mode, at->host, passwd) == FAILURE &&
  	   rvderrno == RVDEBPWD) {
! 	fprintf(stderr, "%s: Need password for RVD spinup\n",
! 		at->hesiodname);
  	if (!isatty(fileno(stdin))) {
  	    error_status = ERR_ATTACHNEEDPW;
  	    return (FAILURE);
--- 49,56 ----
      while (rvd_spinup(at->hostaddr, at->hostdir,
  		      vddrive, at->mode, at->host, passwd) == FAILURE &&
  	   rvderrno == RVDEBPWD) {
! 	fprintf(stderr, "%s: %s: Need password for RVD spinup\n",
! 		progname, at->hesiodname);
  	if (!isatty(fileno(stdin))) {
  	    error_status = ERR_ATTACHNEEDPW;
  	    return (FAILURE);
***************
*** 56,63 ****
  	}
  	passwd = (char *)getpass("Password:");
  	if (!*passwd) {
! 	    fprintf(stderr, "%s: Null password, ignoring filesystem\n",
! 		    at->hesiodname);
  	    return (FAILURE);
  	}
      }
--- 57,64 ----
  	}
  	passwd = (char *)getpass("Password:");
  	if (!*passwd) {
! 	    fprintf(stderr, "%s: %s: Null password, ignoring filesystem\n",
! 		    progname, at->hesiodname);
  	    return (FAILURE);
  	}
      }
***************
*** 65,72 ****
      if (rvderrno && rvderrno != RVDEIDA &&
  	rvderrno != EBUSY /* kernel bug */) {
  	if (errorout)
! 	    fprintf(stderr, "%s: Error in RVD spinup: %d -> %s\n",
! 		    at->hesiodname, rvderrno, rvd_error(rvderrno));
  	switch(rvderrno)
  	  {
  	  case RVDENOENT:
--- 66,73 ----
      if (rvderrno && rvderrno != RVDEIDA &&
  	rvderrno != EBUSY /* kernel bug */) {
  	if (errorout)
! 	    fprintf(stderr, "%s: %s: Error in RVD spinup: %d -> %s\n",
! 		    progname, at->hesiodname, rvderrno, rvd_error(rvderrno));
  	switch(rvderrno)
  	  {
  	  case RVDENOENT:
***************
*** 145,152 ****
      strcpy(temp, name);
      pack = index(temp, ':');
      if (!pack) {
! 	fprintf(stderr, "%s: Illegal explicit definition for type %s\n",
! 		name, filsys_type);
  	return (0);
      }
      *pack = '\0';
--- 146,153 ----
      strcpy(temp, name);
      pack = index(temp, ':');
      if (!pack) {
! 	fprintf(stderr, "%s: %s: Illegal explicit definition for type %s\n",
! 		progname, name, filsys_type);
  	return (0);
      }
      *pack = '\0';
*** /tmp/,RCSt1000717	Thu Jul 26 23:36:37 1990
--- rvdutil.c	Thu Jul 26 23:10:01 1990
***************
*** 72,78 ****
  	return;
      vdcntrl = open(VDCONTROL, O_RDONLY, 0);
      if (vdcntrl < 0) {
! 	    fprintf(stderr, "Can't open RVD control device\n");
  	    exit(ERR_FATAL);
      }
  }
--- 72,78 ----
  	return;
      vdcntrl = open(VDCONTROL, O_RDONLY, 0);
      if (vdcntrl < 0) {
! 	    fprintf(stderr, "%s: Can't open RVD control device\n", progname);
  	    exit(ERR_FATAL);
      }
  }
***************
*** 106,122 ****
      rvd_open();
      
      if (ioctl(vdcntrl, VDIOCGETSTAT, &stats) < 0) {
! 	    fprintf(stderr, "Can't perform VDIOCGETSTAT for RVD\n");
  	    exit(ERR_FATAL);
      }
  
      if (!(drives = (struct vd_long_dev *)malloc(lstats.num_drives*
  						sizeof(struct vd_long_dev)))) {
! 	    fprintf(stderr, "Can't malloc rvd information table.\n");
  	    exit(ERR_FATAL);
      }
      if (ioctl(vdcntrl, VDIOCGETDRIVE, &drives) < 0) {
! 	    fprintf(stderr, "Can't perform VDIOCGETDRIVE for RVD\n");
  	    exit(ERR_FATAL);
      }
      for (i=0, d=drives; i < lstats.num_drives; i++, d++) {
--- 106,125 ----
      rvd_open();
      
      if (ioctl(vdcntrl, VDIOCGETSTAT, &stats) < 0) {
! 	    fprintf(stderr, "%s: Can't perform VDIOCGETSTAT for RVD\n",
! 		    progname);
  	    exit(ERR_FATAL);
      }
  
      if (!(drives = (struct vd_long_dev *)malloc(lstats.num_drives*
  						sizeof(struct vd_long_dev)))) {
! 	    fprintf(stderr, "%s: Can't malloc rvd information table.\n",
! 		    progname);
  	    exit(ERR_FATAL);
      }
      if (ioctl(vdcntrl, VDIOCGETDRIVE, &drives) < 0) {
! 	    fprintf(stderr, "%s: Can't perform VDIOCGETDRIVE for RVD\n",
! 		    progname);
  	    exit(ERR_FATAL);
      }
      for (i=0, d=drives; i < lstats.num_drives; i++, d++) {
*** /tmp/,RCSt1000717	Thu Jul 26 23:36:38 1990
--- ufs.c	Thu Jul 26 23:10:56 1990
***************
*** 72,78 ****
  	struct mntopts	*mopt;
  	int errorout;		/* ignored */
  {
! 	fprintf(stderr, "%s: error: %s\n", at->hesiodname, at->hostdir);
  	return(FAILURE);
  }
  
--- 72,79 ----
  	struct mntopts	*mopt;
  	int errorout;		/* ignored */
  {
! 	fprintf(stderr, "%s: %s: error: %s\n", progname, at->hesiodname,
! 		at->hostdir);
  	return(FAILURE);
  }
  
***************
*** 155,162 ****
  	
  	if (error_ret = waitb.w_retcode) {
  		fprintf(stderr,
! 			"%s: fsck returned a bad exit status (%d)\n",
! 			errorname, error_ret);
  		error_status = ERR_ATTACHFSCK;
  		return (FAILURE);
  	}
--- 156,163 ----
  	
  	if (error_ret = waitb.w_retcode) {
  		fprintf(stderr,
! 			"%s: %s: fsck returned a bad exit status (%d)\n",
! 			progname, errorname, error_ret);
  		error_status = ERR_ATTACHFSCK;
  		return (FAILURE);
  	}
*** /tmp/,RCSt1000717	Thu Jul 26 23:36:40 1990
--- unmount.c	Thu Jul 26 22:29:49 1990
***************
*** 50,57 ****
      }
      if (!found) {
  	fprintf(stderr,
! 		"%s: Directory %s appears to already be unmounted\n",
! 		errname, mntpt);
  	return(SUCCESS);
      }
  /* this hack to avoid ugly ifdef's */
--- 50,57 ----
      }
      if (!found) {
  	fprintf(stderr,
! 		"%s: %s: Directory %s appears to already be unmounted\n",
! 		progname, errname, mntpt);
  	return(SUCCESS);
      }
  /* this hack to avoid ugly ifdef's */
***************
*** 61,72 ****
      if (unmount(mntpt) < 0) {
  	if (errno == EINVAL || errno == ENOENT) {
  		fprintf(stderr,
! 			"%s: Directory %s appears to already be unmounted\n",
! 			errname, mntpt);
  		/* Continue on, to flush mtab if necessary */
  	} else {
! 		fprintf(stderr, "%s: Unable to unmount %s: %s\n", errname,
! 			mntpt, sys_errlist[errno]);
  		return (FAILURE);
  	}
      }
--- 61,72 ----
      if (unmount(mntpt) < 0) {
  	if (errno == EINVAL || errno == ENOENT) {
  		fprintf(stderr,
! 		      "%s: %s: Directory %s appears to already be unmounted\n",
! 			progname, errname, mntpt);
  		/* Continue on, to flush mtab if necessary */
  	} else {
! 		fprintf(stderr, "%s: %s: Unable to unmount %s: %s\n", progname,
! 			errname, mntpt, sys_errlist[errno]);
  		return (FAILURE);
  	}
      }
***************
*** 78,84 ****
  
      lock_mtab();
      if (!(tmpname = malloc(strlen(mtab_fn)+7))) {
! 	    fprintf(stderr, "Can't malloc temp filename for unmount!\n");
  	    exit(ERR_FATAL);
      }
      (void) strcpy(tmpname, mtab_fn);
--- 78,85 ----
  
      lock_mtab();
      if (!(tmpname = malloc(strlen(mtab_fn)+7))) {
! 	    fprintf(stderr, "%s: Can't malloc temp filename for unmount!\n",
! 		    progname);
  	    exit(ERR_FATAL);
      }
      (void) strcpy(tmpname, mtab_fn);
***************
*** 85,91 ****
      (void) strcat(tmpname, "XXXXXX");
      mktemp(tmpname);
      if ((tmpfd = open(tmpname, O_RDWR|O_CREAT|O_TRUNC, 0644)) < 0) {
! 	    fprintf(stderr, "Can't open temporary file for umount!\n");
  	    exit(ERR_FATAL);
      }
      close(tmpfd);
--- 86,93 ----
      (void) strcat(tmpname, "XXXXXX");
      mktemp(tmpname);
      if ((tmpfd = open(tmpname, O_RDWR|O_CREAT|O_TRUNC, 0644)) < 0) {
! 	    fprintf(stderr, "%s: Can't open temporary file for umount!\n",
! 		    progname);
  	    exit(ERR_FATAL);
      }
      close(tmpfd);
***************
*** 92,104 ****
      tmpmnt = setmntent(tmpname, "w");
      if (!tmpmnt) {
  	    fprintf(stderr,
! 		    "Can't open temporary file for writing in umount!\n");
  	    exit(ERR_FATAL);
      }
      mnted = setmntent(mtab_fn, "r");
      if (!mnted) {
! 	    fprintf(stderr, "Can't open %s for read:%s\n", mtab_fn,
! 		    sys_errlist[errno]);
  	    exit(ERR_FATAL);
      }
      /* Delete filesystem from /etc/mtab */
--- 94,107 ----
      tmpmnt = setmntent(tmpname, "w");
      if (!tmpmnt) {
  	    fprintf(stderr,
! 		    "%s: Can't open temporary file for writing in umount!\n",
! 		    progname);
  	    exit(ERR_FATAL);
      }
      mnted = setmntent(mtab_fn, "r");
      if (!mnted) {
! 	    fprintf(stderr, "%s: Can't open %s for read:%s\n", progname,
! 		    mtab_fn, sys_errlist[errno]);
  	    exit(ERR_FATAL);
      }
      /* Delete filesystem from /etc/mtab */
***************
*** 109,116 ****
      endmntent(tmpmnt);
      endmntent(mnted);
      if (rename(tmpname, mtab_fn) < 0) {
! 	    fprintf(stderr, "Unable to rename %s to %s: %s\n", tmpname,
! 		    mtab_fn, sys_errlist[errno]);
  	    exit(ERR_FATAL);
      }
      unlock_mtab();
--- 112,119 ----
      endmntent(tmpmnt);
      endmntent(mnted);
      if (rename(tmpname, mtab_fn) < 0) {
! 	    fprintf(stderr, "%s: Unable to rename %s to %s: %s\n", progname,
! 		    tmpname, mtab_fn, sys_errlist[errno]);
  	    exit(ERR_FATAL);
      }
      unlock_mtab();
***************
*** 146,153 ****
  	return (SUCCESS);
  
      if ((client = (CLIENT *)rpc_create(hostaddr, &sin)) == NULL) {
! 	fprintf(stderr,
! 		"%s: Server %s not responding\n",
  		errname, host);
  	return (SUCCESS);
      }
--- 149,155 ----
  	return (SUCCESS);
  
      if ((client = (CLIENT *)rpc_create(hostaddr, &sin)) == NULL) {
! 	fprintf(stderr, "%s: %s: Server %s not responding\n", progname,
  		errname, host);
  	return (SUCCESS);
      }
***************
*** 162,186 ****
  	mark_errored(hostaddr);
  	switch (rpc_stat) {
  	case RPC_TIMEDOUT:
! 	    fprintf(stderr, "%s: Timeout while contacting mount daemon on %s\n",
! 		    errname, host);
  	    break;
  	case RPC_AUTHERROR:
! 	    fprintf(stderr, "%s: Authentication failed\n",
! 		    errname, host);
  	    break;
  	case RPC_PMAPFAILURE:
! 	    fprintf(stderr, "%s: Can't find mount daemon on %s\n",
! 		    errname, host);
  	    break;
  	case RPC_PROGUNAVAIL:
  	case RPC_PROGNOTREGISTERED:
! 	    fprintf(stderr, "%s: Mount daemon not available on %s\n",
! 		    errname, host);
  	    break;
  	default:
! 	    fprintf(stderr, "%s: System error contacting server %s\n",
! 		    errname, host);
  	    break;
  	}
  	if (debug_flag)
--- 164,189 ----
  	mark_errored(hostaddr);
  	switch (rpc_stat) {
  	case RPC_TIMEDOUT:
! 	    fprintf(stderr,
! 		    "%s: %s: Timeout while contacting mount daemon on %s\n",
! 		    progname, errname, host);
  	    break;
  	case RPC_AUTHERROR:
! 	    fprintf(stderr, "%s: %s: %s: Authentication failed\n", progname,
! 		    progname, errname, host);
  	    break;
  	case RPC_PMAPFAILURE:
! 	    fprintf(stderr, "%s: %s: Can't find mount daemon on %s\n",
! 		    progname, errname, host);
  	    break;
  	case RPC_PROGUNAVAIL:
  	case RPC_PROGNOTREGISTERED:
! 	    fprintf(stderr, "%s: %s: Mount daemon not available on %s\n",
! 		    progname, errname, host);
  	    break;
  	default:
! 	    fprintf(stderr, "%s: %s: System error contacting server %s\n",
! 		    progname, errname, host);
  	    break;
  	}
  	if (debug_flag)
*** /tmp/,RCSt1000717	Thu Jul 26 23:36:42 1990
--- util.c	Thu Jul 26 23:16:32 1990
***************
*** 97,104 ****
  	
  	if (mtab_lock_fd < 0) {
  		if (!(lockfn = malloc(strlen(mtab_fn)+6))) {
! 			fprintf(stderr, "Can't malloc lockfile filename.\n");
! 			fprintf(stderr, abort_msg);
  			exit(ERR_FATAL);
  		}
  		(void) strcpy(lockfn, mtab_fn);
--- 97,106 ----
  	
  	if (mtab_lock_fd < 0) {
  		if (!(lockfn = malloc(strlen(mtab_fn)+6))) {
! 			fprintf(stderr,
! 				"%s: Can't malloc lockfile filename.\n",
! 				progname);
! 			fprintf(stderr, "%s: %s", progname, abort_msg);
  			exit(ERR_FATAL);
  		}
  		(void) strcpy(lockfn, mtab_fn);
***************
*** 105,113 ****
  		(void) strcat(lockfn, ".lock");
  		mtab_lock_fd = open(lockfn, O_CREAT, 0644);
  		if (mtab_lock_fd < 0) {
! 			fprintf(stderr,"Can't open %s: %s\n", lockfn,
! 				sys_errlist[errno]);
! 			fprintf(stderr, abort_msg);
  			exit(ERR_FATAL);
  		}
  	} 
--- 107,115 ----
  		(void) strcat(lockfn, ".lock");
  		mtab_lock_fd = open(lockfn, O_CREAT, 0644);
  		if (mtab_lock_fd < 0) {
! 			fprintf(stderr,"%s: Can't open %s: %s\n", progname,
! 				lockfn, sys_errlist[errno]);
! 			fprintf(stderr, "%s: %s", progname, abort_msg);
  			exit(ERR_FATAL);
  		}
  	} 
***************
*** 157,163 ****
  		    realhes = hes_resolve(name, "filsys");
  #endif
  	    if (!realhes || !*realhes)
! 		    fprintf(stderr, "%s: Can't resolve name\n", name);
  	    return (realhes);
      }
  
--- 159,166 ----
  		    realhes = hes_resolve(name, "filsys");
  #endif
  	    if (!realhes || !*realhes)
! 		    fprintf(stderr, "%s: %s: Can't resolve name\n", progname,
! 			    name);
  	    return (realhes);
      }
  
***************
*** 165,172 ****
      if (!fsp)
  	return (NULL);
      if (!fsp->explicit) {
! 	fprintf(stderr, "Explicit definitions for type %s not allowed\n",
! 		filsys_type);
  	return (NULL);
      }
  
--- 168,175 ----
      if (!fsp)
  	return (NULL);
      if (!fsp->explicit) {
! 	fprintf(stderr, "%s: Explicit definitions for type %s not allowed\n",
! 		progname, filsys_type);
  	return (NULL);
      }
  
***************
*** 230,238 ****
      if (type & ~(TYPE_UFS | TYPE_AFS)) {
  	    hent = gethostbyname(at->host);
  	    if (!hent) {
! 		    fprintf(stderr,"%s: Can't resolve host %s\n",errorname,
! 			    at->host);
! 		    fprintf(stderr, abort_msg);
  		    return(-1);
  	    }
  	    bcopy(hent->h_addr_list[0], &at->hostaddr.s_addr, 4);
--- 233,241 ----
      if (type & ~(TYPE_UFS | TYPE_AFS)) {
  	    hent = gethostbyname(at->host);
  	    if (!hent) {
! 		    fprintf(stderr,"%s: %s: Can't resolve host %s\n", progname,
! 			    errorname, at->host);
! 		    fprintf(stderr, "%s: %s", progname, abort_msg);
  		    return(-1);
  	    }
  	    bcopy(hent->h_addr_list[0], &at->hostaddr.s_addr, 4);
***************
*** 242,249 ****
      return(0);
      
  bad_hes_line:
!     fprintf(stderr,"Badly formatted filesystem definition\n");
!     fprintf(stderr, abort_msg);
      return(-1);
  }
  
--- 245,252 ----
      return(0);
      
  bad_hes_line:
!     fprintf(stderr,"%s: Badly formatted filesystem definition\n", progname);
!     fprintf(stderr, "%s: %s", progname, abort_msg);
      return(-1);
  }
  
***************
*** 270,277 ****
      if (!stat(bfr, &statbuf)) {
  	if ((statbuf.st_mode & S_IFMT) == S_IFDIR)
  	    return (SUCCESS);
! 	fprintf(stderr, "%s: %s is not a directory\n", at->hesiodname,
! 		at->mntpt);
  	return (FAILURE);
      }
      
--- 273,280 ----
      if (!stat(bfr, &statbuf)) {
  	if ((statbuf.st_mode & S_IFMT) == S_IFDIR)
  	    return (SUCCESS);
! 	fprintf(stderr, "%s: %s: %s is not a directory\n", progname,
! 		at->hesiodname, at->mntpt);
  	return (FAILURE);
      }
      
***************
*** 291,298 ****
  	if (mkdir(bfr, 0777)) {
  	    if (errno == EEXIST)
  		continue;
! 	    fprintf(stderr, "%s: Can't create directory %s: %s\n",
! 		    at->hesiodname, bfr, sys_errlist[errno]);
  	    umask(oldmask);
  	    return (FAILURE);
  	}
--- 294,301 ----
  	if (mkdir(bfr, 0777)) {
  	    if (errno == EEXIST)
  		continue;
! 	    fprintf(stderr, "%s: %s: Can't create directory %s: %s\n",
! 		    progname, at->hesiodname, bfr, sys_errlist[errno]);
  	    umask(oldmask);
  	    return (FAILURE);
  	}
***************
*** 326,335 ****
  		printf("Deleting directory %s (%s)\n", bfr, ptr ? ptr : "");
  	if (rmdir(bfr)) {
  	    if (errno != ENOENT) {
! 		fprintf(stderr,
! 			"%s: Can't remove directory %s: %s\n",
! 			at->hesiodname, ptr,
! 			sys_errlist[errno]);
  		return (FAILURE);
  	    }
  	}
--- 329,336 ----
  		printf("Deleting directory %s (%s)\n", bfr, ptr ? ptr : "");
  	if (rmdir(bfr)) {
  	    if (errno != ENOENT) {
! 		fprintf(stderr, "%s: %s: Can't remove directory %s: %s\n",
! 			progname, at->hesiodname, ptr, sys_errlist[errno]);
  		return (FAILURE);
  	    }
  	}
***************
*** 437,445 ****
      unlink(filename);
      fd = open(filename, O_CREAT, 0644);
      if (!fd) {
! 	    fprintf(stderr,"Can't open %s: %s\n", attachtab_fn,
  		    sys_errlist[errno]);
! 	    fprintf(stderr, abort_msg);
  	    exit(ERR_FATAL);
      }
  
--- 438,446 ----
      unlink(filename);
      fd = open(filename, O_CREAT, 0644);
      if (!fd) {
! 	    fprintf(stderr,"%s: Can't open %s: %s\n", attachtab_fn, progname,
  		    sys_errlist[errno]);
! 	    fprintf(stderr, "%s: %s", progname, abort_msg);
  	    exit(ERR_FATAL);
      }
  
***************
*** 490,496 ****
  	register char	*cp;
  	
  	if (!(cp = malloc(strlen(s)+1))) {
! 		fprintf(stderr, "attach: out of memory, exiting...\n");
  		exit(1);
  	}
  	return(strcpy(cp,s));
--- 491,497 ----
  	register char	*cp;
  	
  	if (!(cp = malloc(strlen(s)+1))) {
! 		fprintf(stderr, "%s: out of memory, exiting...\n", progname);
  		exit(1);
  	}
  	return(strcpy(cp,s));
***************
*** 678,685 ****
  	char	*arg;
  {
  	fprintf(stderr,
! 		"%s: missing argument to mount option; ignoring.\n",
! 		arg);
  }
  
  /*
--- 679,686 ----
  	char	*arg;
  {
  	fprintf(stderr,
! 		"%s: %s: missing argument to mount option; ignoring.\n",
! 		progname, arg);
  }
  
  /*
***************
*** 856,863 ****
  			if (atp->fs->type == TYPE_NFS && do_nfsid) {
  				if (debug_flag)
  					fprintf(stderr,
! 						"nfs unmap(%s, %d)\n",
! 						atp->host, atp->owners[i]);
  				(void) nfsid(atp->host, atp->hostaddr, 
  					     MOUNTPROC_KUIDUMAP, 1,
  					     atp->hesiodname, 0, atp->owners[i]);
--- 857,865 ----
  			if (atp->fs->type == TYPE_NFS && do_nfsid) {
  				if (debug_flag)
  					fprintf(stderr,
! 						"%s: nfs unmap(%s, %d)\n",
! 						progname, atp->host,
! 						atp->owners[i]);
  				(void) nfsid(atp->host, atp->hostaddr, 
  					     MOUNTPROC_KUIDUMAP, 1,
  					     atp->hesiodname, 0, atp->owners[i]);
***************
*** 973,979 ****
  			s++;
  		if (isdigit(*s))
  			return(atoi(s));
! 		fprintf(stderr, "Can't parse username/uid string: %s\n", os);
  		exit(1);
  		/* NOTREACHED */
  	}
--- 975,982 ----
  			s++;
  		if (isdigit(*s))
  			return(atoi(s));
! 		fprintf(stderr, "%s: Can't parse username/uid string: %s\n",
! 			progname, os);
  		exit(1);
  		/* NOTREACHED */
  	}
*** /tmp/,RCSt1000717	Thu Jul 26 23:36:48 1990
--- zephyr.c	Thu Jul 26 23:33:49 1990
***************
*** 59,65 ****
  
      if (!inited) {
  	if ((retval = ZInitialize()) != ZERR_NONE) {
! 	    fprintf(stderr, "Can't intialize Zephyr library!\n");
  	    inited = -1;
  	    return 1;
  	}
--- 59,65 ----
  
      if (!inited) {
  	if ((retval = ZInitialize()) != ZERR_NONE) {
! 	    fprintf(stderr, "%s: Can't intialize Zephyr library!\n", progname);
  	    inited = -1;
  	    return 1;
  	}
***************
*** 79,85 ****
  	if ((retval = (func)(shortsubs,
  			     min(ZEPHYR_MAXONEPACKET,num_subs-count),
  			     wgport)) != ZERR_NONE) {
! 	    fprintf(stderr, "Error while subscribing: %s\n",
  		    error_message(retval));
  	    inited = -1;
  	    return 1;
--- 79,85 ----
  	if ((retval = (func)(shortsubs,
  			     min(ZEPHYR_MAXONEPACKET,num_subs-count),
  			     wgport)) != ZERR_NONE) {
! 	    fprintf(stderr, "%s: Error while subscribing: %s\n", progname,
  		    error_message(retval));
  	    inited = -1;
  	    return 1;
*** /tmp/,RCSt1000858	Thu Jul 26 23:48:23 1990
--- attachtab.c	Thu Jul 26 23:47:25 1990
***************
*** 40,47 ****
  	if (attach_lock_count == 0) {
  		if (!(lockfn = malloc(strlen(attachtab_fn)+6))) {
  			fprintf(stderr,
! 				"Can't malloc for lockfile filename\n");
! 			fprintf(stderr, abort_msg);
  			exit(ERR_FATAL);
  		}
  		(void) strcpy(lockfn, attachtab_fn);
--- 40,48 ----
  	if (attach_lock_count == 0) {
  		if (!(lockfn = malloc(strlen(attachtab_fn)+6))) {
  			fprintf(stderr,
! 				"%s: Can't malloc for lockfile filename\n",
! 				progname);
! 			fprintf(stderr, "%s: %s", progname, abort_msg);
  			exit(ERR_FATAL);
  		}
  		(void) strcpy(lockfn, attachtab_fn);
***************
*** 50,58 ****
  		if (attach_lock_fd < 0) {
  			attach_lock_fd = open(lockfn, O_CREAT, 0644);
  			if (attach_lock_fd < 0) {
! 				fprintf(stderr,"Can't open %s: %s\n", lockfn,
! 					sys_errlist[errno]);
! 				fprintf(stderr, abort_msg);
  				exit(ERR_FATAL);
  			}
  		}
--- 51,59 ----
  		if (attach_lock_fd < 0) {
  			attach_lock_fd = open(lockfn, O_CREAT, 0644);
  			if (attach_lock_fd < 0) {
! 				fprintf(stderr, "%s: Can't open %s: %s\n",
! 					progname, lockfn, sys_errlist[errno]);
! 				fprintf(stderr, "%s: %s", progname, abort_msg);
  				exit(ERR_FATAL);
  			}
  		}
***************
*** 76,82 ****
  		attach_lock_fd = -1;
  	} else if (attach_lock_count < 0) {
  		fprintf(stderr,
! 	"Programming botch!  Tried to unlock unlocked attachtab\n");
  	}
  }
  
--- 77,84 ----
  		attach_lock_fd = -1;
  	} else if (attach_lock_count < 0) {
  		fprintf(stderr,
! 		"%s: Programming botch!  Tried to unlock unlocked attachtab\n",
! 			progname);
  	}
  }
  
***************
*** 99,106 ****
  	while (fgets(attach_buf, sizeof attach_buf, f)) {
  		if (!(at = (struct _attachtab *) malloc(sizeof(*at)))) {
  			fprintf(stderr,
! 				"Can't malloc while parsing attachtab\n");
! 			fprintf(stderr, abort_msg);
  			exit(ERR_FATAL);
  		}
  		parse_attach(attach_buf, at, 0);
--- 101,109 ----
  	while (fgets(attach_buf, sizeof attach_buf, f)) {
  		if (!(at = (struct _attachtab *) malloc(sizeof(*at)))) {
  			fprintf(stderr,
! 				"%s: Can't malloc while parsing attachtab\n",
! 				progname);
! 			fprintf(stderr, "%s: %s", progname, abort_msg);
  			exit(ERR_FATAL);
  		}
  		parse_attach(attach_buf, at, 0);
***************
*** 144,160 ****
  	int	i;
  	
  	if (!(tempfn = malloc(strlen(attachtab_fn)+6))) {
! 		fprintf(stderr,
! 			"Can't malloc while writing attachtab.\n");
! 		fprintf(stderr, abort_msg);
  		exit(ERR_FATAL);
  	}
  	(void) strcpy(tempfn, attachtab_fn);
  	(void) strcat(tempfn, ".temp");
  	if (!(f = fopen(tempfn, "w"))) {
! 		fprintf(stderr,"Can't open %s for write: %s\n", attachtab_fn,
! 			sys_errlist[errno]);
! 		fprintf(stderr, abort_msg);
  		exit(ERR_FATAL);
  	}
  	at = attachtab_first;
--- 147,163 ----
  	int	i;
  	
  	if (!(tempfn = malloc(strlen(attachtab_fn)+6))) {
! 		fprintf(stderr, "%s: Can't malloc while writing attachtab.\n",
! 			progname);
! 		fprintf(stderr, "%s: %s", progname, abort_msg);
  		exit(ERR_FATAL);
  	}
  	(void) strcpy(tempfn, attachtab_fn);
  	(void) strcat(tempfn, ".temp");
  	if (!(f = fopen(tempfn, "w"))) {
! 		fprintf(stderr,"%s: Can't open %s for write: %s\n", progname,
! 			attachtab_fn, sys_errlist[errno]);
! 		fprintf(stderr, "%s: %s", progname, abort_msg);
  		exit(ERR_FATAL);
  	}
  	at = attachtab_first;
***************
*** 186,194 ****
  	fclose(f);
  
  	if (rename(tempfn, attachtab_fn)) {
! 		fprintf(stderr,"Can't rename %s to %s\n", tempfn,
  			attachtab_fn);
! 		fprintf(stderr, abort_msg);
  		exit(ERR_FATAL);
  	}
  }
--- 189,197 ----
  	fclose(f);
  
  	if (rename(tempfn, attachtab_fn)) {
! 		fprintf(stderr,"%s: Can't rename %s to %s\n", progname, tempfn,
  			attachtab_fn);
! 		fprintf(stderr, "%s: %s", progname, abort_msg);
  		exit(ERR_FATAL);
  	}
  }
***************
*** 207,214 ****
  	while (fgets(attach_buf, sizeof attach_buf, f)) {
  		if (!(at = (struct _attachtab *) malloc(sizeof(*at)))) {
  			fprintf(stderr,
! 				"Can't malloc while parsing attachtab\n");
! 			fprintf(stderr, abort_msg);
  			exit(ERR_FATAL);
  		}
  		if(parse_attach(attach_buf, at, 1) == FAILURE)
--- 210,218 ----
  	while (fgets(attach_buf, sizeof attach_buf, f)) {
  		if (!(at = (struct _attachtab *) malloc(sizeof(*at)))) {
  			fprintf(stderr,
! 				"%s: Can't malloc while parsing attachtab\n",
! 				progname);
! 			fprintf(stderr, "%s: %s", progname, abort_msg);
  			exit(ERR_FATAL);
  		}
  		if(parse_attach(attach_buf, at, 1) == FAILURE)
***************
*** 249,258 ****
      if (!strcmp(cp, "A0"))
  	    old_version = 1;
      else if (strcmp(cp, ATTACH_VERSION)) {
! 	    fprintf(stderr, "Bad version number in %s\n", attachtab_fn);
  	    if(lint) 
  	      return FAILURE;
! 	    fprintf(stderr, abort_msg);
  	    exit(ERR_FATAL);
      }
      strcpy(at->version, cp);
--- 253,263 ----
      if (!strcmp(cp, "A0"))
  	    old_version = 1;
      else if (strcmp(cp, ATTACH_VERSION)) {
! 	    fprintf(stderr, "%s: Bad version number in %s\n", progname,
! 		    attachtab_fn);
  	    if(lint) 
  	      return FAILURE;
! 	    fprintf(stderr, "%s: %s", progname, abort_msg);
  	    exit(ERR_FATAL);
      }
      strcpy(at->version, cp);
***************
*** 338,347 ****
      return SUCCESS;
      
  bad_line:
!     fprintf(stderr,"Badly formatted entry in %s\n", attachtab_fn);
      if(lint)
        return FAILURE;
!     fprintf(stderr, abort_msg);
      exit(ERR_FATAL);
  }
  
--- 343,353 ----
      return SUCCESS;
      
  bad_line:
!     fprintf(stderr, "%s: Badly formatted entry in %s\n", progname,
! 	    attachtab_fn);
      if(lint)
        return FAILURE;
!     fprintf(stderr, "%s: %s", progname, abort_msg);
      exit(ERR_FATAL);
  }
  
***************
*** 431,438 ****
  
  	if (!(atnew = (struct _attachtab *)
  	      malloc(sizeof(struct _attachtab)))) {
! 		fprintf(stderr, "Can't malloc while adding to attachtab\n");
! 		fprintf(stderr, abort_msg);
  		exit(ERR_FATAL);
  	}
  	*atnew = *at;
--- 437,445 ----
  
  	if (!(atnew = (struct _attachtab *)
  	      malloc(sizeof(struct _attachtab)))) {
! 		fprintf(stderr, "%s: Can't malloc while adding to attachtab\n",
! 			progname);
! 		fprintf(stderr, "%s: %s", progname, abort_msg);
  		exit(ERR_FATAL);
  	}
  	*atnew = *at;

home help back first fref pref prev next nref lref last post