]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
target_file_exists: Use non-root access for this check
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 28 Nov 2013 18:20:04 +0000 (18:20 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 28 Nov 2013 18:20:04 +0000 (18:20 +0000)
The new call of this in built_stash_file makes ts-*-build require root
access, which is not desirable.

The only other caller of target_file_exists is in ts-xen-install where
it is called on
                        /etc/default/xencommons
                        /etc/sysconfig/xencommons
                        /etc/default/xend
                        /etc/sysconfig/xend
all of which should be accessible as a normal user in a default config.

So change the access to use target_cmd_output rather than
target_cmd_output_root.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Osstest/TestSupport.pm

index 4954d8445fe8422c7686af51065170f5b0e23142..3bad5cac75be2e1840c7833c8784b73af46b1eb3 100644 (file)
@@ -457,7 +457,7 @@ sub target_putfilecontents_root_stash ($$$$;$) {
 
 sub target_file_exists ($$) {
     my ($ho,$rfile) = @_;
-    my $out= target_cmd_output_root($ho, "if test -e $rfile; then echo y; fi");
+    my $out= target_cmd_output($ho, "if test -e $rfile; then echo y; fi");
     return 1 if $out =~ m/^y$/;
     return 0 if $out !~ m/\S/;
     die "$rfile $out ?";