Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jai

看板FB_security作者時間19年前 (2007/01/16 09:45), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串11/22 (看更多)
Dirk Engling wrote: > Please try the "cp -f" before guessing, what it might do ;) > > cp -f removes anything on that location before relinking the new file. > Atomically. No. `cp -f` unlinks the existing file and creates a new file, but will still follow a symlink if one is created between the "unlink" syscall and the "open" syscall. /* remove existing destination file name, * create a new file */ (void)unlink(to.p_path); if (!lflag) to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT, fs->st_mode & ~(S_ISUID | S_ISGID)); Colin Percival _______________________________________________ freebsd-security@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-security To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.org"
文章代碼(AID): #15h2up00 (FB_security)
討論串 (同標題文章)
完整討論串 (本文為第 11 之 22 篇):
文章代碼(AID): #15h2up00 (FB_security)