Skip to content

Commit

Permalink
Document unsafe_symlink().
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Pool committed Apr 8, 2002
1 parent ac13ad1 commit 036e70b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,18 @@ void show_progress(OFF_T ofs, OFF_T size)

/**
* Determine if a symlink points outside the current directory tree.
* This is considered "unsafe" because e.g. when mirroring somebody
* else's machine it might allow them to establish a symlink to
* /etc/passwd, and then read it through a web server.
*
* @param dest Target of the symlink in question.
*
* @src src Top source directory currently applicable. Basically this
* is the first parameter to rsync in a simple invocation, but it's
* modified as topsrcname in slightly complex ways.
*
* @retval True if unsafe
* @retval False is unsafe
**/
int unsafe_symlink(char *dest, char *src)
{
Expand Down

0 comments on commit 036e70b

Please sign in to comment.