
136 Cal.App.2d 437 (1955)
THE PEOPLE, Respondent,
v.
GILBERT GONZALES, Appellant.
Crim. No. 5376. 
California Court of Appeals. Second Dist., Div. Two.  
Oct. 21, 1955.
 Forno & Umann for Appellant.
 Edmund G. Brown, Attorney General, and Elizabeth Miller, Deputy Attorney General, for Respondent.
 McCOMB, J.
 From a judgment of guilty after trial before a jury on three counts of violating section 11500 of the Health and Safety Code (unlawfully selling a preparation of heroin), defendant appeals. There is also an appeal from the order denying his motion for a new trial.
 Facts:  [fn. *] On December 15, 1953, Deputy Sheriff Berteaux of Los Angeles County, drove with a confidential operator past a cafe at 2435 Brooklyn Avenue. When they saw defendant standing in front of the cafe, they parked at the curb. Defendant came to the side of the car where the deputy sheriff was sitting. The confidential operator talked to him and introduced the deputy sheriff as "Rudy," a friend of his. Defendant appeared to know the confidential operator. The operator asked him if he had any "junk." Defendant said, "Yes." The deputy sheriff said they did not have any money at the time but they were going to get some from selling some appliances. Thereafter the deputy sheriff and the operator left.
 About an hour and 45 minutes later, the deputy sheriff and the operator returned and parked their car in front of the cafe. Defendant was seated on the steps at the time. At his signal the deputy sheriff entered the cafe, and in three minutes defendant followed him and beckoned to the deputy sheriff to follow him. They went to the rear of the cafe and up about a dozen steps, at the top of which they came to a small door. There defendant entered a toilet while the deputy stood outside. Defendant stepped out of the toilet and handed the deputy officer five capsules of light brown powder in return for $15. Thereupon the deputy sheriff left the cafe.
 About 4:30 p. m. on December 17, 1953, the deputy sheriff *439 went again to the cafe and walked into the cocktail bar where defendant was tending bar. The officer seated himself at the bar whereupon defendant approached him and admonished him for discussing narcotics with the waitress earlier that afternoon. The officer said he did not know that she knew nothing about the narcotics. Defendant then said, "When you want anything, come to me," to which Mr. Berteaux replied, "All right," and asked for a gram. Defendant went through a door at the rear of the cafe, returned in a minute or two, and beckoned the deputy sheriff to enter the toilet, where he handed him 10 capsules for which the officer paid defendant $25. The deputy sheriff then left the cafe.
 On December 29, Officer Berteaux again went to the cafe and entered the bar, which defendant was tending. The officer sat on a stool closest to the entrance. Defendant, who was talking to two patrons, went to the deputy sheriff after a minute or two, at which time the officer asked for a coke and said, "A gram." Defendant said, "Later." Then defendant talked to a man for 10 or 15 minutes, after which he went through a back door and returned, at which time he beckoned the deputy sheriff to follow him into the toilet. This the officer did and handed defendant $25 in return for 10 capsules of a brownish powder after which the deputy sheriff left the cafe.
 Each of the capsules handed to the officer by defendant was tested by a chemist and found to contain heroin. Thereafter defendant was arrested and convicted, as set forth above.
 Defendant relies for reversal of the judgment on two propositions:
 First: The criminal intent originated in the minds of the law enforcement officers who lured him into the offenses charged in order to prosecute him.
 This contention is devoid of merit. The evidence discloses, in addition to the facts set forth above, that prior to December 15, 1953, the law enforcement agencies of Los Angeles County had a plan to round up as many narcotic peddlers and users as possible. Deputy Sheriff Berteaux, who did not know defendant, was told about him and was told to try to make a purchase from him. Thereafter the purchases were made in accordance with the facts mentioned supra. These facts fail to disclose any entrapment of defendant but on the contrary, fall within these established rules:
 [1] (1) Where the doing of an act is criminal, regardless of the consent of anyone, and the criminal intent originates *440 in the mind of the accused and the offense is completed, the fact that an officer furnishes the accused an opportunity to commit the crime and aids him in the commission thereof for the purpose of securing evidence necessary to prosecute him constitutes no defense;
 [2] (2) There is no entrapment if the officers use no more persuasion than is necessary to an ordinary sale and the accused is willing to and does in fact make the sale. (People v. Braddock, 41 Cal.2d 794, 802 [8] [264 P.2d 521].)
 In the instant case the facts fall squarely within the foregoing rules of law. It is clear from the evidence that defendant had the criminal intent to sell heroin in violation of law and that the officer used no greater persuasion than that incident to an ordinary purchase and sale transaction of the contraband. (See People v. Lee, 9 Cal.App.2d 99, 109 [48 P.2d 1003]; People v. Jackson, 106 Cal.App.2d 114, 125 [14] [234 P.2d 766].)
 [3] The record discloses merely that the officers intended at a certain time to arrest as many narcotics peddlers and users as possible, and that in an effort to find out who were peddlers they sent Deputy Sheriff Berteaux out to approach defendant and try to find out whether he was a peddler. To enable him to learn whether or not defendant was a peddler, the confidential informer was sent with him to introduce him to defendant. After the introduction was made the deputy sheriff did not use any more persuasion than was necessary to make an ordinary sale. He merely asked defendant for the heroin and defendant gave it to him. Clearly there was no entrapment.
 There is likewise no merit in defendant's contention that the confidential informer was a witness present at the time defendant committed his illegal acts. The record is to the contrary. The fact is, the record discloses that the confidential informer was not present at any time that defendant violated the law.
 Second: That the court erred in refusing to compel Deputy Sheriff Berteaux, when a witness, to give the name of the informer who introduced him to defendant.
 This proposition is also devoid of merit. Defendant contends that the trial court's refusal to compel Deputy Sheriff Berteaux to reveal the name of the confidential operator who introduced him to defendant denied him his constitutional right to (a) face his accuser and (b) subpoena a witness who would have testified that it was a case of mistaken *441 identity; that this refusal deprived him of his constitutional rights pursuant to the provisions of article I, section 13 of the Constitution of California and Amendments VI and XIV of the Constitution of the United States.
 [4] During the course of the cross-examination of Deputy Sheriff Berteaux, he was asked to name the confidential operator who had introduced him to defendant. The deputy district attorney objected to this question on the ground that the officers had promised the informer that they would never divulge his name in order to protect the health and welfare of the informer. The objection was sustained. This ruling was correct. Section 1881 of the Code of Civil Procedure reads in part as follows: "There are particular relations in which it is the policy of the law to encourage confidence and to preserve it inviolate; therefore a person cannot be examined as a witness in the following cases: ..."
 "5. [Public Officers.] A public officer cannot be examined as to communications made to him in official confidence, when the public interest would suffer by the disclosure."
 In People v. Hernandez, 115 Cal.App.2d 435, 439 [252 P.2d 75], Mr. Justice Griffin, after discussing subdivision 5 of section 1881, Code of Civil Procedure, states: "The trial court committed no prejudicial error in excluding the testimony concerning the name of the informer, which name was communicated to the public officer in confidence." (Cf. In re Quarles, 158 U.S. 532 [15 S.Ct. 959, 961, 39 L.Ed. 1080].)
 It is clear that the public interest would suffer if the disclosure were compelled of the names of those citizens who inform public officers of violation of law and who assist such officers in the performance of their duty to apprehend law violators. A citizen who knows that the fact would be made public that he has disclosed such information to public officers may be loath to cooperate in the administration of justice by exercising his right and duty to make such disclosures because he would justifiably believe himself to be in danger of physical violence from those upon whom he had informed, as well as in danger of actions of slander and malicious prosecution.
 [5] Contrary to defendant's contention, a deputy sheriff is a public officer within the meaning of Code of Civil Procedure, section 1881, subdivision 5, for the reason that a county officer is a public officer (Coulter v. Pool, 187 Cal. 181, 187 [7] [201 P. 120]); a sheriff is a county officer, and a deputy sheriff possesses all the powers and may perform all *442 the duties attached by law to his principal's office. (People v. Otto, 77 Cal. 45, 47 [18 P. 869]; Shirran v. Dallas, 21 Cal.App. 405, 414 et seq. [132 P. 454, 462]; Gov. Code,  24100.) It is thus clear that a deputy sheriff is a public officer for the purposes mentioned in the Code of Civil Procedure, section 1881, subdivision 5.
 The judgment and the order are, and each is, affirmed.
 Moore, P. J., and Fox, J., concurred.
NOTES
[fn. *]  *. The evidence is viewed in the light most favorable to the People (respondent). See People v. Pianezzi, 42 Cal.App.2d 270, 277 [2] [108 P.2d 685] (hearing denied by the Supreme Court).
