Field, J.
This is a petition, brought by a citizen and taxpayer of the town of Wakefield against the selectmen of that town, for a writ of prohibition to restrain them from entering into an agreement with the Heywood-Wakefield *586Company in accordance with a vote of the town. It sets forth in Ml St. 1906, c. 249, which authorizes the town “for the purposes of surface and ground drainage and for the protection of the public health” to “improve the brooks and natural streams and water courses in said town” and to take or purchase property and enter into contracts for that purpose, and alleges the appropriation of money by the town to carry out the purposes of the act, and a vote of a special town meeting held on May 6, 1929, purporting to authorize the selectmen “to enter into an agreement or agreements with the Heywood-Wakefield Company whereby said Company shall permit said town to relocate and divert the main brook, crossing the land of said company,” but “in no way to modify, amend or alter the rights respectively of either party with reference to existing contracts or agreements relating to the furnishing and receiving water through the town water supply system or otherwise.” The petition alleges also that “there is located within the premises of the Heywood-Wakefield Company a natural water course, the location of which it will be necessary for said town to take in accordance with said act, but the contract referred to . . . relative to the water supply of said town and company, is in no way connected with or involved in the taking of the location of said natural water course within the premises of said company.” A demurrer to the petition was sustained by a single justice and the petitioner excepted.
The demurrer was sustained rightly both on procedural and on substantive grounds.
Prohibition does not lie in such a case. “The function of that writ is to restrain excesses of jurisdiction intended to be committed by judicial or quasi judicial tribunals, officers and boards. It is not available for the purpose of restraining executive, administrative or legislative officers or bodies from acting where they have no authority.” Smith v. Selectmen of Norwood, 223 Mass. 222, 223. See also Lodge v. Fletcher, 184 Mass. 238. In entering into such an agreement or agreements as the vote of the town purported to authorize, the selectmen would not be performing a judicial or quasi judicial function. In fixing the details *587of such an agreement they do not act judicially. It cannot be said that making such an agreement amounts to the taking of property by right of eminent domain, the assessment of damages resulting from such a taking, or the assessment of a tax. Hence it is not necessary to consider the nature of such functions or the extent to which the exercise thereof may be restrained by a writ of prohibition. See, however, Day v. Aldermen of Springfield, 102 Mass. 310; Connecticut River Railroad v. County Commissioners, 127 Mass. 50; Smith v. Selectmen of Norwood, supra, compare Dowling v. Boston Board of Assessors, 268 Mass. 480. Nor need we decide whether a writ of prohibition may be granted upon the petition of a stranger. See Kilty v. Railroad Commissioners, 184 Mass. 310. The function to be performed by the selectmen according to the terms of the vote is executive or administrative, even if the agreement or agreements entered into by them thereunder adjust damages for the taking of property or bind the town to the expenditure of money raised by taxation. The petition does not allege that any right of the petitioner, other than his rights as “a citizen of and a property owner and taxpayer in” the town, will be infringed by such agreements as are contemplated by the vote. Under these circumstances, if any agreement which the selectmen are about to make is unlawful, his exclusive remedy is to join with other taxable inhabitants in a petition under G. L. c. 40, § 53. Fuller v. Trustees of Deerfield, Academy, 252 Mass. 258, and cases cited.
It does not appear from the allegations of the petition that, even if the petitioner had sought his remedy in a proper way, he would be entitled to relief. It is not alleged that the respondents threaten or intend to act contrary to law or, indeed, to act at all. If it is assumed in favor of the petitioner that they are about to act under the vote, it does not follow that they will act unlawfully. The vote was a valid action of the town under St. 1906, c. 249. By that statute the town is authorized, acting by its selectmen, to “improve the brooks and natural streams and water courses” therein by widening them, removing obstructions, diverting *588the water, altering the courses, deepening the channels or constructing new channels, and for those purposes to purchase or take land or rights therein and water rights and to “enter into any contracts or agreements with any person or corporation,” but no “land, water rights or other rights” are to be “purchased,” “work and acts . . . undertaken” or “contracts . . . made,” until an appropriation is made therefor. Appropriations to carry out the purposes of the act have been made. Agreements such as are authorized by the vote of the town are within the statutory authority. Thereby permission is to be secured to “relocate and divert” a brook. Obviously the statute does not require the town to exercise the power of eminent domain in order to obtain this right. If the allegation in the petition, that “it will be necessary for said town to take” the location of the watercourse in question, is to be construed as meaning that it will be necessary for the town to acquire this location by eminent domain, it is a conclusion of law which is not admitted by demurrer and is unsound. Nor was the vote unlawful, as the petitioner contends, because of its effect, or the effect of agreements authorized thereby, upon existing contracts. Existing contracts were not ratified by the vote and are not to be ratified by any agreement thereunder. On the contrary the vote provided expressly that such agreements shall in no way “modify, amend or alter” the rights of either party with reference to the “existing contracts or agreements” referred to in the vote.
Exceptions overruled.