Loading ...
Sorry, an error occurred while loading the content.
 

RE: VIm 7.2 on Linux - bug in temporary files

Expand Messages
  • Warren Swan
    Never mind. I found out what I was doing wrong. I had copied my vimfiles from a Windoze/cygwin system to my Linux system and I still had set shell=bash.exe
    Message 1 of 8 , Apr 29, 2009
      Never mind.  I found out what I was doing wrong.  I had copied my vimfiles from a Windoze/cygwin system to my Linux system and I still had

      set shell=bash.exe

      in my .vimrc.  For some reason I was NOT receiving a message that it could not execute my shell.  I was only receiving the message that it could not read the temporary file.

      I removed the above line and everything is working fine.  FYI: How I found out.

      I started editing a junk file.  Typed :echo tempname()
      to get the name of the temporary directory that would be used for this session.  Then tried
      !!ls -l /tmp/v39755
      to try to list the contents of the directory as a filter.  Then, and only then, did I receive a message stating that bash.exe could not be executed.  That immediately told me what the problem was.  Odd thing is that I did not get the same message when I tried other filters.

      Thanks,
      Warren D. Swan - “Woods”
      IT Architect, SCM SME
      IBM Global Point of Sale Team; Wal-Mart Enterprise

      wswan@...

      Office:        479-277-5065
      Cell:        417-846-6385



      From:Bram Moolenaar <Bram@...>
      To:Warren Swan/Bentonville/IBM@IBMUS
      Cc:vim_use@...
      Date:04/29/2009 04:00 AM
      Subject:RE: VIm 7.2 on Linux - bug in temporary files






      Warren Swan wrote:

      > gvim complains if the executable (vim) has the setuid bit on.  I
      found out
      > the hard way.  I thought maybe making it setuid to root would
      work, albeit
      > making all new files belong to root!
      > Since we're talking about a temporary file made within vim/gvim itself,
      > the file comes and goes.  There's no way to check its permissions.
       I've
      > toyed with trying to make a debug version of vim so that I can find
      out
      > what's going on.
      >
      > I'm not doing anything strange here at all.   Just make install
      (as root,
      > which is correct), and then using gvim.  Certainly there must
      be other
      > Linux users trying to use version 7.2 that are running into the same
      > problem!

      I'm surprised you get this far when setting the setuid bit.  In my
      opinion this is a really bad idea, since all files you edit will be with
      root permissions.

      What happens is that Vim creates a directory in /tmp and changes the
      permissions so that only the owner can read/write there.  That is the
      safest way to deal with temp files.  The file will then be owned by
      root, and the external command runs as yourself and won't be able to
      access the file.

      Don't use the setuid bit, use "sudo vim".

      --
      If your life is a hard drive,
      Christ can be your backup.

      /// Bram Moolenaar -- Bram@... --
      http://www.Moolenaar.net   \\\
      ///        sponsor Vim, vote for features --
      http://www.Vim.org/sponsor/ \\\
      \\\        download, build and distribute --
      http://www.A-A-P.org        ///
      \\\            help me help AIDS victims --
      http://ICCF-Holland.org    ///



      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---

    Your message has been successfully submitted and would be delivered to recipients shortly.