Fix sshfs: file systems that do not support hard links but make a copy instead.

Andreas requested to merge andibm/gnome-keyring:master into master

Three cases need to be considered:

  1. The file system supports hard links created by link().
  2. The file system does not support link(). This is covered by calling copy_to_temp_file() instead.
  3. The file system does not support hard links, however it makes a copy instead when link() is called.

The third case is not covered yet: link() generates the file, but this is not noticed and in turn making a copy in copy_to_temp_file() fails, as the file already exists. The loop generates files until MAX_TRIES is reached.

The commit checks if 'result' exists after calling link() and covers the last case which is needed to support home directories on sshfs.

Corresponding issue: #84

Edited by Andreas

Merge request reports