From 10dffc3ed32844de28b28c7db6f97849c7e4f01a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 16 Jun 2014 13:19:21 -0400 Subject: add parabolaweb-changepassword as a setuid program. --- Makefile | 4 ++++ parabolaweb-changepassword | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 parabolaweb-changepassword diff --git a/Makefile b/Makefile index 9bf082f..1a698ae 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ confdir = /etc/conf.d all: depends.txt install: \ + $(DESTDIR)$(sbindir)/parabolaweb-changepassword \ $(DESTDIR)$(sbindir)/parabolaweb-fcgi \ $(DESTDIR)$(sbindir)/parabolaweb-reporead-inotify \ $(DESTDIR)$(sbindir)/parabolaweb-update \ @@ -22,6 +23,9 @@ depends.txt: list-depends depends_static.txt $(DESTDIR)$(sbindir)/%: % install -Dm755 $< $@ +$(DESTDIR)$(sbindir)/parabolaweb-changepassword: parabolaweb-changepassword + install -Dm7755 $< $@ + $(DESTDIR)$(systemddir)/%.service: %.service install -Dm644 $< $@ diff --git a/parabolaweb-changepassword b/parabolaweb-changepassword new file mode 100644 index 0000000..96c285a --- /dev/null +++ b/parabolaweb-changepassword @@ -0,0 +1,24 @@ +#!/bin/bash -e + +# Copyright (c) 2014 Luke Shumaker +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# 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, see . + +. /etc/conf.d/parabolaweb + +[[ -e "${WEBDIR}/manage.py" ]] +[[ -n "${WEBUSER}" ]] +[[ $# -eq 0 ]] + +sudo -u "${WEBUSER}" python2 "${WEBDIR}/manage.py" changepassword "${USER}" -- cgit v1.2.3