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
0c2ef5f4
Commit
0c2ef5f4
authored
Aug 04, 2003
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure that the error message for mkstemp() includes the full
path of where we're trying to create the temp file.
parent
ca20c7fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
receiver.c
receiver.c
+14
-6
No files found.
receiver.c
View file @
0c2ef5f4
...
...
@@ -206,14 +206,15 @@ static int get_tmpname(char *fnametmp, char *fname)
length
=
strlen
(
fnametmp
);
fnametmp
[
length
++
]
=
'/'
;
fnametmp
[
length
]
=
'\0'
;
/* always NULL terminated */
}
}
if
((
f
=
strrchr
(
fname
,
'/'
))
)
{
/* extra () for gcc */
if
((
f
=
strrchr
(
fname
,
'/'
))
!=
NULL
)
{
++
f
;
if
(
!
tmpdir
)
{
length
=
f
-
fname
;
/* copy up to and including the slash */
strlcpy
(
fnametmp
,
fname
,
length
+
1
);
}
/* copy up to and including the slash */
}
}
else
{
f
=
fname
;
}
...
...
@@ -222,8 +223,7 @@ static int get_tmpname(char *fnametmp, char *fname)
maxname
=
MIN
(
MAXPATHLEN
-
7
-
length
,
NAME_MAX
-
8
);
if
(
maxname
<
1
)
{
if
(
maxname
<
1
)
{
rprintf
(
FERROR
,
"temporary filename too long: %s
\n
"
,
fname
);
fnametmp
[
0
]
=
'\0'
;
return
0
;
...
...
@@ -466,7 +466,15 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen)
fd2
=
do_mkstemp
(
fnametmp
,
file
->
mode
&
INITACCESSPERMS
);
}
if
(
fd2
==
-
1
)
{
rprintf
(
FERROR
,
"mkstemp %s failed: %s
\n
"
,
fnametmp
,
strerror
(
errno
));
extern
char
curr_dir
[];
char
*
p1
,
*
p2
;
if
(
*
fnametmp
==
'.'
)
{
p1
=
curr_dir
;
p2
=
"/"
;
}
else
p1
=
p2
=
""
;
rprintf
(
FERROR
,
"mkstemp %s%s%s failed: %s
\n
"
,
p1
,
p2
,
fnametmp
,
strerror
(
errno
));
receive_data
(
f_in
,
buf
,
-
1
,
NULL
,
file
->
length
);
if
(
buf
)
unmap_file
(
buf
);
if
(
fd1
!=
-
1
)
close
(
fd1
);
...
...
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