]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/wanna-build
Use the unprivilged service in case it's read-only and not security related.
[wannabuild.git] / bin / wanna-build
index ec0ea582b01de923c38b8f822263d5d7424f827f..4ba644ebbdb4149adb1e30f1c8a496a79d389ab5 100755 (executable)
@@ -303,8 +303,7 @@ END {
 }
 
 my $schema_suffix = '';
-# TODO: Base this on something else, like an option that is passed.
-if ($real_user eq 'nobody') {
+if (isin( $op_mode, qw(list info)) && $distribution !~ /security/) {
        $dbh = DBI->connect("DBI:Pg:service=wanna-build") || 
                die "FATAL: Cannot open database: $DBI::errstr\n";
        $schema_suffix = '_public';
@@ -2421,7 +2420,8 @@ sub user_table_name {
 sub get_source_info {
        my $name = shift;
        my $pkg = $dbh->selectrow_hashref('SELECT * FROM ' . 
-               table_name() . ' WHERE package = ? AND distribution = ?',
+               table_name() . ' WHERE package = ? AND distribution = ?' .
+               'FOR UPDATE',
                undef, $name, $distribution);
        return $pkg;
 }