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
1923b1fc
Commit
1923b1fc
authored
Jan 31, 2004
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switched a buffer name in make_file() to make the code a little more
similar to what is in receive_file_entry().
parent
5dc4003e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
flist.c
flist.c
+17
-18
No files found.
flist.c
View file @
1923b1fc
...
...
@@ -724,36 +724,35 @@ struct file_struct *make_file(char *fname, struct string_area **ap,
STRUCT_STAT
st
;
char
sum
[
SUM_LENGTH
];
char
*
p
;
char
cleaned_
name
[
MAXPATHLEN
];
char
this
name
[
MAXPATHLEN
];
char
linkbuf
[
MAXPATHLEN
];
unsigned
short
flags
=
0
;
if
(
strlcpy
(
cleaned_name
,
fname
,
sizeof
cleaned_
name
)
>=
sizeof
cleaned_
name
-
flist_dir_len
)
{
if
(
strlcpy
(
thisname
,
fname
,
sizeof
this
name
)
>=
sizeof
this
name
-
flist_dir_len
)
{
rprintf
(
FINFO
,
"skipping overly long name: %s
\n
"
,
fname
);
return
NULL
;
}
clean_fname
(
cleaned_
name
);
clean_fname
(
this
name
);
if
(
sanitize_paths
)
sanitize_path
(
cleaned_name
,
NULL
);
fname
=
cleaned_name
;
sanitize_path
(
thisname
,
NULL
);
memset
(
sum
,
0
,
SUM_LENGTH
);
if
(
readlink_stat
(
f
name
,
&
st
,
linkbuf
)
!=
0
)
{
if
(
readlink_stat
(
this
name
,
&
st
,
linkbuf
)
!=
0
)
{
int
save_errno
=
errno
;
if
(
errno
==
ENOENT
&&
exclude_level
!=
NO_EXCLUDES
)
{
/* either symlink pointing nowhere or file that
* was removed during rsync run; see if excluded
* before reporting an error */
if
(
check_exclude_file
(
f
name
,
0
,
exclude_level
))
{
if
(
check_exclude_file
(
this
name
,
0
,
exclude_level
))
{
/* file is excluded anyway, ignore silently */
return
NULL
;
}
}
io_error
|=
IOERR_GENERAL
;
rprintf
(
FERROR
,
"readlink %s failed: %s
\n
"
,
full_fname
(
f
name
),
strerror
(
save_errno
));
full_fname
(
this
name
),
strerror
(
save_errno
));
return
NULL
;
}
...
...
@@ -762,7 +761,7 @@ struct file_struct *make_file(char *fname, struct string_area **ap,
goto
skip_excludes
;
if
(
S_ISDIR
(
st
.
st_mode
)
&&
!
recurse
&&
!
files_from
)
{
rprintf
(
FINFO
,
"skipping directory %s
\n
"
,
f
name
);
rprintf
(
FINFO
,
"skipping directory %s
\n
"
,
this
name
);
return
NULL
;
}
...
...
@@ -774,17 +773,17 @@ struct file_struct *make_file(char *fname, struct string_area **ap,
flags
|=
FLAG_MOUNT_POINT
;
}
if
(
check_exclude_file
(
f
name
,
S_ISDIR
(
st
.
st_mode
)
!=
0
,
exclude_level
))
if
(
check_exclude_file
(
this
name
,
S_ISDIR
(
st
.
st_mode
)
!=
0
,
exclude_level
))
return
NULL
;
if
(
lp_ignore_nonreadable
(
module_id
)
&&
access
(
f
name
,
R_OK
)
!=
0
)
if
(
lp_ignore_nonreadable
(
module_id
)
&&
access
(
this
name
,
R_OK
)
!=
0
)
return
NULL
;
skip_excludes:
if
(
verbose
>
2
)
{
rprintf
(
FINFO
,
"[%s] make_file(%s,*,%d)
\n
"
,
who_am_i
(),
f
name
,
exclude_level
);
who_am_i
(),
this
name
,
exclude_level
);
}
file
=
new
(
struct
file_struct
);
...
...
@@ -793,20 +792,20 @@ struct file_struct *make_file(char *fname, struct string_area **ap,
memset
((
char
*
)
file
,
0
,
sizeof
(
*
file
));
file
->
flags
=
flags
;
if
((
p
=
strrchr
(
f
name
,
'/'
)))
{
if
((
p
=
strrchr
(
this
name
,
'/'
)))
{
static
char
*
lastdir
;
*
p
=
0
;
if
(
lastdir
&&
strcmp
(
f
name
,
lastdir
)
==
0
)
if
(
lastdir
&&
strcmp
(
this
name
,
lastdir
)
==
0
)
file
->
dirname
=
lastdir
;
else
{
file
->
dirname
=
strdup
(
f
name
);
file
->
dirname
=
strdup
(
this
name
);
lastdir
=
file
->
dirname
;
}
file
->
basename
=
STRDUP
(
ap
,
p
+
1
);
*
p
=
'/'
;
}
else
{
file
->
dirname
=
NULL
;
file
->
basename
=
STRDUP
(
ap
,
f
name
);
file
->
basename
=
STRDUP
(
ap
,
this
name
);
}
file
->
modtime
=
st
.
st_mtime
;
...
...
@@ -836,7 +835,7 @@ struct file_struct *make_file(char *fname, struct string_area **ap,
if
(
always_checksum
&&
S_ISREG
(
st
.
st_mode
))
{
if
(
!
(
file
->
u
.
sum
=
(
char
*
)
MALLOC
(
ap
,
MD4_SUM_LENGTH
)))
out_of_memory
(
"md4 sum"
);
file_checksum
(
f
name
,
file
->
u
.
sum
,
st
.
st_size
);
file_checksum
(
this
name
,
file
->
u
.
sum
,
st
.
st_size
);
}
file
->
basedir
=
flist_dir
;
...
...
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