change proxy user from www-data to backup

This commit is contained in:
Dietmar Maurer 2019-02-16 09:29:04 +01:00
parent 5d14eb6a76
commit 17ed456c2e
2 changed files with 5 additions and 3 deletions

4
debian/rules vendored
View File

@ -10,12 +10,12 @@ export BUILD_MODE=release
override_dh_auto_build: override_dh_auto_build:
dh_auto_build -- \ dh_auto_build -- \
PROXY_USER=www-data \ PROXY_USER=backup \
LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
override_dh_auto_install: override_dh_auto_install:
dh_auto_install -- \ dh_auto_install -- \
PROXY_USER=www-data \ PROXY_USER=backup \
LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
override_dh_installinit: override_dh_installinit:

View File

@ -42,7 +42,9 @@ pub fn generate_csrf_key() -> Result<(), Error> {
tools::file_set_contents( tools::file_set_contents(
&path, &pem, Some(Mode::from_bits_truncate(0o0640)))?; &path, &pem, Some(Mode::from_bits_truncate(0o0640)))?;
nix::unistd::chown(&path, Some(nix::unistd::ROOT), Some(nix::unistd::Gid::from_raw(33)))?; let (_, backup_gid) = tools::getpwnam_ugid("backup")?;
nix::unistd::chown(&path, Some(nix::unistd::ROOT), Some(nix::unistd::Gid::from_raw(backup_gid)))?;
Ok(()) Ok(())
} }