A: Dear Parent:
This is normal! Your daughter is smacking you and pulling your hair because she is excited. She is too little to know the difference between hugging and kissing, and yanking on your hair. Often a child of this age will bite you from excitement too.
There really isn't anything you need to do, because even if you don't try to stop her by holding her hands or saying "no," I am sure that she can tell that you don't like it. In fact, by grabbing her hands and scolding her, you are adding excitement to the situation which is likely to stir her up even more.
I wouldn't really worry about this behavior, but if you feel you must "do" something, what you might try is to just adjust the level of excitement at these moments by being quiet and looking away from her face for a few seconds until she lets go of your hair and stops hitting you. Time will fix this on its own however.