summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjl <hjl>2000-01-10 22:31:41 +0000
committerhjl <hjl>2000-01-10 22:31:41 +0000
commit08f6b0ea56f96eac00b092c7d5e1f6486eb6f457 (patch)
tree3e3650828c221fbad22c4a897d392c82b39d414e
parent1bae64b1475e9c1458582f26aa0e837edc4c6aca (diff)
downloadnfs-utils-08f6b0ea56f96eac00b092c7d5e1f6486eb6f457.tar.gz
nfs-utils-08f6b0ea56f96eac00b092c7d5e1f6486eb6f457.tar.xz
nfs-utils-08f6b0ea56f96eac00b092c7d5e1f6486eb6f457.zip
Mon Jan 10 14:26:33 2000 H.J. Lu <hjl@lucon.org>
* utils/mountd/auth.c (auth_authenticate_internal): Call xstrdup for hostname before passing it to gethostbyname. * utils/mountd/mountd.c (get_exportlist): Use xstrdup instead of strdup.
-rw-r--r--ChangeLog8
-rw-r--r--utils/mountd/auth.c10
-rw-r--r--utils/mountd/mountd.c2
3 files changed, 17 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index ef9d5db..a3d37f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Jan 10 14:26:33 2000 H.J. Lu <hjl@lucon.org>
+
+ * utils/mountd/auth.c (auth_authenticate_internal): Call
+ xstrdup for hostname before passing it to gethostbyname.
+
+ * utils/mountd/mountd.c (get_exportlist): Use xstrdup instead
+ of strdup.
+
Sun Dec 19 09:35:01 1999 H.J. Lu <hjl@lucon.org>
* README: Update the mailing list address.
diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c
index afa2292..98c3944 100644
--- a/utils/mountd/auth.c
+++ b/utils/mountd/auth.c
@@ -16,6 +16,7 @@
#include "nfslib.h"
#include "exportfs.h"
#include "mountd.h"
+#include "xmalloc.h"
enum auth_error
{
@@ -83,9 +84,14 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller,
else {
/* must make sure the hostent is authorative. */
char **sp;
- struct hostent *forward;
+ struct hostent *forward = NULL;
+ char *tmpname;
- forward = gethostbyname((*hpp)->h_name);
+ tmpname = xstrdup((*hpp)->h_name);
+ if (tmpname) {
+ forward = gethostbyname(tmpname);
+ free(tmpname);
+ }
if (forward) {
/* now make sure the "addr" is in the list */
for (sp = forward->h_addr_list ; *sp ; sp++) {
diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
index 9f467d1..164983a 100644
--- a/utils/mountd/mountd.c
+++ b/utils/mountd/mountd.c
@@ -312,7 +312,7 @@ get_exportlist(void)
e = (struct exportnode *) xmalloc(sizeof(*e));
e->ex_next = elist;
e->ex_groups = NULL;
- e->ex_dir = strdup(exp->m_export.m_path);
+ e->ex_dir = xstrdup(exp->m_export.m_path);
elist = e;
}