From: "Joseph D. Wagner" Subject: RE: Does sendfile() copy extended attributes? Date: Sat, 20 Dec 2003 06:19:25 -0600 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <006301c3c6f3$8274ef80$0201a8c0@joe> References: <20031219163715.GA16578@mail.sternwelten.at> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Cc: Return-path: Received: from ssa8.serverconfig.com ([209.51.129.179]:48042 "EHLO ssa8.serverconfig.com") by vger.kernel.org with ESMTP id S263895AbTLTMT1 convert rfc822-to-8bit (ORCPT ); Sat, 20 Dec 2003 07:19:27 -0500 To: "'maximilian attems'" In-Reply-To: <20031219163715.GA16578@mail.sternwelten.at> List-Id: linux-fsdevel.vger.kernel.org > just out of curiosity: > why not using rsync(1) or cp -a ?? Because that violates one of the Immutable Laws of Security -- "If you're running someone else's program, it's not your program anymore." If my program executes another program like cp/rsync in your example, it would be vulnerable to a privilege elevation when run as root. A hacker could replace cp/rsync, change the PATH, or a dozen other tricks to get it to execute his version of cp/rsync. Now if there's a function call that will copy a file -- other than the sendfile function which is what this thread has been all about -- I'm all ears. However, I am not going to execute another program. Joseph D. Wagner