In my experience police at festivals don't seem to give a cr@p about drugs. They're not stupid, and they know that they couldn't POSSIBLY arrest everyone they saw walking past smoking a joint. As long as you're not stupid, OVERLY obvious, obnoxious, or aggressive, then enjoy yourself.
Bare in mind, I've never been to Glastonbury in particular, so it could all be different...
And also, I've always wondered if sniffer dogs are even trained to smell weed, I've never been barked at by them, and also, it wouldn't be particularly sensible, they'd be barking all day in London, and all the people strapped with semtex would be able to walk through.