Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Vi IMproved 7.3 Released w/ Fixes + New Features

  1. #11
    Join Date
    Oct 2006
    Location
    Israel
    Posts
    648

    Default

    Quote Originally Posted by pingufunkybeat View Post
    I think it's more to protect users from other sneaky users.

    But yeah, I'm not sure whether the swap files inherit the original file's permissions and whatnot. There are likely corner cases involved. It was probably a much requested feature that finally got implemented. You don't have to use it if you don't feel the need (I don't).
    It does inherit the permissions from the original file - but the problem is not the swap file permissions, but the swap file location.
    E.g. open /home/testuser/bin/test.sh, vim will create a swap file in /var/tmp/test.sh.swap - alas, /var/tmp is open for all users, while /home/testuser is open only for testuser. Bingo: attack vector.

    - Gilboa
    DEV: Intel S2600C0, 2xE52658V2, 32GB, 4x2TB + 2x3TB, GTX780, F21/x86_64, Dell U2711.
    SRV: Intel S5520SC, 2xX5680, 36GB, 4x2TB, GTX550, F21/x86_64, Dell U2412..
    BACK: Tyan Tempest i5400XT, 2xE5335, 8GB, 3x1.5TB, 9800GTX, F21/x86-64.
    LAP: ASUS N56VJ, i7-3630QM, 16GB, 1TB, 635M, F21/x86_64.

  2. #12
    Join Date
    Jun 2009
    Posts
    2,937

    Default

    For me, it always opens the swap file in the same directory as the file. In fact, it's configurable, and you can tell it to put them all into a hidden temporary directory or something else.

  3. #13
    Join Date
    Jun 2010
    Posts
    72

    Default

    Quote Originally Posted by gilboa View Post
    It does inherit the permissions from the original file - but the problem is not the swap file permissions, but the swap file location.
    E.g. open /home/testuser/bin/test.sh, vim will create a swap file in /var/tmp/test.sh.swap - alas, /var/tmp is open for all users, while /home/testuser is open only for testuser. Bingo: attack vector.

    - Gilboa
    False. It opens the swap in /home/testuser/bin/ and it cribs if it can't.

    If you configured it to use /var/tmp, then the problem is between the chair and monitor, not in ViM.

  4. #14
    Join Date
    Oct 2006
    Location
    Israel
    Posts
    648

    Default

    Quote Originally Posted by devsk View Post
    False. It opens the swap in /home/testuser/bin/ and it cribs if it can't.

    If you configured it to use /var/tmp, then the problem is between the chair and monitor, not in ViM.
    Because we all compile VIM by hand and never use the distribution supplied packages.

    (I'd add something funny comparing your IQ to my shoe size, but its 5.36 am and I'm far too tired and busy to spent any mental resources on mocking you.)

    Flames aside, I should fix my previous message, at least in the Fedora package, vim seems to alternate between using /var/tmp and using the local directory when it comes to placing the .swap file, when backupdir isn't defined in vimrc. I assumed that it was a global behavior and not Fedora specific. (Guess I was wrong).

    - Gilboa
    DEV: Intel S2600C0, 2xE52658V2, 32GB, 4x2TB + 2x3TB, GTX780, F21/x86_64, Dell U2711.
    SRV: Intel S5520SC, 2xX5680, 36GB, 4x2TB, GTX550, F21/x86_64, Dell U2412..
    BACK: Tyan Tempest i5400XT, 2xE5335, 8GB, 3x1.5TB, 9800GTX, F21/x86-64.
    LAP: ASUS N56VJ, i7-3630QM, 16GB, 1TB, 635M, F21/x86_64.

  5. #15
    Join Date
    Oct 2006
    Location
    Israel
    Posts
    648

    Default

    /backupdir/dir[ectory]/ isn't defined.
    DEV: Intel S2600C0, 2xE52658V2, 32GB, 4x2TB + 2x3TB, GTX780, F21/x86_64, Dell U2711.
    SRV: Intel S5520SC, 2xX5680, 36GB, 4x2TB, GTX550, F21/x86_64, Dell U2412..
    BACK: Tyan Tempest i5400XT, 2xE5335, 8GB, 3x1.5TB, 9800GTX, F21/x86-64.
    LAP: ASUS N56VJ, i7-3630QM, 16GB, 1TB, 635M, F21/x86_64.

  6. #16
    Join Date
    Jun 2010
    Posts
    72

    Smile

    Quote Originally Posted by gilboa View Post
    Because we all compile VIM by hand and never use the distribution supplied packages.

    (I'd add something funny comparing your IQ to my shoe size, but its 5.36 am and I'm far too tired and busy to spent any mental resources on mocking you.)

    Flames aside, I should fix my previous message, at least in the Fedora package, vim seems to alternate between using /var/tmp and using the local directory when it comes to placing the .swap file, when backupdir isn't defined in vimrc. I assumed that it was a global behavior and not Fedora specific. (Guess I was wrong).

    - Gilboa
    hehe...You are using world writable directory as your swap and my IQ is low?

  7. #17
    Join Date
    Oct 2006
    Location
    Israel
    Posts
    648

    Default

    hehe... Fedora is using world writeable directory (/var/tmp) as the the alternate swap and my IQ is low?

    Here. Fixed it for you.

    - Gilboa
    DEV: Intel S2600C0, 2xE52658V2, 32GB, 4x2TB + 2x3TB, GTX780, F21/x86_64, Dell U2711.
    SRV: Intel S5520SC, 2xX5680, 36GB, 4x2TB, GTX550, F21/x86_64, Dell U2412..
    BACK: Tyan Tempest i5400XT, 2xE5335, 8GB, 3x1.5TB, 9800GTX, F21/x86-64.
    LAP: ASUS N56VJ, i7-3630QM, 16GB, 1TB, 635M, F21/x86_64.

  8. #18
    Join Date
    Jun 2010
    Posts
    72

    Default

    Quote Originally Posted by gilboa View Post
    hehe... Fedora is using world writeable directory (/var/tmp) as the the alternate swap and my IQ is low?

    Here. Fixed it for you.

    - Gilboa
    OK, my apologies for starting this stupidity! I am sorry dude! I think I may have gone overboard.

  9. #19
    Join Date
    Oct 2006
    Location
    Israel
    Posts
    648

    Default

    Same here. (Was too early, had a short fuse).
    Both me and my shoes apologies.
    DEV: Intel S2600C0, 2xE52658V2, 32GB, 4x2TB + 2x3TB, GTX780, F21/x86_64, Dell U2711.
    SRV: Intel S5520SC, 2xX5680, 36GB, 4x2TB, GTX550, F21/x86_64, Dell U2412..
    BACK: Tyan Tempest i5400XT, 2xE5335, 8GB, 3x1.5TB, 9800GTX, F21/x86-64.
    LAP: ASUS N56VJ, i7-3630QM, 16GB, 1TB, 635M, F21/x86_64.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •