Date: Wed, 7 Feb 2007 16:03:24 GMT From: Michael Bushkov <bushman@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 114179 for review Message-ID: <200702071603.l17G3OXg097034@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=114179 Change 114179 by bushman@bushman_nss_ldap_cached on 2007/02/07 16:02:27 IFC Affected files ... .. //depot/projects/soc2006/nss_ldap_cached_openldap/branches.bl#1 branch .. //depot/projects/soc2006/nss_ldap_cached_openldap/create_patches.sh#1 branch .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldapconn.c#3 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/nss_ldap.c#3 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/etc/periodic/security/800.loginfail#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/include/rpc/auth_kerb.h#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/include/tgmath.h#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/ctags/C.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/ctags/fortran.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/ctags/tree.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/getent/getent.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/mklocale/yacc.y#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/ncplist/ncplist.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/ncplogin/ncplogin.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/quota/quota.c#3 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/apmd/apmd.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/apmd/contrib/pccardq.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/edquota/edquota.8#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/edquota/edquota.c#3 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/iostat/iostat.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/mountd/mountd.8#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/mountd/mountd.c#5 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/ngctl/dot.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/ngctl/list.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/ngctl/main.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/ngctl/show.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/pciconf/Makefile#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/pciconf/cap.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/pciconf/pciconf.8#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/pciconf/pciconf.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/pciconf/pciconf.h#1 branch .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/quotaon/quotaon.c#3 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/repquota/repquota.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/update_branches.sh#1 branch Differences ... ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldapconn.c#3 (text+ko) ==== @@ -100,7 +100,11 @@ { struct nss_ldap_connection_error conn_err; int dummy_fd, backup_fd, rv; - + + /* + * If we can't get the socket from ldap connection, then don't + * close it gracefully and just ignore it. + */ if (conn->sock_fd == -1) return (NSS_LDAP_CONNECTION_ERROR); @@ -114,7 +118,7 @@ if (dummy_fd != conn->sock_fd) { backup_fd = dup(conn->sock_fd); dup2(dummy_fd, conn->sock_fd); - close (conn->sock_fd); + close(conn->sock_fd); } memset(&conn_err, 0, sizeof(struct nss_ldap_connection_error)); rv = __nss_ldap_disconnect(&__nss_ldap_conf->connection_method, conn, @@ -138,13 +142,9 @@ struct nss_ldap_connection_error conn_err_; int rv; - if (check_connection_socket(conn) != 0) { + if (check_connection_socket(conn) != 0 || conn->last_pid != getpid()) { rv = close_lost_connection(conn); return (NSS_LDAP_CONNECTION_ERROR); - } else if (conn->last_pid != getpid()) { - (void)__nss_ldap_disconnect(&__nss_ldap_conf->connection_method, - conn, __nss_ldap_conf, &conn_err_); - return (NSS_LDAP_CONNECTION_ERROR); } else return (NSS_LDAP_SUCCESS); } ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/nss_ldap.c#3 (text+ko) ==== @@ -118,7 +118,7 @@ static pthread_rwlock_t nss_ldap_lock = PTHREAD_RWLOCK_INITIALIZER; static struct nss_ldap_configuration nss_ldap_conf; struct nss_ldap_configuration *__nss_ldap_conf = NULL; -int __nss_ldap_debug_level = 4; +int __nss_ldap_debug_level = 1; static int nss_ldap_configure(); static void nss_ldap_atexit(); ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/etc/periodic/security/800.loginfail#2 (text+ko) ==== @@ -24,7 +24,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: src/etc/periodic/security/800.loginfail,v 1.6 2006/03/05 15:45:38 matteo Exp $ +# $FreeBSD: src/etc/periodic/security/800.loginfail,v 1.7 2007/02/05 16:36:25 jdp Exp $ # # Show login failures @@ -59,7 +59,7 @@ [Yy][Ee][Ss]) echo "" echo "${host} login failures:" - n=$(catmsgs | grep -ia "^$yesterday.*(fail|invalid|bad|illegal)" | + n=$(catmsgs | egrep -ia "^$yesterday.*(fail|invalid|bad|illegal)" | tee /dev/stderr | wc -l) [ $n -gt 0 ] && rc=1 || rc=0;; *) rc=0;; ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/include/rpc/auth_kerb.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/include/rpc/auth_kerb.h,v 1.2 2002/09/04 23:58:23 alfred Exp $ */ +/* $FreeBSD: src/include/rpc/auth_kerb.h,v 1.3 2007/02/02 18:11:18 schweikh Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -6,23 +6,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -137,5 +137,5 @@ extern int svc_kerb_reg(SVCXPRT *, char *, char *, char *); extern enum auth_stat _svcauth_kerb(struct svc_req *, struct rpc_msg *); -#endif KERBEROS +#endif /* KERBEROS */ #endif /* !_RPC_AUTH_KERB_H */ ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/include/tgmath.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/include/tgmath.h,v 1.4 2004/09/03 23:44:09 stefanf Exp $ + * $FreeBSD: src/include/tgmath.h,v 1.5 2007/02/02 18:30:23 schweikh Exp $ */ #ifndef _TGMATH_H_ @@ -64,8 +64,8 @@ #define __tg_is_complex(e1, e2, e3) \ (__tg_type3(e1, e2, e3, float _Complex) || \ __tg_type3(e1, e2, e3, double _Complex) || \ - __tg_type3(e1, e2, e3, long double _Complex)) || \ - __tg_type3(e1, e2, e3, __typeof__(_Complex_I)) + __tg_type3(e1, e2, e3, long double _Complex) || \ + __tg_type3(e1, e2, e3, __typeof__(_Complex_I))) #define __tg_impl_simple(x, y, z, fn, fnf, fnl, ...) \ __builtin_choose_expr(__tg_type_corr(x, y, z, long double), \ ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/ctags/C.c#2 (text+ko) ==== @@ -38,7 +38,7 @@ #endif #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.bin/ctags/C.c,v 1.11 2002/07/28 15:50:38 dwmalone Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/ctags/C.c,v 1.12 2007/02/04 20:07:07 rse Exp $"); #include <limits.h> #include <stdio.h> @@ -114,7 +114,7 @@ */ case '"': case '\'': - (void)skip_string(c); + skip_string(c); break; /* ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/ctags/fortran.c#2 (text+ko) ==== @@ -38,7 +38,7 @@ #endif #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.bin/ctags/fortran.c,v 1.12 2002/07/28 15:50:38 dwmalone Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/ctags/fortran.c,v 1.13 2007/02/04 20:06:10 rse Exp $"); #include <ctype.h> #include <limits.h> @@ -124,7 +124,7 @@ continue; for (cp = lbp + 1; *cp && intoken(*cp); ++cp) continue; - if ((cp = lbp + 1)) + if (cp == lbp + 1) continue; *cp = EOS; (void)strlcpy(tok, lbp, sizeof(tok)); /* possible trunc */ ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/ctags/tree.c#2 (text+ko) ==== @@ -38,7 +38,7 @@ #endif #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.bin/ctags/tree.c,v 1.11 2002/07/28 15:50:38 dwmalone Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/ctags/tree.c,v 1.12 2007/02/04 20:04:29 rse Exp $"); #include <err.h> #include <limits.h> @@ -126,10 +126,12 @@ static void free_tree(NODE *node) { + NODE *node_next; while (node) { if (node->right) free_tree(node->right); + node_next = node->left; free(node); - node = node->left; + node = node_next; } } ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/getent/getent.c#2 (text) ==== @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.bin/getent/getent.c,v 1.2 2006/05/04 11:28:16 ume Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/getent/getent.c,v 1.3 2007/02/04 20:52:57 rse Exp $"); #include <sys/socket.h> #include <sys/param.h> @@ -77,7 +77,7 @@ RV_OK = 0, RV_USAGE = 1, RV_NOTFOUND = 2, - RV_NOENUM = 3, + RV_NOENUM = 3 }; static struct getentdb { @@ -109,7 +109,6 @@ for (curdb = databases; curdb->name != NULL; curdb++) { if (strcmp(curdb->name, argv[1]) == 0) { exit(curdb->callback(argc, argv)); - break; } } fprintf(stderr, "Unknown database: %s\n", argv[1]); @@ -178,6 +177,7 @@ curpref = sep; } printf("\n"); + va_end(ap); } /* ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/mklocale/yacc.y#2 (text+ko) ==== @@ -42,7 +42,7 @@ #endif /* not lint */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.bin/mklocale/yacc.y,v 1.25 2005/05/16 09:32:41 ru Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/mklocale/yacc.y,v 1.26 2007/02/06 08:48:28 kevlo Exp $"); #include <arpa/inet.h> @@ -227,7 +227,7 @@ fp = stdout; - while ((x = getopt(ac, av, "do:")) != EOF) { + while ((x = getopt(ac, av, "do:")) != -1) { switch(x) { case 'd': debug = 1; ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/ncplist/ncplist.c#2 (text+ko) ==== @@ -32,7 +32,7 @@ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.bin/ncplist/ncplist.c,v 1.2 2002/04/28 12:21:31 markm Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/ncplist/ncplist.c,v 1.3 2007/02/05 07:35:23 kevlo Exp $"); #include <sys/param.h> #include <sys/time.h> @@ -380,7 +380,7 @@ bzero(args, sizeof(args)); what = LO_NONE; - while ((opt = getopt(argc, argv, "h")) != EOF) { + while ((opt = getopt(argc, argv, "h")) != -1) { switch (opt) { case 'h': case '?': help(); ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/ncplogin/ncplogin.c#2 (text+ko) ==== @@ -32,7 +32,7 @@ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.bin/ncplogin/ncplogin.c,v 1.4 2002/09/04 23:29:04 dwmalone Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/ncplogin/ncplogin.c,v 1.5 2007/02/05 07:35:23 kevlo Exp $"); #include <sys/types.h> #include <sys/errno.h> @@ -69,7 +69,7 @@ login(int argc, char *argv[], struct ncp_conn_loginfo *li) { int error = 0, connid, opt, setprimary = 0; - while ((opt = getopt(argc, argv, STDPARAM_OPT"D")) != EOF){ + while ((opt = getopt(argc, argv, STDPARAM_OPT"D")) != -1) { switch(opt){ case STDPARAM_ARGS: if (ncp_li_arg(li, opt, optarg)) ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.bin/quota/quota.c#3 (text+ko) ==== @@ -48,7 +48,7 @@ * Disk quota reporting program. */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.bin/quota/quota.c,v 1.26 2007/02/01 08:37:44 mpp Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/quota/quota.c,v 1.28 2007/02/04 14:06:58 mpp Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -85,7 +85,7 @@ char fsname[MAXPATHLEN + 1]; }; -static const char *timeprt(time_t seconds); +static char *timeprt(time_t seconds, int *needfree); static struct quotause *getprivs(long id, int quotatype); static void usage(void); static int showuid(u_long uid); @@ -271,6 +271,8 @@ struct quotause *quplist; const char *msgi, *msgb; const char *nam; + char *bgrace, *igrace; + int bfree, ifree; int lines = 0, overquota = 0; static time_t now; @@ -348,16 +350,22 @@ , (u_long) (dbtob(qup->dqblk.dqb_bhardlimit) / 1024)); } + if (msgb != NULL) + bgrace = timeprt(qup->dqblk.dqb_btime, &bfree); + if (msgi != NULL) + igrace = timeprt(qup->dqblk.dqb_itime, &ifree); printf("%8s%8lu%c%7lu%8lu%8s\n" - , (msgb == (char *)0) ? "" - :timeprt(qup->dqblk.dqb_btime) + , (msgb == (char *)0) ? "" : bgrace , (u_long)qup->dqblk.dqb_curinodes , (msgi == (char *)0) ? ' ' : '*' , (u_long)qup->dqblk.dqb_isoftlimit , (u_long)qup->dqblk.dqb_ihardlimit - , (msgi == (char *)0) ? "" - : timeprt(qup->dqblk.dqb_itime) + , (msgi == (char *)0) ? "" : igrace ); + if (msgb != NULL && bfree) + free(bgrace); + if (msgi != NULL && ifree) + free(igrace); continue; } } @@ -390,30 +398,38 @@ /* * Calculate the grace period and return a printable string for it. */ -static const char * -timeprt(time_t seconds) +static char * +timeprt(time_t seconds, int *needfree) { time_t hours, minutes; - static char buf[20]; + char *buf; static time_t now; if (now == 0) time(&now); - if (now > seconds) + if (now > seconds) { + *needfree = 0; return ("none"); + } seconds -= now; minutes = (seconds + 30) / 60; hours = (minutes + 30) / 60; if (hours >= 36) { - sprintf(buf, "%lddays", ((long)hours + 12) / 24); + if (asprintf(&buf, "%lddays", ((long)hours + 12) / 24) < 0) + errx(1, "asprintf failed in timeprt(1)"); + *needfree = 1; return (buf); } if (minutes >= 60) { - sprintf(buf, "%2ld:%ld", (long)minutes / 60, - (long)minutes % 60); + if (asprintf(&buf, "%2ld:%ld", (long)minutes / 60, + (long)minutes % 60) < 0) + errx(1, "asprintf failed in timeprt(2)"); + *needfree = 1; return (buf); } - sprintf(buf, "%2ld", (long)minutes); + if (asprintf(&buf, "%2ld", (long)minutes) < 0) + errx(1, "asprintf failed in timeprt(3)"); + *needfree = 1; return (buf); } @@ -483,13 +499,17 @@ static int ufshasquota(struct fstab *fs, int type, char **qfnamep) { + char *opt; + char *cp; + struct statfs sfb; static char initname, usrname[100], grpname[100]; static char buf[BUFSIZ]; - char *opt, *cp; if (!initname) { - sprintf(usrname, "%s%s", qfextension[USRQUOTA], qfname); - sprintf(grpname, "%s%s", qfextension[GRPQUOTA], qfname); + (void)snprintf(usrname, sizeof(usrname), "%s%s", + qfextension[USRQUOTA], qfname); + (void)snprintf(grpname, sizeof(grpname), "%s%s", + qfextension[GRPQUOTA], qfname); initname = 1; } strcpy(buf, fs->fs_mntops); @@ -503,12 +523,22 @@ } if (!opt) return (0); - if (cp) { + if (cp) *qfnamep = cp; - return (1); + else { + (void)snprintf(buf, sizeof(buf), "%s/%s.%s", fs->fs_file, + qfname, qfextension[type]); + *qfnamep = buf; + } + if (statfs(fs->fs_file, &sfb) != 0) { + warn("cannot statfs mount point %s", fs->fs_file); + return (0); + } + if (strcmp(fs->fs_file, sfb.f_mntonname)) { + warnx("%s not mounted for %s quotas", fs->fs_file, + type == USRQUOTA ? "user" : "group"); + return (0); } - (void) sprintf(buf, "%s/%s.%s", fs->fs_file, qfname, qfextension[type]); - *qfnamep = buf; return (1); } ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/apmd/apmd.c#2 (text+ko) ==== @@ -29,7 +29,7 @@ #ifndef lint static const char rcsid[] = - "$FreeBSD: src/usr.sbin/apmd/apmd.c,v 1.8 2005/03/24 01:26:40 mdodd Exp $"; + "$FreeBSD: src/usr.sbin/apmd/apmd.c,v 1.9 2007/02/05 07:35:23 kevlo Exp $"; #endif /* not lint */ #include <assert.h> @@ -650,7 +650,7 @@ char *prog; int logopt = LOG_NDELAY | LOG_PID; - while ((ch = getopt(ac, av, "df:sv")) != EOF) { + while ((ch = getopt(ac, av, "df:sv")) != -1) { switch (ch) { case 'd': daemonize = 0; ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/apmd/contrib/pccardq.c#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/usr.sbin/apmd/contrib/pccardq.c,v 1.5 2001/08/20 15:09:32 brian Exp $ */ +/* $FreeBSD: src/usr.sbin/apmd/contrib/pccardq.c,v 1.6 2007/02/05 07:35:23 kevlo Exp $ */ #include <err.h> #include <errno.h> @@ -36,7 +36,7 @@ tmp_dir = getenv("TMPDIR") ? getenv("TMPDIR") : tmp_dir; - while ((ch = getopt(ac, av, "ans:")) != EOF) { + while ((ch = getopt(ac, av, "ans:")) != -1) { switch (ch) { case 'a': slot_map = ~0; ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ * Bridge MIB implementation for SNMPd. * Bridge OS specific ioctls. * - * $FreeBSD: src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c,v 1.5 2006/12/29 19:23:38 bz Exp $ + * $FreeBSD: src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c,v 1.6 2007/02/04 13:31:05 syrinx Exp $ */ #include <sys/ioctl.h> @@ -36,9 +36,7 @@ #include <sys/socket.h> #include <sys/sysctl.h> -#if __FreeBSD_version > 700018 #include <net/bridgestp.h> -#endif #include <net/ethernet.h> #include <net/if.h> #include <net/if_bridgevar.h> @@ -238,10 +236,8 @@ bif->max_age = 100 * b_req.ifbop_maxage; bif->hello_time = 100 * b_req.ifbop_hellotime; bif->fwd_delay = 100 * b_req.ifbop_fwddelay; -#if __FreeBSD_version > 700024 bif->stp_version = b_req.ifbop_protocol; bif->tx_hold_count = b_req.ifbop_holdcount; -#endif if (b_req.ifbop_root_port == 0 && bif->root_port != b_req.ifbop_root_port) @@ -436,7 +432,6 @@ bridge_set_tx_hold_count(struct bridge_if *bif __unused, int32_t tx_hc __unused) { -#if __FreeBSD_version > 700024 struct ifdrv ifd; struct ifbrparam b_param; @@ -457,16 +452,12 @@ bif->tx_hold_count = b_param.ifbrp_txhc; return (0); -#else - return (-1); -#endif } int bridge_set_stp_version(struct bridge_if *bif __unused, int32_t stp_proto __unused) { -#if __FreeBSD_version > 700024 struct ifdrv ifd; struct ifbrparam b_param; @@ -484,9 +475,6 @@ bif->stp_version = b_param.ifbrp_proto; return (0); -#else - return (-1); -#endif } /* @@ -643,9 +631,7 @@ case BSTP_IFSTATE_FORWARDING: return (StpPortState_forwarding); case BSTP_IFSTATE_BLOCKING: -#if __FreeBSD_version > 700024 case BSTP_IFSTATE_DISCARDING: -#endif return (StpPortState_blocking); } @@ -671,12 +657,11 @@ * the maximum value." */ -#if __FreeBSD_version > 700024 if (k_info->ifbr_ifsflags & IFBIF_BSTP_ADMCOST) bp->admin_path_cost = k_info->ifbr_path_cost; else bp->admin_path_cost = 0; -#endif + bp->path_cost = k_info->ifbr_path_cost; if (k_info->ifbr_ifsflags & IFBIF_STP) @@ -690,7 +675,6 @@ else bp->span_enable = begemotBridgeBaseSpanEnabled_disabled; -#if __FreeBSD_version > 700024 if (k_info->ifbr_ifsflags & IFBIF_BSTP_ADMEDGE) bp->admin_edge = TruthValue_true; else @@ -714,7 +698,6 @@ bp->admin_ptp = StpPortAdminPointToPointType_forceFalse; bp->oper_ptp = TruthValue_false; } -#endif } /* @@ -830,11 +813,9 @@ struct ifdrv ifd; struct ifbreq b_req; -#if __FreeBSD_version < 700025 if (path_cost < SNMP_PORT_MIN_PATHCOST || path_cost > SNMP_PORT_PATHCOST_OBSOLETE) return (-2); -#endif strlcpy(ifd.ifd_name, bif_name, sizeof(ifd.ifd_name)); ifd.ifd_len = sizeof(b_req); @@ -850,11 +831,7 @@ return (-1); } -#if __FreeBSD_version > 700024 bp->admin_path_cost = path_cost; -#else - bp->path_cost = path_cost; -#endif return (0); } @@ -866,7 +843,6 @@ bridge_port_set_admin_ptp(const char *bif_name __unused, struct bridge_port *bp __unused, uint32_t admin_ptp __unused) { -#if __FreeBSD_version > 700024 struct ifdrv ifd; struct ifbreq b_req; @@ -909,9 +885,6 @@ bp->admin_ptp = admin_ptp; return (0); -#else - return (-1); -#endif } /* @@ -921,7 +894,6 @@ bridge_port_set_admin_edge(const char *bif_name __unused, struct bridge_port *bp __unused, uint32_t enable __unused) { -#if __FreeBSD_version > 700024 struct ifdrv ifd; struct ifbreq b_req; @@ -955,10 +927,8 @@ } bp->admin_edge = enable; + return (0); -#else - return (-1); -#endif } /* ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/edquota/edquota.8#2 (text+ko) ==== @@ -29,7 +29,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)edquota.8 8.1 (Berkeley) 6/6/93 -.\" $FreeBSD: src/usr.sbin/edquota/edquota.8,v 1.23 2005/01/18 20:02:33 ru Exp $ +.\" $FreeBSD: src/usr.sbin/edquota/edquota.8,v 1.24 2007/02/04 14:26:01 mpp Exp $ .\" .Dd June 6, 1993 .Dt EDQUOTA 8 @@ -222,6 +222,8 @@ grace period should be imposed. Setting a grace period to one second indicates that no grace period should be granted. +Quotas must be turned off for the file system and +then turned back on for the new grace period to take effect. .Pp Only the super-user may edit quotas. .Sh FILES ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/edquota/edquota.c#3 (text+ko) ==== @@ -43,7 +43,7 @@ #endif #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.sbin/edquota/edquota.c,v 1.24 2006/09/14 04:45:44 charnier Exp $"); +__FBSDID("$FreeBSD: src/usr.sbin/edquota/edquota.c,v 1.26 2007/02/04 06:33:14 mpp Exp $"); /* * Disk quota editor. @@ -52,6 +52,7 @@ #include <sys/param.h> #include <sys/stat.h> #include <sys/file.h> +#include <sys/mount.h> #include <sys/wait.h> #include <ufs/ufs/quota.h> #include <ctype.h> @@ -375,7 +376,13 @@ getentry(quotagroup, GRPQUOTA)); (void) fchmod(fd, 0640); } - lseek(fd, (long)(id * sizeof(struct dqblk)), L_SET); + if (lseek(fd, (off_t)id * sizeof(struct dqblk), + L_SET) < 0) { + warn("seek error on %s", qfpathname); + close(fd); + free(qup); + continue; + } switch (read(fd, &qup->dqblk, sizeof(struct dqblk))) { case 0: /* EOF */ /* @@ -421,21 +428,70 @@ { register struct quotause *qup; int qcmd, fd; + struct dqblk dqbuf; qcmd = QCMD(Q_SETQUOTA, quotatype); for (qup = quplist; qup; qup = qup->next) { if (quotactl(qup->fsname, qcmd, id, &qup->dqblk) == 0) continue; - if ((fd = open(qup->qfname, O_WRONLY)) < 0) { + if ((fd = open(qup->qfname, O_RDWR)) < 0) { warn("%s", qup->qfname); - } else { - lseek(fd, (long)id * (long)sizeof (struct dqblk), 0); - if (write(fd, &qup->dqblk, sizeof (struct dqblk)) != - sizeof (struct dqblk)) { - warn("%s", qup->qfname); - } + continue; + } + if (lseek(fd, (off_t)id * sizeof(struct dqblk), L_SET) < 0) { + warn("seek error on %s", qup->qfname); + close(fd); + continue; + } + switch (read(fd, &dqbuf, sizeof(struct dqblk))) { + case 0: /* EOF */ + /* + * Convert implicit 0 quota (EOF) + * into an explicit one (zero'ed dqblk) + */ + bzero(&dqbuf, sizeof(struct dqblk)); + break; + + case sizeof(struct dqblk): /* OK */ + break; + + default: /* ERROR */ + warn("read error in %s", qup->qfname); + close(fd); + continue; + } + /* + * Reset time limit if have a soft limit and were + * previously under it, but are now over it + * or if there previously was no soft limit, but + * now have one and are over it. + */ + if (dqbuf.dqb_bsoftlimit && id != 0 && + dqbuf.dqb_curblocks < dqbuf.dqb_bsoftlimit && + dqbuf.dqb_curblocks >= qup->dqblk.dqb_bsoftlimit) + qup->dqblk.dqb_btime = 0; + if (dqbuf.dqb_bsoftlimit == 0 && id != 0 && + dqbuf.dqb_curblocks >= qup->dqblk.dqb_bsoftlimit) + qup->dqblk.dqb_btime = 0; + if (dqbuf.dqb_isoftlimit && id != 0 && + dqbuf.dqb_curinodes < dqbuf.dqb_isoftlimit && + dqbuf.dqb_curinodes >= qup->dqblk.dqb_isoftlimit) + qup->dqblk.dqb_itime = 0; + if (dqbuf.dqb_isoftlimit == 0 && id !=0 && + dqbuf.dqb_curinodes >= qup->dqblk.dqb_isoftlimit) + qup->dqblk.dqb_itime = 0; + qup->dqblk.dqb_curinodes = dqbuf.dqb_curinodes; + qup->dqblk.dqb_curblocks = dqbuf.dqb_curblocks; + if (lseek(fd, (off_t)id * sizeof(struct dqblk), L_SET) < 0) { + warn("seek error on %s", qup->qfname); close(fd); + continue; } + if (write(fd, &qup->dqblk, sizeof (struct dqblk)) != + sizeof (struct dqblk)) { + warn("%s", qup->qfname); + } + close(fd); } } @@ -814,18 +870,21 @@ */ int hasquota(fs, type, qfnamep) - register struct fstab *fs; + struct fstab *fs; int type; char **qfnamep; { - register char *opt; + char *opt; char *cp; + struct statfs sfb; static char initname, usrname[100], grpname[100]; static char buf[BUFSIZ]; if (!initname) { - sprintf(usrname, "%s%s", qfextension[USRQUOTA], qfname); - sprintf(grpname, "%s%s", qfextension[GRPQUOTA], qfname); + (void)snprintf(usrname, sizeof(usrname), "%s%s", + qfextension[USRQUOTA], qfname); + (void)snprintf(grpname, sizeof(grpname), "%s%s", + qfextension[GRPQUOTA], qfname); initname = 1; } strcpy(buf, fs->fs_mntops); @@ -839,11 +898,22 @@ } if (!opt) return (0); - if (cp) { + if (cp) *qfnamep = cp; - return (1); + else { + (void)snprintf(buf, sizeof(buf), "%s/%s.%s", fs->fs_file, + qfname, qfextension[type]); + *qfnamep = buf; + } + if (statfs(fs->fs_file, &sfb) != 0) { + warn("cannot statfs mount point %s", fs->fs_file); + return (0); + } + if (strcmp(fs->fs_file, sfb.f_mntonname)) { + warnx("%s not mounted for %s quotas", fs->fs_file, + type == USRQUOTA ? "user" : "group"); + sleep(3); + return (0); } - (void) sprintf(buf, "%s/%s.%s", fs->fs_file, qfname, qfextension[type]); - *qfnamep = buf; return (1); } ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/iostat/iostat.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/iostat/iostat.c,v 1.31 2006/04/16 22:30:24 maxim Exp $ + * $FreeBSD: src/usr.sbin/iostat/iostat.c,v 1.32 2007/02/06 20:29:40 jhb Exp $ */ /* * Parts of this program are derived from the original FreeBSD iostat @@ -823,15 +823,16 @@ if (kd != NULL) { ssize_t nbytes; - nbytes = kvm_read(kd, nlid, ptr, len); + nbytes = kvm_read(kd, namelist[nlid].n_value, ptr, len); - if (nbytes == 0) { - warnx("kvm_read(%s): %s", name, kvm_geterr(kd)); + if (nbytes < 0) { + warnx("kvm_read(%s): %s", namelist[nlid].n_name, + kvm_geterr(kd)); return (1); } if (nbytes != len) { - warnx("kvm_read(%s): expected %lu bytes, got %ld bytes", - name, (unsigned long)len, (long)nbytes); + warnx("kvm_read(%s): expected %zu bytes, got %zd bytes", + namelist[nlid].n_name, len, nbytes); return (1); } } else { ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/mountd/mountd.8#2 (text+ko) ==== @@ -26,9 +26,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)mountd.8 8.4 (Berkeley) 4/28/95 -.\" $FreeBSD: src/usr.sbin/mountd/mountd.8,v 1.28 2006/05/02 21:00:43 keramida Exp $ +.\" $FreeBSD: src/usr.sbin/mountd/mountd.8,v 1.30 2007/02/03 00:15:46 pjd Exp $ .\" -.Dd May 2, 2006 +.Dd February 3, 2007 .Dt MOUNTD 8 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nm .Op Fl 2dlnr .Op Fl p Ar port -.Op Ar exportsfile +.Op Ar exportsfile ... .Sh DESCRIPTION The .Nm @@ -106,6 +106,7 @@ .It Ar exportsfile Specify an alternate location for the exports file. +More than one exports file can be specified. .El .Pp When ==== //depot/projects/soc2006/nss_ldap_cached_openldap/src/usr.sbin/mountd/mountd.c#5 (text+ko) ==== @@ -43,7 +43,7 @@ #endif #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.sbin/mountd/mountd.c,v 1.92 2007/01/26 13:26:43 rodrigc Exp $"); +__FBSDID("$FreeBSD: src/usr.sbin/mountd/mountd.c,v 1.93 2007/02/03 00:12:18 pjd Exp $"); #include <sys/param.h> #include <sys/mount.h> @@ -205,7 +205,8 @@ struct exportlist *exphead; struct mountlist *mlhead; struct grouplist *grphead; -char exname[MAXPATHLEN]; +char *exnames_default[2] = { _PATH_EXPORTS, NULL }; +char **exnames; struct xucred def_anon = { XUCRED_VERSION, (uid_t)-2, @@ -322,11 +323,10 @@ grphead = (struct grouplist *)NULL; exphead = (struct exportlist *)NULL; mlhead = (struct mountlist *)NULL; - if (argc == 1) { - strncpy(exname, *argv, MAXPATHLEN-1); - exname[MAXPATHLEN-1] = '\0'; - } else - strcpy(exname, _PATH_EXPORTS); + if (argc > 0) + exnames = argv; + else >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702071603.l17G3OXg097034>