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
943882a2
Commit
943882a2
authored
May 23, 1998
by
Andrew Tridgell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- don't allow chown for the group of a file if running as a daemon and
uid!=0 - reset am_root after startup as a daemon
parent
6c82f74b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
clientserver.c
clientserver.c
+3
-0
rsync.c
rsync.c
+4
-2
No files found.
clientserver.c
View file @
943882a2
...
...
@@ -121,6 +121,7 @@ static int rsync_module(int fd, int i)
char
*
request
=
NULL
;
extern
int
am_sender
;
extern
int
remote_version
;
extern
int
am_root
;
if
(
!
allow_access
(
addr
,
host
,
lp_hosts_allow
(
i
),
lp_hosts_deny
(
i
)))
{
rprintf
(
FERROR
,
"rsync denied on module %s from %s (%s)
\n
"
,
...
...
@@ -204,6 +205,8 @@ static int rsync_module(int fd, int i)
return
-
1
;
}
am_root
=
(
getuid
()
==
0
);
io_printf
(
fd
,
"@RSYNCD: OK
\n
"
);
argv
[
argc
++
]
=
"rsyncd"
;
...
...
rsync.c
View file @
943882a2
...
...
@@ -267,6 +267,7 @@ static int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
{
int
updated
=
0
;
STRUCT_STAT
st2
;
extern
int
am_daemon
;
if
(
dry_run
)
return
0
;
...
...
@@ -300,8 +301,9 @@ static int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
}
#endif
if
((
am_root
&&
preserve_uid
&&
st
->
st_uid
!=
file
->
uid
)
||
(
preserve_gid
&&
st
->
st_gid
!=
file
->
gid
))
{
if
((
am_root
||
!
am_daemon
)
&&
((
am_root
&&
preserve_uid
&&
st
->
st_uid
!=
file
->
uid
)
||
(
preserve_gid
&&
st
->
st_gid
!=
file
->
gid
)))
{
if
(
do_lchown
(
fname
,
(
am_root
&&
preserve_uid
)
?
file
->
uid
:-
1
,
preserve_gid
?
file
->
gid
:-
1
)
!=
0
)
{
...
...
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