All persons confined in the county jail, industrial farm, road camp, or city jail under a final judgment of imprisonment rendered in a criminal action or proceeding and all persons confined in the county jail, industrial farm, road camp, or city jail as a condition of probation after suspension of imposition of a sentence or suspension of execution of sentence may be required by an order of the board of supervisors or city council to perform labor on the public works or ways in the county or city, respectively, and to engage in the prevention and suppression of forest, brush and grass fires upon lands within the county or city, respectively, or upon lands in adjacent counties where the suppression of fires would afford fire protection to lands within the county.
Whenever any such person so in custody shall suffer injuries or death while working in the prevention or suppression of forest, brush or grass fires he shall be considered to be an employee of the county or city, respectively, for the purposes of compensation under the provisions of the Labor Code regarding workmen's compensation and such work shall be performed under the direct supervision of a local, state or federal employee whose duties include fire prevention and suppression work. A regularly employed member of an organized fire department shall not be required to directly supervise more than 20 such persons so in custody.
As used in this section, "labor on the public works" includes clerical and menial labor in the county jail, industrial farm, camps maintained for the labor of such persons upon the ways in the county, or city jail.
Ca. Pen. Code § 4017