]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Mon Jan 10 14:26:33 2000 H.J. Lu <hjl@lucon.org>
authorhjl <hjl>
Mon, 10 Jan 2000 22:31:41 +0000 (22:31 +0000)
committerhjl <hjl>
Mon, 10 Jan 2000 22:31:41 +0000 (22:31 +0000)
* 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.

ChangeLog
utils/mountd/auth.c
utils/mountd/mountd.c

index ef9d5dbc7d8ececef8385a98e451fa9275f1e4a2..a3d37f2d9583037f7e13f6ecba2096ecbc951e1b 100644 (file)
--- 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.
 Sun Dec 19 09:35:01 1999  H.J. Lu <hjl@lucon.org>
 
        * README: Update the mailing list address.
index afa2292888088afdd572661ce9b65d5c6e21f1c0..98c3944767767744091db7954824643b6a73d1bc 100644 (file)
@@ -16,6 +16,7 @@
 #include "nfslib.h"
 #include "exportfs.h"
 #include "mountd.h"
 #include "nfslib.h"
 #include "exportfs.h"
 #include "mountd.h"
+#include "xmalloc.h"
 
 enum auth_error
 {
 
 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;
        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++) {
                if (forward) {
                        /* now make sure the "addr" is in the list */
                        for (sp = forward->h_addr_list ; *sp ; sp++) {
index 9f467d1f9b4c4e227a91a87bb15b691c561199f1..164983a7938f1efbb37f35c3a811fa4c9393f061 100644 (file)
@@ -312,7 +312,7 @@ get_exportlist(void)
                                e = (struct exportnode *) xmalloc(sizeof(*e));
                                e->ex_next = elist;
                                e->ex_groups = NULL;
                                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;
                        }
 
                                elist = e;
                        }