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
c9bce0b8
Commit
c9bce0b8
authored
Oct 13, 2006
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed strcpy() calls into strlcpy() calls, just to be extra safe.
parent
deee574b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
12 deletions
+15
-12
permstring.c
lib/permstring.c
+1
-1
pool_alloc.c
lib/pool_alloc.c
+1
-1
log.c
log.c
+4
-4
options.c
options.c
+6
-3
progress.c
progress.c
+1
-1
tls.c
tls.c
+2
-2
No files found.
lib/permstring.c
View file @
c9bce0b8
...
@@ -30,7 +30,7 @@ void permstring(char *perms, mode_t mode)
...
@@ -30,7 +30,7 @@ void permstring(char *perms, mode_t mode)
static
const
char
*
perm_map
=
"rwxrwxrwx"
;
static
const
char
*
perm_map
=
"rwxrwxrwx"
;
int
i
;
int
i
;
str
cpy
(
perms
,
"----------"
);
str
lcpy
(
perms
,
"----------"
,
11
);
for
(
i
=
0
;
i
<
9
;
i
++
)
{
for
(
i
=
0
;
i
<
9
;
i
++
)
{
if
(
mode
&
(
1
<<
i
))
if
(
mode
&
(
1
<<
i
))
...
...
lib/pool_alloc.c
View file @
c9bce0b8
...
@@ -272,7 +272,7 @@ pool_stats(alloc_pool_t p, int fd, int summarize)
...
@@ -272,7 +272,7 @@ pool_stats(alloc_pool_t p, int fd, int summarize)
if
(
pool
->
live
)
if
(
pool
->
live
)
FDEXTSTAT
(
pool
->
live
);
FDEXTSTAT
(
pool
->
live
);
str
cpy
(
buf
,
" FREE BOUND
\n
"
);
str
lcpy
(
buf
,
" FREE BOUND
\n
"
,
sizeof
buf
);
write
(
fd
,
buf
,
strlen
(
buf
));
write
(
fd
,
buf
,
strlen
(
buf
));
for
(
cur
=
pool
->
free
;
cur
;
cur
=
cur
->
next
)
for
(
cur
=
pool
->
free
;
cur
;
cur
=
cur
->
next
)
...
...
log.c
View file @
c9bce0b8
...
@@ -394,7 +394,7 @@ void rsyserr(enum logcode code, int errcode, const char *format, ...)
...
@@ -394,7 +394,7 @@ void rsyserr(enum logcode code, int errcode, const char *format, ...)
char
buf
[
BIGPATHBUFLEN
];
char
buf
[
BIGPATHBUFLEN
];
size_t
len
;
size_t
len
;
str
cpy
(
buf
,
RSYNC_NAME
": "
);
str
lcpy
(
buf
,
RSYNC_NAME
": "
,
sizeof
buf
);
len
=
(
sizeof
RSYNC_NAME
": "
)
-
1
;
len
=
(
sizeof
RSYNC_NAME
": "
)
-
1
;
va_start
(
ap
,
format
);
va_start
(
ap
,
format
);
...
@@ -544,15 +544,15 @@ static void log_formatted(enum logcode code, char *format, char *op,
...
@@ -544,15 +544,15 @@ static void log_formatted(enum logcode code, char *format, char *op,
case
'L'
:
case
'L'
:
if
(
hlink
&&
*
hlink
)
{
if
(
hlink
&&
*
hlink
)
{
n
=
hlink
;
n
=
hlink
;
str
cpy
(
buf2
,
" => "
);
str
lcpy
(
buf2
,
" => "
,
sizeof
buf2
);
}
else
if
(
S_ISLNK
(
file
->
mode
)
&&
file
->
u
.
link
)
{
}
else
if
(
S_ISLNK
(
file
->
mode
)
&&
file
->
u
.
link
)
{
n
=
file
->
u
.
link
;
n
=
file
->
u
.
link
;
str
cpy
(
buf2
,
" -> "
);
str
lcpy
(
buf2
,
" -> "
,
sizeof
buf2
);
}
else
{
}
else
{
n
=
""
;
n
=
""
;
if
(
!
fmt
[
1
])
if
(
!
fmt
[
1
])
break
;
break
;
str
cpy
(
buf2
,
" "
);
str
lcpy
(
buf2
,
" "
,
sizeof
buf2
);
}
}
strlcat
(
fmt
,
"s"
,
sizeof
fmt
);
strlcat
(
fmt
,
"s"
,
sizeof
fmt
);
snprintf
(
buf2
+
4
,
sizeof
buf2
-
4
,
fmt
,
n
);
snprintf
(
buf2
+
4
,
sizeof
buf2
-
4
,
fmt
,
n
);
...
...
options.c
View file @
c9bce0b8
...
@@ -613,8 +613,9 @@ static char err_buf[200];
...
@@ -613,8 +613,9 @@ static char err_buf[200];
void
option_error
(
void
)
void
option_error
(
void
)
{
{
if
(
!
err_buf
[
0
])
{
if
(
!
err_buf
[
0
])
{
strcpy
(
err_buf
,
"Error parsing options: "
strlcpy
(
err_buf
,
"Error parsing options: option may "
"option may be supported on client but not on server?
\n
"
);
"be supported on client but not on server?
\n
"
,
sizeof
err_buf
);
}
}
rprintf
(
FERROR
,
RSYNC_NAME
": %s"
,
err_buf
);
rprintf
(
FERROR
,
RSYNC_NAME
": %s"
,
err_buf
);
...
@@ -832,7 +833,9 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
...
@@ -832,7 +833,9 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
case
OPT_DAEMON
:
case
OPT_DAEMON
:
if
(
am_daemon
)
{
if
(
am_daemon
)
{
strcpy
(
err_buf
,
"Attempt to hack rsync thwarted!
\n
"
);
strlcpy
(
err_buf
,
"Attempt to hack rsync thwarted!
\n
"
,
sizeof
err_buf
);
return
0
;
return
0
;
}
}
poptFreeContext
(
pc
);
poptFreeContext
(
pc
);
...
...
progress.c
View file @
c9bce0b8
...
@@ -104,7 +104,7 @@ static void rprint_progress(OFF_T ofs, OFF_T size, struct timeval *now,
...
@@ -104,7 +104,7 @@ static void rprint_progress(OFF_T ofs, OFF_T size, struct timeval *now,
stats
.
num_files
-
stats
.
current_file_index
-
1
,
stats
.
num_files
-
stats
.
current_file_index
-
1
,
stats
.
num_files
);
stats
.
num_files
);
}
else
}
else
str
cpy
(
eol
,
"
\r
"
);
str
lcpy
(
eol
,
"
\r
"
,
sizeof
eol
);
rprintf
(
FCLIENT
,
"%12s %3d%% %7.2f%s %4d:%02d:%02d%s"
,
rprintf
(
FCLIENT
,
"%12s %3d%% %7.2f%s %4d:%02d:%02d%s"
,
human_num
(
ofs
),
pct
,
rate
,
units
,
human_num
(
ofs
),
pct
,
rate
,
units
,
remain_h
,
remain_m
,
remain_s
,
eol
);
remain_h
,
remain_m
,
remain_s
,
eol
);
...
...
tls.c
View file @
c9bce0b8
...
@@ -74,7 +74,7 @@ static void list_file(const char *fname)
...
@@ -74,7 +74,7 @@ static void list_file(const char *fname)
buf
.
st_mode
&=
~
0777
;
buf
.
st_mode
&=
~
0777
;
buf
.
st_mtime
=
(
time_t
)
0
;
buf
.
st_mtime
=
(
time_t
)
0
;
buf
.
st_uid
=
buf
.
st_gid
=
0
;
buf
.
st_uid
=
buf
.
st_gid
=
0
;
str
cpy
(
linkbuf
,
" -> "
);
str
lcpy
(
linkbuf
,
" -> "
,
sizeof
linkbuf
);
/* const-cast required for silly UNICOS headers */
/* const-cast required for silly UNICOS headers */
len
=
readlink
((
char
*
)
fname
,
linkbuf
+
4
,
sizeof
(
linkbuf
)
-
4
);
len
=
readlink
((
char
*
)
fname
,
linkbuf
+
4
,
sizeof
(
linkbuf
)
-
4
);
if
(
len
==
-
1
)
if
(
len
==
-
1
)
...
@@ -99,7 +99,7 @@ static void list_file(const char *fname)
...
@@ -99,7 +99,7 @@ static void list_file(const char *fname)
(
int
)
mt
->
tm_min
,
(
int
)
mt
->
tm_min
,
(
int
)
mt
->
tm_sec
);
(
int
)
mt
->
tm_sec
);
}
else
{
}
else
{
str
cpy
(
datebuf
,
" "
);
str
lcpy
(
datebuf
,
" "
,
sizeof
datebuf
);
}
}
/* TODO: Perhaps escape special characters in fname? */
/* TODO: Perhaps escape special characters in fname? */
...
...
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