Re: [SLE] file permissions?

From: Bruce Munro (brucemunro_at_blueyonder.co.uk)
Date: 08/27/03

  • Next message: Bill Wisse: "Re: [SLE] Kazaalite"
    Date: Wed, 27 Aug 2003 22:35:19 +0100
    To: Paul Varner <suse-linux-e@varnerfamily.org>
    
    

    Paul Varner wrote:

    >If you own the directory and have read/write permission then things like
    >this can happen. What is happening is that vim is trying to be helpful and
    >do what you told it to do. Since you gave it a w! command, it takes that to
    >mean "I really really want to write this file" and what vim did was delete
    >the original using the unlink system call, created a new file with the same
    >name using the open system call, wrote its buffers to the new file and when
    >you quit it closed the file. Since the read/write directory permissions
    >allow you to remove and create files, vim successfully wrote the file.
    >
    >Not all editors will exhibit same behavior. I know that on a Solaris box,
    >the vi command will not write a file if you don't have write permissions on
    >the file.
    >
    >
    Quite correct. Just did the procedure, with strace running on vi(m), and
    sure enough it tries to open the file for writing, fails, deletes the
    file, opens for writing again and writes out the contents.

    Earlier in the thread someone mentioned checking the inode number, and
    on my first run through I did that and Hey Presto! the inode number was
    the same. I was starting to get paranoid that the file was being written
    and chowned/chgrped! Then I realised, that on a desktop machine, with
    not a great deal of activity in /home at the time, then deleting a file,
    followed the creation of another immediately afterwards will most likely
    end up getting the recently freed inode number. You can force a
    different inode number for the new file, by deleting some other files on
    the same file system immediately prior to doing the write in vi(m).

    Cheers,
        -Bruce

    -- 
    Check the headers for your unsubscription address
    For additional commands send e-mail to suse-linux-e-help@suse.com
    Also check the archives at http://lists.suse.com
    Please read the FAQs: suse-linux-e-faq@suse.com
    

  • Next message: Bill Wisse: "Re: [SLE] Kazaalite"

    Relevant Pages

    • Re: vim 7 - set path?
      ... the:cd command was more how I understood it is all. ... Does anyone know how to make Vim look into a specific directory ... Use:find instead of:edit. ... Another alternative is to:edit some directory, which opens a file ...
      (comp.editors)
    • Re: Another VIM for OS/2 Question
      ... It does _not_ work when i double click on a data file that normally opens with e.exe. ... default open action to point to vim. ... I Downloaded assoedit, ran it, associated vim (in fact an OS/2 command file that calls vim) with files i need to open with it, and it all works beautifully. ...
      (comp.os.os2.misc)
    • Re: Copying to a new file
      ... xyz.txt would help but vimtutor is a command which opens as tutorial in Vi or Vim. ... If I yank those 970 lines and I open a blank new file, I cannot p because it is not programmed that way. ... I don't understand why this limitation for a command related file. ...
      (alt.os.linux)
    • Re: inode table
      ... The inode table can only be manipulated by a kernel ... and the left and right arrow keys to edit the command. ... ''; it redirects standard input. ... though one can always use 'cat', ...
      (comp.os.linux.setup)
    • Re: functional differences between cp and mv
      ... Your daemon will still be writing to the ... restart logging to grab the new inode of your newly created trace.log file. ... thus having the process continue to write entries to the old original ... When using the web based GUI admin console or the command line admin ...
      (comp.unix.admin)