(a) amounts paid in settling or otherwise disposing of a threatened action, or pending action with or without court approval, or
(b) expenses incurred in defending a threatened action, or pending action which is settled or otherwise disposed of without court approval. 4. A general partner who has been wholly successful on the merits or otherwise in the defense of an action of the character described in subdivision two of this section shall be entitled to indemnification as authorized in subdivisions two and three of this section. 5. Except as provided in subdivision four of this section, any indemnification under subdivision two, unless ordered by a court under subdivision six, shall be made by the limited partnership only if authorized in the specific case
(a) by a majority of all the general partners, excluding any partners who are parties to such action, upon a finding that the general partner to be indemnified has met the standard of conduct set forth in subdivision two, or,
(b) if a majority of general partners who are not parties to such action is not obtainable with due diligence by the general partner or partners, upon the opinion of independent legal counsel that indemnification is proper in the circumstances because the standard of conduct set forth in subdivision two has been met by the general partner to be indemnified. 6. (a) Notwithstanding the failure of the limited partnership to provide indemnification, and despite any contrary determination by the general partners, indemnification shall be awarded by a court to the extent authorized under subdivisions two and four of this section. Application therefor may be made, in every case, either
(i) in the action in which the expenses were incurred or other amounts were paid, or
(ii) to the supreme court in a separate proceeding, in which case the application shall set forth the disposition of any previous application made to any court for the same relief and also reasonable cause for the failure to make application for such relief in the action in which the expenses were incurred or other amounts were paid.
(b) The application shall be made in such manner and form as may be required by the applicable rules of court or, in the absence thereof, by direction of a court to which it is made. Such application shall be on notice to the limited partnership, given through a general partner, if any, other than the general partner making the application. The court may also direct that notice be given at the expense of the limited partnership, to the limited partners and such other persons as it may designate in such manner as it may require. When there is no general partner other than those making the application, notice shall be given, as herein provided, to the limited partners.
(c) When indemnification is sought by judicial action, the court may allow a general partner such reasonable expenses, including attorneys' fees, during the pendency of the litigation as are necessary in connection with his defense therein, if the court shall find that the defendant has by his pleadings or during the course of the litigation raised genuine issues of fact or law. 7. Expenses incurred in defending an action of the character described in subdivision two of this section may be paid voluntarily by the limited partnership in advance of the final disposition of such action if authorized under subdivision five of this section. 8. All expenses incurred in defending an action which are allowed by the court under subdivisions six or seven of this section shall be repaid in case the general partner receiving such advancement or allowance is ultimately found, under the procedure set forth in this section, not to be entitled to indemnification or, where indemnification is granted, to the extent the expenses so advanced by the general partnership or allowed by the court exceed the indemnification to which he is entitled. 9. No indemnification, advancement or allowance shall be made under this section in any circumstance where it appears
(a) that indemnification would be inconsistent with a provision of the certificate of limited partnership, agreement, partnership resolution or other proper partnership action, in effect at the time of accrual of the alleged cause of action asserted in the threatened or pending action in which the expenses were incurred or other amounts were paid, which prohibits or otherwise limits indemnification; or
(b) if there has been a settlement approved by the court, that the indemnification would be inconsistent with any condition with respect to indemnification expressly imposed by the court in approving the settlement.