Two Negro “Muslims,” inmates of Lorton Reformatory,1 appeal from denial of their petitions for writs of habeas corpus. They alleged interference with their right to practice their religion, mistreatment, amounting to cruel and inhuman punishment, and denial of or interference with their right to complain to the Board of Commissioners of the District of Columbia, which has general supervisory jurisdiction over the penal institutions of the District. They do not claim that their detention is unlawful, and, in light of recently adopted policies respecting the treatment of Muslims confined in penal institutions of the District of Columbia, we find in the petitions no basis for injunctive relief. We, therefore, affirm their denial after answers had been filed but without a hearing.
The traditional function of the writ of habeas corpus is to test the legality of the detention. It is inappropriate to the procurement of the kind of injunctive relief these petitioners seek.2 *550Unlearned inmates of penal institutions, however, are usually ignorant of the legal niceties of the procedural rules in the courts. If one presents in his own behalf a petition which clearly merits some relief, he ought not to fail entirely because he misconceives the nature of the proceeding or mislabels his petition. If the petition substantively is one for injunctive relief, the court most certainly has a discretionary right to treat it as such, despite the fact that the untutored petitioner has mistakenly designated it as a petition for a writ of habeas corpus.3
In this instance, however, though we were to treat the petitions as ones for injunctive relief, we find that they were properly dismissed without a hearing on the basis of the petitions, themselves, and the answers and the affidavits which had been filed by the defendant.
Some of the claims clearly are not justiciable. The petitioner, Robert X. Roberts, among other things claims that when he was first received at Lorton from the District of Columbia Jail, he was placed in a maximum security unit. He alleges in his petition that his placement there followed an attempt by him to post a letter to his spiritual advisor, while the answer alleges that he was placed in the maximum security unit because of a report from the District of Columbia jail that he had been a constant disciplinary problem there and was possibly psychotic.4
The petitioner, James X. Hayes, Jr., presents similar non justiciable claims. Illustrative, is his complaint that he was denied amusement and recreational privileges for two weeks and forfeited sixty days of good time allowance for having eaten “on the wrong mess,” a violation of the prison rules.
The maximum security unit at Lorton is not a place of punishment. Confinement in the “control unit” is disciplinary and punitive, but confinement in the maximum security unit results from considerations of the security of the institution, itself. fSince management of the penal institutions has been placed by the Congress in the Executive Department, and the Executive Department is solely responsible for the security of the prisoners and of the officials and others working within the prison, they must be allowed to exercise a largely unfettered discretion in deciding what security measures are appropriate and, with respect to each prisoner, what relative freedom he safely may be allowed. ‘If one is given greater freedom of movement than another, or if one becomes a trusty, while many do not, such routine matters of prison administration ought not to become the subject of judicial controversy. Whether or not the report of Roberts’ misconduct while confined in the District of Columbia jail reasonably warranted his initial placement in the maximum security unit, or whether his placement there was motivated wholly or partially by his attempt to post an unauthorized letter, it does not create a justiciable controversy.
Similarly, whether or not the infraction of the rules when Hayes ate “on the wrong mess,” in light of his other conduct in the institution, reasonably justified the punishment he received of two weeks loss of amusement and recreational privileges and the forfeiture of sixty days good time allowance is not a matter for judicial consideration. So long as the punishment imposed for an infraction of the rules is not so unreasonable as to be characterized as vindictive, cruel or inhuman, there is no right of judicial review of it. If a judge thought that the particular infraction of the rule, in the light of other conduct by Hayes, *551would have been sufficiently punished by the forfeiture of privileges for a shorter period of time, his judgment is not to be substituted for that of the prison officials who are responsible for the management of the prison population.'
Such questions as these have consistently been held to be nonjusticiable, for routine security measures and disciplinary action rest solely in the discretion of the prison officials and their superiors in the Executive Department.5
There are other allegations in the petitions, however, which upon their face, might warrant judicial inquiry. Each of the petitioners at times was confined in the “control unit,” a type of punishment which is described by Judge Matthews in Fulwood v. Clemmer, D.C.D.C., 206 F. Supp. 370. Allegations of their religious beliefs and of denial of their right to practice their religion are also present. Under similar circumstances, we held that judicial inquiry was warranted to determine whether or not the severe punishment inflicted was a denial of religious freedom and not reasonably appropriate to misconduct on the part of the recipient.6
Moreover, in these petitions, there are allegations that the petitioners were frustrated or delayed in efforts to file complaints regarding their treatment with the Board of Commissioners of the District of Columbia. The answer admits that such complaints were forwarded first to the Director of the Department of Corrections, who works under the supervision of the Board of Commissioners, and the complaints necessarily were critical of his administration of the reformatory. The responsive pleadings and affidavits are open to the interpretation that there has been some hindrance or delay in the transmittal of communications of prisoners to the Board of Commissioners.
If the operation of the prisons and the treatment of the inmates is lodged solely in the Executive, generally without any possibility of judicial restraint, there ought to be open avenues of complaint by prisoners to those in general charge of their immediate jailers. Executive capacity to prevent abuses and excesses on the part of subordinate.officials would be greatly impaired if the most fruitful sources of information are dammed up or diverted. The Board of Commissioners, itself, should be, and probably is, interested in seeing that no offending subordinate be allowed to suppress a complaint which would reveal his offense.
The factual issues present here, however, are out-of-date. While the second appeal in the very similar case of Sewell v. Pegelow was pending before this Court, the Commissioners of the District of Columbia adopted new policies regarding the treatment of Muslims confined in Lorton Reformatory. These were incorporated in certain assurances addressed to the Court, upon the basis of which the second appeal in Sewell was dismissed. A letter addressed to Chief Judge Sobeloff containing those assurances is printed as an appendix to the order of dismissal of that appeal.7 Under the revised policy, earlier practices which the Muslims found discriminatory were to be eliminated and thenceforth the Muslims were to be treated as other inmates of the institution. Among the assurances were specific ones respecting their right to engage in religious practices. There was a formal amendment of an earlier policy order regarding nondiscrimination which confers a formal right upon an inmate to complain directly to the Board of Commissioners if he is aggrieved by a violation of the amended order. Among the assurances given this Court is one of compliance with the amended order and *552a representation that all complaints will be forwarded directly to the Secretary of the Board of Commissioners without alteration or delay.
Since all of the matters alleged here ■occurred prior to the adoption of the revised policy toward the Muslim inmates in Lorton and the representations made to this Court on'June 18, 1962, it would be purposeless to treat these petitions as ones for injunctive relief. If the District Court, upon a remand, should find that, prior to the adoption of the revised policy, the rights of these petitioners had been so seriously and shockingly denied as to call for injunctive relief, it would not be warranted in issuing the injunction after adoption of the revised policy, with its assurance that thenceforth there would be no further cause for complaint. We have no reason to doubt that the revised policy is being followed since its adoption six months ago. As we found the assurances based upon the revised policy sufficient to dismiss the appeal in Sewell, we find in them a quite adequate basis for affirmance of the District Court’s dismissal of these very similar petitions, for though the petitions be treated as ones for injunctive relief, the factual issues have become substantially moot by the adoption in June of the revised policies.8
Our action is, of course, without prejudice to any future action if the assurances of the Board of Commissioners, should be violated.
Affirmed.
. Lorton Reformatory is a penal institution maintained and operated by the District of Columbia. It is under the immediate supervision of the defendant Pegelow, Superintendent of the Reformatory Division of the District of Columbia Department of Corrections. Donald Clemmer is the Director of the Department of Corrections, which operates under the general supervision of the District’s Board of Commissioners. Lorton is physically located, however, in the Eastern District of Virginia, and these proceedings appear to have been properly brought in that District against Supex-intendent Pegelow, who is the only named defendant.
. Haskins v. United States, 4 Cir., 292 F.2d 265; Morton v. Steele, 8 Cir., 217 F.2d 13; Henson v. Welch, 4 Cir., 199 F.2d 367; Williams v. Steele, 8 Cir., 194 F.2d 32; Rosheisen v. Steele, 8 Cir., 193 F.2d 273; Snow v. Roche, 9 Cir., 143 F.2d 718.
. See Smith v. Bennett, 365 U.S. 708, 81 S.Ct. 895, 6 L.Ed.2d 39; United States v. Morgan, 346 U.S. 502, 74 S.Ct. 247, 98 L.Ed. 248; Darr v. Burford, 339 U.S. 200, 70 S.Ct. 587, 94 L.Ed. 761; Fulwood v. Clemmer, 111 U.S.App.D.C. 184, 295 F. 2d 171; Moon v. United States, 106 U.S. App.D.C. 301, 272 F.2d 530; Thomas v. United States, 106 U.S.App.D.C. 234, 271 F.2d 500; Fulwood v. Clemmer, D.C.D.C., 206 F.Supp. 370.
. Later lie was found to be psychotic. Indeed, he is now confined in St. Elizabeths Hospital.
. See White v. Clemmer, 111 U.S.App.D.C. 145, 295 F.2d 132; Haskins v. United States, 4 Cir., 292 F.2d 265; Sewell v. Pegelow, 4 Cir., 291 F.2d 196; Tabor v. Hardwick, 5 Cir., 224 F.2d 526; Dayton v. McGranery, 92 U.S.App.D.C. 24, 201 F.2d 711; Henson v. Welch, 4 Cir., 199 F.2d 367; Stroud v. Swope, 9 Cir., 187 F.2d 850; Sturm v. McGrath, 10 Cir., 177 F.2d 472, 473; Fulwood v. Clemmer, D.C.D.C., 206 F.Supp. 370.
. Sewell v. Pegelow, 4 Cir., 291 F.2d 196.
. Sewell v. Pegelow, 4 Cir., 304 F.2d 670.
. As to Roberts, the case may also have been mooted by his transfer to St. Elizabeths Hospital. Examination there in April 1962 resulted in a diagnosis of “Schizophrenic Reaction, Paranoid Type.” In September 1962, the supervising physician at St. Elizabeths reported that Roberts had shown some improvement, but required further hospitalization. There were then no plans for his release from that institution and his return to Lorton.