VirtualBox

Ticket #4771 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Truncating files does not work on shared folders (Linux guest) => Fixed in SVN/3.0.8

Reported by: martin_frb Owned by:
Priority: major Component: shared folders
Version: VirtualBox 3.0.6 Keywords: truncate
Cc: Guest type: Linux
Host type: other

Description

Host: Vista Guest: Ubuntu9 Vbox 3.0.2

The below c program fails to truncate fails if the file is on a shared folder The program runs on the guest, so the file is actually a file on the vista host.

  • The program works fine, if the file is *not* on a shared folder.
  • The program does not works, if the file *is* on a shared folder.
  • I can compile it with or without O_EXCL => makes no difference. I did also run the resulting exe as root to be sure.
  • The file is found and open did succeed (f has a positive value, usually 3)
  • ftruncate also returns success (zero)

this is somewhat similar to bug 2257 (except that piping shorter/empty text (or dev/null) into the file actually works

#include <stdio.h> #include <fcntl.h> int main() {

int f = open("/mnt/share/text", O_WRONLY); | O_EXCL ); printf("%d", f); ftruncate(f, 0); close(f);

}

Change History

comment:1 Changed 5 years ago by martin_frb

Create something ate the linebreaks ...

#include <stdio.h>

#include <fcntl.h>

int main() {

int f = open("/mnt/share/text", O_WRONLY); | O_EXCL );

printf("%d", f);

ftruncate(f, 0);

close(f);

}

comment:2 Changed 5 years ago by martin_frb

some more research in existing bugs, this may be related to #3712

comment:3 Changed 5 years ago by frank

  • Host type changed from Windows to other
  • Version changed from VirtualBox 3.0.2 to VirtualBox 3.0.6
  • Summary changed from truncate files does not work on shared folder (3.0.2) host Vista / guest ubuntu to Truncating files does not work on shared folders (Linux guest) => Fixed in SVN

No, this bug is not related to #3712. Actually this bug was just fixed in SVN and the fix will be part of the next maintenance release. This was a bug (missing case) in the Linux guest additions so make sure to update the additions to verify the fix.

comment:4 Changed 5 years ago by sandervl73

  • Status changed from new to closed
  • Resolution set to fixed
  • Summary changed from Truncating files does not work on shared folders (Linux guest) => Fixed in SVN to Truncating files does not work on shared folders (Linux guest) => Fixed in SVN/3.0.8
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use