Re: Possible bug in NFSv4 with krb5p security?

看板FB_current作者時間12年前 (2013/04/27 13:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串28/33 (看更多)
On 19 February 2013 17:31, Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>wrote: It can require bigger buffer, since root can get the pw_password field > in the struct passwd{}. > > Since sysconf(_SC_GETPW_R_SIZE_MAX) does not work on FreeBSD, the buffer > for getpwnam_r() call should have at least (2 * MAXLOGNAME + 2 * > MAXPATHLEN + > _PASSWORD_LEN + 1) bytes (it is unclear how much is required for pw_gecos). > > This buffer can be dynamically reallocated until getpwnam_r() is not > return ERANGE error (the following code has not been compiled and > verified): > Is this really a better solution than to aim high right away? A series of malloc() calls should certainly have much higher overhead than the previous stack-allocated solution. A better compromise would be to do the lookup in a separate function, that allocates the buffer using alloca() instead, yes? Regards, Elias _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1HUsBRJn (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1HUsBRJn (FB_current)