Salvador is a challenging place for a tourist. More so for photographers. Here's my recommendations for shooting photos in Salvador. Don't have an expensive camera out unless you see a police officer. That means no Leicas, no digital SLRs, nothing you can't live without. I recommend having the smallest cameras you can get. I used an Olympus 35 RC, a really great compact rangefinder. I wrapped the camera strap around my wrist a few times. Sometimes I crossed my arms and tucked the camera underneath.
You will get looks and attention, especially if you are fair-skinned. There were only a few places I felt really uncomfortable, mostly because locals were telling me not to bring a camera and I just got psyched out by that. Barra beach was one place. Night is not a good idea. Just bring cheap cameras and put them in your pocket if it gets shady. It helps to have lived in a big city and to have street smarts.