Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
a70d070c
Commit
a70d070c
authored
Jan 15, 2003
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make unsafe_symlink() take const args so that we don't get any
compiler warnings when calling it with a const char *.
parent
1f1fbe18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
util.c
util.c
+5
-5
No files found.
util.c
View file @
a70d070c
...
...
@@ -793,15 +793,15 @@ int u_strcmp(const char *cs1, const char *cs2)
*
* @sa t_unsafe.c
**/
int
unsafe_symlink
(
c
har
*
dest
,
char
*
src
)
int
unsafe_symlink
(
c
onst
char
*
dest_path
,
const
char
*
src_path
)
{
char
*
tok
;
char
*
tok
,
*
src
,
*
dest
;
int
depth
=
0
;
/* all absolute and null symlinks are unsafe */
if
(
!
dest
||
!
(
*
dest
)
||
(
*
dest
==
'/'
)
)
return
1
;
if
(
!
dest
_path
||
!*
dest_path
||
*
dest_path
==
'/'
)
return
1
;
src
=
strdup
(
src
);
src
=
strdup
(
src
_path
);
if
(
!
src
)
out_of_memory
(
"unsafe_symlink"
);
/* find out what our safety margin is */
...
...
@@ -819,7 +819,7 @@ int unsafe_symlink(char *dest, char *src)
/* drop by one to account for the filename portion */
depth
--
;
dest
=
strdup
(
dest
);
dest
=
strdup
(
dest
_path
);
if
(
!
dest
)
out_of_memory
(
"unsafe_symlink"
);
for
(
tok
=
strtok
(
dest
,
"/"
);
tok
;
tok
=
strtok
(
NULL
,
"/"
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment