Skip to content

Commit

Permalink
Added new --needroot option to require root permissions before extrac…
Browse files Browse the repository at this point in the history
…ting (bug #73)

Bumping version number to 2.3.0 for next release
  • Loading branch information
megastep committed Dec 21, 2016
1 parent 8189c05 commit 436cf30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
8 changes: 8 additions & 0 deletions makeself-header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ do
if test x"$copy" = xcopy; then
echo "Archive will copy itself to a temporary location"
fi
if test x"$NEED_ROOT" = xy; then
echo "Root permissions required for extraction"
fi
if test x"$KEEP" = xy; then
echo "directory \$targetdir is permanent"
else
Expand Down Expand Up @@ -366,6 +369,11 @@ if test x"\$quiet" = xy -a x"\$verbose" = xy; then
exit 1
fi
if test x"$NEED_ROOT" = xy -a \`id -u\` -ne 0; then
echo "Administrative privileges required for this archive (use su or sudo)" >&2
exit 1
fi
if test x"\$copy" \!= xphase2; then
MS_PrintLicense
fi
Expand Down
12 changes: 9 additions & 3 deletions makeself.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@
# Added --target dir to allow extracting directly to a target directory (Guy Baconniere)
# - 2.2.0 : Many bugfixes, updates and contributions from users. Check out the project page on Github for the details.
#
# (C) 1998-2013 by Stephane Peter <megastep@megastep.org>
# (C) 1998-2016 by Stephane Peter <megastep@megastep.org>
#
# This software is released under the terms of the GNU GPL version 2 and above
# Please read the license at http://www.gnu.org/copyleft/gpl.html
#

MS_VERSION=2.2.0
MS_VERSION=2.3.0
MS_COMMAND="$0"
unset CDPATH

Expand Down Expand Up @@ -107,6 +107,7 @@ MS_Usage()
echo " --nocomp : Do not compress the data"
echo " --notemp : The archive will create archive_dir in the"
echo " current directory and uncompress in ./archive_dir"
echo " --needroot : Check that the root user is extracting the archive before proceeding"
echo " --copy : Upon extraction, the archive will first copy itself to"
echo " a temporary directory"
echo " --append : Append more files to an existing Makeself archive"
Expand Down Expand Up @@ -153,6 +154,7 @@ KEEP_UMASK=n
QUIET=n
NOPROGRESS=n
COPY=none
NEED_ROOT=n
TAR_ARGS=cvf
TAR_EXTRA=""
DU_ARGS=-ks
Expand Down Expand Up @@ -248,14 +250,18 @@ do
NOOVERWRITE=y
shift
;;
--needroot)
NEED_ROOT=y
shift
;;
--header)
HEADER="$2"
if ! shift 2; then MS_Help; exit 1; fi
;;
--license)
LICENSE=`cat $2`
if ! shift 2; then MS_Help; exit 1; fi
;;
;;
--follow)
TAR_ARGS=cvhf
DU_ARGS=-ksL
Expand Down

0 comments on commit 436cf30

Please sign in to comment.