summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-16 13:19:21 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-16 13:19:21 -0400
commit10dffc3ed32844de28b28c7db6f97849c7e4f01a (patch)
tree3aee9fae5748c9abddfcb2a3adc1a6ee0562720f
parent15fbd71774a67ad84b52b3908733259844429024 (diff)
add parabolaweb-changepassword as a setuid program.v20140616
-rw-r--r--Makefile4
-rw-r--r--parabolaweb-changepassword24
2 files changed, 28 insertions, 0 deletions
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 <lukeshu@sbcglobal.net>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+. /etc/conf.d/parabolaweb
+
+[[ -e "${WEBDIR}/manage.py" ]]
+[[ -n "${WEBUSER}" ]]
+[[ $# -eq 0 ]]
+
+sudo -u "${WEBUSER}" python2 "${WEBDIR}/manage.py" changepassword "${USER}"