
68 Cal.2d 619 (1968)
DEWEY MERRITT, Plaintiff and Appellant,
v.
J. A. STAFFORD COMPANY et al., Defendants and Respondents; STUYVESANT INSURANCE COMPANY, Surety and Respondent.
L. A. No. 29545. 
Supreme Court of California. In Bank.  
May 27, 1968.
 Wild, Christensen, Barnard & Wild, Magana, Olney, Levy, Cathcart & Gelfand, Magana, Olney, Levy & Cathcart and Ellis J. Horvitz for Plaintiff and Appellant.
 Anderson, McPharlin & Conners, Peter R. Regal and Henry F. Walker for Surety and Respondent.
 No appearance for Defendants and Respondents.
 PETERS, J.
 Dewey Merritt has appealed from an order denying his motion for judgment on an appeal bond.
 Merritt recovered judgment against the J. A. Stafford Company, a corporation, and one of its employees for $434,441.68 for personal injuries suffered in a truck accident, and Merritt's employer recovered judgment for $21,255.93 against Stafford and its employee for property damage.  [fn. 1]
 Stafford and its employee filed a notice of appeal, and on May 22, 1964, Stuyvesant Insurance Company filed an "undertaking for Appeal Bond as provided by Section 942 C.C.P." The document recites that Stuyvesant obligates itself "under said statutory obligations" in the sum of $181,883.90. The judgment was affirmed, and the remittitur was filed on October 13, 1965.
 Stuyvesant and Reserve Insurance Company filed an action for declaratory relief alleging that Reserve has issued to Stafford a liability insurance policy providing that the limit of liability for injury to any one person was $100,000 and that the company shall pay "all costs and all interest accruing after entry of judgment until the company has paid or tendered or deposited in court such part of such judgment as does not exceed the limit of the company's liability thereon. ..." It was also alleged that Stuyvesant was the reinsurer of Reserve, that on May 8, 1964, Reserve tendered to plaintiff $100,000, which tender was refused, that on September 21, 1965, Reserve tendered in writing $100,000 "plus costs and interest thereon," that Merritt's attorneys previously indicated that the tender would be refused, that controversies existed as to the validity of the tenders, the amount of interest due, the validity of the appeal bond, and as to whether the liability on appeal bond, if valid, is in excess of the limits of the Reserve policy. *622
 The trial court issued a temporary restraining order in the declaratory relief action enjoining Merritt from seeking an ex parte judgment against Stuyvesant but providing that upon notice Merritt could move for judgment on the appeal bond.
 In January 1966, Merritt noticed a motion for judgment on the appeal bond, alleging that no part of the judgment in the personal injury action had been paid. Stuyvesant opposed the motion, and filed an affidavit by its attorney alleging that in September 1964 (which was after the filing of the appeal in the personal injury and property damage action but before affirmance) Merritt and Stafford entered into an agreement which recites that Stafford's insurance carrier had failed to post an appeal bond to stay execution in the amount required by section 942 of the Code of Civil Procedure, that Merritt intends to levy execution against Stafford to satisfy his judgment, that Stafford assigns any cause of action it might have against its insurer for bad faith, negligence, or breach of contract arising out of the truck accident, that Stafford will pay to Merritt $20,000, and that the $20,000 shall not be credited against the judgment, and that Merritt will not levy execution against Stafford until the final termination of any assigned cause of action and the pending appeal in the personal injury and property damage action.
 The motion for judgment on the appeal bond was denied, and this appeal followed.
 [1] Orders relating to enforcement of a judgment either by enforcing it or staying its execution are appealable as special orders made after final judgment. (Code Civ. Proc.,  963; Raff v. Raff, 61 Cal.2d 514, 517-519 [39 Cal.Rptr. 366, 393 P.2d 678]; Baum v. Baum, 51 Cal.2d 610, 611 et seq. [335 P.2d 481].) In furtherance of this rule, an order quashing and recalling a writ of execution has been held appealable (Stegge v. Wilkerson, 189 Cal.App.2d 1, 4 [10 Cal.Rptr. 867]); an order denying an application for an order charging a partner's interest has been held appealable (Baum v. Baum, supra, 51 Cal.2d 610, 611 et seq.), and the judgment in a third party claim proceeding under section 689b of the Code of Civil Procedure has been held appealable (Embree Uranium Co. v. Liebel, 169 Cal.App.2d 256, 258 [337 P.2d 159]). Like the aforementioned orders, an order denying a motion for judgment on an appeal bond relates directly to the enforcement of a judgment, and such an order was reviewed on appeal, without discussion, in Chas. F. Harper Co. v. DeWitt etc. Co., 10 Cal.2d 467 [75 P.2d 65]. *623
 It is true that it has been held that a judgment on an appeal bond may not be appealed by the surety. (Eg., Hood v. Verdugo Lbr. Co., 219 Cal. 558, 560 [27 P.2d 897].) This is not because the matter does not relate to the enforcement of a judgment, but, as pointed out in Hood, is because the judgment against the surety is a consent judgment. The order appealed from in the instant case, of course, was not entered by consent. [2] We are satisfied that an order denying a motion for judgment on an appeal bond is an appealable order.
 [3] Section 942 of the Code of Civil Procedure provides in part that an appeal from a money judgment does not stay execution unless an adequate undertaking is filed and that a surety bond by an authorized corporation for a stay pending appeal of a judgment directing the payment of money shall be one and one-half times the amount named in the judgment or order appealed. Although the section provides for enforcement of an adequate undertaking after affirmance, it contains no provision as to the enforceability, after affirmance, of a corporate surety bond which is for an amount less than one and one-half times the amount named in the judgment appealed.  [fn. 2]
 In Chas. F. Harper Co. v. DeWitt etc. Co., supra, 10 Cal.2d 467, 469-470, the court discussed the position of the sureties upon an appeal bond after affirmance as follows: "Although sureties upon such a bond became parties to the original action (Hawley v. Gray Bros. etc. Co., 127 Cal. 560 [60 P. 437]; Hogan v. Locke-Paddon, 91 Cal.App.2d 606 [267 P. 392]), their position is not the same as that of the defendants. When the judgment becomes final it cannot be executed against them without further proceedings. They are not entitled to notice of subsequent steps in the proceedings and have no right to participate in them. By signing an undertaking upon appeal, a surety consents that judgment may be entered against him on motion for the amount of the judgment as affirmed (Gray *624 v. Cotton et al., 174 Cal. 256 [162 P. 1019]), and he becomes a party to the action for the limited purpose of giving the court jurisdiction to render and enforce a judgment against him (Meredith v. Santa Clara Min. Assn. of Baltimore, 60 Cal. 617). In effect, the bond is a stipulation for judgment upon a certain contingency. ..."
 "The obligation of the sureties is upon the undertaking, an instrument in writing, not upon the judgment."
 It was held that liability upon the undertaking accrues from the affirming of the judgment. (Chas. F. Harper Co. v. DeWitt etc. Co., supra, 10 Cal.2d at p. 470.)
 It has been held that undertakings may be enforced although not in exact conformity with the statute, that the defect may be waived, that the obligor is in no position to complain that his obligation is less onerous than that provided for by statute, and that, where the appellant has the benefit of the bond, the obligor may not rely upon the fact that the respondent could but did not object to the sufficiency of the bond. (Murdock v. Brooks, 38 Cal. 596, 602-603; Hathaway v. Davis, 33 Cal. 161, 169-170; Dore v. Covey, 13 Cal. 502, 508 et seq.; see Moffat v. Greenwalt, 90 Cal. 368, 371 [27 P. 296]; Hammond v. United States Fid. & Guar. Co., 29 Cal.App. 464, 468-469 [155 P. 1023].)
 [4] "The sureties generally are held liable on a supersedeas or appeal bond, although it was legally insufficient to effect a stay of proceedings, where as a matter of fact there was in effect a stay, no execution being issued, nor any attempt made to collect an execution if issued, or to enforce the judgment." (Annot. 120 A.L.R. 1062.) The above annotation cites more than 50 cases for the above statement and points out that receipt by the obligors of the contemplated benefits of the bond furnishes a sufficient consideration for enforcement. (120 A.L.R. at p. 1065.)
 Cases cited by Stuyvesant such as Estate of Kennedy, 129 Cal. 384 [62 P. 64], Reay v. Butler, 118 Cal. 113 [50 P. 375], and Powers v. Chabot, 93 Cal. 266 [28 P. 1070], which held appeal bonds wholly void and unenforceable after affirmance on appeal, are distinguishable. Those cases involve judgments which were stayed by operation of law without necessity of a bond, orders which were not subject to execution or other immediate enforcement against the appellant, or a judgment for a sale of perishables as to which it would be against public policy to permit a stay pending appeal. As to the first two kinds of judgments and orders, the respondent could not *625 forego any rights in reliance on the bonds, and there was no consideration. As to the third, the public policy involved serves to distinguish it.
 [5] There is nothing in section 942 of the Code of Civil Procedure or the other sections dealing with stay bonds which indicates that an appellant should not be able to get together with his judgment creditor and agree that execution should be stayed if the appellant will post a bond in an amount less than that required by statute and will also furnish additional consideration for a stay. As we have seen, the liability is on the undertaking, not the judgment, and there is no reason why the parties should not be permitted by agreement to determine what constitutes a sufficient undertaking. (Cf. Hammond v. United States Fid. & Guar. Co., supra, 29 Cal.App. 464, 468 (where court is to fix amount of undertaking the parties may stipulate as to the amount).) The fact that additional consideration is furnished does not show that the respondent's determination not to seek enforcement of the judgment pending appeal is not based in part on the existence of the bond, and thus there is consideration for the bond.
 The same rule applies where, as here, the appellant and respondent agree, after the filing of a bond in an inadequate amount, that further consideration should be paid so that the respondent will not seek execution. If the respondent does not seek execution in such a case, the obligor on the bond has received the benefit sought.
 [6] It follows that the giving of consideration in addition to a bond in an inadequate amount does not preclude resort to the bond after affirmance of the appeal where the judgment creditor does not seek execution prior to affirmance and that this is true even if the bond itself would not be effective to stay execution. Stuyvesant's argument that the additional consideration precludes resort to the bond is premised on two points, namely, that the bond itself was ineffective to stay execution and that the creditor by seeking additional consideration did not rely on the bond. The latter premise being incorrect the argument fails.
 Moreover, Stuyvesant's first premise is also defective. We have concluded that a bond furnished by a liability insurer to stay the part of a judgment within the policy limits is effective to stay enforcement of that part of the judgment.
 Protection of the right of appeal of insurers, and consideration of the rights of insureds and of the judgment creditor require such a result. Liability insurance is ordinarily written *626 with limits, and when a judgment is obtained in excess of those limits, an insurer should not be faced with the alternatives of either posting a bond for the entire judgment or refusing to post a bond at all. [7] In every contract, including policies of insurance, there is an implied covenant of good faith and fair dealing that neither party will do anything which will injure the right of the other party to receive the benefits of the agreement. (Crisci v. Security Ins. Co., 66 Cal.2d 425, 429 [58 Cal.Rptr. 13, 426 P.2d 173]; Comunale v. Traders & General Ins. Co., 50 Cal.2d 654, 658 [328 P.2d 198, 68 A.L.R.2d 883].) Failure of the insurer to file any bond may result in the insured losing large amounts of property due to execution sales during the appeal and thus losing in large part, if not entirely, the benefits of the insurance. On the other hand, the insurer cannot be required to post a bond for the entire judgment when its liability does not extend to the entire judgment. Fairness to the insurer and the insured requires that the insurer be permitted to fulfill its covenant of good faith and fair dealing by filing an appeal bond in an amount sufficient to cover the part of the judgment for which it is liable and that the respondent be denied his right to seek execution with regard to such part of the judgment. Such a rule does no harm to the respondent. As to the excess part of the judgment he may seek execution or enter into an agreement to stay execution with the insured, and as to the part of the judgment within the policy limits he will be protected by the bond.  [fn. 3]
 [8] In other words, where there is a judgment in excess of the policy limits, the insurer and the insured have separate and differing interests; the insurer may furnish a bond for the portion of the judgment within the policy limits, and the bond will be given effect pending appeal to stay execution on that portion of the judgment.
 [9] Stuyvesant also urges that it was exonerated because Merritt by agreeing to refrain from seeking execution against Stafford until disposition of any assigned cause of action *627 impaired his remedies against the principal debtor without consent. As Stuyvesant points out, "A surety is exonerated, except so far as he may be indemnified by the principal, if by any act of the creditor, without the consent of the surety the original obligation of the principal is altered in any respect, or the remedies or rights of the creditor against the principal, in respect thereto, in any way impaired or suspended." (Civ. Code,  2819.)
 However, the section is not applicable here because this is not the ordinary surety case. Although in form Stuyvesant was a surety and Stafford the principal obligor, this ignores the realities of the situation. When the judgment was returned in excess of the policy limits, it is clear that as to that judgment the insurers and Stafford had positions other than those ordinarily found in a surety situation. As to the part of the judgment within the policy limits, if affirmed on appeal, the ultimate liability would be that of the insurers and as to the part in excess of the policy limits, the insurer apparently had no liability. Although Stafford in form was liable for the entire judgment, it could reasonably expect that to the extent of the policy limits the insurers would pay upon affirmance and that as to this extent it was in reality the surety and not the principal obligor.
 The realities of the situation thus appearing must be contrasted with the ordinary position of a surety and a principal obligor. Sections 2847 and 2848 of the Civil Code provide that a surety upon satisfying the obligation of the principal is entitled to reimbursement by the principal and is entitled to enforce every remedy the creditor has against the principal. Insofar as the judgment was within the policy limits, the insurers had no right to require Stafford to reimburse, and they were not subrogated to Merritt's rights. Obviously, sections 2847 and 2848 dealing with the rights of sureties should have no application to the present situation because in reality a relationship of principal and surety was not contemplated or effectuated. The filing of the bond by Stuyvesant protected Reserve as insurer and itself as reinsurer, and it was not intended that by filing the bond and by a judgment on it after affirmance of the appeal, Stafford would become primarily liable for the part of the judgment within the policy limits.
 Support for the view that the ordinary rules relating to surety law have no application here is found in authorities *628 dealing with the statutory requirement that, except in the cases mentioned in section 2794 of the Civil Code, a promise to answer for the debt of another must be in writing. (Code Civ. Proc.,  1973, subd. 2; Civ. Code,  1624, subd. 2.) Section 2794, subdivision (4), of the Civil Code provides that a promise to answer for the obligation of another is deemed an original obligation of the promisor and need not be in writing where the promise is upon a consideration beneficial to the promisor, whether moving from either party to the antecedent obligation, or from another person. It is well settled that whenever the leading and main object of the promisor is not to become surety or guarantor of another but to subserve some purpose or interest of his own, the promise is not within the statute even though performance of the promise may pay the debt or discharge the obligation of another. (Schumm v. Berg, 37 Cal.2d 174, 187 [231 P.2d 39, 21 A.L.R.2d 1051]; Raboff v. Albertson, 122 Cal.App.2d 555, 560-561 [265 P.2d 139]; see generally 2 Corbin on Contracts (1950) ch. 16, pp. 273 et seq.)
 In the instant case, it is clear that the leading purpose of Stuyvesant in filing its bond was to protect Reserve as insurer and to perform its own obligation as reinsurer, and Stuyvesant, although agreeing to pay part of the obligation of Stafford, should not be viewed as thereby becoming a surety for Stafford. It does not appear how Stuyvesant was or could have been harmed by Merritt's agreement to stay execution against Stafford, and the agreement did not exonerate Stuyvesant.
 The order appealed from is reversed.
 Traynor, C. J., Tobriner, J., Mosk, J., Burke, J., and Sullivan., J., concurred.
 McCOMB, J.
 I dissent. I would affirm the judgment for the reasons expressed by Justice Lillie in the opinion prepared by her for the Court of Appeal in Merritt v. J. A. Stafford Co. (Cal.App.) 63 Cal.Rptr. 556.
NOTES
[fn. 1]  1. It is not clear whether the judgment in favor of Merritt's employer has been paid, but in any event the employer is not a party to this appeal.
[fn. 2]  2. With respect to individual sureties, the section contemplates that a surety may be held liable for less than the full amount of the judgment because it is provided that they may state in their affidavits what they are severally worth in which case judgment against each surety is limited to the amount stated. Section 948 of the Code of Civil Procedure provides that the adverse party may except to the sufficiency of the sureties within 30 days of the notice of the filing of the undertaking, that the sureties or other sureties must justify within 20 days thereafter or execution of the judgment is no longer stayed, and that the respondent may waive the undertaking or deposit by written consent.
[fn. 3]  3. It is true that it has been held that, where there is a failure to post bond in the amount required by the statute, execution will not be stayed because a stay can only be had upon a substantial compliance with the code provisions. (De Garmo v. Superior Court, 1 Cal.2d 83, 85 [33 P.2d 411]; Mohn v. Superior Court, 53 Cal.App. 425, 428 [200 P. 360].) However, the cases did not involve the question whether execution might be stayed as to part of the judgment and did not involve a situation like that present here where the defendant and the insurer had differing interests as to a judgment which exceeded the policy limits.
