Re: OT: why no file copy() libc/syscall ??

From: Ihar 'Philips' Filipau (filia_at_softhome.net)
Date: 11/11/03

  • Next message: Frank Horowitz: "[BUG] 2.4.23-rc1 USB2 (ICH4) ehci-hcd and usb-storage lockups"
    Date:	Tue, 11 Nov 2003 10:51:10 +0100
    To: Florian Weimer <fw@deneb.enyo.de>
    
    

    Florian Weimer wrote:
    > Andreas Dilger wrote:
    >
    >
    >>>This is fast turning into a creeping horror of aggregation. I defy anybody
    >>>to create an API to cover all the options mentioned so far and *not* have it
    >>>look like the process_clone horror we so roundly derided a few weeks ago.
    >>
    >> int sys_copy(int fd_src, int fd_dst)
    >
    >
    > Doesn't work. You have to set the security attributes while you open
    > fd_dst.

       int new_fd = sys_copy( int src_fd ); /* cloned copy, out of any fs */
       fchmod( new_fd, XXX_WHAT_EVER ); /* do the job. */
       ...
       flink(new_fd, "/some/path/some/file/name"); /* commit to fs */
       close(new_fd); /* bye-bye */

       I beleive this can be more useful. Not only in naive tries to replace
    cp(1) with kernel ;-)

    -- 
    Ihar 'Philips' Filipau  / with best regards from Saarbruecken.
    --                                                           _ _ _
      "... and for $64000 question, could you get yourself       |_|*|_|
        vaguely familiar with the notion of on-topic posting?"   |_|_|*|
                                     -- Al Viro @ LKML           |*|*|*|
    -
    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/
    

  • Next message: Frank Horowitz: "[BUG] 2.4.23-rc1 USB2 (ICH4) ehci-hcd and usb-storage lockups"

    Relevant Pages

    • Re: [RFC] frandom - fast random generator module
      ... For the current version of Lustre security is not a primary concern (our ... customers run Lustre in very secure network environments). ... Andreas Dilger ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: thoughts on kernel security issues
      ... Florian Weimer wrote: ... > I don't know that much about vendor-sec, ... It's normal for projects to have their own security ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: OT: why no file copy() libc/syscall ??
      ... Andreas Dilger wrote: ... You have to set the security attributes while you open ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: SATA support merge in 2.4.27
      ... > A stable kernel is a kernel in which a new release does not induce 20 rejects ... > confidently upgrade to fix a security issue without worrying that everything ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] whitespace cleanups for fs/cifs/file.c
      ... > project cold and don't know how anything works or where it lives it ... Judicious use of gotos and some helper functions would help a lot ... Andreas Dilger ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)