summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-06-21 00:49:32 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-06-21 00:52:26 -0400
commit7b9ed9a218d408390049c5e9618d4c9b90d33ccb (patch)
tree5bb367a08b6a4f4457c82733934961b2d2d0ee50 /src
parente07dc125d5567a40ef75467506df0765ad2cc5bc (diff)
conf.sh: Don't look at SUDO_USER if it's root
Fixes https://labs.parabola.nu/issues/1372
Diffstat (limited to 'src')
-rw-r--r--src/lib/conf.sh.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/conf.sh.in b/src/lib/conf.sh.in
index f2d515d..149e416 100644
--- a/src/lib/conf.sh.in
+++ b/src/lib/conf.sh.in
@@ -18,6 +18,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+if [[ "$(id -u "${SUDO_USER:-root}")" == 0 ]]; then
+ unset SUDO_USER
+fi
LIBREUSER="${SUDO_USER:-$USER}"
if [[ $LIBREUSER == "$USER" ]]; then
LIBREHOME=$HOME