Skip to content

Commit

Permalink
Moving to rsyncd.conf from /etc to hermetic-usr pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Dec 4, 2023
1 parent 2f9b963 commit 50458ab
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
10 changes: 8 additions & 2 deletions clientserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,10 +1261,16 @@ static void send_listing(int fd)
static int load_config(int globals_only)
{
if (!config_file) {
if (am_daemon < 0 && am_root <= 0)
if (am_daemon < 0 && am_root <= 0) {
config_file = RSYNCD_USERCONF;
else
} else {
config_file = RSYNCD_SYSCONF;
#ifdef RSYNCD_DISTCONF
STRUCT_STAT st;
if (do_stat(RSYNCD_SYSCONF, &st) != 0)
config_file = RSYNCD_DISTCONF;
#endif
}
}
return lp_load(config_file, globals_only);
}
Expand Down
24 changes: 22 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ AC_ARG_WITH(rsync-path,
AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [location of rsync on remote machine])

AC_ARG_WITH(rsyncd-conf,
AS_HELP_STRING([--with-rsyncd-conf=PATH],[set configuration file for rsync server to PATH (default: /etc/rsyncd.conf)]),
AS_HELP_STRING([--with-rsyncd-conf=PATH],[set user/admin defined configuration file for rsync server to PATH (default: /etc/rsyncd.conf)]),
[ if test ! -z "$with_rsyncd_conf" ; then
case $with_rsyncd_conf in
yes|no)
Expand All @@ -193,7 +193,27 @@ AC_ARG_WITH(rsyncd-conf,
fi ],
[ RSYNCD_SYSCONF="/etc/rsyncd.conf" ])

AC_DEFINE_UNQUOTED(RSYNCD_SYSCONF, "$RSYNCD_SYSCONF", [location of configuration file for rsync server])
AC_DEFINE_UNQUOTED(RSYNCD_SYSCONF, "$RSYNCD_SYSCONF", [location of user/admin defined configuration file for rsync server])

AC_ARG_WITH(rsyncd-distconf,
AS_HELP_STRING([--with-rsyncd-distconf=PATH],[set vendor configuration file for rsync server to PATH (default: not set)]),
[ if test ! -z "$with_rsyncd_distconf" ; then
case $with_rsyncd_distconf in
yes|no)
RSYNCD_DISTCONF="/usr/etc/rsyncd.conf"
;;
/*)
RSYNCD_DISTCONF="$with_rsyncd_distconf"
;;
*)
AC_MSG_ERROR(You must specify an absolute path to --with-rsyncd-distconf=PATH)
;;
esac
fi
],
[])

AC_DEFINE_UNQUOTED(RSYNCD_DISTCONF, "$RSYNCD_DISTCONF", [location of vendor configuration file for rsync server])

AC_ARG_WITH(rsh,
AS_HELP_STRING([--with-rsh=CMD],[set remote shell command to CMD (default: ssh)]))
Expand Down
2 changes: 1 addition & 1 deletion rsyncd.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ The /etc/rsyncd.secrets file would look something like this:
## FILES
/etc/rsyncd.conf or rsyncd.conf
rsyncd.conf or /etc/rsyncd.conf or /usr/etc/rsyncd.conf
## SEE ALSO
Expand Down

0 comments on commit 50458ab

Please sign in to comment.