skipping symlink with 0-length value
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 200
- Forks
- 85
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 2
Description
Hello,
I've got filesystems with some symlink entries with 0-length value (all of them are symbolic links to a hard drive within a Wine subdirectory). I don't know how to create them in the first place, my few attempts were a failure.
Example below with the the 'z' symlink.
$ ls -l Wine\ Files/dosdevices/
c -> ../drive_c
z -> ''
When running dsync, it translates to this error during the file creation phase:
ERROR: Create [...]/dosdevices/z symlink() failed, (errno=2 No such file or directory)
Using rsync, those special symlink are explicitly skipped:
skipping symlink with 0-length value: "[...]/Wine Files/dosdevices/z"
This is the code in rsync flist.c:
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(file->mode)) {
symlink_name = F_SYMLINK(file);
symlink_len = strlen(symlink_name);
if (symlink_len == 0) {
io_error |= IOERR_GENERAL;
f_name(file, fbuf);
rprintf(FERROR_XFER,
"skipping symlink with 0-length value: %s\n",
full_fname(fbuf));
return NULL;
}
} else {
symlink_name = NULL;
symlink_len = 0;
}
#endif
It would be nice to have a more explicit message rather than the actual 'No such file or directory'.
Jean-Baptiste
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating dsync's symlink creation path and compare its handling with the zero-length check shown from rsync's flist.c. Done means zero-length symlinks are handled explicitly and no longer surface only the misleading “No such file or directory” error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100