The anal glands or anal sacs are small glands near the anus in many mammals, including dogs and cats. They are paired sacs on either side of the anus between the external and internal sphincter muscles. Sebaceous glands within the lining secrete a liquid that is used for identification of members within a species. These sacs are found in many species of carnivorans, including wolves, bears, sea otters and kinkajous.
Read article on Wikipedia