address of a down server had changed.
* amd/info_union.c (union_reload): use safer xsnprintf() routine.
2005-07-10 Erez Zadok <ezk@cs.sunysb.edu>
+ * amd/srvr_nfs.c (find_nfs_srvr): flush NFS handle cache if the IP
+ address of a down server had changed.
+
+ * amd/info_union.c (union_reload): use safer xsnprintf() routine.
+
* amd/srvr_nfs.c (find_nfs_srvr): check to see if the IP address
of a named but down fserver changed (i.e., the previous IP address
is no longer responding). If so, then reset the fserver to the
* buffer overflow in pawd.
* aix4 clean build.
* use strlcat/snprintf in a few places for safety.
+ * recover from IP address change of a down NFS server
*** Notes specific to am-utils version 6.1
* SUCH DAMAGE.
*
*
- * $Id: info_union.c,v 1.11 2005/02/17 03:37:42 ezk Exp $
+ * $Id: info_union.c,v 1.12 2005/07/11 01:55:28 ezk Exp $
*
*/
* Add wildcard entry
*/
{
- char *val = xmalloc(strlen(*(dir-1)) + 5);
+ size_t len = strlen(*(dir-1)) + 5;
+ char *val = xmalloc(len);
- sprintf(val, "fs:=%s", *(dir-1));
+ xsnprintf(val, len, "fs:=%s", *(dir-1));
(*fn) (m, strdup("*"), val);
}
XFREE(mapd);
* SUCH DAMAGE.
*
*
- * $Id: srvr_nfs.c,v 1.40 2005/07/10 21:41:48 ezk Exp $
+ * $Id: srvr_nfs.c,v 1.41 2005/07/11 01:55:28 ezk Exp $
*
*/
int pingval;
mntent_t mnt;
nfs_private *np;
- struct hostent *hp = 0;
+ struct hostent *hp = NULL;
struct sockaddr_in *ip = NULL;
u_long nfs_version = 0; /* default is no version specified */
u_long best_nfs_version = 0;
sizeof(ip->sin_addr));
fs->fs_flags |= FSF_VALID;
fs->fs_flags &= ~(FSF_DOWN|FSF_ERROR);
+ flush_nfs_fhandle_cache(fs); /* XXX: safer, but really needed? */
/* fall through to checking available NFS protocols, pinging, etc. */
} else {
/* server was down and is still down. Not much we can do. */