[web] kill https-deny-anonymous option (closes #5193687)
It doesn't make much sense to prevent people from using https.
#!/bin/sh# This script starts an instance of Xvfb, the "fake" X server, runs a command# with that server available, and kills the X server when done. The return# value of the command becomes the return value of this script.## If anyone is using this to build a Debian package, make sure the package# Build-Depends on xvfb and xauth.set-ePROGNAME=xvfb-runSERVERNUM=99AUTHFILE=ERRORFILE=/dev/nullXVFBARGS="-screen 0 640x480x8"LISTENTCP="-nolisten tcp"XAUTHPROTO=.# Query the terminal to establish a default number of columns to use for# displaying messages to the user. This is used only as a fallback in the event# the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while the# script is running, and this cannot, only being calculated once.)DEFCOLUMNS=$(sttysize2>/dev/null|awk'{print $2}')||trueif!expr"$DEFCOLUMNS":"[[:digit:]]\+$">/dev/null2>&1;thenDEFCOLUMNS=80fi# Display a message, wrapping lines at the terminal width.message(){echo"$PROGNAME: $*"|fmt-t-w${COLUMNS:-$DEFCOLUMNS}}# Display an error message.error(){message"error: $*">&2}# Display a usage message.usage(){if[-n"$*"];thenmessage"usage error: $*"ficat<<EOFUsage: $PROGNAME [OPTION ...] COMMANDRun COMMAND (usually an X client) in a virtual X server environment.Options:-a --auto-servernum try to get a free server number, starting at --server-num-e FILE --error-file=FILE file used to store xauth errors and Xvfb output (default: $ERRORFILE)-f FILE --auth-file=FILE file used to store auth cookie (default: ./.Xauthority)-h --help display this usage message and exit-n NUM --server-num=NUM server number to use (default: $SERVERNUM)-l --listen-tcp enable TCP port listening in the X server-p PROTO --xauth-protocol=PROTO X authority protocol name to use (default: xauth command's default)-s ARGS --server-args=ARGS arguments (other than server number and "-nolisten tcp") to pass to the Xvfb server (default: "$XVFBARGS")EOF}# Find a free server number by looking at .X*-lock files in /tmp.find_free_servernum(){# Sadly, the "local" keyword is not POSIX. Leave the next line commented in# the hope Debian Policy eventually changes to allow it in /bin/sh scripts# anyway.#local ii=$SERVERNUMwhile[-f/tmp/.X$i-lock];doi=$(($i+1))doneecho$i}# Clean up filesclean_up(){if[-e"$AUTHFILE"];thenXAUTHORITY=$AUTHFILExauthremove":$SERVERNUM">>"$ERRORFILE"2>&1fiif[-n"$XVFB_RUN_TMPDIR"];thenif!rm-r"$XVFB_RUN_TMPDIR";thenerror"problem while cleaning up temporary directory"exit5fiXVFB_RUN_TMPDIR=fiif[-n"$XVFBPID"];thenkill"$XVFBPID"fi}# Parse the command line.ARGS=$(getopt--options+ae:f:hn:lp:s:w:\--longauto-servernum,error-file:,auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait:\--name"$PROGNAME"--"$@")GETOPT_STATUS=$?if[$GETOPT_STATUS-ne0];thenerror"internal error; getopt exited with status $GETOPT_STATUS"exit6fievalset--"$ARGS"while:;docase"$1"in-a|--auto-servernum)SERVERNUM=$(find_free_servernum);AUTONUM="yes";;-e|--error-file)ERRORFILE="$2";shift;;-f|--auth-file)AUTHFILE="$2";shift;;-h|--help)SHOWHELP="yes";;-n|--server-num)SERVERNUM="$2";shift;;-l|--listen-tcp)LISTENTCP="";;-p|--xauth-protocol)XAUTHPROTO="$2";shift;;-s|--server-args)XVFBARGS="$2";shift;;-w|--wait)shift;;--)shift;break;;*)error"internal error; getopt permitted \"$1\" unexpectedly"exit6;;esacshiftdoneif["$SHOWHELP"];thenusageexit0fiif[-z"$*"];thenusage"need a command to run">&2exit2fiif!whichxauth>/dev/null;thenerror"xauth command not found"exit3fi# tidy up after ourselvestrapclean_upEXITTERM# If the user did not specify an X authorization file to use, set up a temporary# directory to house one.if[-z"$AUTHFILE"];thenXVFB_RUN_TMPDIR="$(mktemp-d-t$PROGNAME.XXXXXX)"# Create empty file to avoid xauth warningAUTHFILE=$(tempfile-n"$XVFB_RUN_TMPDIR/Xauthority")fi# Start Xvfb.MCOOKIE=$(mcookie)tries=10while[$tries-gt0];dotries=$(($tries-1))XAUTHORITY=$AUTHFILExauthsource-<< EOF >>"$ERRORFILE" 2>&1add :$SERVERNUM $XAUTHPROTO $MCOOKIEEOF# handle SIGUSR1 so Xvfb knows to send a signal when it's ready to accept# connectionstrap:USR1(trap''USR1;XAUTHORITY=$AUTHFILEexecXvfb":$SERVERNUM"$XVFBARGS$LISTENTCP>>"$ERRORFILE"2>&1)&XVFBPID=$!wait||:ifkill-0$XVFBPID2>/dev/null;thenbreakelif[-n"$AUTONUM"];then# The display is in use so try another one (if '-a' was specified).SERVERNUM=$((SERVERNUM+1))SERVERNUM=$(find_free_servernum)continuefierror"Xvfb failed to start">&2XVFBPID=exit1done# Start the commandDISPLAY=:$SERVERNUMXAUTHORITY=$AUTHFILE"$@"2>&1&wait$!# vim:set ai et sts=4 sw=4 tw=80: