Umar bin Khattab acquired a piece of land at Khaybar. He came to the Prophet ﷺ to seek his advice about it and said, "Messenger of Allah, I have acquired a piece of land at Khaybar. I have never obtained any property more valuable to me than this. What do you command me to do with it?"The Prophet ﷺ replied, "If you wish, you may keep the land itself and give its produce in charity."So Umar gave it in charity on the condition that the land itself would not be sold, gifted, or inherited. He gave its produce in charity to the poor, to relatives, for freeing slaves, in the cause of Allah, to travelers, and to guests. There is no blame on whoever administers it if he eats from it in a reasonable manner or feeds a friend, without seeking to accumulate wealth from it.
حدثنا نصر بن علي الجهضمي حدثنا معتمر بن سليمان عن ابن عون عن نافع
أصاب عمر بن الخطاب أرضا بخيبر فأتى النبي ﷺ فاستأمره فقال يا رسول الله إني أصبت مالا بخيبر لم أصب مالا قط هو أنفس عندي منه فما تأمرني به فقال إن شئت حبست أصلها وتصدقت بها قال فعمل بها عمر على أن لا يباع أصلها ولا يوهب ولا يورث تصدق بها للفقراء وفي القربى وفي الرقاب وفي سبيل الله وابن السبيل والضيف لا جناح على من وليها أن يأكلها بالمعروف أو يطعم صديقا غير متمول
Bukhari narrated it in the Book of Conditions, Chapter on Conditions in Endowments, no. 2737, 2772, 2773, and Muslim in the Book of Wills, Chapter on Endowments, no. 1632, from the hadith of Ibn Awn.