From 8608eee4f244663b592b4e3214ccfcdb7c846884 Mon Sep 17 00:00:00 2001 From: Scott Barninger Date: Sat, 13 Feb 2010 12:32:42 -0500 Subject: [PATCH] Changes to run bat as nonroot user. --- bacula/platforms/rpm/bacula-bat.spec | 10 +++++++++- bacula/scripts/bat.console_apps.in | 1 + bacula/scripts/bat.desktop.xsu.in | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bacula/platforms/rpm/bacula-bat.spec b/bacula/platforms/rpm/bacula-bat.spec index a407fa55ef..f8998c52ec 100644 --- a/bacula/platforms/rpm/bacula-bat.spec +++ b/bacula/platforms/rpm/bacula-bat.spec @@ -197,6 +197,7 @@ rm -rf $RPM_BUILD_ROOT%{_prefix}/share/doc/bacula %if %{suse} cp -p src/qt-console/images/bat_icon.png $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png cp -p scripts/bat.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/bat.desktop +touch RPM_BUILD_ROOT%{sysconfdir}/bat.kdesu %else cp -p src/qt-console/images/bat_icon.png $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png cp -p scripts/bat.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bat.desktop @@ -207,12 +208,17 @@ ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bat %files %defattr(-,root,root) -%{_sbindir}/bat +%attr(-, root, %{daemon_group}) %{_sbindir}/bat %attr(-, root, %{daemon_group}) %dir %{sysconf_dir} %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bat.conf /usr/share/pixmaps/bat_icon.png /usr/share/applications/bat.desktop +# if user is a member of daemon_group then kdesu will run bat as user +%if %{suse} +%attr(0660, root, %{daemon_group}) %{sysconf_dir}/bat.kdesu +%endif + %if ! %{suse} # add the console helper files %config(noreplace,missingok) /etc/pam.d/bat @@ -261,6 +267,8 @@ fi rm -rf $RPM_BUILD_DIR/depkgs-qt %changelog +* Sat Feb 13 2010 D. Scott Barninger +- create file to allow bat to run nonroot with kdesu * Sat Jan 30 2010 D. Scott Barninger - fix consolehelper/xsu for suse packages * Sat Aug 1 2009 Kern Sibbald diff --git a/bacula/scripts/bat.console_apps.in b/bacula/scripts/bat.console_apps.in index ed71121637..3f660a9a5b 100644 --- a/bacula/scripts/bat.console_apps.in +++ b/bacula/scripts/bat.console_apps.in @@ -1,3 +1,4 @@ USER=root PROGRAM=@sbindir@/bat SESSION=true +FALLBACK=true diff --git a/bacula/scripts/bat.desktop.xsu.in b/bacula/scripts/bat.desktop.xsu.in index d4a66f554e..cced5a00c3 100644 --- a/bacula/scripts/bat.desktop.xsu.in +++ b/bacula/scripts/bat.desktop.xsu.in @@ -2,7 +2,7 @@ Name=Bacula Administration Tool Comment=Bacula Director Console Icon=/usr/share/pixmaps/bat_icon.png -Exec=gnomesu -t "Query" -c "@sbindir@/bat -c @sysconfdir@/bat.conf" -d -e -m "In order to run the bacula console as root, ^additional information is required." +Exec=kdesu -t -c "@sbindir@/bat -c @sysconfdir@/bat.conf" -f @sysconfdir@/bat.kdesu Terminal=false Type=Application Encoding=UTF-8 -- 2.39.5