]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Merge branch 'master' of git://linux-nfs.org/nfs-utils
authorGreg Banks <gnb@melbourne.sgi.com>
Mon, 3 Jul 2006 04:21:48 +0000 (14:21 +1000)
committerGreg Banks <gnb@melbourne.sgi.com>
Mon, 3 Jul 2006 04:21:48 +0000 (14:21 +1000)
1  2 
configure.in
support/nfs/conn.c
tools/rpcgen/rpc_parse.c
tools/rpcgen/rpc_scan.c
utils/idmapd/idmapd.c

diff --combined configure.in
index 8459ef89b632d3390d5f3bb44fd0e6a6bacd74ef,ded529ffba96ea3aae6b3f95e90023db0f29ef01..6f9ab4024dd4a3622f233bf64f4b845ebb8a25d0
@@@ -1,6 -1,6 +1,6 @@@
  dnl Process this file with autoconf to produce a configure script.
  dnl
- AC_INIT([linux nfs-utils],[1.0.8],[nfs@lists.sf.net],[nfs-utils])
+ AC_INIT([linux nfs-utils],[1.0.9-pre1],[nfs@lists.sf.net],[nfs-utils])
  AC_CANONICAL_BUILD([])
  AC_CANONICAL_HOST([])
  AC_CONFIG_SRCDIR(tools/getiversion/getiversion.c)
@@@ -107,12 -107,12 +107,12 @@@ AC_ARG_ENABLE(rquotad
        fi
        AM_CONDITIONAL(CONFIG_RQUOTAD, [test "$enable_rquotad" = "yes"])
  
- AC_ARG_WITH(mount,
-       [AC_HELP_STRING([--without-mount],
-                       [Create mount.nfs and do not use the util-linux mount(8) functionality. By default it doesn't.])],
-       use_mount=$withval,
-       use_mount=yes)
-       AM_CONDITIONAL(CONFIG_NOMOUNT, [test "$use_mount" = "no"])
+ AC_ARG_ENABLE(mount,
+       [AC_HELP_STRING([--enable-mount],
+                       [Create mount.nfs and don't use the util-linux mount(8) functionality. @<:@default=yes@:>@])],
+       enable_mount=$enableval,
+       enable_mount=yes)
+       AM_CONDITIONAL(CONFIG_MOUNT, [test "$enable_mount" = "yes"])
  
  # Check whether user wants TCP wrappers support
  AC_TCP_WRAPPERS
@@@ -151,20 -151,20 +151,20 @@@ AC_CHECK_LIB(socket, main, [LIBSOCKET="
  AC_CHECK_LIB(nsl, main,       [LIBNSL="-lnsl"])
  AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"])
  if test "$enable_nfsv4" = yes; then
 -    AC_CHECK_LIB(event, event_dispatch, [libevent=1], [AC_MSG_ERROR(libevent needed for nfsv4 support)])
 -    AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, [libnfsidmap=1], [AC_MSG_ERROR(libnfsidmap needed for nfsv4 support)])
 -    AC_CHECK_HEADERS(event.h, ,[AC_MSG_ERROR(libevent needed for nfsv4 support)])
 -    AC_CHECK_HEADERS(nfsidmap.h, ,[AC_MSG_ERROR(libnfsidmap needed for nfsv4 support)])
 +    AC_CHECK_LIB(event, event_dispatch, [libevent=1], AC_MSG_ERROR([libevent needed for nfsv4 support]))
 +    AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, [libnfsidmap=1], AC_MSG_ERROR([libnfsidmap needed for nfsv4 support]))
 +    AC_CHECK_HEADERS(event.h, ,AC_MSG_ERROR([libevent needed for nfsv4 support]))
 +    AC_CHECK_HEADERS(nfsidmap.h, ,AC_MSG_ERROR([libnfsidmap needed for nfsv4 support]))
      dnl librpcsecgss already has a dependency on libgssapi,
      dnl but we need to make sure we get the right version
      if test "$enable_gss" = yes; then
 -     PKG_CHECK_MODULES([RPCSECGSS], [librpcsecgss >= 0.10], [],
 -      [AC_MSG_ERROR([Unable to locate information required to use librpcsecgss.
 -       If you have pkgconfig installed, you might try setting environment
 -       variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])
 +     PKG_CHECK_MODULES(RPCSECGSS, librpcsecgss >= 0.10, ,
 +      [AC_MSG_ERROR([Unable to locate information required to use librpcsecgss.])
 +       AC_MSG_ERROR([If you have pkgconfig installed, you might try setting environment])
 +       AC_MSG_ERROR([variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])
        ]
       )
 -    PKG_CHECK_MODULES([GSSAPI], [libgssapi >= 0.9])
 +    PKG_CHECK_MODULES(GSSAPI, libgssapi >= 0.9)
      fi
  
  fi
@@@ -178,19 -178,15 +178,19 @@@ AC_SUBST(LIBBSD
  
  if test "$enable_gss" = yes; then
    dnl 'gss' also depends on nfsidmap.h - at least for svcgssd_proc.c
 -  AC_CHECK_HEADERS(nfsidmap.h, ,[AC_MSG_ERROR(libnfsidmap needed for gss support)])
 -  AC_CHECK_HEADERS(spkm3.h, ,[AC_MSG_WARN(could not locate SPKM3 header; will not have SPKM3 support)])
 +  AC_CHECK_HEADERS(nfsidmap.h, ,AC_MSG_ERROR([libnfsidmap needed for gss support]))
 +  AC_CHECK_HEADERS(spkm3.h, ,AC_MSG_WARN([could not locate SPKM3 header; will not have SPKM3 support]))
 +  dnl the nfs4_set_debug function doesn't appear in all version of the library
 +  AC_CHECK_LIB(nfsidmap, nfs4_set_debug,
 +             AC_DEFINE(HAVE_NFS4_SET_DEBUG,1,
 +                       [Whether nfs4_set_debug() is present in libnfsidmap]),)
  
    dnl Check for Kerberos V5
    AC_KERBEROS_V5
  
    dnl This is not done until here because we need to have KRBLIBS set
    dnl ("librpcsecgss=1" is so that it doesn't get added to LIBS)
 -  AC_CHECK_LIB(rpcsecgss, authgss_create_default, [librpcsecgss=1], [AC_MSG_ERROR(librpcsecgss needed for nfsv4 support)], $KRBLIBS)
 +  AC_CHECK_LIB(rpcsecgss, authgss_create_default, [librpcsecgss=1], AC_MSG_ERROR([librpcsecgss needed for nfsv4 support]), $KRBLIBS)
    AC_CHECK_LIB(rpcsecgss, authgss_set_debug_level,
               AC_DEFINE(HAVE_AUTHGSS_SET_DEBUG_LEVEL, 1, [Define this if the rpcsec_gss library has the function authgss_set_debug_level]),, $KRBLIBS)
  
@@@ -242,7 -238,7 +242,7 @@@ AC_CHECK_FUNCS([alarm atexit dup2 fdata
                 gethostbyaddr gethostbyname gethostname getmntent \
                 gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \
                 realpath rmdir select socket strcasecmp strchr strdup \
 -               strerror strrchr strtol strtoul])
 +               strerror strrchr strtol strtoul sigprocmask])
  
  
  dnl *************************************************************
@@@ -252,8 -248,6 +252,8 @@@ AC_CHECK_SIZEOF(short
  AC_CHECK_SIZEOF(int)
  AC_CHECK_SIZEOF(long)
  AC_CHECK_SIZEOF(size_t)
 +AC_CHECK_SIZEOF(socklen_t)
 +
  
  dnl *************************************************************
  dnl Export some path names to config.h
diff --combined support/nfs/conn.c
index bf2afad678c71ad3b6e39b740f8745e09d387af8,5160c8b29c2fd2c1632be80cbe67adbe1a0fda38..733bf24f4bc0fccdb77011b9249f095a961b286b
@@@ -7,7 -7,6 +7,7 @@@
   */
  
  #include <errno.h>
 +#include <unistd.h>
  #include <rpc/rpc.h>
  #include <rpc/pmap_prot.h>
  #include <rpc/pmap_clnt.h>
@@@ -93,7 -92,7 +93,7 @@@ int get_socket(struct sockaddr_in *sadd
                        return RPC_ANYSOCK;
                }
        }
-       if (type == SOCK_STREAM) {
+       if (type == SOCK_STREAM || type == SOCK_DGRAM) {
                cc = connect(so, (struct sockaddr *)saddr, namelen);
                if (cc < 0) {
                        rpc_createerr.cf_stat = RPC_SYSTEMERROR;
   */
  int
  clnt_ping(struct sockaddr_in *saddr, const u_long prog, const u_long vers,
-         const u_int prot)
+         const u_int prot, struct sockaddr_in *caddr)
  {
        CLIENT *clnt=NULL;
        int sock, stat;
                rpc_createerr.cf_stat = stat;
        }
        clnt_destroy(clnt);
-       if (sock != -1)
+       if (sock != -1) {
+               if (caddr) {
+                       /* Get the address of our end of this connection */
+                       int len = sizeof(*caddr);
+                       if (getsockname(sock, caddr, &len) != 0)
+                               caddr->sin_family = 0;
+               }
                close(sock);
+       }
  
        if (stat == RPC_SUCCESS)
                return 1;
diff --combined tools/rpcgen/rpc_parse.c
index 2a2b7e0589b9cd53f8d7de88c4015ab437964e22,70d1260e12f1ab2df493bceb1eedb43409aac523..52300a47335b698fb3e8b46f2a4a9843fc00fed7
@@@ -28,7 -28,7 +28,7 @@@
   * Mountain View, California  94043
   */
  
 -#ifndef lint
 +#if 0
  static char sccsid[] = "@(#)rpc_parse.c 1.8 89/02/22 (C) 1987 SMI";
  #endif
  
@@@ -94,6 -94,7 +94,7 @@@ get_definition(void
                def_const(defp);
                break;
        case TOK_EOF:
+               free(defp);
                return (NULL);
        default:
                error("definition keyword expected");
@@@ -290,7 -291,6 +291,6 @@@ def_union(definition *defp
    declaration dec;
    case_list *cases;
    case_list **tailp;
-   int flag;
  
    defp->def_kind = DEF_UNION;
    scan(TOK_IDENT, &tok);
      cases->case_name = tok.str;
      scan(TOK_COLON, &tok);
      /* now peek at next token */
-     flag=0;
      if(peekscan(TOK_CASE,&tok))
        {
  
        
          }while(peekscan(TOK_CASE,&tok));
        }
-     else
-       if(flag)
-       {
-         *tailp = cases;
-         tailp = &cases->next;
-         cases = ALLOC(case_list);
-       };
  
      get_declaration(&dec, DEF_UNION);
      cases->case_decl = dec;
diff --combined tools/rpcgen/rpc_scan.c
index c0ddc1495b98547bd6556afcb22eb84980932af6,51eecfee750539023346281e2b8a9cbbe5ce480e..a6f442c3eb9b1555fd82f326609b64af2881f613
@@@ -28,7 -28,7 +28,7 @@@
   * Mountain View, California  94043
   */
  
 -#ifndef lint
 +#if 0
  static char sccsid[] = "@(#)rpc_scan.c 1.11 89/02/22 (C) 1987 SMI";
  #endif
  
@@@ -468,6 -468,7 +468,7 @@@ docppline(char *line, int *lineno, cha
        *p = 0;
        if (*file == 0) {
                *fname = NULL;
+               free(file);
        } else {
                *fname = file;
        }
diff --combined utils/idmapd/idmapd.c
index 16b1316c60096173d8e3bd9618b76f63ec85f1ed,5fc7811a8465b3c5be2ce35ef85c628fc639d092..21a1916ded036da2446df0c839012ca042a888d6
@@@ -345,9 -345,7 +345,9 @@@ main(int argc, char **argv
                errx(1, "Could not find group \"%s\"", nobodygroup);
        nobodygid = gr->gr_gid;
  
 +#ifdef HAVE_NFS4_SET_DEBUG
        nfs4_set_debug(verbose, idmapd_warnx);
 +#endif
        if (conf_path == NULL)
                conf_path = _PATH_IDMAPDCONF;
        if (nfs4_init_name_mapping(conf_path))
@@@ -541,8 -539,7 +541,8 @@@ nfsdcb(int fd, short which, void *data
        struct idmap_client *ic = data;
        struct idmap_msg im;
        u_char buf[IDMAP_MAXMSGSZ + 1];
 -      size_t len, bsiz;
 +      size_t len;
 +      ssize_t bsiz;
        char *bp, typebuf[IDMAP_MAXMSGSZ],
                buf1[IDMAP_MAXMSGSZ], authbuf[IDMAP_MAXMSGSZ], *p;
        unsigned long tmp;
  
        /* Get rid of newline and terminate buffer*/
        buf[len - 1] = '\0';
 -      bp = buf;
 +      bp = (char *)buf;
  
        memset(&im, 0, sizeof(im));
  
        imconv(ic, &im);
  
        buf[0] = '\0';
 -      bp = buf;
 +      bp = (char *)buf;
        bsiz = sizeof(buf);
  
        /* Authentication name */
@@@ -1006,10 -1003,15 +1006,15 @@@ mydaemon(int nochdir, int noclose
  
        if (noclose == 0) {
                tempfd = open("/dev/null", O_RDWR);
-               dup2(tempfd, 0);
-               dup2(tempfd, 1);
-               dup2(tempfd, 2);
-               closeall(3);
+               if (tempfd < 0)
+                       tempfd = open("/", O_RDONLY);
+               if (tempfd >= 0) {
+                       dup2(tempfd, 0);
+                       dup2(tempfd, 1);
+                       dup2(tempfd, 2);
+                       closeall(3);
+               } else
+                       closeall(0);
        }
  
        return;