From: Greg Banks Date: Mon, 3 Jul 2006 04:21:48 +0000 (+1000) Subject: Merge branch 'master' of git://linux-nfs.org/nfs-utils X-Git-Tag: nfs-utils-1-0-9~30 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=commitdiff_plain;h=940c7c304d4a43c00c27529cdddc7c87db6eef87;hp=-c Merge branch 'master' of git://linux-nfs.org/nfs-utils --- 940c7c304d4a43c00c27529cdddc7c87db6eef87 diff --combined configure.in index 8459ef8,ded529f..6f9ab40 --- a/configure.in +++ b/configure.in @@@ -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 bf2afad,5160c8b..733bf24 --- a/support/nfs/conn.c +++ b/support/nfs/conn.c @@@ -7,7 -7,6 +7,7 @@@ */ #include +#include #include #include #include @@@ -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; @@@ -119,7 -118,7 +119,7 @@@ */ 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; @@@ -161,8 -160,15 +161,15 @@@ 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 2a2b7e0,70d1260..52300a4 --- a/tools/rpcgen/rpc_parse.c +++ b/tools/rpcgen/rpc_parse.c @@@ -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); @@@ -309,7 -309,6 +309,6 @@@ cases->case_name = tok.str; scan(TOK_COLON, &tok); /* now peek at next token */ - flag=0; if(peekscan(TOK_CASE,&tok)) { @@@ -325,14 -324,6 +324,6 @@@ }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 c0ddc14,51eecfe..a6f442c --- a/tools/rpcgen/rpc_scan.c +++ b/tools/rpcgen/rpc_scan.c @@@ -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 16b1316,5fc7811..21a1916 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@@ -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; @@@ -559,7 -556,7 +559,7 @@@ /* Get rid of newline and terminate buffer*/ buf[len - 1] = '\0'; - bp = buf; + bp = (char *)buf; memset(&im, 0, sizeof(im)); @@@ -609,7 -606,7 +609,7 @@@ 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;