#!/bin/sh

# gnome-sudo-helper -- GUI frontend to sudo (helper script).

#  $Progeny: gnome-sudo/src/gnome-sudo-helper,v 1.2 2001/05/03 21:33:43 epg Exp $

#  Copyright (C) 2001  Progeny Linux Systems, Inc.
#  AUTHORS: Eric Gillespie, Jr. <epg@progeny.com>

#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License, version 2,  as
#  published by the Free Software Foundation.

#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.

#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

# Alert gnome-sudo that sudo has passed and we've gotten this far.
printf "GNOME_SUDO_DONE " >&2

dir="$1"
shift

command="$1"
shift

export XAUTHORITY=$dir/.Xauthority

# gnome-sudo redirected stderr, this sets it back
exec 2>&1

"$command" "$@"

rm -rf $dir
