In the beit midrash where I used to learn, I found a sefer with the name of someone who learned there in the past. I tracked him down, and he said I could keep it. I have since moved away and began wondering whether the owner had the right to let me keep his sefer since the beit midrash has a sign that whoever leaves seforim unattended for an extended period allows the yeshiva to take them.
It is not 100% clear that such signs in batei midrash and shuls are halachically effective. However, enough places use them and enough poskim (Igrot Moshe, Choshen Mishpat II, 45; Shevet Halevi X, 278; Minchat Yitzchak VIII, 146) suggest them to deal with an inundation of lost objects that we will assume they work. The question of how they work will help answer your question. Some signs refer to making the seforim ownerless (hefker), which generally requires the owner to make a declaration in front of three people (Shulchan Aruch, CM 273:7), which is missing in our case. However, since when people are interested in being mafkir, the procedure is reduced (see Meiri, Bava Metzia 30b), reading the sign in agreement may suffice. Although the one who sees the sign does not know if and what he will lose, it is still possible to be mafkir based on future circumstances (see Bava Kama 69a and Tosafot, ad loc.). Still, hefker is tenuous because the signs prompt few people to clearly relinquish rights in the requisite way. Let us explore another way the signs can help. While the Torah gives people rights for nice treatment from other people, these rights can be waived (mechilla). For example, a father can waive some of the respect due to him by his son. So too, one can forgo his rights to have lost objects returned (hashavat aveida) (Berachot 19b). Why should assume one will waive this right? When people enter into a relationship with mutual obligations (including Torah-mandated ones), one can stipulate to the other that he will do so only on condition that he does mechilla on certain rights. For example, a groom can tell his bride that he will marry her on condition that she waives her right to financial support (Ketubot 56a). Similarly, a beit midrash can open its doors to students or the public on condition that they waive the right to make the gabbaim do hashavat aveida. If one sees a sign to that effect and enters without protest, he implicitly accepts the condition to waive the obligation of hashavat aveida. It is a complicated to determine if, after leaving the period of use of the beit midrash, one can say: “I won’t come back anymore but now that the relationship is over, I expect you to return my objects.” After all, if we are not working with hefker, the object remains the original owner’s, just that the finder does not have to look for him. In any case, until he informs the finder that he has stopped the mechilla, one may assume it continues. This system seems to work better than the previous one and to be morally preferable. However, while gabbaim need not be burdened with aveidot in addition to other responsibilities, it is less clear that they deserve to gain the rights to books whose owners’ names are clearly displayed. A third possibility is that the owner gives the beit midrash the right to acquire the sefarim as a present at some point. This is like telling a guest to help himself to snacks when he is hungry. Let us return to your question. If the sign works through hefker, it is likely (but beyond our scope- see Minchat Yitzchak, ibid.) that the beit midrash had acquired the sefer, and you need their permission. If it works based on permission to take a present, it depends if they took control of the book (i.e., by stamping it or selling it). If, as makes most sense to us (it may depend on the sign’s wording), it is just that people agree to waive hashavat aveida, it is still the original owner’s decision who should keep it. Even if it is likely you may keep the sefer, it is not a bad idea to ask the gabbai if he has any complaints. Rabbis of Eretz Chemda