Page MenuHome GnuPG

is_file_compressed (filename, &rc2)) doesn`t CloseHandle files in windows
Closed, ResolvedPublic

Description

iobuf_close (inp) doesn`t fclose the files in windows OS

Tested with 2.0.28 and 2.1.6 builded with w64-mingw32 gcc-4.9

How to reproduce.

Add pause or sleep to end of g10_exit function. run as gpg2.exe -r XXXXXX -e
file.txt Try to remove or rename file.txt file.

This bug is not present in linux.

Details

Version
2.1.6

Event Timeline

justanon added projects: gnupg, Bug Report.
justanon added a subscriber: justanon.
justanon renamed this task from iobuf_close (inp) doesn`t fclose the files in windows to is_file_compressed doesn`t (filename, &rc2)) CloseHandle files in windows.Jul 19 2015, 9:52 PM

if (do_compress && cfx.dek->use_mdc && is_file_compressed(filename, &rc2))

  {
    if (opt.verbose)
      log_info(_("'%s' already compressed\n"), filename);
    do_compress = 0;
  }
if (rc2)
  {
    rc = rc2;
    goto leave;
  }
justanon renamed this task from is_file_compressed doesn`t (filename, &rc2)) CloseHandle files in windows to is_file_compressed (filename, &rc2)) doesn`t CloseHandle files in windows.Jul 19 2015, 9:53 PM
werner added a subscriber: werner.

That is not a bug. gpg keeps keeps files open and only closes them as needed.
For example before renaming a file under Windows. This is actually the same
uner Windows and Unix but under Unix we have the inode concept and thus we can
rename open files.

werner claimed this task.