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
11ef77b7
Commit
11ef77b7
authored
Jan 15, 2009
by
Matt McCutchen
Committed by
Wayne Davison
Jan 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the "reverse lookup" daemon-config parameter.
parent
abd32c95
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
8 deletions
+47
-8
NEWS
NEWS
+3
-0
clientserver.c
clientserver.c
+9
-1
loadparm.c
loadparm.c
+4
-0
log.c
log.c
+9
-2
rsyncd.conf.yo
rsyncd.conf.yo
+22
-5
No files found.
NEWS
View file @
11ef77b7
...
...
@@ -33,6 +33,9 @@ Changes since 3.0.4:
MD5 checksum of any transferred file, or all files if --checksum was
specified (when protocol 30 or above is in effect).
- Added the "reverse lookup" parameter to the rsync daemon config file to
allow reverse-DNS lookups to be disabled.
EXTRAS:
- Added an "instant-rsyncd" script to the support directory, which makes
...
...
clientserver.c
View file @
11ef77b7
...
...
@@ -81,6 +81,9 @@ static int rl_nulls = 0;
static
struct
sigaction
sigact
;
#endif
/* Used when "reverse lookup" is off. */
const
char
undetermined_hostname
[]
=
"UNDETERMINED"
;
/**
* Run a client connected to an rsyncd. The alternative to this
* function for remote-shell connections is do_cmd().
...
...
@@ -427,6 +430,11 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
iconv_opt
=
NULL
;
#endif
/* If reverse lookup is disabled globally but enabled for this module,
* we need to do it now before the access check. */
if
(
host
==
undetermined_hostname
&&
lp_reverse_lookup
(
i
))
host
=
client_name
(
f_in
);
if
(
!
allow_access
(
addr
,
host
,
lp_hosts_allow
(
i
),
lp_hosts_deny
(
i
)))
{
rprintf
(
FLOG
,
"rsync denied on module %s from %s (%s)
\n
"
,
name
,
host
,
addr
);
...
...
@@ -927,7 +935,7 @@ int start_daemon(int f_in, int f_out)
exit_cleanup
(
RERR_SYNTAX
);
addr
=
client_addr
(
f_in
);
host
=
client_name
(
f_in
)
;
host
=
lp_reverse_lookup
(
-
1
)
?
client_name
(
f_in
)
:
undetermined_hostname
;
rprintf
(
FLOG
,
"connect from %s (%s)
\n
"
,
host
,
addr
);
if
(
!
am_server
)
{
...
...
loadparm.c
View file @
11ef77b7
...
...
@@ -149,6 +149,7 @@ typedef struct {
BOOL
munge_symlinks
;
BOOL
numeric_ids
;
BOOL
read_only
;
BOOL
reverse_lookup
;
BOOL
strict_modes
;
BOOL
transfer_logging
;
BOOL
use_chroot
;
...
...
@@ -203,6 +204,7 @@ static section sDefault = {
/* munge_symlinks; */
(
BOOL
)
-
1
,
/* numeric_ids; */
(
BOOL
)
-
1
,
/* read_only; */
True
,
/* reverse_lookup; */
True
,
/* strict_modes; */
True
,
/* transfer_logging; */
False
,
/* use_chroot; */
True
,
...
...
@@ -327,6 +329,7 @@ static struct parm_struct parm_table[] =
#endif
{
"read only"
,
P_BOOL
,
P_LOCAL
,
&
sDefault
.
read_only
,
NULL
,
0
},
{
"refuse options"
,
P_STRING
,
P_LOCAL
,
&
sDefault
.
refuse_options
,
NULL
,
0
},
{
"reverse lookup"
,
P_BOOL
,
P_LOCAL
,
&
sDefault
.
reverse_lookup
,
NULL
,
0
},
{
"secrets file"
,
P_STRING
,
P_LOCAL
,
&
sDefault
.
secrets_file
,
NULL
,
0
},
{
"strict modes"
,
P_BOOL
,
P_LOCAL
,
&
sDefault
.
strict_modes
,
NULL
,
0
},
{
"syslog facility"
,
P_ENUM
,
P_LOCAL
,
&
sDefault
.
syslog_facility
,
enum_facilities
,
0
},
...
...
@@ -417,6 +420,7 @@ FN_LOCAL_BOOL(lp_list, list)
FN_LOCAL_BOOL
(
lp_munge_symlinks
,
munge_symlinks
)
FN_LOCAL_BOOL
(
lp_numeric_ids
,
numeric_ids
)
FN_LOCAL_BOOL
(
lp_read_only
,
read_only
)
FN_LOCAL_BOOL
(
lp_reverse_lookup
,
reverse_lookup
)
FN_LOCAL_BOOL
(
lp_strict_modes
,
strict_modes
)
FN_LOCAL_BOOL
(
lp_transfer_logging
,
transfer_logging
)
FN_LOCAL_BOOL
(
lp_use_chroot
,
use_chroot
)
...
...
log.c
View file @
11ef77b7
...
...
@@ -60,6 +60,7 @@ extern char curr_dir[MAXPATHLEN];
extern
char
*
full_module_path
;
extern
unsigned
int
module_dirlen
;
extern
char
sender_file_sum
[
MAX_DIGEST_LEN
];
extern
const
char
undetermined_hostname
[];
static
int
log_initialised
;
static
int
logfile_was_closed
;
...
...
@@ -503,10 +504,16 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
*
c
=
'\0'
;
n
=
NULL
;
/* Note for %h and %a: it doesn't matter what fd we pass to
* client_{name,addr} because rsync_module will already have
* forced the answer to be cached (assuming, of course, for %h
* that lp_reverse_lookup(module_id) is true). */
switch
(
*
p
)
{
case
'h'
:
if
(
am_daemon
)
n
=
client_name
(
0
);
if
(
am_daemon
)
{
n
=
lp_reverse_lookup
(
module_id
)
?
client_name
(
0
)
:
undetermined_hostname
;
}
break
;
case
'a'
:
if
(
am_daemon
)
...
...
rsyncd.conf.yo
View file @
11ef77b7
...
...
@@ -304,10 +304,14 @@ attempted downloads will fail. If "write only" is false then downloads
will be possible if file permissions on the daemon side allow them. The
default is for this parameter to be disabled.
dit(bf(list)) This parameter determines if this module should be
listed when the client asks for a listing of available modules. By
setting this to false you can create hidden modules. The default is
for modules to be listable.
dit(bf(list)) This parameter determines whether this module is
listed when the client asks for a listing of available modules. In addition,
if this is false, the daemon will pretend the module does not exist
when a client denied by "hosts allow" or "hosts deny" attempts to access it.
Realize that if "reverse lookup" is disabled globally but enabled for the
module, the resulting reverse lookup to a potentially client-controlled DNS
server may still reveal to the client that it hit an existing module.
The default is for modules to be listable.
dit(bf(uid)) This parameter specifies the user name or user ID that
file transfers to and from that module should take place as when the daemon
...
...
@@ -450,7 +454,8 @@ quote(itemization(
addresses which match the masked IP address will be allowed in.
it() a hostname. The hostname as determined by a reverse lookup will
be matched (case insensitive) against the pattern. Only an exact
match is allowed in.
match is allowed in. This only works if "reverse lookup" is enabled
(the default).
it() a hostname pattern using wildcards. These are matched using the
same rules as normal unix filename matching. If the pattern matches
then the client is allowed in.
...
...
@@ -481,6 +486,18 @@ rejected. See the "hosts allow" parameter for more information.
The default is no "hosts deny" parameter, which means all hosts can connect.
dit(bf(reverse lookup)) Controls whether the daemon performs a reverse lookup
on the client's IP address to determine its hostname, which is used for
"hosts allow"/"hosts deny" checks and the "%h" log escape. This is enabled by
default, but you may wish to disable it to save time if you know the lookup will
not return a useful result, in which case the daemon will use the name
"UNDETERMINED" instead.
If this parameter is enabled globally (even by default), rsync performs the
lookup as soon as a client connects, so disabling it for a module will not
avoid the lookup. Thus, you probably want to disable it globally and then
enable it for modules that need the information.
dit(bf(ignore errors)) This parameter tells rsyncd to
ignore I/O errors on the daemon when deciding whether to run the delete
phase of the transfer. Normally rsync skips the bf(--delete) step if any
...
...
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