#1054 Missing permission to update batch number

1.4
closed-fixed
Chris Travers
None
5
2014-02-10
2014-02-09
John Locke
No

After upgrading a database from 1.3, I cannot access any Cash -> Voucher -> * screen, because there is only SELECT access on the defaults table, other than the Postgres user, and the setting_increment function is not a security definer.

Error:
Access Denied
More information has been reported in the error logs at LedgerSMB.pm line 771 LedgerSMB::dberror('LedgerSMB::Setting=HASH(0x6dc5148)', 'ERROR: permission denied for relation defaults CONTEXT: SQL...') called at LedgerSMB.pm line 587 LedgerSMB::call_procedure('LedgerSMB::Setting=HASH(0x6dc5148)', 'procname', 'setting_increment', 'args', 'ARRAY(0x6d9de70)') called at LedgerSMB/Setting.pm line 76 LedgerSMB::Setting::increment('LedgerSMB::Setting=HASH(0x6dc5148)') called at LedgerSMB/Batch.pm line 30 LedgerSMB::Batch::get_new_info('LedgerSMB::Batch=HASH(0x6d9dbd0)') called at LedgerSMB/Scripts/vouchers.pm line 55 LedgerSMB::Scripts::vouchers::create_batch('LedgerSMB=HASH(0x3b6e170)') called at lsmb-request.pl line 108 LedgerSMB::Handler::ANON() called at /usr/share/perl5/Try/Tiny.pm line 76 eval {...} called at /usr/share/perl5/Try/Tiny.pm line 67 Try::Tiny::try('CODE(0x2721ac0)', 'Try::Tiny::Catch=REF(0x4baf880)') called at lsmb-request.pl line 120 LedgerSMB::Handler::call_script('vouchers.pl', 'LedgerSMB=HASH(0x3b6e170)') called at lsmb-request.pl line 84 require lsmb-request.pl called at /usr/local/ledger/ledger14/vouchers.pl line 8

Discussion

  • John Locke
    John Locke
    2014-02-09

    This also affects saving an invoice:

    [Sat Feb 08 16:46:08 2014] [error] [client 24.22.233.203] DBD::Pg::st execute failed: ERROR: permission denied for relation defaults at LedgerSMB/Form.pm line 3245, referer: https://xxx/ledger14/oe.pl
    [Sat Feb 08 16:46:08 2014] [error] [client 24.22.233.203] \tForm::update_defaults('Form=HASH(0x21974d8)', 'HASH(0x688f300)', 'sinumber', undef) called at LedgerSMB/IS.pm line 933, referer: https://xxx/ledger14/oe.pl
    [Sat Feb 08 16:46:08 2014] [error] [client 24.22.233.203] \tIS::post_invoice('IS', 'HASH(0x688f300)', 'Form=HASH(0x21974d8)') called at bin/is.pl line 1459, referer: https://xxx/ledger14/oe.pl

     
  • Chris Travers
    Chris Travers
    2014-02-10

    • assigned_to: Chris Travers
     
  • Chris Travers
    Chris Travers
    2014-02-10

    • status: open --> closed-fixed
     
  • Chris Travers
    Chris Travers
    2014-02-10

    6830