Hi Tallguy,
Yes, you are right about shellac being used in the past. Some modern primer/sealers like "BIN" or "123" are in fact white pigmented shellac.
Before you paint you will need to seal out the water stain. The stain will come to the surface of latex paint.
I would spot the stain with a primer/sealer such as "Kilz" or "Coverstain". The solvent based sealers seem to "hold out" a stain better than the water based sealers.
Be sure to cover the entire stain by applying the sealer four or five inches past the edges of the visible stain.
Hope this Helps,
rmichael pro painter