Date: Sat, 24 Apr 2010 21:05:08 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r207160 - in user/kib/vm6: . bin/ln contrib/tzdata etc etc/devd etc/mtree include lib lib/libc/stdlib lib/libpkg lib/libufs lib/libz release/powerpc sbin/devd sbin/dumpfs sbin/fsck_ffs ... Message-ID: <201004242105.o3OL58E5046168@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sat Apr 24 21:05:08 2010 New Revision: 207160 URL: http://svn.freebsd.org/changeset/base/207160 Log: IFC Added: user/kib/vm6/lib/libpkg/ - copied from r207158, head/lib/libpkg/ user/kib/vm6/sbin/fsck_ffs/suj.c - copied unchanged from r207158, head/sbin/fsck_ffs/suj.c user/kib/vm6/tools/regression/bin/sh/expansion/trim3.0 - copied unchanged from r207158, head/tools/regression/bin/sh/expansion/trim3.0 user/kib/vm6/tools/test/testfloat/ - copied from r207158, head/tools/test/testfloat/ Deleted: user/kib/vm6/sys/cddl/dev/cyclic/amd64/ user/kib/vm6/usr.sbin/pkg_install/lib/ Modified: user/kib/vm6/Makefile.inc1 user/kib/vm6/bin/ln/ln.c user/kib/vm6/contrib/tzdata/africa user/kib/vm6/contrib/tzdata/asia user/kib/vm6/contrib/tzdata/southamerica user/kib/vm6/etc/devd.conf user/kib/vm6/etc/devd/uath.conf user/kib/vm6/etc/mtree/BSD.usr.dist user/kib/vm6/include/stdlib.h user/kib/vm6/lib/Makefile user/kib/vm6/lib/libc/stdlib/realpath.3 user/kib/vm6/lib/libc/stdlib/realpath.c user/kib/vm6/lib/libufs/Makefile user/kib/vm6/lib/libufs/cgroup.c user/kib/vm6/lib/libufs/inode.c user/kib/vm6/lib/libufs/libufs.h user/kib/vm6/lib/libufs/sblock.c user/kib/vm6/lib/libufs/type.c user/kib/vm6/lib/libz/ChangeLog user/kib/vm6/lib/libz/README user/kib/vm6/lib/libz/crc32.c user/kib/vm6/lib/libz/deflate.c user/kib/vm6/lib/libz/deflate.h user/kib/vm6/lib/libz/gzguts.h user/kib/vm6/lib/libz/gzlib.c user/kib/vm6/lib/libz/inffast.c user/kib/vm6/lib/libz/inffast.h user/kib/vm6/lib/libz/inftrees.c user/kib/vm6/lib/libz/inftrees.h user/kib/vm6/lib/libz/trees.c user/kib/vm6/lib/libz/trees.h user/kib/vm6/lib/libz/zconf.h user/kib/vm6/lib/libz/zlib.3 user/kib/vm6/lib/libz/zlib.h user/kib/vm6/lib/libz/zutil.c user/kib/vm6/lib/libz/zutil.h user/kib/vm6/release/powerpc/boot_crunch.conf user/kib/vm6/sbin/devd/devd.conf.5 user/kib/vm6/sbin/dumpfs/dumpfs.c user/kib/vm6/sbin/fsck_ffs/Makefile user/kib/vm6/sbin/fsck_ffs/fsck.h user/kib/vm6/sbin/fsck_ffs/gjournal.c user/kib/vm6/sbin/fsck_ffs/main.c user/kib/vm6/sbin/fsck_ffs/pass5.c user/kib/vm6/sbin/fsdb/fsdb.c user/kib/vm6/sbin/fsdb/fsdbutil.c user/kib/vm6/sbin/geom/class/part/geom_part.c user/kib/vm6/sbin/geom/class/part/gpart.8 user/kib/vm6/sbin/hastctl/Makefile user/kib/vm6/sbin/hastd/Makefile user/kib/vm6/sbin/hastd/hast_proto.c user/kib/vm6/sbin/ping6/ping6.8 user/kib/vm6/sbin/ping6/ping6.c user/kib/vm6/sbin/tunefs/Makefile user/kib/vm6/sbin/tunefs/tunefs.8 user/kib/vm6/sbin/tunefs/tunefs.c user/kib/vm6/share/examples/Makefile user/kib/vm6/share/misc/committers-src.dot user/kib/vm6/share/mk/bsd.cpu.mk user/kib/vm6/share/mk/bsd.libnames.mk user/kib/vm6/sys/amd64/amd64/bpf_jit_machdep.c user/kib/vm6/sys/amd64/amd64/bpf_jit_machdep.h user/kib/vm6/sys/amd64/amd64/local_apic.c user/kib/vm6/sys/amd64/amd64/pmap.c user/kib/vm6/sys/amd64/conf/GENERIC user/kib/vm6/sys/amd64/ia32/ia32_signal.c user/kib/vm6/sys/amd64/include/proc.h user/kib/vm6/sys/arm/arm/pmap.c user/kib/vm6/sys/arm/conf/DB-78XXX user/kib/vm6/sys/arm/conf/DB-88F5XXX user/kib/vm6/sys/arm/conf/DB-88F6XXX user/kib/vm6/sys/arm/conf/HL200 user/kib/vm6/sys/arm/conf/KB920X user/kib/vm6/sys/arm/conf/LN2410SBC user/kib/vm6/sys/arm/conf/SHEEVAPLUG user/kib/vm6/sys/arm/include/proc.h user/kib/vm6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c user/kib/vm6/sys/cddl/dev/cyclic/i386/cyclic_machdep.c user/kib/vm6/sys/compat/freebsd32/freebsd32.h user/kib/vm6/sys/compat/freebsd32/freebsd32_misc.c user/kib/vm6/sys/compat/freebsd32/freebsd32_util.h user/kib/vm6/sys/conf/files.sparc64 user/kib/vm6/sys/conf/files.sun4v user/kib/vm6/sys/conf/kern.pre.mk user/kib/vm6/sys/conf/kmod.mk user/kib/vm6/sys/dev/age/if_age.c user/kib/vm6/sys/dev/alc/if_alc.c user/kib/vm6/sys/dev/ale/if_ale.c user/kib/vm6/sys/dev/drm/ati_pcigart.c user/kib/vm6/sys/dev/drm/drmP.h user/kib/vm6/sys/dev/drm/drm_bufs.c user/kib/vm6/sys/dev/drm/drm_context.c user/kib/vm6/sys/dev/drm/drm_drv.c user/kib/vm6/sys/dev/drm/drm_hashtab.c user/kib/vm6/sys/dev/drm/drm_memory.c user/kib/vm6/sys/dev/drm/drm_mm.c user/kib/vm6/sys/dev/drm/drm_scatter.c user/kib/vm6/sys/dev/drm/drm_sman.c user/kib/vm6/sys/dev/drm/drm_sysctl.c user/kib/vm6/sys/dev/drm/drm_vm.c user/kib/vm6/sys/dev/drm/i915_dma.c user/kib/vm6/sys/dev/drm/mach64_dma.c user/kib/vm6/sys/dev/drm/mga_dma.c user/kib/vm6/sys/dev/drm/mga_warp.c user/kib/vm6/sys/dev/drm/r128_cce.c user/kib/vm6/sys/dev/drm/r128_state.c user/kib/vm6/sys/dev/drm/r600_blit.c user/kib/vm6/sys/dev/drm/r600_cp.c user/kib/vm6/sys/dev/drm/radeon_cp.c user/kib/vm6/sys/dev/drm/radeon_cs.c user/kib/vm6/sys/dev/drm/radeon_state.c user/kib/vm6/sys/dev/drm/savage_bci.c user/kib/vm6/sys/dev/drm/via_dma.c user/kib/vm6/sys/dev/drm/via_map.c user/kib/vm6/sys/dev/drm/via_mm.c user/kib/vm6/sys/dev/fxp/if_fxp.c user/kib/vm6/sys/dev/iwn/if_iwn.c user/kib/vm6/sys/dev/msk/if_msk.c user/kib/vm6/sys/dev/nfe/if_nfe.c user/kib/vm6/sys/dev/sge/if_sge.c user/kib/vm6/sys/dev/sis/if_sis.c user/kib/vm6/sys/dev/sound/usb/uaudio.c user/kib/vm6/sys/dev/usb/controller/ehci.c user/kib/vm6/sys/dev/usb/controller/uhci.c user/kib/vm6/sys/dev/usb/controller/uss820dci.c user/kib/vm6/sys/dev/usb/input/atp.c user/kib/vm6/sys/dev/usb/input/uhid.c user/kib/vm6/sys/dev/usb/input/ukbd.c user/kib/vm6/sys/dev/usb/input/ums.c user/kib/vm6/sys/dev/usb/misc/udbp.c user/kib/vm6/sys/dev/usb/net/if_aue.c user/kib/vm6/sys/dev/usb/net/if_axe.c user/kib/vm6/sys/dev/usb/net/if_cdce.c user/kib/vm6/sys/dev/usb/net/if_cue.c user/kib/vm6/sys/dev/usb/net/if_kue.c user/kib/vm6/sys/dev/usb/net/if_rue.c user/kib/vm6/sys/dev/usb/net/if_udav.c user/kib/vm6/sys/dev/usb/serial/u3g.c user/kib/vm6/sys/dev/usb/serial/ubsa.c user/kib/vm6/sys/dev/usb/serial/ubser.c user/kib/vm6/sys/dev/usb/serial/uchcom.c user/kib/vm6/sys/dev/usb/serial/uftdi.c user/kib/vm6/sys/dev/usb/serial/ulpt.c user/kib/vm6/sys/dev/usb/serial/umodem.c user/kib/vm6/sys/dev/usb/serial/umoscom.c user/kib/vm6/sys/dev/usb/serial/uplcom.c user/kib/vm6/sys/dev/usb/serial/usb_serial.c user/kib/vm6/sys/dev/usb/serial/uslcom.c user/kib/vm6/sys/dev/usb/serial/uvisor.c user/kib/vm6/sys/dev/usb/serial/uvscom.c user/kib/vm6/sys/dev/usb/storage/umass.c user/kib/vm6/sys/dev/usb/storage/urio.c user/kib/vm6/sys/dev/usb/storage/ustorage_fs.c user/kib/vm6/sys/dev/usb/usb_compat_linux.c user/kib/vm6/sys/dev/usb/usb_debug.h user/kib/vm6/sys/dev/usb/usb_dev.c user/kib/vm6/sys/dev/usb/usb_device.c user/kib/vm6/sys/dev/usb/usb_device.h user/kib/vm6/sys/dev/usb/usb_freebsd.h user/kib/vm6/sys/dev/usb/usb_generic.c user/kib/vm6/sys/dev/usb/usb_hub.c user/kib/vm6/sys/dev/usb/usb_request.c user/kib/vm6/sys/dev/usb/usb_transfer.c user/kib/vm6/sys/dev/usb/usb_transfer.h user/kib/vm6/sys/dev/usb/wlan/if_rum.c user/kib/vm6/sys/dev/usb/wlan/if_run.c user/kib/vm6/sys/dev/usb/wlan/if_ural.c user/kib/vm6/sys/dev/usb/wlan/if_zyd.c user/kib/vm6/sys/fs/nfs/nfs_var.h user/kib/vm6/sys/fs/nfsclient/nfs.h user/kib/vm6/sys/fs/nfsclient/nfs_clbio.c user/kib/vm6/sys/fs/nfsclient/nfs_clnfsiod.c user/kib/vm6/sys/fs/nfsclient/nfs_clnode.c user/kib/vm6/sys/fs/nfsclient/nfs_clrpcops.c user/kib/vm6/sys/fs/nfsclient/nfs_clstate.c user/kib/vm6/sys/fs/nfsclient/nfs_clvnops.c user/kib/vm6/sys/fs/pseudofs/pseudofs_vnops.c user/kib/vm6/sys/geom/geom_subr.c user/kib/vm6/sys/geom/part/g_part.c user/kib/vm6/sys/geom/part/g_part_apm.c user/kib/vm6/sys/geom/part/g_part_bsd.c user/kib/vm6/sys/geom/part/g_part_gpt.c user/kib/vm6/sys/geom/part/g_part_if.m user/kib/vm6/sys/geom/part/g_part_mbr.c user/kib/vm6/sys/geom/part/g_part_pc98.c user/kib/vm6/sys/geom/part/g_part_vtoc8.c user/kib/vm6/sys/i386/conf/GENERIC user/kib/vm6/sys/i386/conf/XBOX user/kib/vm6/sys/i386/i386/bpf_jit_machdep.c user/kib/vm6/sys/i386/i386/bpf_jit_machdep.h user/kib/vm6/sys/i386/i386/local_apic.c user/kib/vm6/sys/i386/i386/pmap.c user/kib/vm6/sys/i386/include/proc.h user/kib/vm6/sys/i386/xen/pmap.c user/kib/vm6/sys/ia64/conf/GENERIC user/kib/vm6/sys/ia64/ia64/pmap.c user/kib/vm6/sys/ia64/include/proc.h user/kib/vm6/sys/kern/kern_clock.c user/kib/vm6/sys/kern/kern_descrip.c user/kib/vm6/sys/kern/kern_proc.c user/kib/vm6/sys/kern/kern_shutdown.c user/kib/vm6/sys/kern/subr_bus.c user/kib/vm6/sys/kern/vfs_bio.c user/kib/vm6/sys/kern/vfs_cache.c user/kib/vm6/sys/kern/vfs_subr.c user/kib/vm6/sys/mips/conf/SENTRY5 user/kib/vm6/sys/mips/conf/SWARM user/kib/vm6/sys/mips/conf/XLR user/kib/vm6/sys/mips/include/proc.h user/kib/vm6/sys/mips/include/vmparam.h user/kib/vm6/sys/mips/mips/exception.S user/kib/vm6/sys/mips/mips/pmap.c user/kib/vm6/sys/mips/mips/tick.c user/kib/vm6/sys/mips/sibyte/sb_machdep.c user/kib/vm6/sys/modules/cyclic/Makefile user/kib/vm6/sys/netinet/ip_input.c user/kib/vm6/sys/netinet/sctp_asconf.c user/kib/vm6/sys/netinet/sctp_indata.c user/kib/vm6/sys/netinet/sctputil.c user/kib/vm6/sys/pc98/cbus/clock.c user/kib/vm6/sys/pc98/conf/GENERIC user/kib/vm6/sys/powerpc/aim/mmu_oea.c user/kib/vm6/sys/powerpc/aim/mmu_oea64.c user/kib/vm6/sys/powerpc/booke/pmap.c user/kib/vm6/sys/powerpc/conf/GENERIC user/kib/vm6/sys/powerpc/conf/MPC85XX user/kib/vm6/sys/powerpc/include/proc.h user/kib/vm6/sys/powerpc/powerpc/mmu_if.m user/kib/vm6/sys/powerpc/powerpc/pmap_dispatch.c user/kib/vm6/sys/sparc64/conf/GENERIC user/kib/vm6/sys/sparc64/include/proc.h user/kib/vm6/sys/sparc64/sparc64/pmap.c user/kib/vm6/sys/sun4v/conf/GENERIC user/kib/vm6/sys/sun4v/include/proc.h user/kib/vm6/sys/sun4v/sun4v/pmap.c user/kib/vm6/sys/sys/buf.h user/kib/vm6/sys/sys/dtrace_bsd.h user/kib/vm6/sys/sys/mount.h user/kib/vm6/sys/sys/thr.h user/kib/vm6/sys/sys/user.h user/kib/vm6/sys/ufs/ffs/ffs_alloc.c user/kib/vm6/sys/ufs/ffs/ffs_balloc.c user/kib/vm6/sys/ufs/ffs/ffs_extern.h user/kib/vm6/sys/ufs/ffs/ffs_inode.c user/kib/vm6/sys/ufs/ffs/ffs_snapshot.c user/kib/vm6/sys/ufs/ffs/ffs_softdep.c user/kib/vm6/sys/ufs/ffs/ffs_subr.c user/kib/vm6/sys/ufs/ffs/ffs_vfsops.c user/kib/vm6/sys/ufs/ffs/ffs_vnops.c user/kib/vm6/sys/ufs/ffs/fs.h user/kib/vm6/sys/ufs/ffs/softdep.h user/kib/vm6/sys/ufs/ufs/dinode.h user/kib/vm6/sys/ufs/ufs/inode.h user/kib/vm6/sys/ufs/ufs/ufs_dirhash.c user/kib/vm6/sys/ufs/ufs/ufs_extern.h user/kib/vm6/sys/ufs/ufs/ufs_lookup.c user/kib/vm6/sys/ufs/ufs/ufs_vnops.c user/kib/vm6/sys/ufs/ufs/ufsmount.h user/kib/vm6/sys/vm/pmap.h user/kib/vm6/sys/vm/vm_mmap.c user/kib/vm6/sys/vm/vm_pageout.c user/kib/vm6/sys/x86/isa/clock.c user/kib/vm6/tools/regression/bpf/bpf_filter/tests/test0083.h user/kib/vm6/tools/test/README user/kib/vm6/tools/tools/netrate/tcpp/tcpp_client.c user/kib/vm6/tools/tools/netrate/tcpp/tcpp_server.c user/kib/vm6/usr.bin/stat/stat.1 user/kib/vm6/usr.bin/stat/stat.c user/kib/vm6/usr.sbin/config/configvers.h user/kib/vm6/usr.sbin/config/mkmakefile.c user/kib/vm6/usr.sbin/makefs/ffs/ffs_bswap.c user/kib/vm6/usr.sbin/pkg_install/Makefile user/kib/vm6/usr.sbin/pkg_install/Makefile.inc user/kib/vm6/usr.sbin/pkg_install/add/Makefile user/kib/vm6/usr.sbin/pkg_install/add/extract.c user/kib/vm6/usr.sbin/pkg_install/add/futil.c user/kib/vm6/usr.sbin/pkg_install/add/main.c user/kib/vm6/usr.sbin/pkg_install/add/perform.c user/kib/vm6/usr.sbin/pkg_install/create/Makefile user/kib/vm6/usr.sbin/pkg_install/create/main.c user/kib/vm6/usr.sbin/pkg_install/create/perform.c user/kib/vm6/usr.sbin/pkg_install/create/pl.c user/kib/vm6/usr.sbin/pkg_install/delete/Makefile user/kib/vm6/usr.sbin/pkg_install/delete/main.c user/kib/vm6/usr.sbin/pkg_install/delete/perform.c user/kib/vm6/usr.sbin/pkg_install/info/Makefile user/kib/vm6/usr.sbin/pkg_install/info/info.h user/kib/vm6/usr.sbin/pkg_install/info/main.c user/kib/vm6/usr.sbin/pkg_install/info/perform.c user/kib/vm6/usr.sbin/pkg_install/info/show.c user/kib/vm6/usr.sbin/pkg_install/updating/Makefile user/kib/vm6/usr.sbin/pkg_install/updating/main.c user/kib/vm6/usr.sbin/pkg_install/version/Makefile user/kib/vm6/usr.sbin/pkg_install/version/main.c user/kib/vm6/usr.sbin/pkg_install/version/perform.c user/kib/vm6/usr.sbin/pmcstat/pmcpl_calltree.c user/kib/vm6/usr.sbin/sade/disks.c user/kib/vm6/usr.sbin/sade/menus.c user/kib/vm6/usr.sbin/sysinstall/disks.c user/kib/vm6/usr.sbin/sysinstall/menus.c user/kib/vm6/usr.sbin/sysinstall/tcpip.c Directory Properties: user/kib/vm6/ (props changed) user/kib/vm6/contrib/gnu-sort/ (props changed) user/kib/vm6/contrib/tzcode/stdtime/ (props changed) user/kib/vm6/contrib/tzcode/zic/ (props changed) user/kib/vm6/contrib/tzdata/ (props changed) user/kib/vm6/lib/libz/ (props changed) user/kib/vm6/sys/contrib/x86emu/ (props changed) user/kib/vm6/sys/mips/rmi/debug.h (props changed) user/kib/vm6/sys/mips/rmi/msgring.h (props changed) user/kib/vm6/sys/mips/rmi/shared_structs.h (props changed) user/kib/vm6/sys/mips/rmi/shared_structs_func.h (props changed) user/kib/vm6/sys/mips/rmi/shared_structs_offsets.h (props changed) Modified: user/kib/vm6/Makefile.inc1 ============================================================================== --- user/kib/vm6/Makefile.inc1 Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/Makefile.inc1 Sat Apr 24 21:05:08 2010 (r207160) @@ -259,7 +259,7 @@ WMAKEENV= ${CROSSENV} \ VERSION="${VERSION}" \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${TMPPATH} -.if ${MK_CDDL} == "no" || defined(NO_CTF) +.if ${MK_CDDL} == "no" WMAKEENV+= NO_CTF=1 .endif WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP} @@ -780,7 +780,7 @@ buildkernel: @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS \ -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) @@ -1111,7 +1111,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ ${_kerberos5_lib_libroken} \ lib/libbz2 lib/libcom_err lib/libcrypt \ - lib/libexpat \ + lib/libexpat lib/libfetch \ ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ @@ -1138,6 +1138,7 @@ _cddl_lib= cddl/lib _secure_lib_libcrypto= secure/lib/libcrypto _secure_lib_libssl= secure/lib/libssl lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L +lib/libfetch__L: secure/lib/libcrypto__L secure/lib/libssl__L lib/libmd__L .if ${MK_OPENSSH} != "no" _secure_lib_libssh= secure/lib/libssh secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L @@ -1173,7 +1174,7 @@ _lib_libypclnt= lib/libypclnt .endif .if ${MK_OPENSSL} == "no" -lib/libradius__L: lib/libmd__L +lib/libfetch__L lib/libradius__L: lib/libmd__L .endif .for _lib in ${_prereq_libs} Modified: user/kib/vm6/bin/ln/ln.c ============================================================================== --- user/kib/vm6/bin/ln/ln.c Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/bin/ln/ln.c Sat Apr 24 21:05:08 2010 (r207160) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include <err.h> #include <errno.h> #include <fcntl.h> +#include <libgen.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> @@ -226,6 +227,7 @@ linkit(const char *source, const char *t int ch, exists, first; char path[PATH_MAX]; char wbuf[PATH_MAX]; + char bbuf[PATH_MAX]; if (!sflag) { /* If source doesn't exist, quit now. */ @@ -248,11 +250,9 @@ linkit(const char *source, const char *t if (isdir || (lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) || (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode))) { - if ((p = strrchr(source, '/')) == NULL) - p = source; - else - ++p; - if (snprintf(path, sizeof(path), "%s/%s", target, p) >= + if (strlcpy(bbuf, source, sizeof(bbuf)) >= sizeof(bbuf) || + (p = basename(bbuf)) == NULL || + snprintf(path, sizeof(path), "%s/%s", target, p) >= (ssize_t)sizeof(path)) { errno = ENAMETOOLONG; warn("%s", source); @@ -276,15 +276,14 @@ linkit(const char *source, const char *t * absolute path of the source, by appending `source' * to the parent directory of the target. */ - p = strrchr(target, '/'); - if (p != NULL) - p++; - else - p = target; - (void)snprintf(wbuf, sizeof(wbuf), "%.*s%s", - (int)(p - target), target, source); - if (stat(wbuf, &sb) != 0) - warn("warning: %s", source); + strlcpy(bbuf, target, sizeof(bbuf)); + p = dirname(bbuf); + if (p != NULL) { + (void)snprintf(wbuf, sizeof(wbuf), "%s/%s", + p, source); + if (stat(wbuf, &sb) != 0) + warn("warning: %s", source); + } } } Modified: user/kib/vm6/contrib/tzdata/africa ============================================================================== --- user/kib/vm6/contrib/tzdata/africa Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/contrib/tzdata/africa Sat Apr 24 21:05:08 2010 (r207160) @@ -1,5 +1,5 @@ # <pre> -# @(#)africa 8.23 +# @(#)africa 8.26 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -680,6 +680,21 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # http://www.worldtimezone.com/dst_news/dst_news_morocco03.html # </a> +# From Steffen Thorsen (2010-04-13): +# Several news media in Morocco report that the Ministry of Modernization +# of Public Sectors has announced that Morocco will have DST from +# 2010-05-02 to 2010-08-08. +# +# Example: +# <a href="http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html"> +# http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html +# </a> +# (French) +# Our page: +# <a href="http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html"> +# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html +# </a> + # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Morocco 1939 only - Sep 12 0:00 1:00 S @@ -701,6 +716,8 @@ Rule Morocco 2008 only - Jun 1 0:00 1: Rule Morocco 2008 only - Sep 1 0:00 0 - Rule Morocco 2009 only - Jun 1 0:00 1:00 S Rule Morocco 2009 only - Aug 21 0:00 0 - +Rule Morocco 2010 only - May 2 0:00 1:00 S +Rule Morocco 2010 only - Aug 8 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 0:00 Morocco WE%sT 1984 Mar 16 @@ -942,6 +959,24 @@ Zone Africa/Lome 0:04:52 - LMT 1893 # Therefore, the standard time will be kept unchanged the whole year long." # So foregoing DST seems to be an exception (albeit one that may be repeated in the future). +# From Alexander Krivenyshev (2010-03-27): +# According to some news reports Tunis confirmed not to use DST in 2010 +# +# (translation): +# "The Tunisian government has decided to abandon DST, which was scheduled on +# Sunday... +# Tunisian authorities had suspended the DST for the first time last year also +# coincided with the month of Ramadan..." +# +# (in Arabic) +# <a href="http://www.moheet.com/show_news.aspx?nid=358861&pg=1"> +# http://www.moheet.com/show_news.aspx?nid=358861&pg=1 +# <a href="http://www.almadenahnews.com/newss/news.php?c=118&id=38036"> +# http://www.almadenahnews.com/newss/news.php?c=118&id=38036 +# or +# <a href="http://www.worldtimezone.com/dst_news/dst_news_tunis02.html"> +# http://www.worldtimezone.com/dst_news/dst_news_tunis02.html + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Tunisia 1939 only - Apr 15 23:00s 1:00 S Rule Tunisia 1939 only - Nov 18 23:00s 0 - @@ -968,8 +1003,7 @@ Rule Tunisia 2005 only - May 1 0:00s 1 Rule Tunisia 2005 only - Sep 30 1:00s 0 - Rule Tunisia 2006 2008 - Mar lastSun 2:00s 1:00 S Rule Tunisia 2006 2008 - Oct lastSun 2:00s 0 - -Rule Tunisia 2010 max - Mar lastSun 2:00s 1:00 S -Rule Tunisia 2010 max - Oct lastSun 2:00s 0 - + # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's # more precise 0:09:21. # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11. Modified: user/kib/vm6/contrib/tzdata/asia ============================================================================== --- user/kib/vm6/contrib/tzdata/asia Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/contrib/tzdata/asia Sat Apr 24 21:05:08 2010 (r207160) @@ -1,4 +1,4 @@ -# @(#)asia 8.58 +# @(#)asia 8.60 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -566,6 +566,28 @@ Zone Asia/Hong_Kong 7:36:36 - LMT 1904 O # was still controlled by Japan. This is hard to believe, but we don't # have any other information. +# From smallufo (2010-04-03): +# According to Taiwan's CWB, +# <a href="http://www.cwb.gov.tw/V6/astronomy/cdata/summert.htm"> +# http://www.cwb.gov.tw/V6/astronomy/cdata/summert.htm +# </a> +# Taipei has DST in 1979 between July 1st and Sep 30. + +# From Arthur David Olson (2010-04-07): +# Here's Google's translation of the table at the bottom of the "summert.htm" page: +# Decade Name Start and end date +# Republic of China 34 years to 40 years (AD 1945-1951 years) Summer Time May 1 to September 30 +# 41 years of the Republic of China (AD 1952) Daylight Saving Time March 1 to October 31 +# Republic of China 42 years to 43 years (AD 1953-1954 years) Daylight Saving Time April 1 to October 31 +# In the 44 years to 45 years (AD 1955-1956 years) Daylight Saving Time April 1 to September 30 +# Republic of China 46 years to 48 years (AD 1957-1959) Summer Time April 1 to September 30 +# Republic of China 49 years to 50 years (AD 1960-1961) Summer Time June 1 to September 30 +# Republic of China 51 years to 62 years (AD 1962-1973 years) Stop Summer Time +# Republic of China 63 years to 64 years (1974-1975 AD) Daylight Saving Time April 1 to September 30 +# Republic of China 65 years to 67 years (1976-1978 AD) Stop Daylight Saving Time +# Republic of China 68 years (AD 1979) Daylight Saving Time July 1 to September 30 +# Republic of China since 69 years (AD 1980) Stop Daylight Saving Time + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Taiwan 1945 1951 - May 1 0:00 1:00 D Rule Taiwan 1945 1951 - Oct 1 0:00 0 S @@ -576,8 +598,9 @@ Rule Taiwan 1955 1961 - Oct 1 0:00 0 S Rule Taiwan 1960 1961 - Jun 1 0:00 1:00 D Rule Taiwan 1974 1975 - Apr 1 0:00 1:00 D Rule Taiwan 1974 1975 - Oct 1 0:00 0 S -Rule Taiwan 1980 only - Jun 30 0:00 1:00 D -Rule Taiwan 1980 only - Sep 30 0:00 0 S +Rule Taiwan 1979 only - Jun 30 0:00 1:00 D +Rule Taiwan 1979 only - Sep 30 0:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Taipei 8:06:00 - LMT 1896 # or Taibei or T'ai-pei 8:00 Taiwan C%sT @@ -1912,13 +1935,35 @@ Zone Asia/Muscat 3:54:20 - LMT 1920 # [T]he German Consulate General in Karachi reported me today that Pakistan # will go back to standard time on 1st of November. +# From Steffen Thorsen (2010-03-26): +# Steffen Thorsen wrote: +# > On Thursday (2010-03-25) it was announced that DST would start in +# > Pakistan on 2010-04-01. +# > +# > Then today, the president said that they might have to revert the +# > decision if it is not supported by the parliament. So at the time +# > being, it seems unclear if DST will be actually observed or not - but +# > April 1 could be a more likely date than April 15. +# Now, it seems that the decision to not observe DST in final: +# +# "Govt Withdraws Plan To Advance Clocks" +# <a href="http://www.apakistannews.com/govt-withdraws-plan-to-advance-clocks-172041"> +# http://www.apakistannews.com/govt-withdraws-plan-to-advance-clocks-172041 +# </a> +# +# "People laud PM's announcement to end DST" +# <a href="http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2"> +# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2 +# </a> + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Pakistan 2002 only - Apr Sun>=2 0:01 1:00 S Rule Pakistan 2002 only - Oct Sun>=2 0:01 0 - Rule Pakistan 2008 only - Jun 1 0:00 1:00 S Rule Pakistan 2008 only - Nov 1 0:00 0 - -Rule Pakistan 2009 max - Apr 15 0:00 1:00 S -Rule Pakistan 2009 max - Nov 1 0:00 0 - +Rule Pakistan 2009 only - Apr 15 0:00 1:00 S +Rule Pakistan 2009 only - Nov 1 0:00 0 - + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Karachi 4:28:12 - LMT 1907 5:30 - IST 1942 Sep Modified: user/kib/vm6/contrib/tzdata/southamerica ============================================================================== --- user/kib/vm6/contrib/tzdata/southamerica Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/contrib/tzdata/southamerica Sat Apr 24 21:05:08 2010 (r207160) @@ -1,5 +1,5 @@ # <pre> -# @(#)southamerica 8.43 +# @(#)southamerica 8.44 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -437,6 +437,27 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1: # of the country calls it "ART". # ... +# From Alexander Krivenyshev (2010-04-09): +# According to news reports from El Diario de la Republica Province San +# Luis, Argentina (standard time UTC-04) will keep Daylight Saving Time +# after April 11, 2010--will continue to have same time as rest of +# Argentina (UTC-3) (no DST). +# +# Confirmaron la prórroga del huso horario de verano (Spanish) +# <a href="http://www.eldiariodelarepublica.com/index.php?option=com_content&task=view&id=29383&Itemid=9"> +# http://www.eldiariodelarepublica.com/index.php?option=com_content&task=view&id=29383&Itemid=9 +# </a> +# or (some English translation): +# <a href="http://www.worldtimezone.com/dst_news/dst_news_argentina08.html"> +# http://www.worldtimezone.com/dst_news/dst_news_argentina08.html +# </a> + +# From Mariano Absatz (2010-04-12): +# yes...I can confirm this...and given that San Luis keeps calling +# UTC-03:00 "summer time", we should't just let San Luis go back to "Arg" +# rules...San Luis is still using "Western ARgentina Time" and it got +# stuck on Summer daylight savings time even though the summer is over. + # Zone NAME GMTOFF RULES FORMAT [UNTIL] # # Buenos Aires (BA), Capital Federal (CF), @@ -570,8 +591,8 @@ Zone America/Argentina/Mendoza -4:35:16 # # San Luis (SL) -Rule SanLuis 2008 max - Mar Sun>=8 0:00 0 - -Rule SanLuis 2007 max - Oct Sun>=8 0:00 1:00 S +Rule SanLuis 2008 2009 - Mar Sun>=8 0:00 0 - +Rule SanLuis 2007 2009 - Oct Sun>=8 0:00 1:00 S Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31 -4:16:48 - CMT 1920 May Modified: user/kib/vm6/etc/devd.conf ============================================================================== --- user/kib/vm6/etc/devd.conf Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/etc/devd.conf Sat Apr 24 21:05:08 2010 (r207160) @@ -138,12 +138,14 @@ attach 100 { # This entry starts the ColdSync tool in daemon mode. Make sure you have an up # to date /usr/local/etc/palms. We override the 'listen' settings for port and # type in /usr/local/etc/coldsync.conf. -attach 100 { - device-name "ugen[0-9]+"; - match "vendor" "0x082d"; - match "product" "0x0100"; - match "release" "0x0100"; - action "/usr/local/bin/coldsync -md -p /dev/$device-name -t usb"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x082d"; + match "product" "0x0100"; + match "release" "0x0100"; + action "/usr/local/bin/coldsync -md -p /dev/$cdev -t usb"; }; # Modified: user/kib/vm6/etc/devd/uath.conf ============================================================================== --- user/kib/vm6/etc/devd/uath.conf Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/etc/devd/uath.conf Sat Apr 24 21:05:08 2010 (r207160) @@ -4,117 +4,143 @@ # Accton # SMCWUSB-G and SMCWUSBT-G2 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x083a"; - match "product" "(0x4505|0x4507)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x083a"; + match "product" "(0x4505|0x4507)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Atheros Communications # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x168c"; - match "product" "0x0002"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x168c"; + match "product" "0x0002"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Atheros Communications # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x0cf3"; - match "product" "(0x0002|0x0004|0x0006)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0cf3"; + match "product" "(0x0002|0x0004|0x0006)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Conceptronic # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x0d8e"; - match "product" "(0x7802|0x7812)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0d8e"; + match "product" "(0x7802|0x7812)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # D-Link # DWL-AG132, DWL-G132 and DWL-AG122 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x2001"; - match "product" "(0x3a01|0x3a03|0x3a05)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x2001"; + match "product" "(0x3a01|0x3a03|0x3a05)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # D-Link # DWA-120 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x07d1"; - match "product" "0x3a0c"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x07d1"; + match "product" "0x3a0c"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Gigaset # SMCWUSBT-G -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x1690"; - match "product" "(0x0711|0x0713)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x1690"; + match "product" "(0x0711|0x0713)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Global Sun Technology # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x16ab"; - match "product" "(0x7802|0x7812)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x16ab"; + match "product" "(0x7802|0x7812)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # BayNETGEAR # WG111U -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x0846"; - match "product" "0x4301"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0846"; + match "product" "0x4301"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Netgear # WG111T and WPN111 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x1385"; - match "product" "(0x4251|0x5f01)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x1385"; + match "product" "(0x4251|0x5f01)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # U-MEDIA Communications # TEW-444UB and AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x157e"; - match "product" "(0x3007|0x3206)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x157e"; + match "product" "(0x3007|0x3206)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Wistron NeWeb # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x1435"; - match "product" "(0x0827|0x0829)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x1435"; + match "product" "(0x0827|0x0829)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Z-Com # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x0cde"; - match "product" "0x0013"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0cde"; + match "product" "0x0013"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; Modified: user/kib/vm6/etc/mtree/BSD.usr.dist ============================================================================== --- user/kib/vm6/etc/mtree/BSD.usr.dist Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/etc/mtree/BSD.usr.dist Sat Apr 24 21:05:08 2010 (r207160) @@ -219,6 +219,8 @@ .. ibcs2 .. + indent + .. ipfilter .. ipfw Modified: user/kib/vm6/include/stdlib.h ============================================================================== --- user/kib/vm6/include/stdlib.h Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/include/stdlib.h Sat Apr 24 21:05:08 2010 (r207160) @@ -155,6 +155,7 @@ void _Exit(int) __dead2; #if __POSIX_VISIBLE /* >= ??? */ int posix_memalign(void **, size_t, size_t); /* (ADV) */ int rand_r(unsigned *); /* (TSF) */ +char *realpath(const char * __restrict, char * __restrict); int setenv(const char *, const char *, int); int unsetenv(const char *); #endif @@ -201,7 +202,6 @@ int posix_openpt(int); char *ptsname(int); int putenv(char *); long random(void); -char *realpath(const char *, char resolved_path[]); unsigned short *seed48(unsigned short[3]); #ifndef _SETKEY_DECLARED Modified: user/kib/vm6/lib/Makefile ============================================================================== --- user/kib/vm6/lib/Makefile Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/lib/Makefile Sat Apr 24 21:05:08 2010 (r207160) @@ -85,6 +85,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libopie \ libpam \ libpcap \ + ${_libpkg} \ ${_libpmc} \ libproc \ librt \ @@ -197,6 +198,10 @@ _libmp= libmp _libpmc= libpmc .endif +.if ${MK_PKGTOOLS} != "no" +_libpkg= libpkg +.endif + .if ${MK_SENDMAIL} != "no" _libmilter= libmilter _libsm= libsm Modified: user/kib/vm6/lib/libc/stdlib/realpath.3 ============================================================================== --- user/kib/vm6/lib/libc/stdlib/realpath.3 Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/lib/libc/stdlib/realpath.3 Sat Apr 24 21:05:08 2010 (r207160) @@ -31,7 +31,7 @@ .\" @(#)realpath.3 8.2 (Berkeley) 2/16/94 .\" $FreeBSD$ .\" -.Dd February 16, 1994 +.Dd April 19, 2010 .Dt REALPATH 3 .Os .Sh NAME @@ -43,7 +43,7 @@ .In sys/param.h .In stdlib.h .Ft "char *" -.Fn realpath "const char *pathname" "char resolved_path[PATH_MAX]" +.Fn realpath "const char *pathname" "char *resolved_path" .Sh DESCRIPTION The .Fn realpath @@ -56,15 +56,16 @@ and in .Fa pathname , and copies the resulting absolute pathname into -the memory referenced by +the memory pointed to by .Fa resolved_path . The .Fa resolved_path argument .Em must -refer to a buffer capable of storing at least +point to a buffer capable of storing at least .Dv PATH_MAX -characters. +characters, or be +.Dv NULL . .Pp The .Fn realpath @@ -82,13 +83,22 @@ The function returns .Fa resolved_path on success. +If the function was supplied +.Dv NULL +as +.Fa resolved_path , +and operation did not cause errors, the returned value is +a null-terminated string in a buffer allocated by a call to +.Fn malloc 3 . If an error occurs, .Fn realpath returns .Dv NULL , -and +and if .Fa resolved_path -contains the pathname which caused the problem. +is not +.Dv NULL , +the array that it points to contains the pathname which caused the problem. .Sh ERRORS The function .Fn realpath @@ -113,6 +123,11 @@ when given a relative .Fa pathname . .Sh "SEE ALSO" .Xr getcwd 3 +.Sh STANDARDS +The +.Fn realpath +function conforms to +.St -p1003.1-2001 . .Sh HISTORY The .Fn realpath Modified: user/kib/vm6/lib/libc/stdlib/realpath.c ============================================================================== --- user/kib/vm6/lib/libc/stdlib/realpath.c Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/lib/libc/stdlib/realpath.c Sat Apr 24 21:05:08 2010 (r207160) @@ -43,23 +43,37 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" /* - * char *realpath(const char *path, char resolved[PATH_MAX]); - * * Find the real name of path, by removing all ".", ".." and symlink * components. Returns (resolved) on success, or (NULL) on failure, * in which case the path which caused trouble is left in (resolved). */ char * -realpath(const char *path, char resolved[PATH_MAX]) +realpath(const char * __restrict path, char * __restrict resolved) { struct stat sb; char *p, *q, *s; size_t left_len, resolved_len; unsigned symlinks; - int serrno, slen; + int serrno, slen, m; char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX]; + if (path == NULL) { + errno = EINVAL; + return (NULL); + } + if (path[0] == '\0') { + errno = ENOENT; + return (NULL); + } serrno = errno; + if (resolved == NULL) { + resolved = malloc(PATH_MAX); + if (resolved == NULL) + return (NULL); + m = 1; + } else + m = 0; + symlinks = 0; if (path[0] == '/') { resolved[0] = '/'; @@ -70,13 +84,18 @@ realpath(const char *path, char resolved left_len = strlcpy(left, path + 1, sizeof(left)); } else { if (getcwd(resolved, PATH_MAX) == NULL) { - strlcpy(resolved, ".", PATH_MAX); + if (m) + free(resolved); + else + strlcpy(resolved, ".", PATH_MAX); return (NULL); } resolved_len = strlen(resolved); left_len = strlcpy(left, path, sizeof(left)); } if (left_len >= sizeof(left) || resolved_len >= PATH_MAX) { + if (m) + free(resolved); errno = ENAMETOOLONG; return (NULL); } @@ -92,6 +111,8 @@ realpath(const char *path, char resolved p = strchr(left, '/'); s = p ? p : left + left_len; if (s - left >= sizeof(next_token)) { + if (m) + free(resolved); errno = ENAMETOOLONG; return (NULL); } @@ -102,6 +123,8 @@ realpath(const char *path, char resolved memmove(left, s + 1, left_len + 1); if (resolved[resolved_len - 1] != '/') { if (resolved_len + 1 >= PATH_MAX) { + if (m) + free(resolved); errno = ENAMETOOLONG; return (NULL); } @@ -133,6 +156,8 @@ realpath(const char *path, char resolved */ resolved_len = strlcat(resolved, next_token, PATH_MAX); if (resolved_len >= PATH_MAX) { + if (m) + free(resolved); errno = ENAMETOOLONG; return (NULL); } @@ -141,16 +166,23 @@ realpath(const char *path, char resolved errno = serrno; return (resolved); } + if (m) + free(resolved); return (NULL); } if (S_ISLNK(sb.st_mode)) { if (symlinks++ > MAXSYMLINKS) { + if (m) + free(resolved); errno = ELOOP; return (NULL); } slen = readlink(resolved, symlink, sizeof(symlink) - 1); - if (slen < 0) + if (slen < 0) { + if (m) + free(resolved); return (NULL); + } symlink[slen] = '\0'; if (symlink[0] == '/') { resolved[1] = 0; @@ -171,6 +203,8 @@ realpath(const char *path, char resolved if (p != NULL) { if (symlink[slen - 1] != '/') { if (slen + 1 >= sizeof(symlink)) { + if (m) + free(resolved); errno = ENAMETOOLONG; return (NULL); } @@ -179,6 +213,8 @@ realpath(const char *path, char resolved } left_len = strlcat(symlink, left, sizeof(left)); if (left_len >= sizeof(left)) { + if (m) + free(resolved); errno = ENAMETOOLONG; return (NULL); } Modified: user/kib/vm6/lib/libufs/Makefile ============================================================================== --- user/kib/vm6/lib/libufs/Makefile Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/lib/libufs/Makefile Sat Apr 24 21:05:08 2010 (r207160) @@ -3,7 +3,7 @@ LIB= ufs SHLIBDIR?= /lib -SRCS= block.c cgroup.c inode.c sblock.c type.c +SRCS= block.c cgroup.c inode.c sblock.c type.c ffs_subr.c ffs_tables.c INCS= libufs.h MAN= bread.3 cgread.3 libufs.3 sbread.3 ufs_disk_close.3 @@ -16,8 +16,11 @@ MLINKS+= ufs_disk_close.3 ufs_disk_fillo MLINKS+= ufs_disk_close.3 ufs_disk_fillout_blank.3 MLINKS+= ufs_disk_close.3 ufs_disk_write.3 -WARNS?= 3 +.PATH: ${.CURDIR}/../../sys/ufs/ffs +WARNS?= 2 + +DEBUG_FLAGS = -g CFLAGS+= -D_LIBUFS .if defined(LIBUFS_DEBUG) CFLAGS+= -D_LIBUFS_DEBUGGING Modified: user/kib/vm6/lib/libufs/cgroup.c ============================================================================== --- user/kib/vm6/lib/libufs/cgroup.c Sat Apr 24 20:39:18 2010 (r207159) +++ user/kib/vm6/lib/libufs/cgroup.c Sat Apr 24 21:05:08 2010 (r207160) @@ -40,11 +40,143 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <fcntl.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> #include <libufs.h> +ufs2_daddr_t +cgballoc(struct uufsd *disk) +{ + u_int8_t *blksfree; + struct cg *cgp; + struct fs *fs; + long bno; + + fs = &disk->d_fs; + cgp = &disk->d_cg; + blksfree = cg_blksfree(cgp); + for (bno = 0; bno < fs->fs_fpg / fs->fs_frag; bno++) + if (ffs_isblock(fs, blksfree, bno)) + goto gotit; + return (0); +gotit: + fs->fs_cs(fs, cgp->cg_cgx).cs_nbfree--; + ffs_clrblock(fs, blksfree, (long)bno); + ffs_clusteracct(fs, cgp, bno, -1); + cgp->cg_cs.cs_nbfree--; + fs->fs_cstotal.cs_nbfree--; + fs->fs_fmod = 1; + return (cgbase(fs, cgp->cg_cgx) + blkstofrags(fs, bno)); +} + +int +cgbfree(struct uufsd *disk, ufs2_daddr_t bno, long size) +{ + u_int8_t *blksfree; + struct fs *fs; + struct cg *cgp; + ufs1_daddr_t fragno, cgbno; + int i, cg, blk, frags, bbase; + + fs = &disk->d_fs; + cg = dtog(fs, bno); + if (cgread1(disk, cg) != 1) + return (-1); + cgp = &disk->d_cg; + cgbno = dtogd(fs, bno); + blksfree = cg_blksfree(cgp); + if (size == fs->fs_bsize) { + fragno = fragstoblks(fs, cgbno); + ffs_setblock(fs, blksfree, fragno); + ffs_clusteracct(fs, cgp, fragno, 1); + cgp->cg_cs.cs_nbfree++; + fs->fs_cstotal.cs_nbfree++; + fs->fs_cs(fs, cg).cs_nbfree++; + } else { + bbase = cgbno - fragnum(fs, cgbno); + /* + * decrement the counts associated with the old frags + */ + blk = blkmap(fs, blksfree, bbase); + ffs_fragacct(fs, blk, cgp->cg_frsum, -1); + /* + * deallocate the fragment + */ + frags = numfrags(fs, size); + for (i = 0; i < frags; i++) + setbit(blksfree, cgbno + i); + cgp->cg_cs.cs_nffree += i; + fs->fs_cstotal.cs_nffree += i; + fs->fs_cs(fs, cg).cs_nffree += i; + /* + * add back in counts associated with the new frags + */ + blk = blkmap(fs, blksfree, bbase); + ffs_fragacct(fs, blk, cgp->cg_frsum, 1); + /* + * if a complete block has been reassembled, account for it + */ + fragno = fragstoblks(fs, bbase); + if (ffs_isblock(fs, blksfree, fragno)) { + cgp->cg_cs.cs_nffree -= fs->fs_frag; + fs->fs_cstotal.cs_nffree -= fs->fs_frag; + fs->fs_cs(fs, cg).cs_nffree -= fs->fs_frag; + ffs_clusteracct(fs, cgp, fragno, 1); + cgp->cg_cs.cs_nbfree++; + fs->fs_cstotal.cs_nbfree++; + fs->fs_cs(fs, cg).cs_nbfree++; + } + } + return cgwrite(disk); +} + +ino_t +cgialloc(struct uufsd *disk) +{ + struct ufs2_dinode *dp2; + u_int8_t *inosused; + struct cg *cgp; + struct fs *fs; + ino_t ino; + int i; + + fs = &disk->d_fs; + cgp = &disk->d_cg; + inosused = cg_inosused(cgp); + for (ino = 0; ino < fs->fs_ipg / NBBY; ino++) + if (isclr(inosused, ino)) + goto gotit; + return (0); +gotit: + if (fs->fs_magic == FS_UFS2_MAGIC && + ino + INOPB(fs) > cgp->cg_initediblk && + cgp->cg_initediblk < cgp->cg_niblk) { + char block[MAXBSIZE]; + bzero(block, (int)fs->fs_bsize); + dp2 = (struct ufs2_dinode *)█ + for (i = 0; i < INOPB(fs); i++) { + dp2->di_gen = arc4random() / 2 + 1; + dp2++; + } + if (bwrite(disk, ino_to_fsba(fs, + cgp->cg_cgx * fs->fs_ipg + cgp->cg_initediblk), + block, fs->fs_bsize)) + return (0); + cgp->cg_initediblk += INOPB(fs); + } + + setbit(inosused, ino); + cgp->cg_irotor = ino; + cgp->cg_cs.cs_nifree--; + fs->fs_cstotal.cs_nifree--; + fs->fs_cs(fs, cgp->cg_cgx).cs_nifree--; + fs->fs_fmod = 1; + + return (ino + (cgp->cg_cgx * fs->fs_ipg)); +} + int cgread(struct uufsd *disk) { @@ -55,14 +187,12 @@ int cgread1(struct uufsd *disk, int c) { struct fs *fs; - off_t ccg; fs = &disk->d_fs; if ((unsigned)c >= fs->fs_ncg) { return (0); } - ccg = fsbtodb(fs, cgtod(fs, c)) * disk->d_bsize; if (bread(disk, fsbtodb(fs, cgtod(fs, c)), disk->d_cgunion.d_buf, fs->fs_bsize) == -1) { ERROR(disk, "unable to read cylinder group"); @@ -73,6 +203,12 @@ cgread1(struct uufsd *disk, int c) } int +cgwrite(struct uufsd *disk) +{ + return (cgwrite1(disk, disk->d_lcg)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004242105.o3OL58E5046168>