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
667e72a1
Commit
667e72a1
authored
Jun 18, 1998
by
Andrew Tridgell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change the order of chmod and chown calls so that setuid bits don't
get removed by chown calls.
parent
e1b3d5c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
52 deletions
+53
-52
rsync.c
rsync.c
+53
-52
No files found.
rsync.c
View file @
667e72a1
...
...
@@ -291,18 +291,6 @@ static int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
}
}
#ifdef HAVE_CHMOD
if
(
preserve_perms
&&
!
S_ISLNK
(
st
->
st_mode
)
&&
st
->
st_mode
!=
file
->
mode
)
{
updated
=
1
;
if
(
do_chmod
(
fname
,
file
->
mode
)
!=
0
)
{
rprintf
(
FERROR
,
"failed to set permissions on %s : %s
\n
"
,
fname
,
strerror
(
errno
));
return
0
;
}
}
#endif
if
((
am_root
||
!
am_daemon
)
&&
((
am_root
&&
preserve_uid
&&
st
->
st_uid
!=
file
->
uid
)
||
(
preserve_gid
&&
st
->
st_gid
!=
file
->
gid
)))
{
...
...
@@ -311,14 +299,27 @@ static int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
preserve_gid
?
file
->
gid
:-
1
)
!=
0
)
{
if
(
preserve_uid
&&
st
->
st_uid
!=
file
->
uid
)
updated
=
1
;
if
(
verbose
>
1
||
preserve_uid
)
if
(
verbose
>
1
||
preserve_uid
)
{
rprintf
(
FERROR
,
"chown %s : %s
\n
"
,
fname
,
strerror
(
errno
));
return
updated
;
return
0
;
}
}
updated
=
1
;
}
#ifdef HAVE_CHMOD
if
(
preserve_perms
&&
!
S_ISLNK
(
st
->
st_mode
)
&&
st
->
st_mode
!=
file
->
mode
)
{
updated
=
1
;
if
(
do_chmod
(
fname
,
file
->
mode
)
!=
0
)
{
rprintf
(
FERROR
,
"failed to set permissions on %s : %s
\n
"
,
fname
,
strerror
(
errno
));
return
0
;
}
}
#endif
if
(
verbose
>
1
&&
report
)
{
if
(
updated
)
rprintf
(
FINFO
,
"%s
\n
"
,
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