svn commit: r224864 - head/lib/libc/sys
Author: rwatson Date: Sun Aug 14 12:41:44 2011 New Revision: 224864 URL: http://svn.freebsd.org/changeset/base/224864 Log: Cross-reference cap_new(2) from dup(2), as they have similar functionality. Approved by: re (kib) Modified: head/lib/libc/sys/dup.2 Modified: head/lib/libc/sys/dup.2 == --- head/lib/libc/sys/dup.2 Sun Aug 14 12:26:24 2011(r224863) +++ head/lib/libc/sys/dup.2 Sun Aug 14 12:41:44 2011(r224864) @@ -28,7 +28,7 @@ .\" @(#)dup.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd August 14, 2011 .Dt DUP 2 .Os .Sh NAME @@ -115,6 +115,11 @@ and is a valid descriptor, then .Fn dup2 is successful, and does nothing. +.Pp +The related +.Xr cap_new 2 +system call allows file descriptors to be duplicated with restrictions on +their use. .Sh RETURN VALUES The value -1 is returned if an error occurs in either call. The external variable @@ -139,6 +144,7 @@ Too many descriptors are active. .El .Sh SEE ALSO .Xr accept 2 , +.Xr cap_new 2 , .Xr close 2 , .Xr fcntl 2 , .Xr getdtablesize 2 , ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r224865 - head/usr.bin/tail
Author: jilles Date: Sun Aug 14 13:37:38 2011 New Revision: 224865 URL: http://svn.freebsd.org/changeset/base/224865 Log: tail: Fix crash if -F'ed file's filesystem disappears. If tail notices that a file it is following no longer exists (because stat() fails), it will output any final lines and then close the file. If the read operation also causes an error, such as when the filesystem is forcefully unmounted, it closes the file as well, leading to fclose(NULL) and a segmentation fault. PR: bin/159750 Submitted by: swills Approved by: re (kib) MFC after:1 week Modified: head/usr.bin/tail/forward.c Modified: head/usr.bin/tail/forward.c == --- head/usr.bin/tail/forward.c Sun Aug 14 12:41:44 2011(r224864) +++ head/usr.bin/tail/forward.c Sun Aug 14 13:37:38 2011(r224865) @@ -361,8 +361,10 @@ follow(file_info_t *files, enum STYLE st if (errno != ENOENT) ierr(file->file_name); show(file); - fclose(file->fp); - file->fp = NULL; + if (file->fp != NULL) { + fclose(file->fp); + file->fp = NULL; + } ev_change++; continue; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r224866 - head/release/powerpc
Author: nwhitehorn Date: Sun Aug 14 14:36:32 2011 New Revision: 224866 URL: http://svn.freebsd.org/changeset/base/224866 Log: Provide a kboot.conf to allow powerpc64 install media to be booted on Playstation 3 consoles running kboot or petitboot. Approved by: re (bz) Modified: head/release/powerpc/mkisoimages.sh Modified: head/release/powerpc/mkisoimages.sh == --- head/release/powerpc/mkisoimages.sh Sun Aug 14 13:37:38 2011 (r224865) +++ head/release/powerpc/mkisoimages.sh Sun Aug 14 14:36:32 2011 (r224866) @@ -45,6 +45,9 @@ if [ "x$1" = "x-b" ]; then EOF bootable="$bootable -o chrp-boot" + # Playstation 3 boot code + echo "FreeBSD Install='/boot/loader.ps3'" > $4/etc/kboot.conf + shift else bootable="" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r224842 - head/sys/kern
On 2011-08-13 18:03, Robert Watson wrote: > Author: rwatson > Date: Sat Aug 13 16:03:40 2011 > New Revision: 224842 > URL: http://svn.freebsd.org/changeset/base/224842 > > Log: > When falloc() was broken into separate falloc_noinstall() and finstall(), > a bug was introduced in kern_openat() such that the error from the vnode > open operation was overwritten before it was passed as an argument to > dupfdopen(). This broke operations on /dev/{stdin,stdout,stderr}. Fix > by preserving the original error number across finstall() so that it is > still available. > > Approved by:re (kib) > Reported by:cognet > > Modified: > head/sys/kern/vfs_syscalls.c > It might be worth mentioning this in UPDATING or similar, since a kernel built with clang (I haven't tried gcc) during this window will make it impossible to do a buildworld without first rebuilding the kernel with this fix. It also seems to break at least portsnap, and possibly other tools as well. Regards! -- Niclas Zeising ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r224721 - head/sys/sys
On Wed, 10 Aug 2011, Alexander Best wrote: On Wed Aug 10 11, Bruce Evans wrote: On Wed, 10 Aug 2011, Alexander Best wrote: any reason {TIMEVAL,TIMESPEC}_TO_{TIMESPEC,TIMEVAL}()s code is being executed in a do { ... } while (0) conditional loop? Just the usual syntactical trick for making large macros that look like function calls almost usable like function calls. Without the ... thanks a lot for the in depth information. :) any reason, back in the days, it was decided that the functionality of converting a timespec to a timeval and vice versa should be implemented as a macro and not a function? Macros avoid some namespace pollution problems, and all the old kernel timeval manipulation interfaces are either extern functions or macros, partly because inline functions didn't exist when these interfaces were designed. But the TIME* macros still have gratuitously different styles: 1) they are spelled in upper case (which is "correct" since they are unsafe macros, but this is not done for the other timeval macros which are almost all unsafe) 2) FreeBSD moved their definitions from (where 4.4BSD-Lite put them) to . This is not incorrect (since is an old header that should only declare timeval interfaces (POSIX put timespec interfaces in ). However, the move became out of date before it was done (in 2001) because had already grown several other timespec interfaces which were not moved. But these were kernel-only, so they didn't cause namespace problems. Now has grown several more user timespec interfaces. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r224868 - head/sys/dev/mmc
Author: mav Date: Sun Aug 14 16:17:00 2011 New Revision: 224868 URL: http://svn.freebsd.org/changeset/base/224868 Log: Fix integer overflow on 32bit systems when calculating media size, reintroduced by r222475. Approved by: re (kib) Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c == --- head/sys/dev/mmc/mmcsd.cSun Aug 14 16:03:26 2011(r224867) +++ head/sys/dev/mmc/mmcsd.cSun Aug 14 16:17:00 2011(r224868) @@ -137,7 +137,7 @@ mmcsd_attach(device_t dev) d->d_drv1 = sc; d->d_maxsize = 4*1024*1024; /* Maximum defined SD card AU size. */ d->d_sectorsize = mmc_get_sector_size(dev); - d->d_mediasize = mmc_get_media_size(dev) * d->d_sectorsize; + d->d_mediasize = (off_t)mmc_get_media_size(dev) * d->d_sectorsize; d->d_stripeoffset = 0; d->d_stripesize = mmc_get_erase_sector(dev) * d->d_sectorsize; d->d_unit = device_get_unit(dev); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r213507 - head/usr.bin/man
Gordon Tetlow writes: > Author: gordon > Date: Thu Oct 7 06:34:47 2010 > New Revision: 213507 > URL: http://svn.freebsd.org/changeset/base/213507 > > Log: > Add the ability to display specific manual pages if passed on the > commandline. This mirrors the old (undocumented) GNU man functionality. > Also document this feature in the implementation notes section of > the manpage. > > Submitted by: arundel > Approved by:wes (mentor implicit) Why the limitation? It's rather painful to prefix manpages with $PWD on command line. And a useful case of displaying generated on-the-fly manpages is missed, too, irrespective of GNU man. $ man dup.2 $ texi2pod.pl ffmpeg.texi | pod2man | man %% Index: usr.bin/man/man.sh === --- usr.bin/man/man.sh (revision 224842) +++ usr.bin/man/man.sh (working copy) @@ -403,10 +403,9 @@ man_find_and_display() { local found_page locpath p path sect - # Check to see if it's a file. But only if it has a '/' in - # the filename. - case "$1" in - */*)if [ -f "$1" -a -r "$1" ]; then + # Check to see if it's a troff file. + case $(file --brief --mime-type "$1") in + text/troff) if [ -f "$1" -a -r "$1" ]; then decho "Found a usable page, displaying that" unset use_cat manpage="$1" @@ -898,12 +897,16 @@ do_man() { man_parse_args "$@" - if [ -z "$pages" ]; then + if [ -z "$pages" -a -t 0 ]; then echo 'What manual page do you want?' >&2 exit 1 fi man_setup + if [ ! -t 0 ]; then + man_display_page + fi + for page in $pages; do decho "Searching for $page" man_find_and_display "$page" Index: usr.bin/man/man.1 === --- usr.bin/man/man.1 (revision 224842) +++ usr.bin/man/man.1 (working copy) @@ -232,9 +232,7 @@ The .Nm utility also supports displaying a specific manual page if passed a path -to the file as long as it contains a -.Ql / -character. +to the file as long as it's a troff file. .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : %% ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r224842 - head/sys/kern
On Sun Aug 14 11, Niclas Zeising wrote: > On 2011-08-13 18:03, Robert Watson wrote: > > Author: rwatson > > Date: Sat Aug 13 16:03:40 2011 > > New Revision: 224842 > > URL: http://svn.freebsd.org/changeset/base/224842 > > > > Log: > > When falloc() was broken into separate falloc_noinstall() and finstall(), > > a bug was introduced in kern_openat() such that the error from the vnode > > open operation was overwritten before it was passed as an argument to > > dupfdopen(). This broke operations on /dev/{stdin,stdout,stderr}. Fix > > by preserving the original error number across finstall() so that it is > > still available. > > > > Approved by: re (kib) > > Reported by: cognet > > > > Modified: > > head/sys/kern/vfs_syscalls.c > > > > It might be worth mentioning this in UPDATING or similar, since a kernel > built with clang (I haven't tried gcc) during this window will make it > impossible to do a buildworld without first rebuilding the kernel with > this fix. It also seems to break at least portsnap, and possibly other > tools as well. +1. please also mention the KPI change to fget()! so many people have had issues, where 3rd party drivers - mostly the nvidia binary driver - got broken. cheers. alex > > Regards! > -- > Niclas Zeising ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r213507 - head/usr.bin/man
On Sun Aug 14 11, Test Rat wrote: > Gordon Tetlow writes: > > > Author: gordon > > Date: Thu Oct 7 06:34:47 2010 > > New Revision: 213507 > > URL: http://svn.freebsd.org/changeset/base/213507 > > > > Log: > > Add the ability to display specific manual pages if passed on the > > commandline. This mirrors the old (undocumented) GNU man functionality. > > Also document this feature in the implementation notes section of > > the manpage. > > > > Submitted by: arundel > > Approved by: wes (mentor implicit) > > Why the limitation? It's rather painful to prefix manpages with $PWD > on command line. And a useful case of displaying generated on-the-fly > manpages is missed, too, irrespective of GNU man. at the time my issue was that something like 'man /usr/src/share/man/man1/intro.1' didn't work and gordon fixed that to restore gnu man behavior. i never really tried or needed something like in your example to be honest. ;) but if it makes peoples lives easier and doesn't cause any collisions with gnu man behaviour, then i'm in. ;) cheers. alex > > $ man dup.2 > $ texi2pod.pl ffmpeg.texi | pod2man | man > > %% > Index: usr.bin/man/man.sh > === > --- usr.bin/man/man.sh(revision 224842) > +++ usr.bin/man/man.sh(working copy) > @@ -403,10 +403,9 @@ > man_find_and_display() { > local found_page locpath p path sect > > - # Check to see if it's a file. But only if it has a '/' in > - # the filename. > - case "$1" in > - */*)if [ -f "$1" -a -r "$1" ]; then > + # Check to see if it's a troff file. > + case $(file --brief --mime-type "$1") in > + text/troff) if [ -f "$1" -a -r "$1" ]; then > decho "Found a usable page, displaying that" > unset use_cat > manpage="$1" > @@ -898,12 +897,16 @@ > > do_man() { > man_parse_args "$@" > - if [ -z "$pages" ]; then > + if [ -z "$pages" -a -t 0 ]; then > echo 'What manual page do you want?' >&2 > exit 1 > fi > man_setup > > + if [ ! -t 0 ]; then > + man_display_page > + fi > + > for page in $pages; do > decho "Searching for $page" > man_find_and_display "$page" > Index: usr.bin/man/man.1 > === > --- usr.bin/man/man.1 (revision 224842) > +++ usr.bin/man/man.1 (working copy) > @@ -232,9 +232,7 @@ > The > .Nm > utility also supports displaying a specific manual page if passed a path > -to the file as long as it contains a > -.Ql / > -character. > +to the file as long as it's a troff file. > .Sh ENVIRONMENT > The following environment variables affect the execution of > .Nm : > %% ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r224842 - head/sys/kern
On Sun, 14 Aug 2011, Niclas Zeising wrote: When falloc() was broken into separate falloc_noinstall() and finstall(), a bug was introduced in kern_openat() such that the error from the vnode open operation was overwritten before it was passed as an argument to dupfdopen(). This broke operations on /dev/{stdin,stdout,stderr}. Fix by preserving the original error number across finstall() so that it is still available. It might be worth mentioning this in UPDATING or similar, since a kernel built with clang (I haven't tried gcc) during this window will make it impossible to do a buildworld without first rebuilding the kernel with this fix. It also seems to break at least portsnap, and possibly other tools as well. I've queued an update request for UPDATING to re@. I'm not sure that the gcc case was affected (which is to say: I'm not sure I've seen reports of it), but I don't know whether I've specifically tested that case. I can go back and test it, but it seems easiest to instead just advise people to skip those revs entirely. Robert ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r224842 - head/sys/kern
On Sun, 14 Aug 2011, Alexander Best wrote: It might be worth mentioning this in UPDATING or similar, since a kernel built with clang (I haven't tried gcc) during this window will make it impossible to do a buildworld without first rebuilding the kernel with this fix. It also seems to break at least portsnap, and possibly other tools as well. +1. please also mention the KPI change to fget()! so many people have had issues, where 3rd party drivers - mostly the nvidia binary driver - got broken. The nVidia driver is rare in that it uses the file descriptor interfaces from inside a third-party driver. Most third-party drivers plug into much more limited subsets of the kernel -- newbus, busdma, the ifnet interface, the disk interface, CAM, USB, etc. The reason to merge this change now was to ensure that 9.0 shipped with the interface in its final form rather than have to try to work around the existing modules for 9.1. However, I would comment more generally that device drivers that use interfaces outside of the kernel device driver KPIs are inherently fragile. (Not sure there's anything to be done about that in the nVidia case). (Per previous e-mail, I have queued a request to re@ to update UPDATING). Robert ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r224842 - head/sys/kern
On 2011-08-14 20:14, Robert Watson wrote: > > On Sun, 14 Aug 2011, Niclas Zeising wrote: > >>> When falloc() was broken into separate falloc_noinstall() and >>> finstall(), >>> a bug was introduced in kern_openat() such that the error from the >>> vnode >>> open operation was overwritten before it was passed as an argument to >>> dupfdopen(). This broke operations on /dev/{stdin,stdout,stderr}. >>> Fix >>> by preserving the original error number across finstall() so that >>> it is >>> still available. >> >> It might be worth mentioning this in UPDATING or similar, since a >> kernel built with clang (I haven't tried gcc) during this window will >> make it impossible to do a buildworld without first rebuilding the >> kernel with this fix. It also seems to break at least portsnap, and >> possibly other tools as well. > > I've queued an update request for UPDATING to re@. I'm not sure that > the gcc case was affected (which is to say: I'm not sure I've seen > reports of it), but I don't know whether I've specifically tested that > case. I can go back and test it, but it seems easiest to instead just > advise people to skip those revs entirely. > > Robert Thank you very much! -- Niclas ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r224870 - head/sys/netinet
Author: tuexen Date: Sun Aug 14 20:55:32 2011 New Revision: 224870 URL: http://svn.freebsd.org/changeset/base/224870 Log: Add support for the spp_dscp field in the SCTP_PEER_ADDR_PARAMS socket option. Backwards compatibility is provided by still supporting the spp_ipv4_tos field. Approved by: re@ MFC after: 2 months. Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_output.c == --- head/sys/netinet/sctp_output.c Sun Aug 14 20:54:13 2011 (r224869) +++ head/sys/netinet/sctp_output.c Sun Aug 14 20:55:32 2011 (r224870) @@ -3967,7 +3967,7 @@ sctp_lowlevel_chunk_output(struct sctp_i ip->ip_v = IPVERSION; ip->ip_hl = (sizeof(struct ip) >> 2); if (net) { - tos_value = net->tos_flowlabel & 0x00ff; + tos_value = net->dscp; } else { tos_value = inp->ip_inp.inp.inp_ip_tos; } @@ -4204,7 +4204,7 @@ sctp_lowlevel_chunk_output(struct sctp_i int len; if (net != NULL) { - flowlabel = net->tos_flowlabel; + flowlabel = net->flowlabel; } else { flowlabel = ((struct in6pcb *)inp)->in6p_flowinfo; } Modified: head/sys/netinet/sctp_pcb.c == --- head/sys/netinet/sctp_pcb.c Sun Aug 14 20:54:13 2011(r224869) +++ head/sys/netinet/sctp_pcb.c Sun Aug 14 20:55:32 2011(r224870) @@ -4009,20 +4009,13 @@ sctp_add_remote_addr(struct sctp_tcb *st stcb->asoc.numnets++; *(&net->ref_count) = 1; net->cwr_window_tsn = net->last_cwr_tsn = stcb->asoc.sending_seq - 1; - net->tos_flowlabel = 0; if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable)) { net->port = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); } else { net->port = 0; } -#ifdef INET - if (newaddr->sa_family == AF_INET) - net->tos_flowlabel = stcb->asoc.default_tos; -#endif -#ifdef INET6 - if (newaddr->sa_family == AF_INET6) - net->tos_flowlabel = stcb->asoc.default_flowlabel; -#endif + net->dscp = stcb->asoc.default_dscp; + net->flowlabel = stcb->asoc.default_flowlabel; if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { net->dest_state |= SCTP_ADDR_NOHB; } else { Modified: head/sys/netinet/sctp_structs.h == --- head/sys/netinet/sctp_structs.h Sun Aug 14 20:54:13 2011 (r224869) +++ head/sys/netinet/sctp_structs.h Sun Aug 14 20:55:32 2011 (r224870) @@ -321,7 +321,8 @@ struct sctp_nets { uint32_t fast_recovery_tsn; uint32_t heartbeat_random1; uint32_t heartbeat_random2; - uint32_t tos_flowlabel; + uint32_t flowlabel; + uint8_t dscp; struct timeval start_time; /* time when this net was created */ uint32_t marked_retrans;/* number or DATA chunks marked for timer @@ -1137,7 +1138,7 @@ struct sctp_association { uint8_t last_flags_delivered; uint8_t hb_ect_randombit; uint8_t hb_random_idx; - uint8_t default_tos; + uint8_t default_dscp; uint8_t asconf_del_pending; /* asconf delete last addr pending */ /* Modified: head/sys/netinet/sctp_uio.h == --- head/sys/netinet/sctp_uio.h Sun Aug 14 20:54:13 2011(r224869) +++ head/sys/netinet/sctp_uio.h Sun Aug 14 20:55:32 2011(r224870) @@ -505,9 +505,11 @@ struct sctp_paddrparams { uint32_t spp_flags; uint32_t spp_ipv6_flowlabel; uint16_t spp_pathmaxrxt; - uint8_t spp_ipv4_tos; + uint8_t spp_dscp; }; +#define spp_ipv4_tos spp_dscp + #define SPP_HB_ENABLE 0x0001 #define SPP_HB_DISABLE 0x0002 #define SPP_HB_DEMAND 0x0004 @@ -515,7 +517,8 @@ struct sctp_paddrparams { #define SPP_PMTUD_DISABLE 0x0010 #define SPP_HB_TIME_IS_ZERO 0x0080 #define SPP_IPV6_FLOWLABEL 0x0100 -#define SPP_IPV4_TOS0x0200 +#define SPP_DSCP0x0200 +#define SPP_IPV4_TOSSPP_DSCP struct sctp_paddrthlds { sctp_assoc_t spt_assoc_id; Modified: head/sys/netinet/sctp_usrreq.c ===