The practice of "slopping out" must come to an end in Scotland's biggest jail, according to Scotland's chief inspector of prisons.
Barlinnie remains overcrowded, according to the report
Andrew McLellan attacked overcrowding at Barlinnie in Glasgow and said prisoners were being locked up for long periods in poor conditions.
His report also criticised the number of people being held on remand who have not been convicted of a crime.
His inspection team visited the prison between 5 and 14 May this year.
Mr McLellan said that "slopping out" - where prisoners use a pot or bucket as a toilet in their cells - needed to be tackled.
He said: "Overcrowding and the issue of drugs, particularly the provision of medication pervades much of the prison's work."
His report makes "a positive assessment" of the addiction work being carried out.
But he said: "Some prisoners are still locked up for very long periods of time - sometimes up to 23 hours a day - in very poor conditions.
"'Slopping out' exists in two halls and most of the prisoners who have no integral sanitation are also the victims of the chronic overcrowding: so nearly all of these prisoners are sharing a cell.
"The 'holding' cubicles in reception are not acceptable."
Mr McLellan said that some prison refurbishment had provided clean and decent conditions.
However, the number of assaults in the prison were high and "key performance indicators" had not been met.
He said: "The practice of 'slopping out' has been repeatedly condemned in inspectorate reports, yet it still exists in two halls in Barlinnie.
"That could mean up to a maximum of 425 prisoners. The practice should be stopped."
'Fair and balanced'
The Scottish Prison Service (SPS) said the report was "fair and balanced" but stressed that a number of measures had been taken to improve the prison.
These included a £20m investment which had provided sanitation and electric power in cells in three of the prison's halls in the past six years.
There were plans to provide sanitation and electric power in the cells of the other two halls.
It said staff and management should be praised for coping with an average of 2,244 receptions per month.
Bill McKinlay, the governor of Barlinnie prison, said: "We have very few prisoners who are slopping out, only 20%, but it's still not acceptable.
"But three years ago it was 75% and we're continually trying to improve the
situation. It's not good for prisoners and it's not good for staff."
The SPS also said houseblocks were being created at young offenders' institutions to alleviate overcrowding at Barlinnie.
The Scottish Executive has committed £110m over the next three years to end "slopping out".