svn commit: r310014 - head/sys/compat/linuxkpi/common/include/linux
Author: ed Date: Tue Dec 13 07:58:30 2016 New Revision: 310014 URL: https://svnweb.freebsd.org/changeset/base/310014 Log: Remove the only user of sysctl_add_oid(). My plan is to change this function's prototype at some point in the future to add a new label argument, which can be used to export all of sysctl as metrics that can be scraped by Prometheus. Switch over this caller to use the macro wrapper counterpart. Modified: head/sys/compat/linuxkpi/common/include/linux/sysfs.h Modified: head/sys/compat/linuxkpi/common/include/linux/sysfs.h == --- head/sys/compat/linuxkpi/common/include/linux/sysfs.h Tue Dec 13 06:54:13 2016(r310013) +++ head/sys/compat/linuxkpi/common/include/linux/sysfs.h Tue Dec 13 07:58:30 2016(r310014) @@ -126,7 +126,7 @@ static inline int sysfs_create_file(struct kobject *kobj, const struct attribute *attr) { - sysctl_add_oid(NULL, SYSCTL_CHILDREN(kobj->oidp), OID_AUTO, + SYSCTL_ADD_OID(NULL, SYSCTL_CHILDREN(kobj->oidp), OID_AUTO, attr->name, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_MPSAFE, kobj, (uintptr_t)attr, sysctl_handle_attr, "A", ""); @@ -158,7 +158,7 @@ sysfs_create_group(struct kobject *kobj, oidp = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(kobj->oidp), OID_AUTO, grp->name, CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, grp->name); for (attr = grp->attrs; *attr != NULL; attr++) { - sysctl_add_oid(NULL, SYSCTL_CHILDREN(oidp), OID_AUTO, + SYSCTL_ADD_OID(NULL, SYSCTL_CHILDREN(oidp), OID_AUTO, (*attr)->name, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_MPSAFE, kobj, (uintptr_t)*attr, sysctl_handle_attr, "A", ""); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310013 - head/sys/dev/xen/blkfront
Author: cperciva Date: Tue Dec 13 06:54:13 2016 New Revision: 310013 URL: https://svnweb.freebsd.org/changeset/base/310013 Log: Check that blkfront devices have a non-zero number of sectors and a non-zero sector size. Such a device would be a virtual disk of zero bytes; clearly not useful, and not something we should try to attach. As a fortuitous side effect, checking that these values are non-zero here results in them not *becoming* zero later on the function. This odd behaviour began with r309124 (clang 3.9.0) but is challenging to debug; making any changes to this function whatsoever seems to affect the llvm optimizer behaviour enough to make the unexpected zeroing of the sector_size variable cease. PR: 215209 Security: The potential for variables to unexpectedly become zero has worrying consequences for security in general, but not so much in this particular context. Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c == --- head/sys/dev/xen/blkfront/blkfront.cTue Dec 13 05:09:49 2016 (r310012) +++ head/sys/dev/xen/blkfront/blkfront.cTue Dec 13 06:54:13 2016 (r310013) @@ -1245,6 +1245,14 @@ xbd_connect(struct xbd_softc *sc) xenbus_get_otherend_path(dev)); return; } + if ((sectors == 0) || (sector_size == 0)) { + xenbus_dev_fatal(dev, 0, + "invalid parameters from %s:" + " sectors = %lu, sector_size = %lu", + xenbus_get_otherend_path(dev), + sectors, sector_size); + return; + } err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), "physical-sector-size", "%lu", _sector_size, NULL); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310012 - head/sys/arm/freescale/imx
Author: gonzo Date: Tue Dec 13 05:09:49 2016 New Revision: 310012 URL: https://svnweb.freebsd.org/changeset/base/310012 Log: [iMX6] Add compatibility string for GPT timer on i.MX6 Dual Up until r295436 GPT timer in i.MX6 Dual dts used the same compatiblity string as i.MX6 Quad. After the sync up with Linux in r295436, GPT timer stopped getting attached on the i.MX6 Dual MFC after:3 days Modified: head/sys/arm/freescale/imx/imx_gpt.c Modified: head/sys/arm/freescale/imx/imx_gpt.c == --- head/sys/arm/freescale/imx/imx_gpt.cTue Dec 13 04:53:25 2016 (r310011) +++ head/sys/arm/freescale/imx/imx_gpt.cTue Dec 13 05:09:49 2016 (r310012) @@ -106,6 +106,7 @@ static struct resource_spec imx_gpt_spec }; static struct ofw_compat_data compat_data[] = { + {"fsl,imx6dl-gpt", 1}, {"fsl,imx6q-gpt", 1}, {"fsl,imx53-gpt", 1}, {"fsl,imx51-gpt", 1}, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310011 - stable/11/share/examples/jails
Author: dteske Date: Tue Dec 13 04:53:25 2016 New Revision: 310011 URL: https://svnweb.freebsd.org/changeset/base/310011 Log: MFC r308615 [brd]: Attempt to make the parts that people are supposed to change stand out more by capitalizing them. Approved by: me Modified: stable/11/share/examples/jails/rc.conf.jails stable/11/share/examples/jails/rcjail.xxx.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/share/examples/jails/rc.conf.jails == --- stable/11/share/examples/jails/rc.conf.jailsTue Dec 13 04:50:45 2016(r310010) +++ stable/11/share/examples/jails/rc.conf.jailsTue Dec 13 04:53:25 2016(r310011) @@ -5,7 +5,7 @@ ### jail_enable="YES" -jail_list="xxx" +jail_list="XXX" # # Global presets for all jails @@ -57,19 +57,19 @@ jail_devfs_enable="YES" # mount devfs # # XXX # -jail_xxx_hostname="xxx.yyy"# hostname -jail_xxx_rootdir="/vm/xxx" # root directory +jail_XXX_hostname="XXX.YYY"# hostname +jail_XXX_rootdir="/vm/XXX" # root directory # netgraph -jail_xxx_vnet_interface="ng0_xxx" # vnet interface(s) -jail_xxx_exec_prestart0="jng bridge xxx em0" # bridge interface(s) -jail_xxx_exec_poststop0="jng shutdown xxx" # destroy interface(s) +jail_XXX_vnet_interface="ng0_XXX" # vnet interface(s) +jail_XXX_exec_prestart0="jng bridge XXX em0" # bridge interface(s) +jail_XXX_exec_poststop0="jng shutdown XXX" # destroy interface(s) # if_bridge -#jail_xxx_vnet_interface="e0b_xxx" # vnet interface(s) -#jail_xxx_exec_prestart0="jib addm xxx em0"# bridge interface(s) -#jail_xxx_exec_poststop0="jib destroy xxx" # destroy interface(s) +#jail_XXX_vnet_interface="e0b_XXX" # vnet interface(s) +#jail_XXX_exec_prestart0="jib addm XXX em0"# bridge interface(s) +#jail_XXX_exec_poststop0="jib destroy XXX" # destroy interface(s) # Optional (default off) -#jail_xxx_devfs_ruleset="11" # rule to unhide bpf for DHCP -#jail_xxx_mount_enable="YES" # mount /etc/fstab.xxx +#jail_XXX_devfs_ruleset="11" # rule to unhide bpf for DHCP +#jail_XXX_mount_enable="YES" # mount /etc/fstab.XXX # END Modified: stable/11/share/examples/jails/rcjail.xxx.conf == --- stable/11/share/examples/jails/rcjail.xxx.conf Tue Dec 13 04:50:45 2016(r310010) +++ stable/11/share/examples/jails/rcjail.xxx.conf Tue Dec 13 04:53:25 2016(r310011) @@ -1,25 +1,25 @@ # $FreeBSD$ -jail_xxx_hostname="xxx.yyy"# hostname -jail_xxx_rootdir="/vm/xxx" # root directory +jail_XXX_hostname="XXX.YYY"# hostname +jail_XXX_rootdir="/vm/XXX" # root directory # # NB: Below 3 lines required # # netgraph -jail_xxx_vnet_interface="ng0_xxx" # vnet interface(s) -jail_xxx_exec_prestart0="jng bridge xxx em0" # bridge interface(s) -jail_xxx_exec_poststop0="jng shutdown xxx" # destroy interface(s) +jail_XXX_vnet_interface="ng0_XXX" # vnet interface(s) +jail_XXX_exec_prestart0="jng bridge XXX em0" # bridge interface(s) +jail_XXX_exec_poststop0="jng shutdown XXX" # destroy interface(s) # if_bridge -#jail_xxx_vnet_interface="e0b_xxx" # vnet interface(s) -#jail_xxx_exec_prestart0="jib addm xxx em0"# bridge interface(s) -#jail_xxx_exec_poststop0="jib destroy xxx" # destroy interface(s) +#jail_XXX_vnet_interface="e0b_XXX" # vnet interface(s) +#jail_XXX_exec_prestart0="jib addm XXX em0"# bridge interface(s) +#jail_XXX_exec_poststop0="jib destroy XXX" # destroy interface(s) # Standard recipe -jail_xxx_devfs_enable="YES"# mount devfs +jail_XXX_devfs_enable="YES"# mount devfs # Optional (default off) -#jail_xxx_devfs_ruleset="11" # rule to unhide bpf for DHCP -#jail_xxx_mount_enable="YES" # mount /etc/fstab.xxx -#jail_xxx_set_hostname_allow="YES" # Allow hostname to change -#jail_xxx_sysvipc_allow="YES" # Allow SysV Interprocess Comm. +#jail_XXX_devfs_ruleset="11" # rule to unhide bpf for DHCP +#jail_XXX_mount_enable="YES" # mount /etc/fstab.XXX +#jail_XXX_set_hostname_allow="YES" # Allow hostname to change +#jail_XXX_sysvipc_allow="YES" # Allow SysV Interprocess Comm. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all
svn commit: r310010 - stable/11/etc
Author: dteske Date: Tue Dec 13 04:50:45 2016 New Revision: 310010 URL: https://svnweb.freebsd.org/changeset/base/310010 Log: MFC r309504: Fix bug preventing limits(1) from being applied PR: misc/212493 Differential Revision:https://reviews.freebsd.org/D8232 Submitted by: girgen Reviewed by: adrian Modified: stable/11/etc/rc.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.subr == --- stable/11/etc/rc.subr Tue Dec 13 04:47:21 2016(r310009) +++ stable/11/etc/rc.subr Tue Dec 13 04:50:45 2016(r310010) @@ -1045,6 +1045,7 @@ run_rc_command() # check_startmsgs && echo "Starting ${name}." if [ -n "$_chroot" ]; then + _cd= _doit="\ ${_nice:+nice -n $_nice }\ ${_fib:+setfib -F $_fib }\ @@ -1052,8 +1053,8 @@ ${_env:+env $_env }\ chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ $_chroot $command $rc_flags $command_args" else + _cd="${_chdir:+cd $_chdir && }" _doit="\ -${_chdir:+cd $_chdir && }\ ${_fib:+setfib -F $_fib }\ ${_env:+env $_env }\ $command $rc_flags $command_args" @@ -1072,7 +1073,7 @@ $command $rc_flags $command_args" fi # Prepend default limits - _doit="limits -C $_login_class $_doit" + _doit="$_cd limits -C $_login_class $_doit" # run the full command # ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310009 - in stable/11/etc: defaults rc.d
Author: dteske Date: Tue Dec 13 04:47:21 2016 New Revision: 310009 URL: https://svnweb.freebsd.org/changeset/base/310009 Log: MFC r307159: Add jail_confwarn="NO" (default YES) Differential Revision:https://reviews.freebsd.org/D7465 Reviewed by: jelischer Sponsored by: FIS Global, Inc. Modified: stable/11/etc/defaults/rc.conf stable/11/etc/rc.d/jail Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/defaults/rc.conf == --- stable/11/etc/defaults/rc.conf Tue Dec 13 04:45:21 2016 (r310008) +++ stable/11/etc/defaults/rc.conf Tue Dec 13 04:47:21 2016 (r310009) @@ -701,6 +701,7 @@ iovctl_files="" # Config files for iovc ### Jail Configuration (see rc.conf(5) manual page) ## ## jail_enable="NO" # Set to NO to disable starting of any jails +jail_confwarn="YES"# Prevent warning about obsolete per-jail configuration jail_parallel_start="NO" # Start jails in the background jail_list="" # Space separated list of names of jails jail_reverse_stop="NO" # Stop jails in reverse order Modified: stable/11/etc/rc.d/jail == --- stable/11/etc/rc.d/jail Tue Dec 13 04:45:21 2016(r310008) +++ stable/11/etc/rc.d/jail Tue Dec 13 04:47:21 2016(r310009) @@ -147,7 +147,8 @@ parse_options() # # To relieve confusion, show a warning message. # - _confwarn=1 + : ${jail_confwarn:=YES} + checkyesno jail_confwarn && _confwarn=1 if [ -r "$jail_conf" -o -r "$_jconf" ]; then if ! checkyesno jail_parallel_start; then warn "$_conf is created and used for jail $_j." ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310008 - stable/11/etc/autofs
Author: dteske Date: Tue Dec 13 04:45:21 2016 New Revision: 310008 URL: https://svnweb.freebsd.org/changeset/base/310008 Log: MFC r306012 [trasz]: Fix -media to not mount ufs with "async"; it doesn't make sense when there is softupdates. Modified: stable/11/etc/autofs/special_media Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/autofs/special_media == --- stable/11/etc/autofs/special_media Tue Dec 13 04:44:06 2016 (r310007) +++ stable/11/etc/autofs/special_media Tue Dec 13 04:45:21 2016 (r310008) @@ -48,7 +48,7 @@ print_map_entry() { exit 1 fi ;; - "ext2fs" | "msdosfs" | "ufs") + "ext2fs" | "msdosfs") echo "-fstype=${_fstype},nosuid,async :/dev/${_p}" ;; *) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310007 - in stable/11/etc: . autofs
Author: dteske Date: Tue Dec 13 04:44:06 2016 New Revision: 310007 URL: https://svnweb.freebsd.org/changeset/base/310007 Log: MFC r306011 [trasz]: Stop appending "noatime" in the autofs -media map, and instead add it to auto_master, since all filesystems seem to support it. It's cleaner this way, and easier to customize. Modified: stable/11/etc/auto_master stable/11/etc/autofs/special_media Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/auto_master == --- stable/11/etc/auto_master Tue Dec 13 04:43:03 2016(r310006) +++ stable/11/etc/auto_master Tue Dec 13 04:44:06 2016(r310007) @@ -5,5 +5,5 @@ /net -hosts -nobrowse,nosuid,intr # When using the -media special map, make sure to edit devd.conf(5) # to move the call to "automount -c" out of the comments section. -#/media-media -nosuid +#/media-media -nosuid,noatime #/--noauto Modified: stable/11/etc/autofs/special_media == --- stable/11/etc/autofs/special_media Tue Dec 13 04:43:03 2016 (r310006) +++ stable/11/etc/autofs/special_media Tue Dec 13 04:44:06 2016 (r310007) @@ -41,7 +41,7 @@ print_map_entry() { case "${_fstype}" in "ntfs") if [ -f "/usr/local/bin/ntfs-3g" ]; then - echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid,noatime :/dev/${_p}" + echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid:/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" @@ -49,7 +49,7 @@ print_map_entry() { fi ;; "ext2fs" | "msdosfs" | "ufs") - echo "-fstype=${_fstype},nosuid,noatime,async :/dev/${_p}" + echo "-fstype=${_fstype},nosuid,async :/dev/${_p}" ;; *) echo "-fstype=${_fstype},nosuid :/dev/${_p}" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310006 - stable/11/etc/autofs
Author: dteske Date: Tue Dec 13 04:43:03 2016 New Revision: 310006 URL: https://svnweb.freebsd.org/changeset/base/310006 Log: MFC r306009 [trasz]: Make autofs(5) -media map also use "async" and "noatime" for ext2fs(5). Modified: stable/11/etc/autofs/special_media Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/autofs/special_media == --- stable/11/etc/autofs/special_media Tue Dec 13 04:41:49 2016 (r310005) +++ stable/11/etc/autofs/special_media Tue Dec 13 04:43:03 2016 (r310006) @@ -38,7 +38,8 @@ print_map_entry() { _fstype="$1" _p="$2" - if [ "${_fstype}" = "ntfs" ]; then + case "${_fstype}" in + "ntfs") if [ -f "/usr/local/bin/ntfs-3g" ]; then echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid,noatime :/dev/${_p}" else @@ -46,11 +47,14 @@ print_map_entry() { "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" exit 1 fi - elif [ "${_fstype}" = "msdosfs" -o "${_fstype}" = "ufs" ]; then + ;; + "ext2fs" | "msdosfs" | "ufs") echo "-fstype=${_fstype},nosuid,noatime,async :/dev/${_p}" - else + ;; + *) echo "-fstype=${_fstype},nosuid :/dev/${_p}" - fi + ;; + esac } # Determine map entry contents for the given key and print out the entry. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310005 - stable/11/etc/autofs
Author: dteske Date: Tue Dec 13 04:41:49 2016 New Revision: 310005 URL: https://svnweb.freebsd.org/changeset/base/310005 Log: MFC r305969 [trasz]: Make autofs use the "noatime" flag for msdosfs, ntfs, and ufs filesystems mounted on /media. Modified: stable/11/etc/autofs/special_media Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/autofs/special_media == --- stable/11/etc/autofs/special_media Tue Dec 13 04:39:44 2016 (r310004) +++ stable/11/etc/autofs/special_media Tue Dec 13 04:41:49 2016 (r310005) @@ -40,14 +40,14 @@ print_map_entry() { if [ "${_fstype}" = "ntfs" ]; then if [ -f "/usr/local/bin/ntfs-3g" ]; then - echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid:/dev/${_p}" + echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid,noatime :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" exit 1 fi elif [ "${_fstype}" = "msdosfs" -o "${_fstype}" = "ufs" ]; then - echo "-fstype=${_fstype},nosuid,async :/dev/${_p}" + echo "-fstype=${_fstype},nosuid,noatime,async :/dev/${_p}" else echo "-fstype=${_fstype},nosuid :/dev/${_p}" fi ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310004 - stable/11/etc/autofs
Author: dteske Date: Tue Dec 13 04:39:44 2016 New Revision: 310004 URL: https://svnweb.freebsd.org/changeset/base/310004 Log: MFC r305968 [trasz]: Make autofs use the "async" flag for msdosfs and ufs filesystems mounted on /media. Modified: stable/11/etc/autofs/special_media Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/autofs/special_media == --- stable/11/etc/autofs/special_media Tue Dec 13 04:37:14 2016 (r310003) +++ stable/11/etc/autofs/special_media Tue Dec 13 04:39:44 2016 (r310004) @@ -46,6 +46,8 @@ print_map_entry() { "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" exit 1 fi + elif [ "${_fstype}" = "msdosfs" -o "${_fstype}" = "ufs" ]; then + echo "-fstype=${_fstype},nosuid,async :/dev/${_p}" else echo "-fstype=${_fstype},nosuid :/dev/${_p}" fi ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310003 - stable/11/etc/rc.d
Author: dteske Date: Tue Dec 13 04:37:14 2016 New Revision: 310003 URL: https://svnweb.freebsd.org/changeset/base/310003 Log: MFC r303943: Allow enforce_statfs (see jail(8)) to be set per jail Reviewed by: jelischer Modified: stable/11/etc/rc.d/jail Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.d/jail == --- stable/11/etc/rc.d/jail Tue Dec 13 04:35:19 2016(r310002) +++ stable/11/etc/rc.d/jail Tue Dec 13 04:37:14 2016(r310003) @@ -260,6 +260,7 @@ parse_options() extract_var $_jv set_hostname_allow allow.set_hostname YN NO extract_var $_jv sysvipc_allow allow.sysvipc YN NO + extract_var $_jv enforce_statfs enforce_statfs - 2 extract_var $_jv osreldate osreldate extract_var $_jv osrelease osrelease for _p in $_parameters; do ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310002 - stable/11/etc/defaults
Author: dteske Date: Tue Dec 13 04:35:19 2016 New Revision: 310002 URL: https://svnweb.freebsd.org/changeset/base/310002 Log: MFC r302798 [cy]: Restore lost comment from r301295. PR: 211027 Reported by: trond.endres...@ximalas.info Modified: stable/11/etc/defaults/periodic.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/defaults/periodic.conf == --- stable/11/etc/defaults/periodic.confTue Dec 13 04:24:41 2016 (r310001) +++ stable/11/etc/defaults/periodic.confTue Dec 13 04:35:19 2016 (r310002) @@ -137,6 +137,7 @@ daily_status_mail_rejects_shorten="NO" # 480.leapfile-ntpd daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile daily_ntpd_avoid_congestion="YES" # Avoid congesting + # leapfile sources # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310001 - stable/11
Author: dteske Date: Tue Dec 13 04:24:41 2016 New Revision: 310001 URL: https://svnweb.freebsd.org/changeset/base/310001 Log: Merge missing mergeinfo for r303877 Modified: Directory Properties: stable/11/ (props changed) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r310000 - head/sys/dev/gpio
Author: loos Date: Tue Dec 13 03:36:41 2016 New Revision: 31 URL: https://svnweb.freebsd.org/changeset/base/31 Log: Remove a too strict test and instead, just filter the passed flags with the supported capabilities. Spotted by: yamori...@yahoo.co.jp (Hiroki Mori) MFC after:2 weeks Modified: head/sys/dev/gpio/gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c == --- head/sys/dev/gpio/gpiobus.c Tue Dec 13 03:26:12 2016(r30) +++ head/sys/dev/gpio/gpiobus.c Tue Dec 13 03:36:41 2016(r31) @@ -120,9 +120,9 @@ int gpio_check_flags(uint32_t caps, uint32_t flags) { - /* Check for unwanted flags. */ - if ((flags & caps) == 0 || (flags & caps) != flags) - return (EINVAL); + /* Filter unwanted flags. */ + flags &= caps; + /* Cannot mix input/output together. */ if (flags & GPIO_PIN_INPUT && flags & GPIO_PIN_OUTPUT) return (EINVAL); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309999 - head/sys/arm/freescale/imx
Author: gonzo Date: Tue Dec 13 03:26:12 2016 New Revision: 30 URL: https://svnweb.freebsd.org/changeset/base/30 Log: [iMX6] Fix platform compatibility string for i.MX6 Dual i.MX6 Dual boot was broken since r308533 because ofw_bus_node_is_compatible is more strict than fdt_is_compatible and does not accept partial matches Modified: head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/freescale/imx/imx6_machdep.c == --- head/sys/arm/freescale/imx/imx6_machdep.c Tue Dec 13 02:56:52 2016 (r309998) +++ head/sys/arm/freescale/imx/imx6_machdep.c Tue Dec 13 03:26:12 2016 (r30) @@ -352,5 +352,5 @@ static platform_method_t imx6_methods[] }; FDT_PLATFORM_DEF2(imx6, imx6s, "i.MX6 Solo", 0, "fsl,imx6s", 0); -FDT_PLATFORM_DEF2(imx6, imx6d, "i.MX6 Dual", 0, "fsl,imx6d", 0); +FDT_PLATFORM_DEF2(imx6, imx6d, "i.MX6 Dual", 0, "fsl,imx6dl", 0); FDT_PLATFORM_DEF2(imx6, imx6q, "i.MX6 Quad", 0, "fsl,imx6q", 0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309998 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:56:52 2016 New Revision: 309998 URL: https://svnweb.freebsd.org/changeset/base/309998 Log: It's completely pointless to replace newlines with space (this is done automatically for you upon shell expansion) Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:54:44 2016 (r309997) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:56:52 2016 (r309998) @@ -219,7 +219,6 @@ while :; do f_dialog_title "Network Selection" prompt="Select a wireless network to connect to." - menu_list=$( echo $NETWORKS | tr '\n' ' ' ) f_dialog_menu_size height width rows "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" "$prompt" "" $menu_list NETWORK=$( eval $DIALOG \ @@ -229,7 +228,7 @@ while :; do --extra-label \"Rescan\" \ --menu \"\$prompt\"\ $height $width $rows \ - $menu_list \ + $NETWORKS \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) retval=$? ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309997 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:54:44 2016 New Revision: 309997 URL: https://svnweb.freebsd.org/changeset/base/309997 Log: The flags of a WLAN need to be quoted (they contain things like brackets) Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:48:14 2016 (r309996) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:54:44 2016 (r309997) @@ -208,7 +208,7 @@ while :; do f_eval_catch -dk SCAN_RESULTS wlanconfig wpa_cli "wpa_cli scan_results" NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' ' - /..:..:..:..:..:../ && $5 { printf "\"%s\"\t%s\n", $5, $4 } + /..:..:..:..:..:../ && $5 { printf "\"%s\"\t\"%s\"\n", $5, $4 } ' | sort | uniq ) if [ ! "$NETWORKS" ]; then ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309996 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:48:14 2016 New Revision: 309996 URL: https://svnweb.freebsd.org/changeset/base/309996 Log: Simplify single-line if statements Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:47:39 2016 (r309995) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:48:14 2016 (r309996) @@ -357,9 +357,8 @@ network={ EOF # Bring up new network -if [ "$BSDINSTALL_CONFIGCURRENT" ]; then +[ "$BSDINSTALL_CONFIGCURRENT" ] && f_eval_catch -d wlanconfig wpa_cli "wpa_cli reconfigure" -fi exit $SUCCESS ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309995 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:47:39 2016 New Revision: 309995 URL: https://svnweb.freebsd.org/changeset/base/309995 Log: Simplify loop by moving predicate to clause Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:46:36 2016 (r309994) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:47:39 2016 (r309995) @@ -194,12 +194,8 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then f_dialog_title "Regdomain/country" if f_yesno "Change regdomain/country ($DEF_REGDOMAIN/$DEF_COUNTRY)?" then - while :; do - dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY" - if [ $? -eq $SUCCESS ]; then - break - fi - done + while ! dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY" + do :; done fi fi ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309994 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:46:36 2016 New Revision: 309994 URL: https://svnweb.freebsd.org/changeset/base/309994 Log: Wordsmithing Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:45:52 2016 (r309993) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:46:36 2016 (r309994) @@ -192,7 +192,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" [ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="" f_dialog_title "Regdomain/country" - if f_yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" + if f_yesno "Change regdomain/country ($DEF_REGDOMAIN/$DEF_COUNTRY)?" then while :; do dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309993 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:45:52 2016 New Revision: 309993 URL: https://svnweb.freebsd.org/changeset/base/309993 Log: Why test $? when you can test the command Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:45:07 2016 (r309992) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:45:52 2016 (r309993) @@ -192,8 +192,8 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" [ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="" f_dialog_title "Regdomain/country" - f_yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" - if [ $? -eq 0 ]; then + if f_yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" + then while :; do dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY" if [ $? -eq $SUCCESS ]; then ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309992 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:45:07 2016 New Revision: 309992 URL: https://svnweb.freebsd.org/changeset/base/309992 Log: Restore previous comment Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:44:33 2016 (r309991) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:45:07 2016 (r309992) @@ -175,6 +175,7 @@ if ! f_eval_catch -d wlanconfig wpa_cli 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ "$1" "$BSDINSTALL_TMPETC" || exit 1 + # See if we succeeded f_eval_catch wlanconfig wpa_cli "wpa_cli ping" || exit 1 fi ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309991 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:44:33 2016 New Revision: 309991 URL: https://svnweb.freebsd.org/changeset/base/309991 Log: Both simplify bringup of interface after changes and catch errors in debug Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:42:10 2016 (r309990) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:44:33 2016 (r309991) @@ -55,11 +55,10 @@ country_set() f_eval_catch -dk error_str wlanconfig ifconfig "ifconfig %s %s" \ "$WLAN_IFACE" "$ifconfig_args" error_str="${error_str#ifconfig: }" - if [ "$iface_up" ]; then - # Restart wpa_supplicant(8) (should not fail). - wpa_supplicant -B -i "$WLAN_IFACE" -c \ - "$BSDINSTALL_TMPETC/wpa_supplicant.conf" - fi + # Restart wpa_supplicant(8) (should not fail). + [ "$iface_up" ] && f_eval_catch -d wlanconfig wpa_supplicant \ + 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ + "$WLAN_IFACE" "$BSDINSTALL_TMPETC" if [ "$error_str" ]; then $DIALOG \ --title "$msg_error" \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309990 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:42:10 2016 New Revision: 309990 URL: https://svnweb.freebsd.org/changeset/base/309990 Log: Calculate proper size of menu list dialog Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:40:54 2016 (r309989) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:42:10 2016 (r309990) @@ -224,6 +224,8 @@ while :; do f_dialog_title "Network Selection" prompt="Select a wireless network to connect to." menu_list=$( echo $NETWORKS | tr '\n' ' ' ) + f_dialog_menu_size height width rows "$DIALOG_TITLE" \ + "$DIALOG_BACKTITLE" "$prompt" "" $menu_list NETWORK=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309989 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:40:54 2016 New Revision: 309989 URL: https://svnweb.freebsd.org/changeset/base/309989 Log: There's an API function for catching errors and displaying them or logging them to debug output Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:30:24 2016 (r309988) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:40:54 2016 (r309989) @@ -52,8 +52,9 @@ country_set() # Regdomain/country cannot be applied while interface is running iface_up=$( ifconfig -lu | grep -w "$WLAN_IFACE" ) [ "$iface_up" ] && ifconfig "$WLAN_IFACE" down - error_str=$( ifconfig "$WLAN_IFACE" $ifconfig_args 2>&1 | - sed -e 's/ifconfig: //' ) + f_eval_catch -dk error_str wlanconfig ifconfig "ifconfig %s %s" \ + "$WLAN_IFACE" "$ifconfig_args" + error_str="${error_str#ifconfig: }" if [ "$iface_up" ]; then # Restart wpa_supplicant(8) (should not fail). wpa_supplicant -B -i "$WLAN_IFACE" -c \ @@ -165,22 +166,17 @@ EOF # Try to reach wpa_supplicant. If it isn't running and we can modify the # existing system, start it. Otherwise, fail. # -if ! wpa_cli ping > /dev/null 2>&1; then +if ! f_eval_catch -d wlanconfig wpa_cli "wpa_cli ping"; then if [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then f_show_err "Wireless cannot be configured without %s" \ "making changes to the local system!" exit 1 fi - wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || exit 1 + f_eval_catch wlanconfig wpa_supplicant \ + 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ + "$1" "$BSDINSTALL_TMPETC" || exit 1 - if ! wpa_cli ping > /dev/null 2>&1 && [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then - $DIALOG \ - --title "$msg_error" \ - --backtitle "$DIALOG_BACKTITLE" \ - --msgbox "Could not start wpa_supplicant!" \ - 0 0 - exit 1 - fi + f_eval_catch wlanconfig wpa_cli "wpa_cli ping" || exit 1 fi # @@ -209,13 +205,12 @@ fi while :; do SCANSSID=0 - output=$( wpa_cli scan 2>&1 ) - f_dprintf "%s" "$output" + f_eval_catch -d wlanconfig wpa_cli "wpa_cli scan" f_dialog_title "Scanning" f_dialog_pause "Waiting 5 seconds to scan for wireless networks..." 5 || exit 1 - SCAN_RESULTS=$( wpa_cli scan_results ) + f_eval_catch -dk SCAN_RESULTS wlanconfig wpa_cli "wpa_cli scan_results" NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' ' /..:..:..:..:..:../ && $5 { printf "\"%s\"\t%s\n", $5, $4 } ' | sort | uniq ) @@ -365,8 +360,7 @@ EOF # Bring up new network if [ "$BSDINSTALL_CONFIGCURRENT" ]; then - output=$( wpa_cli reconfigure 2>&1 ) - f_dprintf "%s" "$output" + f_eval_catch -d wlanconfig wpa_cli "wpa_cli reconfigure" fi exit $SUCCESS ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309988 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:30:24 2016 New Revision: 309988 URL: https://svnweb.freebsd.org/changeset/base/309988 Log: There's an API function for displaying pauses Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:29:20 2016 (r309987) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:30:24 2016 (r309988) @@ -212,12 +212,8 @@ while :; do output=$( wpa_cli scan 2>&1 ) f_dprintf "%s" "$output" f_dialog_title "Scanning" - $DIALOG \ - --title "$DIALOG_TITLE" \ - --backtitle "$DIALOG_BACKTITLE" \ - --ok-label "$msg_skip" \ - --pause "Waiting 5 seconds to scan for wireless networks..." \ - 9 40 5 || exit 1 + f_dialog_pause "Waiting 5 seconds to scan for wireless networks..." 5 || + exit 1 SCAN_RESULTS=$( wpa_cli scan_results ) NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' ' ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309987 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:29:20 2016 New Revision: 309987 URL: https://svnweb.freebsd.org/changeset/base/309987 Log: There's an API function for displaying yes/no dialogs Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:27:38 2016 (r309986) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:29:20 2016 (r309987) @@ -196,11 +196,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" [ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="" f_dialog_title "Regdomain/country" - $DIALOG \ - --title "$DIALOG_TITLE" \ - --backtitle "$DIALOG_BACKTITLE" \ - --yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \ - 0 0 + f_yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" if [ $? -eq 0 ]; then while :; do dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY" @@ -230,11 +226,7 @@ while :; do if [ ! "$NETWORKS" ]; then f_dialog_title "$msg_error" - $DIALOG \ - --title "$DIALOG_TITLE" \ - --backtitle "$DIALOG_BACKTITLE" \ - --yesno "No wireless networks were found. Rescan?" \ - 0 0 && continue + f_yesno "No wireless networks were found. Rescan?" && continue exit 1 fi ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309986 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:27:38 2016 New Revision: 309986 URL: https://svnweb.freebsd.org/changeset/base/309986 Log: There's an API function for displaying errors Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:25:23 2016 (r309985) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:27:38 2016 (r309986) @@ -167,8 +167,8 @@ EOF # if ! wpa_cli ping > /dev/null 2>&1; then if [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then - $DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \ - "Wireless cannot be configured without making changes to the local system!" 0 0 + f_show_err "Wireless cannot be configured without %s" \ + "making changes to the local system!" exit 1 fi wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || exit 1 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309985 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:25:23 2016 New Revision: 309985 URL: https://svnweb.freebsd.org/changeset/base/309985 Log: Comment Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:23:48 2016 (r309984) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:25:23 2016 (r309985) @@ -256,7 +256,7 @@ while :; do case $retval in $DIALOG_OK) break ;; $DIALOG_CANCEL) - # here we ask if the user wants to select the network manually + # Ask if the user wants to select network manually f_dialog_title "Network Selection" f_yesno "Do you want to select the network manually?" || exit 1 f_dialog_input NETWORK "Enter SSID" || exit 1 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309984 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:23:48 2016 New Revision: 309984 URL: https://svnweb.freebsd.org/changeset/base/309984 Log: Whitespace alignment Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:22:21 2016 (r309983) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:23:48 2016 (r309984) @@ -242,13 +242,13 @@ while :; do prompt="Select a wireless network to connect to." menu_list=$( echo $NETWORKS | tr '\n' ' ' ) NETWORK=$( eval $DIALOG \ - --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ - --extra-button \ - --extra-label \"Rescan\" \ - --menu \"\$prompt\" \ - $height $width $rows \ - $menu_list \ + --extra-button \ + --extra-label \"Rescan\" \ + --menu \"\$prompt\"\ + $height $width $rows \ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) retval=$? @@ -270,11 +270,11 @@ while :; do eval f_dialog_menu_size height width rows \"\$DIALOG_TITLE\" \ \"\$DIALOG_BACKTITLE\" \"\$prompt\" \"\" $menu_list ENCRYPTION=$( eval $DIALOG \ - --title \"\$DIALOG_TITLE\" \ + --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ - --menu \"\$prompt\" \ - $height $width $rows \ - $menu_list \ + --menu \"\$prompt\"\ + $height $width $rows \ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exit 1 SCANSSID=1 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309983 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:22:21 2016 New Revision: 309983 URL: https://svnweb.freebsd.org/changeset/base/309983 Log: Relying on dialog auto-sizing (width/height/rows = 0) is a mistake Use the provided API for calculating the appropriate size of menus Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:16:00 2016 (r309982) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:22:21 2016 (r309983) @@ -239,14 +239,16 @@ while :; do fi f_dialog_title "Network Selection" - NETWORK=$( sh -c "$DIALOG \ - --title \"$DIALOG_TITLE\" \ - --backtitle \"$DIALOG_BACKTITLE\" \ + prompt="Select a wireless network to connect to." + menu_list=$( echo $NETWORKS | tr '\n' ' ' ) + NETWORK=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ --extra-button \ --extra-label \"Rescan\" \ - --menu \"Select a wireless network to connect to.\" \ - 0 0 0 \ - $( echo $NETWORKS | tr '\n' ' ' )" \ + --menu \"\$prompt\" \ + $height $width $rows \ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) retval=$? @@ -258,15 +260,21 @@ while :; do f_dialog_title "Network Selection" f_yesno "Do you want to select the network manually?" || exit 1 f_dialog_input NETWORK "Enter SSID" || exit 1 - ENCRYPTION=$( $DIALOG \ - --title "$DIALOG_TITLE" \ - --backtitle "$DIALOG_BACKTITLE" \ - --menu "Select encryption type" \ - 0 0 0 \ - "1 WPA/WPA2 PSK" "" \ - "2 WPA/WPA2 EAP" "" \ - "3 WEP" "" \ - "0 None" "" \ + prompt="Select encryption type" + menu_list=" + '1 WPA/WPA2 PSK' '' + '2 WPA/WPA2 EAP' '' + '3 WEP' '' + '0 None' '' + " # END-QUOTE + eval f_dialog_menu_size height width rows \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \"\$prompt\" \"\" $menu_list + ENCRYPTION=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --menu \"\$prompt\" \ + $height $width $rows \ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exit 1 SCANSSID=1 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309982 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:16:00 2016 New Revision: 309982 URL: https://svnweb.freebsd.org/changeset/base/309982 Log: Remove unnecessary quotes Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:15:36 2016 (r309981) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:16:00 2016 (r309982) @@ -280,7 +280,7 @@ done [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" | awk -F '\t' "/^\"$NETWORK\"\t/ { print \$2 }" ) -if echo "$ENCRYPTION" | grep -q 'PSK'; then +if echo "$ENCRYPTION" | grep -q PSK; then PASS=$( $DIALOG \ --title "WPA Setup" \ --backtitle "$DIALOG_BACKTITLE" \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309981 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:15:36 2016 New Revision: 309981 URL: https://svnweb.freebsd.org/changeset/base/309981 Log: Add missing quotes Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:14:40 2016 (r309980) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:15:36 2016 (r309981) @@ -280,7 +280,7 @@ done [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" | awk -F '\t' "/^\"$NETWORK\"\t/ { print \$2 }" ) -if echo $ENCRYPTION | grep -q 'PSK'; then +if echo "$ENCRYPTION" | grep -q 'PSK'; then PASS=$( $DIALOG \ --title "WPA Setup" \ --backtitle "$DIALOG_BACKTITLE" \ @@ -300,7 +300,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the priority=5 } EOF -elif echo $ENCRYPTION | grep -q EAP; then +elif echo "$ENCRYPTION" | grep -q EAP; then USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ --backtitle "$DIALOG_BACKTITLE" \ @@ -325,7 +325,7 @@ elif echo $ENCRYPTION | grep -q EAP; the priority=5 } EOF -elif echo $ENCRYPTION | grep -q WEP; then +elif echo "$ENCRYPTION" | grep -q WEP; then WEPKEY=$( $DIALOG \ --title "WEP Setup" \ --backtitle "$DIALOG_BACKTITLE" \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309980 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:14:40 2016 New Revision: 309980 URL: https://svnweb.freebsd.org/changeset/base/309980 Log: In awk, if you're going to append a newline to your printf AND you're going to print only the argument, just use print Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:13:20 2016 (r309979) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:14:40 2016 (r309980) @@ -278,7 +278,7 @@ while :; do done [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" | - awk -F '\t' "/^\"$NETWORK\"\t/ { printf \"%s\n\", \$2 }" ) + awk -F '\t' "/^\"$NETWORK\"\t/ { print \$2 }" ) if echo $ENCRYPTION | grep -q 'PSK'; then PASS=$( $DIALOG \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309979 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:13:20 2016 New Revision: 309979 URL: https://svnweb.freebsd.org/changeset/base/309979 Log: This statement has too many backslashes Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:12:00 2016 (r309978) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:13:20 2016 (r309979) @@ -278,7 +278,7 @@ while :; do done [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" | - awk -F '\t' "/^\"$NETWORK\"\t/ { printf \"%s\n\", \\\$2 }" ) + awk -F '\t' "/^\"$NETWORK\"\t/ { printf \"%s\n\", \$2 }" ) if echo $ENCRYPTION | grep -q 'PSK'; then PASS=$( $DIALOG \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309978 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:12:00 2016 New Revision: 309978 URL: https://svnweb.freebsd.org/changeset/base/309978 Log: Neither printf (and as is commonly known) nor print need parens in awk Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:11:09 2016 (r309977) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:12:00 2016 (r309978) @@ -278,7 +278,7 @@ while :; do done [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" | - awk -F '\t' "/^\"$NETWORK\"\t/ { printf(\"%s\n\", \\\$2 ) }" ) + awk -F '\t' "/^\"$NETWORK\"\t/ { printf \"%s\n\", \\\$2 }" ) if echo $ENCRYPTION | grep -q 'PSK'; then PASS=$( $DIALOG \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309977 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:11:09 2016 New Revision: 309977 URL: https://svnweb.freebsd.org/changeset/base/309977 Log: Whitespace and alignment Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:07:12 2016 (r309976) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:11:09 2016 (r309977) @@ -183,7 +183,6 @@ if ! wpa_cli ping > /dev/null 2>&1; then fi fi - # # There is no way to check country/regdomain without (possible) # interface state modification @@ -283,13 +282,13 @@ done if echo $ENCRYPTION | grep -q 'PSK'; then PASS=$( $DIALOG \ - --title "WPA Setup" \ - --backtitle "$DIALOG_BACKTITLE" \ - --insecure \ - --mixedform "" \ - 0 0 0 \ + --title "WPA Setup" \ + --backtitle "$DIALOG_BACKTITLE" \ + --insecure \ + --mixedform "" \ + 0 0 0\ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ - "Password" 2 0 "" 2 12 15 63 1 \ + "Password" 2 0 "" 2 12 15 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" awk 'sub(/^\t/,"")||1' \ @@ -303,14 +302,14 @@ if echo $ENCRYPTION | grep -q 'PSK'; the EOF elif echo $ENCRYPTION | grep -q EAP; then USERPASS=$( $DIALOG \ - --title "WPA-Enterprise Setup" \ - --backtitle "$DIALOG_BACKTITLE" \ - --insecure \ - --mixedform "" \ - 0 0 0 \ + --title "WPA-Enterprise Setup" \ + --backtitle "$DIALOG_BACKTITLE" \ + --insecure \ + --mixedform "" \ + 0 0 0\ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ - "Username" 2 0 "" 2 12 25 63 0 \ - "Password" 3 0 "" 3 12 25 63 1 \ + "Username" 2 0 "" 2 12 25 63 0 \ + "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" awk 'sub(/^\t/,"")||1' \ @@ -328,13 +327,13 @@ elif echo $ENCRYPTION | grep -q EAP; the EOF elif echo $ENCRYPTION | grep -q WEP; then WEPKEY=$( $DIALOG \ - --title "WEP Setup" \ - --backtitle "$DIALOG_BACKTITLE" \ - --insecure \ - --mixedform "" \ - 0 0 0 \ + --title "WEP Setup" \ + --backtitle "$DIALOG_BACKTITLE" \ + --insecure \ + --mixedform "" \ + 0 0 0\ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ - "WEP Key 0" 2 0 "" 2 12 15 0 1 \ + "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" awk 'sub(/^\t/,"")||1' \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309976 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:07:12 2016 New Revision: 309976 URL: https://svnweb.freebsd.org/changeset/base/309976 Log: You don't need parentheses for awk's printf Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:04:50 2016 (r309975) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:07:12 2016 (r309976) @@ -226,7 +226,7 @@ while :; do SCAN_RESULTS=$( wpa_cli scan_results ) NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' ' - /..:..:..:..:..:../ && $5 { printf("\"%s\"\t%s\n", $5, $4) } + /..:..:..:..:..:../ && $5 { printf "\"%s\"\t%s\n", $5, $4 } ' | sort | uniq ) if [ ! "$NETWORKS" ]; then ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309975 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:04:50 2016 New Revision: 309975 URL: https://svnweb.freebsd.org/changeset/base/309975 Log: Continued resolution of conveluted statement We shouldn't be coding things like "x || (x && x) || x || x || x ..." Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:02:14 2016 (r309974) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:04:50 2016 (r309975) @@ -166,10 +166,12 @@ EOF # existing system, start it. Otherwise, fail. # if ! wpa_cli ping > /dev/null 2>&1; then - ([ "$BSDINSTALL_CONFIGCURRENT" ] && - wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || + if [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then $DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \ - "Wireless cannot be configured without making changes to the local system!" 0 0; exit 1 || exit 1 + "Wireless cannot be configured without making changes to the local system!" 0 0 + exit 1 + fi + wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || exit 1 if ! wpa_cli ping > /dev/null 2>&1 && [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then $DIALOG \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309974 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 02:02:14 2016 New Revision: 309974 URL: https://svnweb.freebsd.org/changeset/base/309974 Log: These two error messages have always been backwards since inception Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:59:35 2016 (r309973) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 02:02:14 2016 (r309974) @@ -169,13 +169,13 @@ if ! wpa_cli ping > /dev/null 2>&1; then ([ "$BSDINSTALL_CONFIGCURRENT" ] && wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || $DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \ - "Could not start wpa_supplicant!" 0 0; exit 1 || exit 1 + "Wireless cannot be configured without making changes to the local system!" 0 0; exit 1 || exit 1 if ! wpa_cli ping > /dev/null 2>&1 && [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then $DIALOG \ --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ - --msgbox "Wireless cannot be configured without making changes to the local system!" \ + --msgbox "Could not start wpa_supplicant!" \ 0 0 exit 1 fi ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309973 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 01:59:35 2016 New Revision: 309973 URL: https://svnweb.freebsd.org/changeset/base/309973 Log: Why use $? when you can use the command itself Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:56:28 2016 (r309972) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:59:35 2016 (r309973) @@ -171,8 +171,7 @@ if ! wpa_cli ping > /dev/null 2>&1; then $DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \ "Could not start wpa_supplicant!" 0 0; exit 1 || exit 1 - wpa_cli ping > /dev/null 2>&1 - if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then + if ! wpa_cli ping > /dev/null 2>&1 && [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then $DIALOG \ --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309972 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 01:56:28 2016 New Revision: 309972 URL: https://svnweb.freebsd.org/changeset/base/309972 Log: If the first ping succeeded, why on Earth should we ping it again? Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:54:44 2016 (r309971) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:56:28 2016 (r309972) @@ -170,19 +170,19 @@ if ! wpa_cli ping > /dev/null 2>&1; then wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || $DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \ "Could not start wpa_supplicant!" 0 0; exit 1 || exit 1 -fi -# See if we succeeded -wpa_cli ping > /dev/null 2>&1 -if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then - $DIALOG \ - --title "$msg_error" \ - --backtitle "$DIALOG_BACKTITLE" \ - --msgbox "Wireless cannot be configured without making changes to the local system!" \ - 0 0 - exit 1 + wpa_cli ping > /dev/null 2>&1 + if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then + $DIALOG \ + --title "$msg_error" \ + --backtitle "$DIALOG_BACKTITLE" \ + --msgbox "Wireless cannot be configured without making changes to the local system!" \ + 0 0 + exit 1 + fi fi + # # There is no way to check country/regdomain without (possible) # interface state modification ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309971 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 01:54:44 2016 New Revision: 309971 URL: https://svnweb.freebsd.org/changeset/base/309971 Log: Start deconstructing a conveluted hunk of code Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:52:10 2016 (r309970) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:54:44 2016 (r309971) @@ -165,10 +165,12 @@ EOF # Try to reach wpa_supplicant. If it isn't running and we can modify the # existing system, start it. Otherwise, fail. # -wpa_cli ping > /dev/null 2>&1 || ([ "$BSDINSTALL_CONFIGCURRENT" ] && - wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || - $DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \ - "Could not start wpa_supplicant!" 0 0; exit 1 || exit 1 +if ! wpa_cli ping > /dev/null 2>&1; then + ([ "$BSDINSTALL_CONFIGCURRENT" ] && + wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || + $DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \ + "Could not start wpa_supplicant!" 0 0; exit 1 || exit 1 +fi # See if we succeeded wpa_cli ping > /dev/null 2>&1 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309970 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 01:52:10 2016 New Revision: 309970 URL: https://svnweb.freebsd.org/changeset/base/309970 Log: Remove completely unnecesary parentheses Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:50:22 2016 (r309969) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:52:10 2016 (r309970) @@ -165,10 +165,10 @@ EOF # Try to reach wpa_supplicant. If it isn't running and we can modify the # existing system, start it. Otherwise, fail. # -(wpa_cli ping > /dev/null 2>&1 || ([ "$BSDINSTALL_CONFIGCURRENT" ] && - wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) || - ($DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \ - "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 +wpa_cli ping > /dev/null 2>&1 || ([ "$BSDINSTALL_CONFIGCURRENT" ] && + wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || + $DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \ + "Could not start wpa_supplicant!" 0 0; exit 1 || exit 1 # See if we succeeded wpa_cli ping > /dev/null 2>&1 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309969 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 01:50:22 2016 New Revision: 309969 URL: https://svnweb.freebsd.org/changeset/base/309969 Log: Why repeat yourself when you can send stderr to the same place as stdout? Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:44:18 2016 (r309968) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:50:22 2016 (r309969) @@ -165,13 +165,13 @@ EOF # Try to reach wpa_supplicant. If it isn't running and we can modify the # existing system, start it. Otherwise, fail. # -(wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] && +(wpa_cli ping > /dev/null 2>&1 || ([ "$BSDINSTALL_CONFIGCURRENT" ] && wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) || ($DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \ "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 # See if we succeeded -wpa_cli ping >/dev/null 2>/dev/null +wpa_cli ping > /dev/null 2>&1 if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then $DIALOG \ --title "$msg_error" \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309968 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 01:44:18 2016 New Revision: 309968 URL: https://svnweb.freebsd.org/changeset/base/309968 Log: Properly quote variable Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:42:13 2016 (r309967) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:44:18 2016 (r309968) @@ -189,8 +189,8 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then # Get current country/regdomain for selected interface WLAN_IFACE=$( wpa_cli ifname | tail -1 ) INPUT=$( ifconfig "$WLAN_IFACE" list regdomain | head -1 ) - DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 ) - DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 ) + DEF_REGDOMAIN=$( echo "$INPUT" | cut -w -f 2 ) + DEF_COUNTRY=$( echo "$INPUT" | cut -w -f 4 ) [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" [ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="" f_dialog_title "Regdomain/country" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309966 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 01:41:06 2016 New Revision: 309966 URL: https://svnweb.freebsd.org/changeset/base/309966 Log: The output of dialog needs to be sanitized for portability/compatibility requirements Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:39:09 2016 (r309965) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:41:06 2016 (r309966) @@ -126,6 +126,7 @@ dialog_country_select() $regdomains\ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) + f_dialog_data_sanitize regdomain f_dialog_title "Country selection" prompt="Select your country." @@ -142,6 +143,7 @@ dialog_country_select() $countries \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) + f_dialog_data_sanitize country country_set "$regdomain" "$country" } @@ -245,7 +247,9 @@ while :; do $( echo $NETWORKS | tr '\n' ' ' )" \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - case $? in + retval=$? + f_dialog_data_sanitize NETWORK + case $retval in $DIALOG_OK) break ;; $DIALOG_CANCEL) # here we ask if the user wants to select the network manually ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309965 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 01:39:09 2016 New Revision: 309965 URL: https://svnweb.freebsd.org/changeset/base/309965 Log: Whitespace alignment Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:36:46 2016 (r309964) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:39:09 2016 (r309965) @@ -117,13 +117,13 @@ dialog_country_select() \"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \ \"\$prompt\" \"\" $regdomains regdomain=$( eval $DIALOG \ - --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --cancel-label \"\$msg_skip\" \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --cancel-label \"\$msg_skip\" \ --default-item \"\$default_regdomain\" \ - --menu \"\$prompt\" \ - $height $width $rows \ - $regdomains \ + --menu \"\$prompt\"\ + $height $width $rows \ + $regdomains\ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) @@ -133,13 +133,13 @@ dialog_country_select() \"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \ \"\$prompt\" \"\" $countries country=$( eval $DIALOG \ - --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --cancel-label \"\$msg_skip\" \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --cancel-label \"\$msg_skip\"\ --default-item \"\$default_country\" \ - --menu \"\$prompt\" \ - $height $width $rows \ - $countries \ + --menu \"\$prompt\" \ + $height $width $rows \ + $countries \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309964 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 01:36:46 2016 New Revision: 309964 URL: https://svnweb.freebsd.org/changeset/base/309964 Log: Sort the domains Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:35:26 2016 (r309963) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:36:46 2016 (r309964) @@ -96,7 +96,7 @@ dialog_country_select() for (i = 1; i <= n; i++) printf "'\''%s'\'' '\'\''", domains[i] } - ' ) + ' | sort ) countries=$( echo "$input" | awk ' sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309963 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 01:35:26 2016 New Revision: 309963 URL: https://svnweb.freebsd.org/changeset/base/309963 Log: The --no-items and --stdout options are non-standard and should be avoided From the dialog(1) manual: using [--stdout] in portable scripts is not recommended Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 00:27:56 2016 (r309962) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 01:35:26 2016 (r309963) @@ -90,8 +90,13 @@ dialog_country_select() # Parse available countries/regdomains # input=$( ifconfig "$WLAN_IFACE" list countries | sed -e 's/DEBUG//gi' ) - regdomains=$( echo $input | sed -e 's/.*domains://' | tr ' ' '\n' | - sort | tr '\n' ' ' ) + regdomains=$( echo "$input" | awk ' + sub(/.*domains:/, ""), /[^[:alnum:][[:space:]]/ { + n = split($0, domains) + for (i = 1; i <= n; i++) + printf "'\''%s'\'' '\'\''", domains[i] + } + ' ) countries=$( echo "$input" | awk ' sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { @@ -108,17 +113,18 @@ dialog_country_select() f_dialog_title "Regdomain selection" prompt="Select your regdomain." - f_dialog_menu_size height width rows "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" "$prompt" "" $regdomains - regdomain=$( sh -c "$DIALOG \ - --title \"$DIALOG_TITLE\" \ - --backtitle \"$DIALOG_BACKTITLE\" \ - --cancel-label \"$msg_skip\" \ - --default-item \"$default_regdomain\" \ - --no-items \ - --stdout \ - --menu \"$prompt\" \ - $height $width $rows $regdomains" + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \"\" $regdomains + regdomain=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --cancel-label \"\$msg_skip\" \ + --default-item \"\$default_regdomain\" \ + --menu \"\$prompt\" \ + $height $width $rows \ + $regdomains \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) f_dialog_title "Country selection" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309962 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 00:27:56 2016 New Revision: 309962 URL: https://svnweb.freebsd.org/changeset/base/309962 Log: More efficiently make use of the exit status Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 00:22:01 2016 (r309961) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 00:27:56 2016 (r309962) @@ -67,12 +67,8 @@ country_set() --no-label Ignore \ --yesno \ "Error while applying chosen settings ($error_str)" \ - 0 0 - if [ $? -eq $DIALOG_OK ]; then - return $FAILURE # Restart - else - return $SUCCESS # Skip - fi + 0 0 || return $SUCCESS # Skip + return $FAILURE # Restart else awk 'sub(/^\t\t/,"")||1' \ > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309961 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 00:22:01 2016 New Revision: 309961 URL: https://svnweb.freebsd.org/changeset/base/309961 Log: Stop repeating strings (centralize prompt string) NB: Changes to strings now only affect a single line Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 00:18:51 2016 (r309960) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 00:22:01 2016 (r309961) @@ -85,7 +85,7 @@ country_set() dialog_country_select() { - local input regdomains countries regdomain country + local input regdomains countries regdomain country prompt local no_default="" local default_regdomain="${1:-$no_default}" local default_country="${2:-$no_default}" @@ -111,8 +111,9 @@ dialog_country_select() ' | sort ) f_dialog_title "Regdomain selection" + prompt="Select your regdomain." f_dialog_menu_size height width rows "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" "Select your regdomain." "" $regdomains + "$DIALOG_BACKTITLE" "$prompt" "" $regdomains regdomain=$( sh -c "$DIALOG \ --title \"$DIALOG_TITLE\" \ --backtitle \"$DIALOG_BACKTITLE\" \ @@ -120,20 +121,21 @@ dialog_country_select() --default-item \"$default_regdomain\" \ --no-items \ --stdout \ - --menu \"Select your regdomain.\" \ + --menu \"$prompt\" \ $height $width $rows $regdomains" ) f_dialog_title "Country selection" + prompt="Select your country." eval f_dialog_menu_size height width rows \ \"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \ - \"Select your country.\" \"\" $countries + \"\$prompt\" \"\" $countries country=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --cancel-label \"\$msg_skip\" \ --default-item \"\$default_country\" \ - --menu \"Select your country.\" \ + --menu \"\$prompt\" \ $height $width $rows \ $countries \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309960 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 00:18:51 2016 New Revision: 309960 URL: https://svnweb.freebsd.org/changeset/base/309960 Log: Add missing backslash (no real effect; it's pedantic and correct for the interpolation level) Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 00:02:59 2016 (r309959) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 00:18:51 2016 (r309960) @@ -132,7 +132,7 @@ dialog_country_select() --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --cancel-label \"\$msg_skip\" \ - --default-item \"$default_country\" \ + --default-item \"\$default_country\" \ --menu \"Select your country.\" \ $height $width $rows \ $countries \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309959 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Tue Dec 13 00:02:59 2016 New Revision: 309959 URL: https://svnweb.freebsd.org/changeset/base/309959 Log: Use the oft-neglected awk syntax "startcondition, stopcondition { ... }" to process the range of country labels which appear as columnar list from the "ifconfig DEV list countries" command. Not only improving maintainability, but also properly encapsulating arguments in single-quotes instead of trying to escape whitespace. It is also completely unnecessary to collapse newlines into whitespace (shell will do this for you automatically upon expansion of the contents where necessary). NB: This also changes the sorting algorithm to sort on the country code, not the country name. The type-ahead feature of dialog is destroyed if the tags are not sorted properly. Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 22:57:07 2016 (r309958) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Tue Dec 13 00:02:59 2016 (r309959) @@ -96,17 +96,19 @@ dialog_country_select() input=$( ifconfig "$WLAN_IFACE" list countries | sed -e 's/DEBUG//gi' ) regdomains=$( echo $input | sed -e 's/.*domains://' | tr ' ' '\n' | sort | tr '\n' ' ' ) - countries=$( echo $input | awk '{ - sub(/Country codes:/, "") - sub(/Regulatory.*/, "") - for (i = 1; i <= NF; i++) { - printf "%s", $i - if ($i ~ /[[:lower:]]/) - printf $(i+1) ~ /[[:lower:]]/ ? "\\ " : "\n" - else - printf " " + countries=$( echo "$input" | awk ' + sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { + while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { + country = substr($0, RSTART) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + code = substr(country, 1, 2) + desc = substr(country, 4) + sub(/[[:space:]]*$/, "", desc) + printf "'\''%s'\'' '\''%s'\''\n", code, desc + $0 = substr($0, RSTART + RLENGTH) + } } - }' | sort -k 2 | tr '\n' ' ' ) + ' | sort ) f_dialog_title "Regdomain selection" f_dialog_menu_size height width rows "$DIALOG_TITLE" \ @@ -123,16 +125,18 @@ dialog_country_select() ) f_dialog_title "Country selection" - f_dialog_menu_size height width rows "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" "Select your country." "" $countries - country=$( sh -c "$DIALOG \ - --title \"$DIALOG_TITLE\" \ - --backtitle \"$DIALOG_BACKTITLE\" \ - --cancel-label \"$msg_skip\" \ + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \ + \"Select your country.\" \"\" $countries + country=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --cancel-label \"\$msg_skip\" \ --default-item \"$default_country\" \ - --stdout \ --menu \"Select your country.\" \ - $height $width $rows $countries" + $height $width $rows \ + $countries \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) country_set "$regdomain" "$country" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r309891 - head/sys/kern
On Mon, 12 Dec 2016, Edward Tomasz Napierala wrote: On 1212T1833, Konstantin Belousov wrote: On Mon, Dec 12, 2016 at 03:22:22PM +, Edward Tomasz Napierala wrote: Author: trasz Date: Mon Dec 12 15:22:21 2016 New Revision: 309891 URL: https://svnweb.freebsd.org/changeset/base/309891 Log: Avoid dereferencing NULL pointers in devtoname(). I've seen it panic, called from ufs_print() in DDB. Calls from DDB should not panic even if accessing NULL pointers. Yeah, by "panic" I've meant the "reentering ddb" thing. It's not a panic per se, but still breaks eg "show lockedvnodes". Hrmph. kib didn't like my patch to kill the spam from reentering ddb. The spam messes up even cases where the ddb command handles errors. Howver, in most cases the error handling is incomplete. There is always the outer setjmp/longjmp back to the command loop. This gives null and bad error handling for unexpected null pointer accesses like the one here. Other cases set up inner setjump/longjmps which longjmp back to an inner context which prints an error message (spammed by the reentry messages) and should clean up. However, cleanup is rarely done. One case is writing to inaccessible memory on at least x86. Then the page tables are left in modified state. Null pointer panics are also interesting. They seem to have been broken on i386 by the double mapping of low memory (PTD[0] = PTD[KERNBASE >> 12] = shared page table for low physical memory). So the null pointer is mapped and points to physical memory 0 . There are other bugs from the shared page table. When I fix the other bugs by changing PTD[0] to 0, this also fixes null pointers. It breaks ACPI resume but not much else. See locore.s for some details about the mapping -- it is documented as being mainly for ACPI. But ACPI somehow works on amd64 with PTD[0] = 0. That said, I also do not think that this is the right place to change. UFS um_dev should not be NULL for any active mount. It could even be a KASSERT(), but that would break use in ddb. Perhaps there are already many KASSERT()s in utility functions that break use in ddb. Here is my old fix for a similar bug in the tty driver: X Index: tty.h X === X --- tty.h (revision 309660) X +++ tty.h (working copy) X @@ -205,7 +215,8 @@ X #define tty_opened(tp) ((tp)->t_flags & TF_OPENED) X #define tty_gone(tp)((tp)->t_flags & TF_GONE) X #define tty_softc(tp) ((tp)->t_devswsoftc) X -#define tty_devname(tp) devtoname((tp)->t_dev) X +#define tty_devname(tp) ((tp)->t_dev == NULL ? "amnesiac" : \ X + devtoname((tp)->t_dev)) X X /* Status line printing. */ X void tty_info(struct tty *tp); In the tty driver, the pointer can be null when the device is going away, but the ddb command "show [all] tty" accesses the tty until it has completely gone away. Perhaps similarly for vnodes -- the state of an object under construction or destruction is especially interesting. After looking at this once again I agree. Looks like some kind of bug specific to my sources at that point of time. Backed off. Thanks. This also fixes a style bug (extra blank line). Bruce ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309958 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 22:57:07 2016 New Revision: 309958 URL: https://svnweb.freebsd.org/changeset/base/309958 Log: Quote WLAN_IFACE (pedantic) Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 22:51:29 2016 (r309957) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 22:57:07 2016 (r309958) @@ -50,13 +50,13 @@ country_set() ifconfig_args="${ifconfig_args# }" # Regdomain/country cannot be applied while interface is running - iface_up=$( ifconfig -lu | grep -w $WLAN_IFACE ) - [ "$iface_up" ] && ifconfig $WLAN_IFACE down - error_str=$( ifconfig $WLAN_IFACE $ifconfig_args 2>&1 | + iface_up=$( ifconfig -lu | grep -w "$WLAN_IFACE" ) + [ "$iface_up" ] && ifconfig "$WLAN_IFACE" down + error_str=$( ifconfig "$WLAN_IFACE" $ifconfig_args 2>&1 | sed -e 's/ifconfig: //' ) if [ "$iface_up" ]; then # Restart wpa_supplicant(8) (should not fail). - wpa_supplicant -B -i $WLAN_IFACE -c \ + wpa_supplicant -B -i "$WLAN_IFACE" -c \ "$BSDINSTALL_TMPETC/wpa_supplicant.conf" fi if [ "$error_str" ]; then @@ -93,7 +93,7 @@ dialog_country_select() # # Parse available countries/regdomains # - input=$( ifconfig $WLAN_IFACE list countries | sed -e 's/DEBUG//gi' ) + input=$( ifconfig "$WLAN_IFACE" list countries | sed -e 's/DEBUG//gi' ) regdomains=$( echo $input | sed -e 's/.*domains://' | tr ' ' '\n' | sort | tr '\n' ' ' ) countries=$( echo $input | awk '{ @@ -178,7 +178,7 @@ fi if [ "$BSDINSTALL_CONFIGCURRENT" ]; then # Get current country/regdomain for selected interface WLAN_IFACE=$( wpa_cli ifname | tail -1 ) - INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -1 ) + INPUT=$( ifconfig "$WLAN_IFACE" list regdomain | head -1 ) DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 ) DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 ) [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309957 - head/tests/sys/kern
Author: jilles Date: Mon Dec 12 22:51:29 2016 New Revision: 309957 URL: https://svnweb.freebsd.org/changeset/base/309957 Log: Add tests for reaper receiving SIGCHLD (r309886). PR: 213928 MFC after:2 weeks Modified: head/tests/sys/kern/reaper.c Modified: head/tests/sys/kern/reaper.c == --- head/tests/sys/kern/reaper.cMon Dec 12 21:54:49 2016 (r309956) +++ head/tests/sys/kern/reaper.cMon Dec 12 22:51:29 2016 (r309957) @@ -35,6 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include +static void +dummy_sighandler(int sig __unused, siginfo_t *info __unused, void *ctx __unused) +{ +} + ATF_TC_WITHOUT_HEAD(reaper_wait_child_first); ATF_TC_BODY(reaper_wait_child_first, tc) { @@ -129,6 +134,161 @@ ATF_TC_BODY(reaper_wait_grandchild_first ATF_CHECK_EQ(2, r); } +ATF_TC(reaper_sigchld_child_first); +ATF_TC_HEAD(reaper_sigchld_child_first, tc) +{ + atf_tc_set_md_var(tc, "timeout", "2"); +} +ATF_TC_BODY(reaper_sigchld_child_first, tc) +{ + struct sigaction act; + sigset_t mask; + siginfo_t info; + pid_t parent, child, grandchild, pid; + int r; + int pip[2]; + + /* Be paranoid. */ + pid = waitpid(-1, NULL, WNOHANG); + ATF_REQUIRE(pid == -1 && errno == ECHILD); + + act.sa_sigaction = dummy_sighandler; + act.sa_flags = SA_SIGINFO | SA_RESTART; + r = sigemptyset(_mask); + ATF_REQUIRE_EQ(0, r); + r = sigaction(SIGCHLD, , NULL); + ATF_REQUIRE_EQ(0, r); + + r = sigemptyset(); + ATF_REQUIRE_EQ(0, r); + r = sigaddset(, SIGCHLD); + ATF_REQUIRE_EQ(0, r); + r = sigprocmask(SIG_BLOCK, , NULL); + ATF_REQUIRE_EQ(0, r); + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + r = pipe(pip); + ATF_REQUIRE_EQ(0, r); + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + if (close(pip[1]) != 0) + _exit(100); + grandchild = fork(); + if (grandchild == -1) + _exit(101); + else if (grandchild == 0) { + if (read(pip[0], &(uint8_t){ 0 }, 1) != 0) + _exit(102); + if (getppid() != parent) + _exit(103); + _exit(2); + } else + _exit(3); + } + + r = sigwaitinfo(, ); + ATF_REQUIRE_EQ(SIGCHLD, r); + ATF_CHECK_EQ(SIGCHLD, info.si_signo); + ATF_CHECK_EQ(CLD_EXITED, info.si_code); + ATF_CHECK_EQ(3, info.si_status); + ATF_CHECK_EQ(child, info.si_pid); + + pid = waitpid(child, NULL, 0); + ATF_REQUIRE_EQ(child, pid); + + r = close(pip[1]); + ATF_REQUIRE_EQ(0, r); + + r = sigwaitinfo(, ); + ATF_REQUIRE_EQ(SIGCHLD, r); + ATF_CHECK_EQ(SIGCHLD, info.si_signo); + ATF_CHECK_EQ(CLD_EXITED, info.si_code); + ATF_CHECK_EQ(2, info.si_status); + grandchild = info.si_pid; + ATF_REQUIRE(grandchild > 0); + ATF_REQUIRE(grandchild != parent); + ATF_REQUIRE(grandchild != child); + + pid = waitpid(-1, NULL, 0); + ATF_REQUIRE_EQ(grandchild, pid); + + r = close(pip[0]); + ATF_REQUIRE_EQ(0, r); +} + +ATF_TC(reaper_sigchld_grandchild_first); +ATF_TC_HEAD(reaper_sigchld_grandchild_first, tc) +{ + atf_tc_set_md_var(tc, "timeout", "2"); +} +ATF_TC_BODY(reaper_sigchld_grandchild_first, tc) +{ + struct sigaction act; + sigset_t mask; + siginfo_t info; + pid_t parent, child, grandchild, pid; + int r; + + /* Be paranoid. */ + pid = waitpid(-1, NULL, WNOHANG); + ATF_REQUIRE(pid == -1 && errno == ECHILD); + + act.sa_sigaction = dummy_sighandler; + act.sa_flags = SA_SIGINFO | SA_RESTART; + r = sigemptyset(_mask); + ATF_REQUIRE_EQ(0, r); + r = sigaction(SIGCHLD, , NULL); + ATF_REQUIRE_EQ(0, r); + + r = sigemptyset(); + ATF_REQUIRE_EQ(0, r); + r = sigaddset(, SIGCHLD); + ATF_REQUIRE_EQ(0, r); + r = sigprocmask(SIG_BLOCK, , NULL); + ATF_REQUIRE_EQ(0, r); + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + grandchild = fork(); + if (grandchild == -1) + _exit(101); + else if (grandchild == 0) + _exit(2); + else { + if (waitid(P_PID, grandchild, NULL, + WNOWAIT | WEXITED) != 0) + _exit(102); + _exit(3); + } + } +
Re: svn commit: r307684 - head/sbin/camcontrol
On Sun, Dec 11, 2016 at 00:49:12 +0100, Oliver Pinter wrote: > On 10/20/16, Kenneth D. Merrywrote: > > Author: ken > > Date: Thu Oct 20 19:42:26 2016 > > New Revision: 307684 > > URL: https://svnweb.freebsd.org/changeset/base/307684 > > > > Log: > > For CCBs allocated on the stack, we need to clear the entire CCB, not > > just > > the header. Otherwise stack garbage can lead to random flags getting > > set. > > > > This showed up as 'camcontrol rescan all' failing with EINVAL because the > > address type wasn't CAM_DATA_VADDR. > > > > sbin/camcontrol/camcontrol.c: > > In rescan_or_reset_bus(), bzero the stack-allocated CCBs before > > use instead of clearing the body. > > > > MFC after:3 days > > Sponsored by: Spectra Logic > > The MFC of this commit is missed both for 10-STABLE and 11-STABLE. Is > this still in plan to do? Done, thanks for the reminder! Ken -- Kenneth Merry k...@freebsd.org ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309956 - stable/10/sbin/camcontrol
Author: ken Date: Mon Dec 12 21:54:49 2016 New Revision: 309956 URL: https://svnweb.freebsd.org/changeset/base/309956 Log: MFC r307684, r307747 r307684 | ken | 2016-10-20 13:42:26 -0600 (Thu, 20 Oct 2016) | 13 lines For CCBs allocated on the stack, we need to clear the entire CCB, not just the header. Otherwise stack garbage can lead to random flags getting set. This showed up as 'camcontrol rescan all' failing with EINVAL because the address type wasn't CAM_DATA_VADDR. sbin/camcontrol/camcontrol.c: In rescan_or_reset_bus(), bzero the stack-allocated CCBs before use instead of clearing the body. Sponsored by: Spectra Logic r307747 | ken | 2016-10-21 12:54:56 -0600 (Fri, 21 Oct 2016) | 27 lines Fix a problem in camcontrol(8) that cropped up with r307684. In r307684, I changed rescan_or_reset_bus() to bzero stack-allocated CCBs before sending them to the kernel because there was stack garbage in there that wound up meaning that bogus CCB flags were set. While this fixed the 'camcontrol rescan all' case (XPT_DEV_MATCH CCBs were failing previously), it broke the 'camcontrol rescan 0' (or any other number) case when INVARIANTS are turned on. Rescanning a single bus reliably produced an assert in cam_periph_runccb(): panic: cam_periph_runccb: ccb=0xf80044ffe000, func_code=0x708, flags=0xdde0 The flags values don't make sense from the code. Changing the CCBs in rescan_or_reset_bus() from stack to heap allocated avoids the problem. It would be better to understand why userland stack allocated CCBs don't work properly, since there may be other code that breaks if stack allocated CCBs don't work. sbin/camcontrol/camcontrol.c: In rescan_or_reset_bus(), allocate the CCBs using malloc(3) instead of on the stack to avoid an assertion in cam_periph_runccb(). Sponsored by: Spectra Logic Sponsored by: Spectra Logic Modified: stable/10/sbin/camcontrol/camcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.c == --- stable/10/sbin/camcontrol/camcontrol.c Mon Dec 12 21:49:29 2016 (r309955) +++ stable/10/sbin/camcontrol/camcontrol.c Mon Dec 12 21:54:49 2016 (r309956) @@ -3124,8 +3124,8 @@ dorescan_or_reset(int argc, char **argv, static int rescan_or_reset_bus(path_id_t bus, int rescan) { - union ccb ccb, matchccb; - int fd, retval; + union ccb *ccb = NULL, *matchccb = NULL; + int fd = -1, retval; int bufsize; retval = 0; @@ -3136,35 +3136,41 @@ rescan_or_reset_bus(path_id_t bus, int r return(1); } + ccb = malloc(sizeof(*ccb)); + if (ccb == NULL) { + warn("failed to allocate CCB"); + retval = 1; + goto bailout; + } + bzero(ccb, sizeof(*ccb)); + if (bus != CAM_BUS_WILDCARD) { - ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS; - ccb.ccb_h.path_id = bus; - ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; - ccb.ccb_h.target_lun = CAM_LUN_WILDCARD; - ccb.crcn.flags = CAM_FLAG_NONE; + ccb->ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS; + ccb->ccb_h.path_id = bus; + ccb->ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb->ccb_h.target_lun = CAM_LUN_WILDCARD; + ccb->crcn.flags = CAM_FLAG_NONE; /* run this at a low priority */ - ccb.ccb_h.pinfo.priority = 5; + ccb->ccb_h.pinfo.priority = 5; - if (ioctl(fd, CAMIOCOMMAND, ) == -1) { + if (ioctl(fd, CAMIOCOMMAND, ccb) == -1) { warn("CAMIOCOMMAND ioctl failed"); - close(fd); - return(1); + retval = 1; + goto bailout; } - if ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { fprintf(stdout, "%s of bus %d was successful\n", rescan ? "Re-scan" : "Reset", bus); } else { fprintf(stdout, "%s of bus %d returned error %#x\n", rescan ? "Re-scan" : "Reset", bus, - ccb.ccb_h.status & CAM_STATUS_MASK); + ccb->ccb_h.status & CAM_STATUS_MASK);
svn commit: r309955 - stable/11/share/man/man5
Author: bapt Date: Mon Dec 12 21:49:29 2016 New Revision: 309955 URL: https://svnweb.freebsd.org/changeset/base/309955 Log: Regen after r309954 Modified: stable/11/share/man/man5/src.conf.5 Modified: stable/11/share/man/man5/src.conf.5 == --- stable/11/share/man/man5/src.conf.5 Mon Dec 12 21:45:25 2016 (r309954) +++ stable/11/share/man/man5/src.conf.5 Mon Dec 12 21:49:29 2016 (r309955) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery +.\" from FreeBSD: stable/11/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd June 28, 2016 +.Dd December 12, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -94,56 +94,56 @@ The following list provides a name and s that can be used for source builds. .Bl -tag -width indent .It Va WITHOUT_ACCT -.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed Set to not build process accounting tools such as .Xr accton 8 and .Xr sa 8 . .It Va WITHOUT_ACPI -.\" from FreeBSD: head/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru Set to not build .Xr acpiconf 8 , .Xr acpidump 8 and related programs. .It Va WITHOUT_AMD -.\" from FreeBSD: head/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam Set to not build .Xr amd 8 , and related programs. .It Va WITHOUT_APM -.\" from FreeBSD: head/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam Set to not build .Xr apm 8 , .Xr apmd 8 and related programs. .It Va WITHOUT_ASSERT_DEBUG -.\" from FreeBSD: head/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru Set to compile programs and libraries without the .Xr assert 3 checks. .It Va WITHOUT_AT -.\" from FreeBSD: head/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam Set to not build .Xr at 1 and related utilities. .It Va WITHOUT_ATM -.\" from FreeBSD: head/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru Set to not build programs and libraries related to ATM networking. .It Va WITHOUT_AUDIT -.\" from FreeBSD: head/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru Set to not build audit support into system programs. .It Va WITHOUT_AUTHPF -.\" from FreeBSD: head/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru Set to not build .Xr authpf 8 . .It Va WITHOUT_AUTOFS -.\" from FreeBSD: head/tools/build/options/WITHOUT_AUTOFS 296264 2016-03-01 11:36:10Z trasz +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_AUTOFS 296264 2016-03-01 11:36:10Z trasz Set to not build .Xr autofs 5 related programs, libraries, and kernel modules. .It Va WITH_AUTO_OBJ -.\" from FreeBSD: head/tools/build/options/WITH_AUTO_OBJ 284708 2015-06-22 20:21:57Z sjg +.\" from FreeBSD: stable/11/tools/build/options/WITH_AUTO_OBJ 284708 2015-06-22 20:21:57Z sjg Enable automatic creation of objdirs. .Pp This must be set in the environment, make command line, or @@ -151,14 +151,14 @@ This must be set in the environment, mak not .Pa /etc/src.conf . .It Va WITHOUT_BHYVE -.\" from FreeBSD: head/tools/build/options/WITHOUT_BHYVE 277727 2015-01-26 06:44:48Z ngie +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BHYVE 277727 2015-01-26 06:44:48Z ngie Set to not build or install .Xr bhyve 8 , associated utilities, and examples. .Pp This option only affects amd64/amd64. .It Va WITHOUT_BINUTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 286332 2015-08-05 18:30:00Z emaste +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BINUTILS 286332 2015-08-05 18:30:00Z emaste Set to not build or install binutils (as, ld, objcopy, and objdump ) as part of the normal system build. The resulting system cannot build programs from source. @@ -166,14 +166,14 @@ The resulting system cannot build progra It is a default setting on arm64/aarch64. .It Va WITH_BINUTILS -.\" from FreeBSD: head/tools/build/options/WITH_BINUTILS 295491
svn commit: r309954 - stable/11/share/mk
Author: bapt Date: Mon Dec 12 21:45:25 2016 New Revision: 309954 URL: https://svnweb.freebsd.org/changeset/base/309954 Log: MFC r309805: Make WITHOUT_CAPSICUM implying WITHOUT_CASPER PR: 214562 Reported by: dewa...@heuristicsystems.com.au Modified: stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/src.opts.mk == --- stable/11/share/mk/src.opts.mk Mon Dec 12 21:43:17 2016 (r309953) +++ stable/11/share/mk/src.opts.mk Mon Dec 12 21:45:25 2016 (r309954) @@ -286,6 +286,10 @@ MK_${var}:=no # Force some options off if their dependencies are off. # Order is somewhat important. # +.if ${MK_CAPSICUM} == "no" +MK_CASPER:=no +.endif + .if ${MK_LIBPTHREAD} == "no" MK_LIBTHR:=no .endif ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309953 - stable/11/tools/build/mk
Author: bapt Date: Mon Dec 12 21:43:17 2016 New Revision: 309953 URL: https://svnweb.freebsd.org/changeset/base/309953 Log: MFC r309797-r309802 r309797: Add entries to remove timed files with make delete-old if WITHOUT_TIMED is set r309798: Also remove auditdistd files if src.conf has WITHOUT_AUDIT r309799: Respect WITHOUT_RBOOTD in src.conf when running make delete-old r309800: Respect WITHOUT_BOOTPARAMD in src.conf when running make delete-old r309801: Respect WITHOUT_BOOTPD in src.conf when running make delete-old r309802: Respect WITHOUT_FINGER in src.conf when running make delete-old PR: 213719, 213720, 213721, 213722, 213723, 213724 Submitted by: philippe.mich...@sfr.fr Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc == --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Mon Dec 12 21:29:48 2016(r309952) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Mon Dec 12 21:43:17 2016(r309953) @@ -166,12 +166,15 @@ OLD_FILES+=usr/share/snmp/mibs/BEGEMOT-A .if ${MK_AUDIT} == no OLD_FILES+=usr/sbin/audit OLD_FILES+=usr/sbin/auditd +OLD_FILES+=usr/sbin/auditdistd OLD_FILES+=usr/sbin/auditreduce OLD_FILES+=usr/sbin/praudit OLD_FILES+=usr/share/man/man1/auditreduce.1.gz OLD_FILES+=usr/share/man/man1/praudit.1.gz +OLD_FILES+=usr/share/man/man5/auditdistd.conf.5.gz OLD_FILES+=usr/share/man/man8/audit.8.gz OLD_FILES+=usr/share/man/man8/auditd.8.gz +OLD_FILES+=usr/share/man/man8/auditdistd.8.gz .endif .if ${MK_AUTHPF} == no @@ -650,6 +653,24 @@ OLD_FILES+=usr/share/man/man8/zfsboot.8. OLD_FILES+=usr/share/man/man8/zfsloader.8.gz .endif +.if ${MK_BOOTPARAMD} == no +OLD_FILES+=usr/sbin/bootparamd +OLD_FILES+=usr/share/man/man5/bootparams.5.gz +OLD_FILES+=usr/share/man/man8/bootparamd.8.gz +OLD_FILES+=usr/sbin/callbootd +.endif + +.if ${MK_BOOTPD} == no +OLD_FILES+=usr/libexec/bootpd +OLD_FILES+=usr/share/man/man5/bootptab.5.gz +OLD_FILES+=usr/share/man/man8/bootpd.8.gz +OLD_FILES+=usr/libexec/bootpgw +OLD_FILES+=usr/sbin/bootpef +OLD_FILES+=usr/share/man/man8/bootpef.8.gz +OLD_FILES+=usr/sbin/bootptest +OLD_FILES+=usr/share/man/man8/bootptest.8.gz +.endif + .if ${MK_BSD_CPIO} == no OLD_FILES+=usr/bin/bsdcpio OLD_FILES+=usr/bin/cpio @@ -1978,6 +1999,14 @@ OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee # to be filled in #.endif +.if ${MK_FINGER} == no +OLD_FILES+=usr/bin/finger +OLD_FILES+=usr/share/man/man1/finger.1.gz +OLD_FILES+=usr/share/man/man5/finger.conf.5.gz +OLD_FILES+=usr/libexec/fingerd +OLD_FILES+=usr/share/man/man8/fingerd.8.gz +.endif + .if ${MK_FLOPPY} == no OLD_FILES+=usr/sbin/fdcontrol OLD_FILES+=usr/sbin/fdformat @@ -6777,6 +6806,11 @@ OLD_FILES+=usr/share/man/man8/quotaon.8. OLD_FILES+=usr/share/man/man8/repquota.8.gz .endif +.if ${MK_RBOOTD} == no +OLD_FILES+=usr/libexec/rbootd +OLD_FILES+=usr/share/man/man8/rbootd.8.gz +.endif + .if ${MK_RCMDS} == no OLD_FILES+=bin/rcp OLD_FILES+=etc/rc.d/rwho @@ -7998,6 +8032,13 @@ OLD_FILES+=usr/share/man/man1/colcrt.1.g OLD_FILES+=usr/share/man/man1/ul.1.gz .endif +.if ${MK_TIMED} == no +OLD_FILES+=usr/sbin/timed +OLD_FILES+=usr/sbin/timedc +OLD_FILES+=usr/share/man/man8/timed.8.gz +OLD_FILES+=usr/share/man/man8/timedc.8.gz +.endif + .if ${MK_TOOLCHAIN} == no OLD_FILES+=usr/bin/addr2line OLD_FILES+=usr/bin/as ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309952 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 21:29:48 2016 New Revision: 309952 URL: https://svnweb.freebsd.org/changeset/base/309952 Log: In awk, casting a variable as a boolean condition is the same as testing if the length of the variable contents is greater than zero This allows us to also move the secondary condition into the action clause Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:27:29 2016 (r309951) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:29:48 2016 (r309952) @@ -213,10 +213,7 @@ while :; do SCAN_RESULTS=$( wpa_cli scan_results ) NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' ' - /..:..:..:..:..:../ { - if (length($5) > 0) - printf("\"%s\"\t%s\n", $5, $4) - } + /..:..:..:..:..:../ && $5 { printf("\"%s\"\t%s\n", $5, $4) } ' | sort | uniq ) if [ ! "$NETWORKS" ]; then ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309951 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 21:27:29 2016 New Revision: 309951 URL: https://svnweb.freebsd.org/changeset/base/309951 Log: Remove an unnecessary call to f_dialog_title_restore() Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:26:36 2016 (r309950) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:27:29 2016 (r309951) @@ -259,7 +259,6 @@ while :; do 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exit 1 SCANSSID=1 - f_dialog_title_restore break ;; $DIALOG_EXTRA) # Rescan ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309950 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 21:26:36 2016 New Revision: 309950 URL: https://svnweb.freebsd.org/changeset/base/309950 Log: Whitespace Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:23:47 2016 (r309949) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:26:36 2016 (r309950) @@ -190,8 +190,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then --yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \ 0 0 if [ $? -eq 0 ]; then - while : - do + while :; do dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY" if [ $? -eq $SUCCESS ]; then break @@ -242,9 +241,7 @@ while :; do 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) case $? in - $DIALOG_OK) - break - ;; + $DIALOG_OK) break ;; $DIALOG_CANCEL) # here we ask if the user wants to select the network manually f_dialog_title "Network Selection" @@ -298,7 +295,8 @@ elif echo $ENCRYPTION | grep -q EAP; the --title "WPA-Enterprise Setup" \ --backtitle "$DIALOG_BACKTITLE" \ --insecure \ - --mixedform "" 0 0 0 \ + --mixedform "" \ + 0 0 0 \ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "Username" 2 0 "" 2 12 25 63 0 \ "Password" 3 0 "" 3 12 25 63 1 \ @@ -322,7 +320,8 @@ elif echo $ENCRYPTION | grep -q WEP; the --title "WEP Setup" \ --backtitle "$DIALOG_BACKTITLE" \ --insecure \ - --mixedform "" 0 0 0 \ + --mixedform "" \ + 0 0 0 \ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309949 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 21:23:47 2016 New Revision: 309949 URL: https://svnweb.freebsd.org/changeset/base/309949 Log: Utilize provided i18n strings Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:20:56 2016 (r309948) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:23:47 2016 (r309949) @@ -61,7 +61,7 @@ country_set() fi if [ "$error_str" ]; then $DIALOG \ - --title "Error" \ + --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ @@ -114,7 +114,7 @@ dialog_country_select() regdomain=$( sh -c "$DIALOG \ --title \"$DIALOG_TITLE\" \ --backtitle \"$DIALOG_BACKTITLE\" \ - --cancel-label \"Skip\" \ + --cancel-label \"$msg_skip\" \ --default-item \"$default_regdomain\" \ --no-items \ --stdout \ @@ -128,7 +128,7 @@ dialog_country_select() country=$( sh -c "$DIALOG \ --title \"$DIALOG_TITLE\" \ --backtitle \"$DIALOG_BACKTITLE\" \ - --cancel-label \"Skip\" \ + --cancel-label \"$msg_skip\" \ --default-item \"$default_country\" \ --stdout \ --menu \"Select your country.\" \ @@ -157,14 +157,14 @@ EOF # (wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] && wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) || - ($DIALOG --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \ + ($DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \ "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 # See if we succeeded wpa_cli ping >/dev/null 2>/dev/null if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then $DIALOG \ - --title "Error" \ + --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --msgbox "Wireless cannot be configured without making changes to the local system!" \ 0 0 @@ -208,7 +208,7 @@ while :; do $DIALOG \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ - --ok-label "Skip" \ + --ok-label "$msg_skip" \ --pause "Waiting 5 seconds to scan for wireless networks..." \ 9 40 5 || exit 1 @@ -221,7 +221,7 @@ while :; do ' | sort | uniq ) if [ ! "$NETWORKS" ]; then - f_dialog_title "Error" + f_dialog_title "$msg_error" $DIALOG \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309948 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 21:20:56 2016 New Revision: 309948 URL: https://svnweb.freebsd.org/changeset/base/309948 Log: Remove incomplete and unnecessary creation of fd3 The provided API already provides a passthru descriptor and even gives you a varaible for referring to it. Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:18:24 2016 (r309947) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:20:56 2016 (r309948) @@ -231,7 +231,6 @@ while :; do fi f_dialog_title "Network Selection" - exec 3>&1 NETWORK=$( sh -c "$DIALOG \ --title \"$DIALOG_TITLE\" \ --backtitle \"$DIALOG_BACKTITLE\" \ @@ -240,7 +239,7 @@ while :; do --menu \"Select a wireless network to connect to.\" \ 0 0 0 \ $( echo $NETWORKS | tr '\n' ' ' )" \ - 2>&1 >&3 + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) case $? in $DIALOG_OK) @@ -260,7 +259,7 @@ while :; do "2 WPA/WPA2 EAP" "" \ "3 WEP" "" \ "0 None" "" \ - 2>&1 >&3 + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exit 1 SCANSSID=1 f_dialog_title_restore @@ -269,14 +268,12 @@ while :; do $DIALOG_EXTRA) # Rescan ;; esac - exec 3>&- done [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" | awk -F '\t' "/^\"$NETWORK\"\t/ { printf(\"%s\n\", \\\$2 ) }" ) if echo $ENCRYPTION | grep -q 'PSK'; then - exec 3>&1 PASS=$( $DIALOG \ --title "WPA Setup" \ --backtitle "$DIALOG_BACKTITLE" \ @@ -285,9 +282,8 @@ if echo $ENCRYPTION | grep -q 'PSK'; the 0 0 0 \ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "Password" 2 0 "" 2 12 15 63 1 \ - 2>&1 >&3 + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - exec 3>&- awk 'sub(/^\t/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF network={ @@ -298,7 +294,6 @@ if echo $ENCRYPTION | grep -q 'PSK'; the } EOF elif echo $ENCRYPTION | grep -q EAP; then - exec 3>&1 USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ --backtitle "$DIALOG_BACKTITLE" \ @@ -307,9 +302,8 @@ elif echo $ENCRYPTION | grep -q EAP; the "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "Username" 2 0 "" 2 12 25 63 0 \ "Password" 3 0 "" 3 12 25 63 1 \ - 2>&1 >&3 + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - exec 3>&- awk 'sub(/^\t/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF network={ @@ -324,7 +318,6 @@ elif echo $ENCRYPTION | grep -q EAP; the } EOF elif echo $ENCRYPTION | grep -q WEP; then - exec 3>&1 WEPKEY=$( $DIALOG \ --title "WEP Setup" \ --backtitle "$DIALOG_BACKTITLE" \ @@ -332,7 +325,7 @@ elif echo $ENCRYPTION | grep -q WEP; the --mixedform "" 0 0 0 \ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "WEP Key 0" 2 0 "" 2 12 15 0 1 \ - 2>&1 >&3 + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" awk 'sub(/^\t/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309947 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 21:18:24 2016 New Revision: 309947 URL: https://svnweb.freebsd.org/changeset/base/309947 Log: Remove unnecessary semi-colons Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:16:37 2016 (r309946) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:18:24 2016 (r309947) @@ -216,7 +216,7 @@ while :; do NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' ' /..:..:..:..:..:../ { if (length($5) > 0) - printf("\"%s\"\t%s\n", $5, $4); + printf("\"%s\"\t%s\n", $5, $4) } ' | sort | uniq ) @@ -273,7 +273,7 @@ while :; do done [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" | - awk -F '\t' "/^\"$NETWORK\"\t/ { printf(\"%s\n\", \\\$2 ); }" ) + awk -F '\t' "/^\"$NETWORK\"\t/ { printf(\"%s\n\", \\\$2 ) }" ) if echo $ENCRYPTION | grep -q 'PSK'; then exec 3>&1 @@ -317,8 +317,8 @@ elif echo $ENCRYPTION | grep -q EAP; the scan_ssid=$SCANSSID key_mgmt=WPA-EAP$( echo "$USERPASS" | awk ' - NR == 1 { printf "\n\t\tidentity=\"%s\"", $1; } - NR == 2 { printf "\n\t\tpassword=\"%s\"", $1; } + NR == 1 { printf "\n\t\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\t\tpassword=\"%s\"", $1 } ' ) priority=5 } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309946 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 21:16:37 2016 New Revision: 309946 URL: https://svnweb.freebsd.org/changeset/base/309946 Log: Use awk the following (more succinct) awk syntax: condition1 { action1 } condition2 { action2 } instead of the following syntax: { if (condition1) { action1 } else if (condition2) { action2 } } Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:11:55 2016 (r309945) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:16:37 2016 (r309946) @@ -317,13 +317,9 @@ elif echo $ENCRYPTION | grep -q EAP; the scan_ssid=$SCANSSID key_mgmt=WPA-EAP$( echo "$USERPASS" | awk ' - { - if (NR == 1) { - printf "identity=\"%s\"\n", $1; - } else if (NR == 2) { - printf "password=\"%s\"\n", $1; - } - }' ) + NR == 1 { printf "\n\t\tidentity=\"%s\"", $1; } + NR == 2 { printf "\n\t\tpassword=\"%s\"", $1; } + ' ) priority=5 } EOF ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309945 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 21:11:55 2016 New Revision: 309945 URL: https://svnweb.freebsd.org/changeset/base/309945 Log: 1 is the default descriptor for redirects without an fd prefix Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:04:11 2016 (r309944) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:11:55 2016 (r309945) @@ -240,7 +240,7 @@ while :; do --menu \"Select a wireless network to connect to.\" \ 0 0 0 \ $( echo $NETWORKS | tr '\n' ' ' )" \ - 2>&1 1>&3 + 2>&1 >&3 ) case $? in $DIALOG_OK) @@ -260,7 +260,7 @@ while :; do "2 WPA/WPA2 EAP" "" \ "3 WEP" "" \ "0 None" "" \ - 2>&1 1>&3 + 2>&1 >&3 ) || exit 1 SCANSSID=1 f_dialog_title_restore @@ -285,7 +285,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the 0 0 0 \ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "Password" 2 0 "" 2 12 15 63 1 \ - 2>&1 1>&3 + 2>&1 >&3 ) || exec "$0" "$@" exec 3>&- awk 'sub(/^\t/,"")||1' \ @@ -307,7 +307,7 @@ elif echo $ENCRYPTION | grep -q EAP; the "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "Username" 2 0 "" 2 12 25 63 0 \ "Password" 3 0 "" 3 12 25 63 1 \ - 2>&1 1>&3 + 2>&1 >&3 ) || exec "$0" "$@" exec 3>&- awk 'sub(/^\t/,"")||1' \ @@ -336,7 +336,7 @@ elif echo $ENCRYPTION | grep -q WEP; the --mixedform "" 0 0 0 \ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "WEP Key 0" 2 0 "" 2 12 15 0 1 \ - 2>&1 1>&3 + 2>&1 >&3 ) || exec "$0" "$@" awk 'sub(/^\t/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309944 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 21:04:11 2016 New Revision: 309944 URL: https://svnweb.freebsd.org/changeset/base/309944 Log: Fix invalid parameter expansion (change $@ to "$@") Without quotes, $@ loses its special meanining (see below) % sh -c 'echo $@' /bin/sh " 1 " " 2 " 1 2 % sh -c 'echo "$@"' /bin/sh " 1 " " 2 " 1 2 The quotes are required to get ARGV to be unperterped Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:02:34 2016 (r309943) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:04:11 2016 (r309944) @@ -286,7 +286,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "Password" 2 0 "" 2 12 15 63 1 \ 2>&1 1>&3 - ) || exec "$0" $@ + ) || exec "$0" "$@" exec 3>&- awk 'sub(/^\t/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF @@ -308,7 +308,7 @@ elif echo $ENCRYPTION | grep -q EAP; the "Username" 2 0 "" 2 12 25 63 0 \ "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 1>&3 - ) || exec "$0" $@ + ) || exec "$0" "$@" exec 3>&- awk 'sub(/^\t/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF @@ -337,7 +337,7 @@ elif echo $ENCRYPTION | grep -q WEP; the "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 1>&3 - ) || exec "$0" $@ + ) || exec "$0" "$@" awk 'sub(/^\t/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF network={ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309943 - stable/11/sbin/camcontrol
Author: ken Date: Mon Dec 12 21:02:34 2016 New Revision: 309943 URL: https://svnweb.freebsd.org/changeset/base/309943 Log: MFC r307684, r307747 r307684 | ken | 2016-10-20 13:42:26 -0600 (Thu, 20 Oct 2016) | 13 lines For CCBs allocated on the stack, we need to clear the entire CCB, not just the header. Otherwise stack garbage can lead to random flags getting set. This showed up as 'camcontrol rescan all' failing with EINVAL because the address type wasn't CAM_DATA_VADDR. sbin/camcontrol/camcontrol.c: In rescan_or_reset_bus(), bzero the stack-allocated CCBs before use instead of clearing the body. Sponsored by: Spectra Logic r307747 | ken | 2016-10-21 12:54:56 -0600 (Fri, 21 Oct 2016) | 27 lines Fix a problem in camcontrol(8) that cropped up with r307684. In r307684, I changed rescan_or_reset_bus() to bzero stack-allocated CCBs before sending them to the kernel because there was stack garbage in there that wound up meaning that bogus CCB flags were set. While this fixed the 'camcontrol rescan all' case (XPT_DEV_MATCH CCBs were failing previously), it broke the 'camcontrol rescan 0' (or any other number) case when INVARIANTS are turned on. Rescanning a single bus reliably produced an assert in cam_periph_runccb(): panic: cam_periph_runccb: ccb=0xf80044ffe000, func_code=0x708, flags=0xdde0 The flags values don't make sense from the code. Changing the CCBs in rescan_or_reset_bus() from stack to heap allocated avoids the problem. It would be better to understand why userland stack allocated CCBs don't work properly, since there may be other code that breaks if stack allocated CCBs don't work. sbin/camcontrol/camcontrol.c: In rescan_or_reset_bus(), allocate the CCBs using malloc(3) instead of on the stack to avoid an assertion in cam_periph_runccb(). Sponsored by: Spectra Logic Sponsored by: Spectra Logic Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c == --- stable/11/sbin/camcontrol/camcontrol.c Mon Dec 12 21:01:20 2016 (r309942) +++ stable/11/sbin/camcontrol/camcontrol.c Mon Dec 12 21:02:34 2016 (r309943) @@ -3127,8 +3127,8 @@ dorescan_or_reset(int argc, char **argv, static int rescan_or_reset_bus(path_id_t bus, int rescan) { - union ccb ccb, matchccb; - int fd, retval; + union ccb *ccb = NULL, *matchccb = NULL; + int fd = -1, retval; int bufsize; retval = 0; @@ -3139,35 +3139,41 @@ rescan_or_reset_bus(path_id_t bus, int r return(1); } + ccb = malloc(sizeof(*ccb)); + if (ccb == NULL) { + warn("failed to allocate CCB"); + retval = 1; + goto bailout; + } + bzero(ccb, sizeof(*ccb)); + if (bus != CAM_BUS_WILDCARD) { - ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS; - ccb.ccb_h.path_id = bus; - ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; - ccb.ccb_h.target_lun = CAM_LUN_WILDCARD; - ccb.crcn.flags = CAM_FLAG_NONE; + ccb->ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS; + ccb->ccb_h.path_id = bus; + ccb->ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb->ccb_h.target_lun = CAM_LUN_WILDCARD; + ccb->crcn.flags = CAM_FLAG_NONE; /* run this at a low priority */ - ccb.ccb_h.pinfo.priority = 5; + ccb->ccb_h.pinfo.priority = 5; - if (ioctl(fd, CAMIOCOMMAND, ) == -1) { + if (ioctl(fd, CAMIOCOMMAND, ccb) == -1) { warn("CAMIOCOMMAND ioctl failed"); - close(fd); - return(1); + retval = 1; + goto bailout; } - if ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { fprintf(stdout, "%s of bus %d was successful\n", rescan ? "Re-scan" : "Reset", bus); } else { fprintf(stdout, "%s of bus %d returned error %#x\n", rescan ? "Re-scan" : "Reset", bus, - ccb.ccb_h.status & CAM_STATUS_MASK); + ccb->ccb_h.status & CAM_STATUS_MASK);
svn commit: r309942 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 21:01:20 2016 New Revision: 309942 URL: https://svnweb.freebsd.org/changeset/base/309942 Log: Allow the script path to contain whitespace and special characters Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:00:09 2016 (r309941) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:01:20 2016 (r309942) @@ -286,7 +286,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "Password" 2 0 "" 2 12 15 63 1 \ 2>&1 1>&3 - ) || exec $0 $@ + ) || exec "$0" $@ exec 3>&- awk 'sub(/^\t/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF @@ -308,7 +308,7 @@ elif echo $ENCRYPTION | grep -q EAP; the "Username" 2 0 "" 2 12 25 63 0 \ "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 1>&3 - ) || exec $0 $@ + ) || exec "$0" $@ exec 3>&- awk 'sub(/^\t/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF @@ -337,7 +337,7 @@ elif echo $ENCRYPTION | grep -q WEP; the "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 1>&3 - ) || exec $0 $@ + ) || exec "$0" $@ awk 'sub(/^\t/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF network={ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309941 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 21:00:09 2016 New Revision: 309941 URL: https://svnweb.freebsd.org/changeset/base/309941 Log: Use provided API to centralize dialog title strings Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 20:54:20 2016 (r309940) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 21:00:09 2016 (r309941) @@ -108,10 +108,11 @@ dialog_country_select() } }' | sort -k 2 | tr '\n' ' ' ) - f_dialog_menu_size height width rows "Regdomain selection" \ + f_dialog_title "Regdomain selection" + f_dialog_menu_size height width rows "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" "Select your regdomain." "" $regdomains regdomain=$( sh -c "$DIALOG \ - --title \"Regdomain selection\" \ + --title \"$DIALOG_TITLE\" \ --backtitle \"$DIALOG_BACKTITLE\" \ --cancel-label \"Skip\" \ --default-item \"$default_regdomain\" \ @@ -121,10 +122,11 @@ dialog_country_select() $height $width $rows $regdomains" ) - f_dialog_menu_size height width rows "Country selection" \ + f_dialog_title "Country selection" + f_dialog_menu_size height width rows "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" "Select your country." "" $countries country=$( sh -c "$DIALOG \ - --title \"Country selection\" \ + --title \"$DIALOG_TITLE\" \ --backtitle \"$DIALOG_BACKTITLE\" \ --cancel-label \"Skip\" \ --default-item \"$default_country\" \ @@ -181,8 +183,9 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 ) [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" [ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="" + f_dialog_title "Regdomain/country" $DIALOG \ - --title "Regdomain/country" \ + --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ --yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \ 0 0 @@ -201,8 +204,9 @@ while :; do SCANSSID=0 output=$( wpa_cli scan 2>&1 ) f_dprintf "%s" "$output" + f_dialog_title "Scanning" $DIALOG \ - --title "Scanning" \ + --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ --ok-label "Skip" \ --pause "Waiting 5 seconds to scan for wireless networks..." \ @@ -217,17 +221,19 @@ while :; do ' | sort | uniq ) if [ ! "$NETWORKS" ]; then + f_dialog_title "Error" $DIALOG \ - --title "Error" \ + --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ --yesno "No wireless networks were found. Rescan?" \ 0 0 && continue exit 1 fi + f_dialog_title "Network Selection" exec 3>&1 NETWORK=$( sh -c "$DIALOG \ - --title \"Network Selection\" \ + --title \"$DIALOG_TITLE\" \ --backtitle \"$DIALOG_BACKTITLE\" \ --extra-button \ --extra-label \"Rescan\" \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309940 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 20:54:20 2016 New Revision: 309940 URL: https://svnweb.freebsd.org/changeset/base/309940 Log: Reorder dialog parameters based on commonality for readability Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 20:49:49 2016 (r309939) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 20:54:20 2016 (r309940) @@ -61,8 +61,8 @@ country_set() fi if [ "$error_str" ]; then $DIALOG \ - --backtitle "$DIALOG_BACKTITLE" \ --title "Error" \ + --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ --yesno \ @@ -111,8 +111,8 @@ dialog_country_select() f_dialog_menu_size height width rows "Regdomain selection" \ "$DIALOG_BACKTITLE" "Select your regdomain." "" $regdomains regdomain=$( sh -c "$DIALOG \ - --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Regdomain selection\" \ + --backtitle \"$DIALOG_BACKTITLE\" \ --cancel-label \"Skip\" \ --default-item \"$default_regdomain\" \ --no-items \ @@ -124,8 +124,8 @@ dialog_country_select() f_dialog_menu_size height width rows "Country selection" \ "$DIALOG_BACKTITLE" "Select your country." "" $countries country=$( sh -c "$DIALOG \ - --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Country selection\" \ + --backtitle \"$DIALOG_BACKTITLE\" \ --cancel-label \"Skip\" \ --default-item \"$default_country\" \ --stdout \ @@ -162,8 +162,8 @@ EOF wpa_cli ping >/dev/null 2>/dev/null if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then $DIALOG \ - --backtitle "$DIALOG_BACKTITLE" \ --title "Error" \ + --backtitle "$DIALOG_BACKTITLE" \ --msgbox "Wireless cannot be configured without making changes to the local system!" \ 0 0 exit 1 @@ -182,8 +182,8 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" [ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="" $DIALOG \ - --backtitle "$DIALOG_BACKTITLE" \ --title "Regdomain/country" \ + --backtitle "$DIALOG_BACKTITLE" \ --yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \ 0 0 if [ $? -eq 0 ]; then @@ -202,8 +202,8 @@ while :; do output=$( wpa_cli scan 2>&1 ) f_dprintf "%s" "$output" $DIALOG \ - --backtitle "$DIALOG_BACKTITLE" \ --title "Scanning" \ + --backtitle "$DIALOG_BACKTITLE" \ --ok-label "Skip" \ --pause "Waiting 5 seconds to scan for wireless networks..." \ 9 40 5 || exit 1 @@ -218,8 +218,8 @@ while :; do if [ ! "$NETWORKS" ]; then $DIALOG \ - --backtitle "$DIALOG_BACKTITLE" \ --title "Error" \ + --backtitle "$DIALOG_BACKTITLE" \ --yesno "No wireless networks were found. Rescan?" \ 0 0 && continue exit 1 @@ -227,10 +227,10 @@ while :; do exec 3>&1 NETWORK=$( sh -c "$DIALOG \ + --title \"Network Selection\" \ + --backtitle \"$DIALOG_BACKTITLE\" \ --extra-button \ --extra-label \"Rescan\" \ - --backtitle \"$DIALOG_BACKTITLE\" \ - --title \"Network Selection\" \ --menu \"Select a wireless network to connect to.\" \ 0 0 0 \ $( echo $NETWORKS | tr '\n' ' ' )" \ @@ -246,8 +246,8 @@ while :; do f_dialog_yesno "Do you want to select the network manually?" || exit 1 f_dialog_input NETWORK "Enter SSID" || exit 1 ENCRYPTION=$( $DIALOG \ - --backtitle "$DIALOG_BACKTITLE" \ --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ --menu "Select encryption type" \ 0 0 0 \ "1 WPA/WPA2 PSK" "" \ @@ -272,9 +272,9 @@ done if echo $ENCRYPTION | grep -q 'PSK'; then exec 3>&1 PASS=$( $DIALOG \ - --insecure \ - --backtitle "$DIALOG_BACKTITLE" \ --title "WPA Setup" \ + --backtitle "$DIALOG_BACKTITLE" \ + --insecure \ --mixedform
svn commit: r309939 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 20:49:49 2016 New Revision: 309939 URL: https://svnweb.freebsd.org/changeset/base/309939 Log: Fix incorrect use of provided API The result of which was incorrectly sized menu dialogs Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 20:43:09 2016 (r309938) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 20:49:49 2016 (r309939) @@ -108,9 +108,8 @@ dialog_country_select() } }' | sort -k 2 | tr '\n' ' ' ) - f_dialog_menu_size height width rows \"Regdomain selection\" \ - \"$DIALOG_BACKTITLE\" \"Select your regdomain.\" \ - \"\" $regdomains + f_dialog_menu_size height width rows "Regdomain selection" \ + "$DIALOG_BACKTITLE" "Select your regdomain." "" $regdomains regdomain=$( sh -c "$DIALOG \ --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Regdomain selection\" \ @@ -122,9 +121,8 @@ dialog_country_select() $height $width $rows $regdomains" ) - f_dialog_menu_size height width rows \"Country selection\" \ - \"$DIALOG_BACKTITLE\" \"Select your country.\" \ - \"\" $countries + f_dialog_menu_size height width rows "Country selection" \ + "$DIALOG_BACKTITLE" "Select your country." "" $countries country=$( sh -c "$DIALOG \ --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Country selection\" \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309938 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 20:43:09 2016 New Revision: 309938 URL: https://svnweb.freebsd.org/changeset/base/309938 Log: Use provided API (change "dialog" to "$DIALOG") Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 20:41:27 2016 (r309937) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 20:43:09 2016 (r309938) @@ -60,7 +60,7 @@ country_set() "$BSDINSTALL_TMPETC/wpa_supplicant.conf" fi if [ "$error_str" ]; then - dialog \ + $DIALOG \ --backtitle "$DIALOG_BACKTITLE" \ --title "Error" \ --yes-label Change \ @@ -111,7 +111,7 @@ dialog_country_select() f_dialog_menu_size height width rows \"Regdomain selection\" \ \"$DIALOG_BACKTITLE\" \"Select your regdomain.\" \ \"\" $regdomains - regdomain=$( sh -c "dialog \ + regdomain=$( sh -c "$DIALOG \ --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Regdomain selection\" \ --cancel-label \"Skip\" \ @@ -125,7 +125,7 @@ dialog_country_select() f_dialog_menu_size height width rows \"Country selection\" \ \"$DIALOG_BACKTITLE\" \"Select your country.\" \ \"\" $countries - country=$( sh -c "dialog \ + country=$( sh -c "$DIALOG \ --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Country selection\" \ --cancel-label \"Skip\" \ @@ -157,13 +157,13 @@ EOF # (wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] && wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) || - (dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \ + ($DIALOG --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \ "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 # See if we succeeded wpa_cli ping >/dev/null 2>/dev/null if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then - dialog \ + $DIALOG \ --backtitle "$DIALOG_BACKTITLE" \ --title "Error" \ --msgbox "Wireless cannot be configured without making changes to the local system!" \ @@ -183,7 +183,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 ) [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" [ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="" - dialog \ + $DIALOG \ --backtitle "$DIALOG_BACKTITLE" \ --title "Regdomain/country" \ --yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \ @@ -203,7 +203,7 @@ while :; do SCANSSID=0 output=$( wpa_cli scan 2>&1 ) f_dprintf "%s" "$output" - dialog \ + $DIALOG \ --backtitle "$DIALOG_BACKTITLE" \ --title "Scanning" \ --ok-label "Skip" \ @@ -219,7 +219,7 @@ while :; do ' | sort | uniq ) if [ ! "$NETWORKS" ]; then - dialog \ + $DIALOG \ --backtitle "$DIALOG_BACKTITLE" \ --title "Error" \ --yesno "No wireless networks were found. Rescan?" \ @@ -228,7 +228,7 @@ while :; do fi exec 3>&1 - NETWORK=$( sh -c "dialog \ + NETWORK=$( sh -c "$DIALOG \ --extra-button \ --extra-label \"Rescan\" \ --backtitle \"$DIALOG_BACKTITLE\" \ @@ -247,7 +247,7 @@ while :; do f_dialog_title "Network Selection" f_dialog_yesno "Do you want to select the network manually?" || exit 1 f_dialog_input NETWORK "Enter SSID" || exit 1 - ENCRYPTION=$( dialog \ + ENCRYPTION=$( $DIALOG \ --backtitle "$DIALOG_BACKTITLE" \ --title "$DIALOG_TITLE" \ --menu "Select encryption type" \ @@ -273,7 +273,7 @@ done if echo $ENCRYPTION | grep -q 'PSK'; then exec 3>&1 - PASS=$( dialog \ + PASS=$( $DIALOG \ --insecure \ --backtitle "$DIALOG_BACKTITLE" \ --title "WPA Setup" \ @@ -295,7 +295,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the EOF elif echo $ENCRYPTION | grep -q EAP; then exec 3>&1 - USERPASS=$( dialog \ + USERPASS=$( $DIALOG \ --insecure \ --backtitle "$DIALOG_BACKTITLE" \ --title "WPA-Enterprise Setup" \ @@ -325,7 +325,7 @@ elif echo $ENCRYPTION | grep -q EAP; the EOF elif echo $ENCRYPTION | grep -q WEP; then exec 3>&1 - WEPKEY=$( dialog \ +
svn commit: r309937 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 20:41:27 2016 New Revision: 309937 URL: https://svnweb.freebsd.org/changeset/base/309937 Log: Whitespace (dialog options separated to minimize diffs) Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 20:25:59 2016 (r309936) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 20:41:27 2016 (r309937) @@ -60,9 +60,14 @@ country_set() "$BSDINSTALL_TMPETC/wpa_supplicant.conf" fi if [ "$error_str" ]; then - dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" \ - --yes-label Change --no-label Ignore --yesno \ - "Error while applying chosen settings ($error_str)" 0 0 + dialog \ + --backtitle "$DIALOG_BACKTITLE" \ + --title "Error" \ + --yes-label Change \ + --no-label Ignore \ + --yesno \ + "Error while applying chosen settings ($error_str)" \ + 0 0 if [ $? -eq $DIALOG_OK ]; then return $FAILURE # Restart else @@ -158,8 +163,11 @@ EOF # See if we succeeded wpa_cli ping >/dev/null 2>/dev/null if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then - dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \ - "Wireless cannot be configured without making changes to the local system!" \ 0 0 + dialog \ + --backtitle "$DIALOG_BACKTITLE" \ + --title "Error" \ + --msgbox "Wireless cannot be configured without making changes to the local system!" \ + 0 0 exit 1 fi @@ -175,9 +183,11 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 ) [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" [ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="" - dialog --backtitle "$DIALOG_BACKTITLE" --title "Regdomain/country" \ - --yesno "Change regdomain/country (now \ - $DEF_REGDOMAIN/$DEF_COUNTRY)?" 0 0 + dialog \ + --backtitle "$DIALOG_BACKTITLE" \ + --title "Regdomain/country" \ + --yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \ + 0 0 if [ $? -eq 0 ]; then while : do @@ -193,28 +203,41 @@ while :; do SCANSSID=0 output=$( wpa_cli scan 2>&1 ) f_dprintf "%s" "$output" - dialog --backtitle "$DIALOG_BACKTITLE" --title "Scanning" \ - --ok-label "Skip" \ - --pause "Waiting 5 seconds to scan for wireless networks..." \ - 9 40 5 || exit 1 + dialog \ + --backtitle "$DIALOG_BACKTITLE" \ + --title "Scanning" \ + --ok-label "Skip" \ + --pause "Waiting 5 seconds to scan for wireless networks..." \ + 9 40 5 || exit 1 SCAN_RESULTS=$( wpa_cli scan_results ) - NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' \ - '/..:..:..:..:..:../ {if (length($5) > 0) \ - printf("\"%s\"\t%s\n", $5, $4);}' | sort | uniq ) + NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' ' + /..:..:..:..:..:../ { + if (length($5) > 0) + printf("\"%s\"\t%s\n", $5, $4); + } + ' | sort | uniq ) if [ ! "$NETWORKS" ]; then - dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" \ - --yesno "No wireless networks were found. Rescan?" 0 0 && - continue + dialog \ + --backtitle "$DIALOG_BACKTITLE" \ + --title "Error" \ + --yesno "No wireless networks were found. Rescan?" \ + 0 0 && continue exit 1 fi exec 3>&1 - NETWORK=$( sh -c "dialog --extra-button --extra-label \"Rescan\" \ - --backtitle \"$DIALOG_BACKTITLE\" --title \"Network Selection\" \ - --menu \"Select a wireless network to connect to.\" 0 0 0 \ - $(echo $NETWORKS | tr '\n' ' ')" 2>&1 1>&3 ) + NETWORK=$( sh -c "dialog \ + --extra-button \ + --extra-label \"Rescan\" \ + --backtitle \"$DIALOG_BACKTITLE\" \ + --title \"Network Selection\" \ + --menu \"Select a wireless network to connect to.\" \ + 0 0 0 \ + $( echo $NETWORKS | tr '\n' ' ' )" \ + 2>&1 1>&3 + ) case $? in $DIALOG_OK) break @@ -224,9 +247,17 @@ while :; do f_dialog_title
svn commit: r309936 - head/bin/ed
Author: pfg Date: Mon Dec 12 20:25:59 2016 New Revision: 309936 URL: https://svnweb.freebsd.org/changeset/base/309936 Log: ed(1): Simplify some checks. The return type for both fread(3) and fwrite(3) cannot be negative, this renders some checks invalid and variable 'ct' unnecessary. Also bump 'len' to size_t to avoid signed/unsigned comparison warnings. Modified: head/bin/ed/buf.c Modified: head/bin/ed/buf.c == --- head/bin/ed/buf.c Mon Dec 12 20:04:31 2016(r309935) +++ head/bin/ed/buf.c Mon Dec 12 20:25:59 2016(r309936) @@ -46,9 +46,9 @@ char * get_sbuf_line(line_t *lp) { static char *sfbuf = NULL; /* buffer */ - static int sfbufsz = 0; /* buffer size */ + static size_t sfbufsz; /* buffer size */ - int len, ct; + size_t len; if (lp == _head) return NULL; @@ -64,7 +64,7 @@ get_sbuf_line(line_t *lp) } len = lp->len; REALLOC(sfbuf, sfbufsz, len + 1, NULL); - if ((ct = fread(sfbuf, sizeof(char), len, sfp)) < 0 || ct != len) { + if ((fread(sfbuf, sizeof(char), len, sfp)) != len) { fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot read temp file"; return NULL; @@ -81,7 +81,7 @@ const char * put_sbuf_line(const char *cs) { line_t *lp; - int len, ct; + size_t len; const char *s; if ((lp = (line_t *) malloc(sizeof(line_t))) == NULL) { @@ -110,7 +110,7 @@ put_sbuf_line(const char *cs) seek_write = 0; } /* assert: SPL1() */ - if ((ct = fwrite(cs, sizeof(char), len, sfp)) < 0 || ct != len) { + if ((fwrite(cs, sizeof(char), len, sfp)) != len) { sfseek = -1; fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot write temp file"; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309935 - in head/sys: arm/lpc mips/atheros mips/atheros/ar531x mips/mediatek mips/rt305x
Author: manu Date: Mon Dec 12 20:04:31 2016 New Revision: 309935 URL: https://svnweb.freebsd.org/changeset/base/309935 Log: Use the spibus accessor when applicable. MFC after:3 days Modified: head/sys/arm/lpc/lpc_spi.c head/sys/mips/atheros/ar531x/ar5315_spi.c head/sys/mips/atheros/ar71xx_spi.c head/sys/mips/mediatek/mtk_spi_v1.c head/sys/mips/mediatek/mtk_spi_v2.c head/sys/mips/rt305x/rt305x_spi.c Modified: head/sys/arm/lpc/lpc_spi.c == --- head/sys/arm/lpc/lpc_spi.c Mon Dec 12 19:46:49 2016(r309934) +++ head/sys/arm/lpc/lpc_spi.c Mon Dec 12 20:04:31 2016(r309935) @@ -141,12 +141,14 @@ static int lpc_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) { struct lpc_spi_softc *sc = device_get_softc(dev); - struct spibus_ivar *devi = SPIBUS_IVAR(child); + uint32_t cs; uint8_t *in_buf, *out_buf; int i; + spibus_get_cs(child, ); + /* Set CS active */ - lpc_gpio_set_state(child, devi->cs, 0); + lpc_gpio_set_state(child, cs, 0); /* Wait for FIFO to be ready */ while ((lpc_spi_read_4(sc, LPC_SSP_SR) & LPC_SSP_SR_TNF) == 0); @@ -168,7 +170,7 @@ lpc_spi_transfer(device_t dev, device_t } /* Set CS inactive */ - lpc_gpio_set_state(child, devi->cs, 1); + lpc_gpio_set_state(child, cs, 1); return (0); } Modified: head/sys/mips/atheros/ar531x/ar5315_spi.c == --- head/sys/mips/atheros/ar531x/ar5315_spi.c Mon Dec 12 19:46:49 2016 (r309934) +++ head/sys/mips/atheros/ar531x/ar5315_spi.c Mon Dec 12 20:04:31 2016 (r309935) @@ -155,9 +155,8 @@ ar5315_spi_transfer(device_t dev, device { struct ar5315_spi_softc *sc; uint8_t *buf_in, *buf_out; - struct spibus_ivar *devi = SPIBUS_IVAR(child); int lin, lout; - uint32_t ctl, cnt, op, rdat; + uint32_t ctl, cnt, op, rdat, cs; int i, j; sc = device_get_softc(dev); @@ -165,8 +164,10 @@ ar5315_spi_transfer(device_t dev, device if (sc->sc_debug & 0x8000) printf("ar5315_spi_transfer: CMD "); + spibus_get_cs(child, ); + /* Open SPI controller interface */ - ar5315_spi_chip_activate(sc, devi->cs); + ar5315_spi_chip_activate(sc, cs); do { ctl = SPI_READ(sc, ARSPI_REG_CTL); @@ -243,7 +244,7 @@ ar5315_spi_transfer(device_t dev, device } } - ar5315_spi_chip_deactivate(sc, devi->cs); + ar5315_spi_chip_deactivate(sc, cs); /* * Close SPI controller interface, restore flash memory mapped access. */ Modified: head/sys/mips/atheros/ar71xx_spi.c == --- head/sys/mips/atheros/ar71xx_spi.c Mon Dec 12 19:46:49 2016 (r309934) +++ head/sys/mips/atheros/ar71xx_spi.c Mon Dec 12 20:04:31 2016 (r309935) @@ -204,13 +204,15 @@ static int ar71xx_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) { struct ar71xx_spi_softc *sc; + uint32_t cs; uint8_t *buf_in, *buf_out; - struct spibus_ivar *devi = SPIBUS_IVAR(child); int i; sc = device_get_softc(dev); - ar71xx_spi_chip_activate(sc, devi->cs); + spibus_get_cs(child, ); + + ar71xx_spi_chip_activate(sc, cs); KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, ("TX/RX command sizes should be equal")); @@ -223,7 +225,7 @@ ar71xx_spi_transfer(device_t dev, device buf_out = (uint8_t *)cmd->tx_cmd; buf_in = (uint8_t *)cmd->rx_cmd; for (i = 0; i < cmd->tx_cmd_sz; i++) - buf_in[i] = ar71xx_spi_txrx(sc, devi->cs, buf_out[i]); + buf_in[i] = ar71xx_spi_txrx(sc, cs, buf_out[i]); /* * Receive/transmit data (depends on command) @@ -231,9 +233,9 @@ ar71xx_spi_transfer(device_t dev, device buf_out = (uint8_t *)cmd->tx_data; buf_in = (uint8_t *)cmd->rx_data; for (i = 0; i < cmd->tx_data_sz; i++) - buf_in[i] = ar71xx_spi_txrx(sc, devi->cs, buf_out[i]); + buf_in[i] = ar71xx_spi_txrx(sc, cs, buf_out[i]); - ar71xx_spi_chip_deactivate(sc, devi->cs); + ar71xx_spi_chip_deactivate(sc, cs); return (0); } Modified: head/sys/mips/mediatek/mtk_spi_v1.c == --- head/sys/mips/mediatek/mtk_spi_v1.c Mon Dec 12 19:46:49 2016 (r309934) +++ head/sys/mips/mediatek/mtk_spi_v1.c Mon Dec 12 20:04:31 2016 (r309935) @@ -224,12 +224,14 @@ mtk_spi_transfer(device_t dev, device_t { struct mtk_spi_softc *sc; uint8_t *buf, byte, *tx_buf; - struct spibus_ivar *devi = SPIBUS_IVAR(child); + uint32_t cs;
svn commit: r309934 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 19:46:49 2016 New Revision: 309934 URL: https://svnweb.freebsd.org/changeset/base/309934 Log: Consolidate redirects into here documents, with proper code indentation Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:33:40 2016 (r309933) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:46:49 2016 (r309934) @@ -69,9 +69,10 @@ country_set() return $SUCCESS # Skip fi else - : > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" - echo create_args_$WLAN_IFACE=\"$ifconfig_args\" >> \ - "$BSDINSTALL_TMPETC/rc.conf.net.wlan" + awk 'sub(/^\t\t/,"")||1' \ + > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + create_args_$WLAN_IFACE="$ifconfig_args" + EOF fi return $SUCCESS @@ -137,11 +138,13 @@ dialog_country_select() : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -echo "ctrl_interface=/var/run/wpa_supplicant" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -echo "eapol_version=2" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -echo "ap_scan=1" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -echo "fast_reauth=1" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -echo >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +ctrl_interface=/var/run/wpa_supplicant +eapol_version=2 +ap_scan=1 +fast_reauth=1 + +EOF # # Try to reach wpa_supplicant. If it isn't running and we can modify the @@ -246,12 +249,15 @@ if echo $ENCRYPTION | grep -q 'PSK'; the 2>&1 1>&3 ) \ || exec $0 $@ exec 3>&- -echo "network={ - ssid=\"$NETWORK\" - scan_ssid=$SCANSSID - psk=\"$PASS\" - priority=5 -}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" + awk 'sub(/^\t/,"")||1' \ + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + ssid="$NETWORK" + scan_ssid=$SCANSSID + psk="$PASS" + priority=5 + } + EOF elif echo $ENCRYPTION | grep -q EAP; then exec 3>&1 USERPASS=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \ @@ -262,20 +268,23 @@ elif echo $ENCRYPTION | grep -q EAP; the 2>&1 1>&3 ) \ || exec $0 $@ exec 3>&- -echo "network={ - ssid=\"$NETWORK\" - scan_ssid=$SCANSSID - key_mgmt=WPA-EAP" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -echo "$USERPASS" | awk ' -{ - if (NR == 1) { - printf "identity=\"%s\"\n", $1; - } else if (NR == 2) { - printf "password=\"%s\"\n", $1; + awk 'sub(/^\t/,"")||1' \ + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + ssid="$NETWORK" + scan_ssid=$SCANSSID + key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + { + if (NR == 1) { + printf "identity=\"%s\"\n", $1; + } else if (NR == 2) { + printf "password=\"%s\"\n", $1; + } + }' ) + priority=5 } -}' >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -echo " priority=5 -}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" + EOF elif echo $ENCRYPTION | grep -q WEP; then exec 3>&1 WEPKEY=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \ @@ -284,28 +293,36 @@ elif echo $ENCRYPTION | grep -q WEP; the "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 1>&3 ) \ || exec $0 $@ -echo "network={ - ssid=\"$NETWORK\" - scan_ssid=$SCANSSID - key_mgmt=NONE - wep_key0=\"$WEPKEY\" - wep_tx_keyidx=0 - priority=5 -}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" + awk 'sub(/^\t/,"")||1' \ + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + ssid="$NETWORK" + scan_ssid=$SCANSSID + key_mgmt=NONE + wep_key0="$WEPKEY" + wep_tx_keyidx=0 + priority=5 + } + EOF else # Open -echo "network={ - ssid=\"$NETWORK\" - scan_ssid=$SCANSSID - key_mgmt=NONE - priority=5 -}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" + awk 'sub(/^\t/,"")||1' \ + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + ssid="$NETWORK" + scan_ssid=$SCANSSID + key_mgmt=NONE + priority=5 + } + EOF fi # Connect to any open
svn commit: r309933 - head/usr.sbin/syslogd
Author: hrs Date: Mon Dec 12 19:33:40 2016 New Revision: 309933 URL: https://svnweb.freebsd.org/changeset/base/309933 Log: - Refactor listening socket list. All of the listening sockets are now maintained in a single linked-list in a transport-independent manner. - Use queue.h for linked-list structure. - Use linked-list for AllowedPeers. - Use getaddrinfo(8) even for Unix Domain sockets. - Use macros to type-casting from/to struct sockaddr{,_in,_in6}. - Define fu_* macro for union f_un to shorten the member names. - Remove an extra #include . - Add "static" to non-exported symbols. - !INET support is still incomplete but will be fixed later. There is no functional change except for some minor debug messages. Modified: head/usr.sbin/syslogd/Makefile head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/Makefile == --- head/usr.sbin/syslogd/Makefile Mon Dec 12 19:26:55 2016 (r309932) +++ head/usr.sbin/syslogd/Makefile Mon Dec 12 19:33:40 2016 (r309933) @@ -13,6 +13,9 @@ LIBADD= util WARNS?= 3 +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif Modified: head/usr.sbin/syslogd/syslogd.c == --- head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:26:55 2016 (r309932) +++ head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:33:40 2016 (r309933) @@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -116,43 +115,56 @@ __FBSDID("$FreeBSD$"); #define SYSLOG_NAMES #include -const char *ConfFile = _PATH_LOGCONF; -const char *PidFile = _PATH_LOGPID; -const char ctty[] = _PATH_CONSOLE; -static const char include_str[] = "include"; -static const char include_ext[] = ".conf"; +static const char *ConfFile = _PATH_LOGCONF; +static const char *PidFile = _PATH_LOGPID; +static const char ctty[] = _PATH_CONSOLE; +static const char include_str[] = "include"; +static const char include_ext[] = ".conf"; #definedprintf if (Debug) printf #defineMAXUNAMES 20 /* maximum number of user names */ -/* - * List of hosts for binding. - */ -static STAILQ_HEAD(, host) hqueue; -struct host { - char*name; - STAILQ_ENTRY(host) next; +#definesstosa(ss) ((struct sockaddr *)(ss)) +#definesatosin6(sa)((struct sockaddr_in6 *)(void *)(sa)) +#definesatosin(sa) ((struct sockaddr_in *)(void *)(sa)) +#defines6_addr32 __u6_addr.__u6_addr32 +#defineIN6_ARE_MASKED_ADDR_EQUAL(d, a, m) ( \ + (((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \ + (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \ + (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \ + (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 ) +/* + * List of peers and sockets for binding. + */ +struct peer { + const char *pe_name; + const char *pe_serv; + mode_t pe_mode; + STAILQ_ENTRY(peer) next; }; - -/* - * Unix sockets. - * We have two default sockets, one with 666 permissions, - * and one for privileged programs. - */ -struct funix { - int s; - const char *name; - mode_t mode; - STAILQ_ENTRY(funix) next; +struct socklist { + struct sockaddr_storage sl_ss; + int sl_socket; + struct peer *sl_peer; + STAILQ_ENTRY(socklist) next; }; -struct funix funix_secure ={ -1, _PATH_LOG_PRIV, S_IRUSR | S_IWUSR, - { NULL } }; -struct funix funix_default = { -1, _PATH_LOG, DEFFILEMODE, - { _secure } }; +static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INITIALIZER(shead); -STAILQ_HEAD(, funix) funixes = { _default, - &(funix_secure.next.stqe_next) }; +static struct peer funix_secure = { + .pe_name = _PATH_LOG_PRIV, + .pe_mode = S_IRUSR | S_IWUSR, + .next = {NULL}, +}; +static struct peer funix_default = { + .pe_name = _PATH_LOG, + .pe_mode = DEFFILEMODE, + .next = {_secure}, +}; +static STAILQ_HEAD(, peer) pqueue = { + _default, + _secure.next.stqe_next, +}; /* * Flags to logmsg(). @@ -172,7 +184,7 @@ STAILQ_HEAD(, funix) funixes = { _ */ struct filed { - struct filed *f_next; /* next in linked list */ + STAILQ_ENTRY(filed) next; /* next in linked list */ short f_type; /* entry type, see below */ short f_file; /* file descriptor */ time_t f_time;
svn commit: r309932 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 19:26:55 2016 New Revision: 309932 URL: https://svnweb.freebsd.org/changeset/base/309932 Log: Remove an unnecessary "return $?" at end of function Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:24:52 2016 (r309931) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:26:55 2016 (r309932) @@ -130,8 +130,6 @@ dialog_country_select() ) country_set "$regdomain" "$country" - - return $? } MAIN ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309931 - head/usr.sbin/syslogd
Author: hrs Date: Mon Dec 12 19:24:52 2016 New Revision: 309931 URL: https://svnweb.freebsd.org/changeset/base/309931 Log: Temporarily backout the previous commit because it was totally broken due to unresolved merge conflicts. Pointy hat to:hrs Modified: head/usr.sbin/syslogd/Makefile head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/Makefile == --- head/usr.sbin/syslogd/Makefile Mon Dec 12 19:24:32 2016 (r309930) +++ head/usr.sbin/syslogd/Makefile Mon Dec 12 19:24:52 2016 (r309931) @@ -13,9 +13,6 @@ LIBADD= util WARNS?= 3 -.if ${MK_INET_SUPPORT} != "no" -CFLAGS+= -DINET -.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif Modified: head/usr.sbin/syslogd/syslogd.c == --- head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:24:32 2016 (r309930) +++ head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:24:52 2016 (r309931) @@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -115,60 +116,43 @@ __FBSDID("$FreeBSD$"); #define SYSLOG_NAMES #include -static const char *ConfFile = _PATH_LOGCONF; -static const char *PidFile = _PATH_LOGPID; -static const char ctty[] = _PATH_CONSOLE; -static const char include_str[] = "include"; -static const char include_ext[] = ".conf"; +const char *ConfFile = _PATH_LOGCONF; +const char *PidFile = _PATH_LOGPID; +const char ctty[] = _PATH_CONSOLE; +static const char include_str[] = "include"; +static const char include_ext[] = ".conf"; #definedprintf if (Debug) printf #defineMAXUNAMES 20 /* maximum number of user names */ -#definesstosa(ss) ((struct sockaddr *)(ss)) -#ifdef INET -#definesatosin(sa) ((struct sockaddr_in *)(void *)(sa)) -#endif -#ifdef INET6 -#definesatosin6(sa)((struct sockaddr_in6 *)(void *)(sa)) -#defines6_addr32 __u6_addr.__u6_addr32 -#defineIN6_ARE_MASKED_ADDR_EQUAL(d, a, m) ( \ - (((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \ - (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \ - (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \ - (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 ) -#endif /* - * List of peers and sockets for binding. + * List of hosts for binding. */ -struct peer { - const char *pe_name; - const char *pe_serv; - mode_t pe_mode; - STAILQ_ENTRY(peer) next; -}; -struct socklist { - struct sockaddr_storage sl_ss; - int sl_socket; - struct peer *sl_peer; - STAILQ_ENTRY(socklist) next; +static STAILQ_HEAD(, host) hqueue; +struct host { + char*name; + STAILQ_ENTRY(host) next; }; -static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INITIALIZER(shead); -static struct peer funix_secure = { - .pe_name = _PATH_LOG_PRIV, - .pe_mode = S_IRUSR | S_IWUSR, - .next = {NULL}, -}; -static struct peer funix_default = { - .pe_name = _PATH_LOG, - .pe_mode = DEFFILEMODE, - .next = {_secure}, -}; -static STAILQ_HEAD(, peer) pqueue = { - _default, - _secure.next.stqe_next, +/* + * Unix sockets. + * We have two default sockets, one with 666 permissions, + * and one for privileged programs. + */ +struct funix { + int s; + const char *name; + mode_t mode; + STAILQ_ENTRY(funix) next; }; +struct funix funix_secure ={ -1, _PATH_LOG_PRIV, S_IRUSR | S_IWUSR, + { NULL } }; +struct funix funix_default = { -1, _PATH_LOG, DEFFILEMODE, + { _secure } }; + +STAILQ_HEAD(, funix) funixes = { _default, + &(funix_secure.next.stqe_next) }; /* * Flags to logmsg(). @@ -188,7 +172,7 @@ static STAILQ_HEAD(, peer) pqueue = { */ struct filed { - STAILQ_ENTRY(filed) next; /* next in linked list */ + struct filed *f_next; /* next in linked list */ short f_type; /* entry type, see below */ short f_file; /* file descriptor */ time_t f_time; /* time this was last written */ @@ -212,12 +196,6 @@ struct filed { pid_t f_pid; } f_pipe; } f_un; -#definefu_unamef_un.f_uname -#definefu_forw_hname f_un.f_forw.f_hname -#definefu_forw_addrf_un.f_forw.f_addr -#definefu_fnamef_un.f_fname -#definefu_pipe_pname f_un.f_pipe.f_pname -#definefu_pipe_pid
svn commit: r309930 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 19:24:32 2016 New Revision: 309930 URL: https://svnweb.freebsd.org/changeset/base/309930 Log: Use ternary operator Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:16:35 2016 (r309929) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:24:32 2016 (r309930) @@ -96,10 +96,7 @@ dialog_country_select() for (i = 1; i <= NF; i++) { printf "%s", $i if ($i ~ /[[:lower:]]/) - if ($(i+1) ~ /[[:lower:]]/) - printf "\\ " - else - printf "\n" + printf $(i+1) ~ /[[:lower:]]/ ? "\\ " : "\n" else printf " " } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309929 - head/sys/kern
Author: mjg Date: Mon Dec 12 19:16:35 2016 New Revision: 309929 URL: https://svnweb.freebsd.org/changeset/base/309929 Log: vfs: use vrefact in getcwd and fchdir Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Mon Dec 12 19:12:31 2016(r309928) +++ head/sys/kern/vfs_cache.c Mon Dec 12 19:16:35 2016(r309929) @@ -2066,9 +2066,9 @@ kern___getcwd(struct thread *td, char *b fdp = td->td_proc->p_fd; FILEDESC_SLOCK(fdp); cdir = fdp->fd_cdir; - VREF(cdir); + vrefact(cdir); rdir = fdp->fd_rdir; - VREF(rdir); + vrefact(rdir); FILEDESC_SUNLOCK(fdp); error = vn_fullpath1(td, cdir, rdir, tmpbuf, , buflen); vrele(rdir); Modified: head/sys/kern/vfs_syscalls.c == --- head/sys/kern/vfs_syscalls.cMon Dec 12 19:12:31 2016 (r309928) +++ head/sys/kern/vfs_syscalls.cMon Dec 12 19:16:35 2016 (r309929) @@ -754,7 +754,7 @@ sys_fchdir(td, uap) if (error != 0) return (error); vp = fp->f_vnode; - VREF(vp); + vrefact(vp); fdrop(fp, td); vn_lock(vp, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(vp); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r309891 - head/sys/kern
On Mon, Dec 12, 2016 at 08:12:57PM +0100, Edward Tomasz Napierala wrote: > On 1212T1833, Konstantin Belousov wrote: > > On Mon, Dec 12, 2016 at 03:22:22PM +, Edward Tomasz Napierala wrote: > > > Author: trasz > > > Date: Mon Dec 12 15:22:21 2016 > > > New Revision: 309891 > > > URL: https://svnweb.freebsd.org/changeset/base/309891 > > > > > > Log: > > > Avoid dereferencing NULL pointers in devtoname(). I've seen it panic, > > > called from ufs_print() in DDB. > > Calls from DDB should not panic even if accessing NULL pointers. > > Yeah, by "panic" I've meant the "reentering ddb" thing. It's not a panic > per se, but still breaks eg "show lockedvnodes". > > > That said, I also do not think that this is the right place to change. > > UFS um_dev should not be NULL for any active mount. > > After looking at this once again I agree. Looks like some kind of bug > specific to my sources at that point of time. Backed off. Thank you. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309928 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 19:12:31 2016 New Revision: 309928 URL: https://svnweb.freebsd.org/changeset/base/309928 Log: If you're not going to make use of the products of a match() in awk (e.g., RSTART and RLENGTH variables) then use ~ instead of match() Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:11:04 2016 (r309927) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:12:31 2016 (r309928) @@ -95,8 +95,8 @@ dialog_country_select() sub(/Regulatory.*/, "") for (i = 1; i <= NF; i++) { printf "%s", $i - if (match($i, /[[:lower:]]/)) - if (match($(i+1), /[[:lower:]]/)) + if ($i ~ /[[:lower:]]/) + if ($(i+1) ~ /[[:lower:]]/) printf "\\ " else printf "\n" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r309891 - head/sys/kern
On 1212T1833, Konstantin Belousov wrote: > On Mon, Dec 12, 2016 at 03:22:22PM +, Edward Tomasz Napierala wrote: > > Author: trasz > > Date: Mon Dec 12 15:22:21 2016 > > New Revision: 309891 > > URL: https://svnweb.freebsd.org/changeset/base/309891 > > > > Log: > > Avoid dereferencing NULL pointers in devtoname(). I've seen it panic, > > called from ufs_print() in DDB. > Calls from DDB should not panic even if accessing NULL pointers. Yeah, by "panic" I've meant the "reentering ddb" thing. It's not a panic per se, but still breaks eg "show lockedvnodes". > That said, I also do not think that this is the right place to change. > UFS um_dev should not be NULL for any active mount. After looking at this once again I agree. Looks like some kind of bug specific to my sources at that point of time. Backed off. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309927 - head/sys/kern
Author: trasz Date: Mon Dec 12 19:11:04 2016 New Revision: 309927 URL: https://svnweb.freebsd.org/changeset/base/309927 Log: Undo r309891. Konstantin is right in that this condition normally cannot happen - the um_dev field is assigned at mount and never written to afterwards. Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c == --- head/sys/kern/kern_conf.c Mon Dec 12 19:10:39 2016(r309926) +++ head/sys/kern/kern_conf.c Mon Dec 12 19:11:04 2016(r309927) @@ -1230,9 +1230,6 @@ const char * devtoname(struct cdev *dev) { - if (dev == NULL) - return (NULL); - return (dev->si_name); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309926 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 19:10:39 2016 New Revision: 309926 URL: https://svnweb.freebsd.org/changeset/base/309926 Log: Now that these variables do not contain the --default-item flag itself, change the name of the variable from $def_item_... to $default_... Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:10:14 2016 (r309925) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:10:39 2016 (r309926) @@ -81,8 +81,8 @@ dialog_country_select() { local input regdomains countries regdomain country local no_default="" - local def_item_regdomain="${1:-$no_default}" - local def_item_country="${2:-$no_default}" + local default_regdomain="${1:-$no_default}" + local default_country="${2:-$no_default}" # # Parse available countries/regdomains @@ -112,7 +112,7 @@ dialog_country_select() --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Regdomain selection\" \ --cancel-label \"Skip\" \ - --default-item \"$def_item_regdomain\" \ + --default-item \"$default_regdomain\" \ --no-items \ --stdout \ --menu \"Select your regdomain.\" \ @@ -126,7 +126,7 @@ dialog_country_select() --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Country selection\" \ --cancel-label \"Skip\" \ - --default-item \"$def_item_country\" \ + --default-item \"$default_country\" \ --stdout \ --menu \"Select your country.\" \ $height $width $rows $countries" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309925 - head/usr.sbin/syslogd
Author: hrs Date: Mon Dec 12 19:10:14 2016 New Revision: 309925 URL: https://svnweb.freebsd.org/changeset/base/309925 Log: - Refactor listening socket list. All of the listening sockets are now maintained in a single linked-list in a transport-independent manner. - Use queue.h for linked-list structure. - Use linked-list for AllowedPeers. - Use getaddrinfo(8) even for Unix Domain sockets. - Use macros to type-casting from/to struct sockaddr{,_in,_in6}. - Define fu_* macro for union f_un to shorten the member names. - Remove an extra #include . - Add "static" to non-exported symbols. - !INET support is still incomplete but will be fixed later. There is no functional change except for some minor debug messages. Modified: head/usr.sbin/syslogd/Makefile head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/Makefile == --- head/usr.sbin/syslogd/Makefile Mon Dec 12 19:09:17 2016 (r309924) +++ head/usr.sbin/syslogd/Makefile Mon Dec 12 19:10:14 2016 (r309925) @@ -13,6 +13,9 @@ LIBADD= util WARNS?= 3 +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif Modified: head/usr.sbin/syslogd/syslogd.c == --- head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:09:17 2016 (r309924) +++ head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:10:14 2016 (r309925) @@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -116,43 +115,60 @@ __FBSDID("$FreeBSD$"); #define SYSLOG_NAMES #include -const char *ConfFile = _PATH_LOGCONF; -const char *PidFile = _PATH_LOGPID; -const char ctty[] = _PATH_CONSOLE; -static const char include_str[] = "include"; -static const char include_ext[] = ".conf"; +static const char *ConfFile = _PATH_LOGCONF; +static const char *PidFile = _PATH_LOGPID; +static const char ctty[] = _PATH_CONSOLE; +static const char include_str[] = "include"; +static const char include_ext[] = ".conf"; #definedprintf if (Debug) printf #defineMAXUNAMES 20 /* maximum number of user names */ +#definesstosa(ss) ((struct sockaddr *)(ss)) +#ifdef INET +#definesatosin(sa) ((struct sockaddr_in *)(void *)(sa)) +#endif +#ifdef INET6 +#definesatosin6(sa)((struct sockaddr_in6 *)(void *)(sa)) +#defines6_addr32 __u6_addr.__u6_addr32 +#defineIN6_ARE_MASKED_ADDR_EQUAL(d, a, m) ( \ + (((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \ + (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \ + (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \ + (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 ) +#endif /* - * List of hosts for binding. + * List of peers and sockets for binding. */ -static STAILQ_HEAD(, host) hqueue; -struct host { - char*name; - STAILQ_ENTRY(host) next; +struct peer { + const char *pe_name; + const char *pe_serv; + mode_t pe_mode; + STAILQ_ENTRY(peer) next; }; - -/* - * Unix sockets. - * We have two default sockets, one with 666 permissions, - * and one for privileged programs. - */ -struct funix { - int s; - const char *name; - mode_t mode; - STAILQ_ENTRY(funix) next; +struct socklist { + struct sockaddr_storage sl_ss; + int sl_socket; + struct peer *sl_peer; + STAILQ_ENTRY(socklist) next; }; -struct funix funix_secure ={ -1, _PATH_LOG_PRIV, S_IRUSR | S_IWUSR, - { NULL } }; -struct funix funix_default = { -1, _PATH_LOG, DEFFILEMODE, - { _secure } }; +static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INITIALIZER(shead); -STAILQ_HEAD(, funix) funixes = { _default, - &(funix_secure.next.stqe_next) }; +static struct peer funix_secure = { + .pe_name = _PATH_LOG_PRIV, + .pe_mode = S_IRUSR | S_IWUSR, + .next = {NULL}, +}; +static struct peer funix_default = { + .pe_name = _PATH_LOG, + .pe_mode = DEFFILEMODE, + .next = {_secure}, +}; +static STAILQ_HEAD(, peer) pqueue = { + _default, + _secure.next.stqe_next, +}; /* * Flags to logmsg(). @@ -172,7 +188,7 @@ STAILQ_HEAD(, funix) funixes = { _ */ struct filed { - struct filed *f_next; /* next in linked list */ + STAILQ_ENTRY(filed) next; /* next in linked list */ short f_type; /* entry type, see below */ short f_file; /* file
svn commit: r309924 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 19:09:17 2016 New Revision: 309924 URL: https://svnweb.freebsd.org/changeset/base/309924 Log: Always pass --default-item parameter to dialog Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:07:42 2016 (r309923) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:09:17 2016 (r309924) @@ -126,7 +126,7 @@ dialog_country_select() --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Country selection\" \ --cancel-label \"Skip\" \ - $def_item_country \ + --default-item \"$def_item_country\" \ --stdout \ --menu \"Select your country.\" \ $height $width $rows $countries" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309923 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 19:07:42 2016 New Revision: 309923 URL: https://svnweb.freebsd.org/changeset/base/309923 Log: There is zero harm in always passing --default-item to dialog Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:01:04 2016 (r309922) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:07:42 2016 (r309923) @@ -80,8 +80,9 @@ country_set() dialog_country_select() { local input regdomains countries regdomain country - local def_item_regdomain= - local def_item_country= + local no_default="" + local def_item_regdomain="${1:-$no_default}" + local def_item_country="${2:-$no_default}" # # Parse available countries/regdomains @@ -104,14 +105,6 @@ dialog_country_select() } }' | sort -k 2 | tr '\n' ' ' ) - # Change default cursor position (if required). - if [ "$1" != "" ]; then - def_item_regdomain="--default-item $1" - fi - if [ "$2" != "" ]; then - def_item_country="--default-item $2" - fi - f_dialog_menu_size height width rows \"Regdomain selection\" \ \"$DIALOG_BACKTITLE\" \"Select your regdomain.\" \ \"\" $regdomains @@ -119,7 +112,7 @@ dialog_country_select() --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Regdomain selection\" \ --cancel-label \"Skip\" \ - $def_item_regdomain \ + --default-item \"$def_item_regdomain\" \ --no-items \ --stdout \ --menu \"Select your regdomain.\" \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r309921 - head/bin/dd
Yay! >From someone whom has tried 2>&- >&- on a dd run to be surprised to find the >status information go into the destination output file... Thank you! > On Dec 12, 2016, at 10:56 AM, Bartek Rutkowskiwrote: > > Author: robak (ports committer) > Date: Mon Dec 12 18:56:40 2016 > New Revision: 309921 > URL: https://svnweb.freebsd.org/changeset/base/309921 > > Log: > Fix regression when stdin/out/err fds are are overridden by shell. > > Submitted by:Pawel Biernacki > Reported by: ngie > Approved by: ngie > Sponsored by:Mysterious Code Ltd. > Differential Revision: https://reviews.freebsd.org/D8543 > > Modified: > head/bin/dd/dd.c > > Modified: head/bin/dd/dd.c > == > --- head/bin/dd/dd.c Mon Dec 12 18:55:41 2016(r309920) > +++ head/bin/dd/dd.c Mon Dec 12 18:56:40 2016(r309921) > @@ -142,8 +142,6 @@ setup(void) > in.fd = open(in.name, O_RDONLY, 0); > if (in.fd == -1) > err(1, "%s", in.name); > - if (caph_limit_stdin() == -1) > - err(1, "unable to limit capability rights"); > } > > getfdtype(); > @@ -176,8 +174,6 @@ setup(void) > } > if (out.fd == -1) > err(1, "%s", out.name); > - if (caph_limit_stdout() == -1) > - err(1, "unable to limit capability rights"); > } > > getfdtype(); > @@ -188,6 +184,16 @@ setup(void) > errno != ENOSYS) > err(1, "unable to limit capability rights"); > > + if (in.fd != STDIN_FILENO && out.fd != STDIN_FILENO) { > + if (caph_limit_stdin() == -1) > + err(1, "unable to limit capability rights"); > + } > + > + if (in.fd != STDOUT_FILENO && out.fd != STDOUT_FILENO) { > + if (caph_limit_stdout() == -1) > + err(1, "unable to limit capability rights"); > + } > + > if (in.fd != STDERR_FILENO && out.fd != STDERR_FILENO) { > if (caph_limit_stderr() == -1) > err(1, "unable to limit capability rights"); > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309922 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 19:01:04 2016 New Revision: 309922 URL: https://svnweb.freebsd.org/changeset/base/309922 Log: Centralize backtitle string Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 18:56:40 2016 (r309921) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 19:01:04 2016 (r309922) @@ -32,6 +32,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_include $BSDCFG_SHARE/dialog.subr +f_dialog_backtitle "FreeBSD Installer" FUNCTIONS @@ -59,7 +60,7 @@ country_set() "$BSDINSTALL_TMPETC/wpa_supplicant.conf" fi if [ "$error_str" ]; then - dialog --backtitle "FreeBSD Installer" --title "Error" \ + dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" \ --yes-label Change --no-label Ignore --yesno \ "Error while applying chosen settings ($error_str)" 0 0 if [ $? -eq $DIALOG_OK ]; then @@ -112,10 +113,10 @@ dialog_country_select() fi f_dialog_menu_size height width rows \"Regdomain selection\" \ - \"FreeBSD Installer\" \"Select your regdomain.\" \ + \"$DIALOG_BACKTITLE\" \"Select your regdomain.\" \ \"\" $regdomains regdomain=$( sh -c "dialog \ - --backtitle \"FreeBSD Installer\" \ + --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Regdomain selection\" \ --cancel-label \"Skip\" \ $def_item_regdomain \ @@ -126,10 +127,10 @@ dialog_country_select() ) f_dialog_menu_size height width rows \"Country selection\" \ - \"FreeBSD Installer\" \"Select your country.\" \ + \"$DIALOG_BACKTITLE\" \"Select your country.\" \ \"\" $countries country=$( sh -c "dialog \ - --backtitle \"FreeBSD Installer\" \ + --backtitle \"$DIALOG_BACKTITLE\" \ --title \"Country selection\" \ --cancel-label \"Skip\" \ $def_item_country \ @@ -160,13 +161,13 @@ echo >> "$BSDINSTALL_TMPETC/wpa_supplica # (wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] && wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) || - (dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ + (dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \ "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 # See if we succeeded wpa_cli ping >/dev/null 2>/dev/null if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then - dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ + dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \ "Wireless cannot be configured without making changes to the local system!" \ 0 0 exit 1 fi @@ -183,7 +184,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 ) [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" [ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="" - dialog --backtitle "FreeBSD Installer" --title "Regdomain/country" \ + dialog --backtitle "$DIALOG_BACKTITLE" --title "Regdomain/country" \ --yesno "Change regdomain/country (now \ $DEF_REGDOMAIN/$DEF_COUNTRY)?" 0 0 if [ $? -eq 0 ]; then @@ -201,7 +202,7 @@ while :; do SCANSSID=0 output=$( wpa_cli scan 2>&1 ) f_dprintf "%s" "$output" - dialog --backtitle "FreeBSD Installer" --title "Scanning" \ + dialog --backtitle "$DIALOG_BACKTITLE" --title "Scanning" \ --ok-label "Skip" \ --pause "Waiting 5 seconds to scan for wireless networks..." \ 9 40 5 || exit 1 @@ -212,7 +213,7 @@ while :; do printf("\"%s\"\t%s\n", $5, $4);}' | sort | uniq ) if [ ! "$NETWORKS" ]; then - dialog --backtitle "FreeBSD Installer" --title "Error" \ + dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" \ --yesno "No wireless networks were found. Rescan?" 0 0 && continue exit 1 @@ -220,7 +221,7 @@ while :; do exec 3>&1 NETWORK=$( sh -c "dialog --extra-button --extra-label \"Rescan\" \ - --backtitle \"FreeBSD Installer\" --title \"Network Selection\" \ + --backtitle \"$DIALOG_BACKTITLE\" --title \"Network Selection\" \ --menu \"Select a wireless network to connect to.\" 0 0 0 \ $(echo $NETWORKS | tr '\n' ' ')" 2>&1 1>&3 ) case $? in @@ -250,7 +251,7 @@ done if echo $ENCRYPTION | grep -q 'PSK'; then
svn commit: r309921 - head/bin/dd
Author: robak (ports committer) Date: Mon Dec 12 18:56:40 2016 New Revision: 309921 URL: https://svnweb.freebsd.org/changeset/base/309921 Log: Fix regression when stdin/out/err fds are are overridden by shell. Submitted by: Pawel BiernackiReported by: ngie Approved by: ngie Sponsored by: Mysterious Code Ltd. Differential Revision:https://reviews.freebsd.org/D8543 Modified: head/bin/dd/dd.c Modified: head/bin/dd/dd.c == --- head/bin/dd/dd.cMon Dec 12 18:55:41 2016(r309920) +++ head/bin/dd/dd.cMon Dec 12 18:56:40 2016(r309921) @@ -142,8 +142,6 @@ setup(void) in.fd = open(in.name, O_RDONLY, 0); if (in.fd == -1) err(1, "%s", in.name); - if (caph_limit_stdin() == -1) - err(1, "unable to limit capability rights"); } getfdtype(); @@ -176,8 +174,6 @@ setup(void) } if (out.fd == -1) err(1, "%s", out.name); - if (caph_limit_stdout() == -1) - err(1, "unable to limit capability rights"); } getfdtype(); @@ -188,6 +184,16 @@ setup(void) errno != ENOSYS) err(1, "unable to limit capability rights"); + if (in.fd != STDIN_FILENO && out.fd != STDIN_FILENO) { + if (caph_limit_stdin() == -1) + err(1, "unable to limit capability rights"); + } + + if (in.fd != STDOUT_FILENO && out.fd != STDOUT_FILENO) { + if (caph_limit_stdout() == -1) + err(1, "unable to limit capability rights"); + } + if (in.fd != STDERR_FILENO && out.fd != STDERR_FILENO) { if (caph_limit_stderr() == -1) err(1, "unable to limit capability rights"); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309919 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 18:52:22 2016 New Revision: 309919 URL: https://svnweb.freebsd.org/changeset/base/309919 Log: Whitespace Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 18:48:00 2016 (r309918) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 18:52:22 2016 (r309919) @@ -56,12 +56,12 @@ country_set() if [ "$iface_up" ]; then # Restart wpa_supplicant(8) (should not fail). wpa_supplicant -B -i $WLAN_IFACE -c \ - "$BSDINSTALL_TMPETC/wpa_supplicant.conf" + "$BSDINSTALL_TMPETC/wpa_supplicant.conf" fi if [ "$error_str" ]; then dialog --backtitle "FreeBSD Installer" --title "Error" \ - --yes-label Change --no-label Ignore --yesno \ - "Error while applying chosen settings ($error_str)" 0 0 + --yes-label Change --no-label Ignore --yesno \ + "Error while applying chosen settings ($error_str)" 0 0 if [ $? -eq $DIALOG_OK ]; then return $FAILURE # Restart else @@ -101,7 +101,7 @@ dialog_country_select() else printf " " } - }' | sort -k 2 | tr '\n' ' ' ) + }' | sort -k 2 | tr '\n' ' ' ) # Change default cursor position (if required). if [ "$1" != "" ]; then @@ -112,29 +112,31 @@ dialog_country_select() fi f_dialog_menu_size height width rows \"Regdomain selection\" \ - \"FreeBSD Installer\" \"Select your regdomain.\" \ - \"\" $regdomains + \"FreeBSD Installer\" \"Select your regdomain.\" \ + \"\" $regdomains regdomain=$( sh -c "dialog \ - --backtitle \"FreeBSD Installer\" \ - --title \"Regdomain selection\" \ - --cancel-label \"Skip\" \ - $def_item_regdomain \ - --no-items \ - --stdout \ - --menu \"Select your regdomain.\" \ - $height $width $rows $regdomains" ) + --backtitle \"FreeBSD Installer\" \ + --title \"Regdomain selection\" \ + --cancel-label \"Skip\" \ + $def_item_regdomain \ + --no-items \ + --stdout \ + --menu \"Select your regdomain.\" \ + $height $width $rows $regdomains" + ) f_dialog_menu_size height width rows \"Country selection\" \ \"FreeBSD Installer\" \"Select your country.\" \ \"\" $countries country=$( sh -c "dialog \ - --backtitle \"FreeBSD Installer\" \ - --title \"Country selection\" \ - --cancel-label \"Skip\" \ - $def_item_country \ - --stdout \ - --menu \"Select your country.\" \ - $height $width $rows $countries" ) + --backtitle \"FreeBSD Installer\" \ + --title \"Country selection\" \ + --cancel-label \"Skip\" \ + $def_item_country \ + --stdout \ + --menu \"Select your country.\" \ + $height $width $rows $countries" + ) country_set "$regdomain" "$country" @@ -195,8 +197,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then fi fi -while : -do +while :; do SCANSSID=0 output=$( wpa_cli scan 2>&1 ) f_dprintf "%s" "$output" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r309918 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Mon Dec 12 18:48:00 2016 New Revision: 309918 URL: https://svnweb.freebsd.org/changeset/base/309918 Log: Remove unnecessary `-n' parameter to head/tail Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 18:45:52 2016 (r309917) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 18:48:00 2016 (r309918) @@ -175,8 +175,8 @@ fi # if [ "$BSDINSTALL_CONFIGCURRENT" ]; then # Get current country/regdomain for selected interface - WLAN_IFACE=$( wpa_cli ifname | tail -n 1 ) - INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -n 1 ) + WLAN_IFACE=$( wpa_cli ifname | tail -1 ) + INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -1 ) DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 ) DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 ) [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"