Messages in this thread | | | Subject | Re: OT: why no file copy() libc/syscall ?? | From | Albert Cahalan <> | Date | 11 Nov 2003 09:11:45 -0500 |
| |
On Tue, 2003-11-11 at 08:38, Rogier Wolff wrote: > On Mon, Nov 10, 2003 at 08:05:11PM -0500, Albert Cahalan wrote: > > So open the file, change context, and then: > > > > long copy_fd_to_file(int fd, const char *name, ...) > > > > (if you can no longer read from the OPEN fd, > > either we override that or we just don't care > > about such mostly-fictional cases) > > > Actually, I think we should have a: > > long copy_fd_to_fd (int src, int dst, int len) > > type of systemcall.
I don't think that works. To have a destination file descriptor, you have to already have created the destination file. Having done so, it may now be impossible to transfer the security data. This is especially the case with network filesystems.
I can well imagine providing a file descriptor for the destination directory and making the filename optional. This helps pin things down if there's worry about an attacker moving directories, and it neatly allows for fully anonymous temporary files if a file descriptor is returned.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |