From 17ed456c2ee8542e63969cbca81714edf2e8a374 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 16 Feb 2019 09:29:04 +0100 Subject: [PATCH] change proxy user from www-data to backup --- debian/rules | 4 ++-- src/auth_helpers.rs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/rules b/debian/rules index 44ea2a18..e073d9e4 100755 --- a/debian/rules +++ b/debian/rules @@ -10,12 +10,12 @@ export BUILD_MODE=release override_dh_auto_build: dh_auto_build -- \ - PROXY_USER=www-data \ + PROXY_USER=backup \ LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) override_dh_auto_install: dh_auto_install -- \ - PROXY_USER=www-data \ + PROXY_USER=backup \ LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) override_dh_installinit: diff --git a/src/auth_helpers.rs b/src/auth_helpers.rs index f8805816..fa0217dd 100644 --- a/src/auth_helpers.rs +++ b/src/auth_helpers.rs @@ -42,7 +42,9 @@ pub fn generate_csrf_key() -> Result<(), Error> { tools::file_set_contents( &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(()) }