From 53d06b5cf92690bb3ea1d4184ef0366bce188f5e Mon Sep 17 00:00:00 2001 From: Al Pou Date: Tue, 24 May 2022 21:45:31 -0400 Subject: [PATCH] Added step in makefile to make the i2pd executable belong to the _i2pd user and group --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile b/Makefile index c4c4a13..271d344 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,12 @@ install: chown -R _i2pd:_i2pd /var/lib/i2pd; \ fi +# These commands make the i2pd executable belong to the _i2pd user and +# group, and make it non-writable for all and non-executable for others. + @echo "Giving ownership of i2pd to _i2pd" + @chown _i2pd:_i2pd $$(which i2pd) + @chmod 550 $$(which i2pd) + # This command copies the RC script in the RC script folder to allow I2Pd to # be managed by the service supervisor. @echo "Installing i2pd service" @@ -50,6 +56,11 @@ uninstall: @rcctl disable i2pd @rm -f /etc/rc.d/i2pd +# These commands restore the ownership and permissions of i2pd. + @echo "Giving ownership of i2pd back to root" + @chown root:wheel $$(which i2pd) + @chmod 755 $$(which i2pd) + # This command removes the _i2pd user and its home if they exist. @if userinfo -e _i2pd; then \ echo "Removing _i2pd user"; \