From 9cb44f599bc74a432c58148bc11825e889eff003 Mon Sep 17 00:00:00 2001
From: Tomas Cohen Arazi <tomascohen@gmail.com>
Date: Thu, 19 Dec 2013 15:15:19 -0300
Subject: [PATCH] Bug 10003: (followup) use sudo to get the instances list

Te only way of using the koha-* commands is using sudo. The only way
to get the list of enabled instances and other insight information of
the instances is through the use of sudo.
This followup makes the tab-completion bash script use sudo for calling
'koha-list' so it can read teh relevant data.

The drawback of this approach is that the user will be prompted for password
the first time he/she presses the tab key twice (triggering tab-completion).

I see no problem with that. And is the only option available, apart from the
setuid one. Which I don't like.

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
---
 debian/koha-common.bash-completion |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/koha-common.bash-completion b/debian/koha-common.bash-completion
index 934e279..b3eeeda 100644
--- a/debian/koha-common.bash-completion
+++ b/debian/koha-common.bash-completion
@@ -54,9 +54,9 @@ _koha_list_cmd()
     substract=`_build_substract_instances`
 
     if [[ "$substract" != "" ]]; then
-        instancelist=$( koha-list $filter | grep -v -x $substract )
+        instancelist=$( sudo koha-list $filter | grep -v -x $substract )
     else
-        instancelist=$( koha-list $filer )
+        instancelist=$( sudo koha-list $filer )
     fi
 
     COMPREPLY=( $(compgen -W "$instancelist" -- $cur ) )
-- 
1.7.2.5