Deleted Added
full compact
mustberoot.subr (245437) mustberoot.subr (249746)
1if [ ! "$_MUSTBEROOT_SUBR" ]; then _MUSTBEROOT_SUBR=1
2#
1if [ ! "$_MUSTBEROOT_SUBR" ]; then _MUSTBEROOT_SUBR=1
2#
3# Copyright (c) 2006-2012 Devin Teske
3# Copyright (c) 2006-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9# 1. Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright

--- 7 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9# 1. Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright

--- 7 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/share/mustberoot.subr 245437 2013-01-14 21:03:34Z dteske $
27# $FreeBSD: head/usr.sbin/bsdconfig/share/mustberoot.subr 249746 2013-04-22 05:02:34Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." mustberoot.subr
34f_include $BSDCFG_SHARE/dialog.subr
35

--- 209 unchanged lines hidden (view full) ---

245 HOSTNAME=$(hostname)
246 displaynum="${DISPLAY#*:}"
247 xauth -f ~/.Xauthority extract - $HOSTNAME/unix:$displaynum \
248 $HOSTNAME:$displaynum | sudo sh -c 'xauth -ivf \
249 ~root/.Xauthority merge - > /dev/null 2>&1'
250 fi
251
252 # Re-execute ourselves with sudo(8)
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." mustberoot.subr
34f_include $BSDCFG_SHARE/dialog.subr
35

--- 209 unchanged lines hidden (view full) ---

245 HOSTNAME=$(hostname)
246 displaynum="${DISPLAY#*:}"
247 xauth -f ~/.Xauthority extract - $HOSTNAME/unix:$displaynum \
248 $HOSTNAME:$displaynum | sudo sh -c 'xauth -ivf \
249 ~root/.Xauthority merge - > /dev/null 2>&1'
250 fi
251
252 # Re-execute ourselves with sudo(8)
253 f_dprintf "%s: Becoming root via sudo(8)..." mustberoot.subr
253 if [ $ARGC -gt 0 ]; then
254 exec sudo "$0" $ARGV
255 else
256 exec sudo "$0"
257 fi
258 exit $? # Never reached unless error
259}
260

--- 167 unchanged lines hidden ---
254 if [ $ARGC -gt 0 ]; then
255 exec sudo "$0" $ARGV
256 else
257 exec sudo "$0"
258 fi
259 exit $? # Never reached unless error
260}
261

--- 167 unchanged lines hidden ---