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
cd8185f2
Commit
cd8185f2
authored
Nov 19, 1998
by
Andrew Tridgell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added "refuse options" option
parent
6bd98f06
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
2 deletions
+63
-2
clientserver.c
clientserver.c
+1
-2
loadparm.c
loadparm.c
+4
-0
options.c
options.c
+50
-0
rsyncd.conf.yo
rsyncd.conf.yo
+8
-0
No files found.
clientserver.c
View file @
cd8185f2
...
...
@@ -310,8 +310,7 @@ static int rsync_module(int fd, int i)
io_start_multiplex_out
(
fd
);
if
(
!
ret
)
{
rprintf
(
FERROR
,
"Error parsing options (unsupported option?) - aborting
\n
"
);
exit_cleanup
(
RERR_SYNTAX
);
option_error
();
}
if
(
lp_timeout
(
i
))
{
...
...
loadparm.c
View file @
cd8185f2
...
...
@@ -130,6 +130,7 @@ typedef struct
char
*
exclude
;
char
*
exclude_from
;
char
*
log_format
;
char
*
refuse_options
;
int
timeout
;
}
service
;
...
...
@@ -153,6 +154,7 @@ static service sDefault =
NULL
,
/* exclude */
NULL
,
/* exclude from */
"%o %h [%a] %m (%u) %f %l"
,
/* log format */
NULL
,
/* refuse options */
0
/* timeout */
};
...
...
@@ -261,6 +263,7 @@ static struct parm_struct parm_table[] =
{
"exclude from"
,
P_STRING
,
P_LOCAL
,
&
sDefault
.
exclude_from
,
NULL
,
0
},
{
"transfer logging"
,
P_BOOL
,
P_LOCAL
,
&
sDefault
.
transfer_logging
,
NULL
,
0
},
{
"log format"
,
P_STRING
,
P_LOCAL
,
&
sDefault
.
log_format
,
NULL
,
0
},
{
"refuse options"
,
P_STRING
,
P_LOCAL
,
&
sDefault
.
refuse_options
,
NULL
,
0
},
{
NULL
,
P_BOOL
,
P_NONE
,
NULL
,
NULL
,
0
}
};
...
...
@@ -333,6 +336,7 @@ FN_LOCAL_STRING(lp_secrets_file, secrets_file)
FN_LOCAL_STRING
(
lp_exclude
,
exclude
)
FN_LOCAL_STRING
(
lp_exclude_from
,
exclude_from
)
FN_LOCAL_STRING
(
lp_log_format
,
log_format
)
FN_LOCAL_STRING
(
lp_refuse_options
,
refuse_options
)
FN_LOCAL_INTEGER
(
lp_timeout
,
timeout
)
/* local prototypes */
...
...
options.c
View file @
cd8185f2
...
...
@@ -205,14 +205,62 @@ static struct option long_options[] = {
{
0
,
0
,
0
,
0
}};
static
char
err_buf
[
100
];
void
option_error
(
void
)
{
if
(
err_buf
[
0
])
{
rprintf
(
FLOG
,
"%s"
,
err_buf
);
rprintf
(
FERROR
,
"%s"
,
err_buf
);
}
else
{
rprintf
(
FLOG
,
"Error parsing options - unsupported option?
\n
"
);
rprintf
(
FERROR
,
"Error parsing options - unsupported option?
\n
"
);
}
exit_cleanup
(
RERR_UNSUPPORTED
);
}
/* check to see if we should refuse this option */
static
int
check_refuse_options
(
char
*
ref
,
int
opt
)
{
int
i
,
len
;
char
*
p
;
const
char
*
name
;
for
(
i
=
0
;
long_options
[
i
].
name
;
i
++
)
{
if
(
long_options
[
i
].
val
==
opt
)
break
;
}
if
(
!
long_options
[
i
].
name
)
return
0
;
name
=
long_options
[
i
].
name
;
len
=
strlen
(
name
);
while
((
p
=
strstr
(
ref
,
name
)))
{
if
(
p
[
len
]
==
' '
||
p
[
len
]
==
0
)
{
slprintf
(
err_buf
,
sizeof
(
err_buf
),
"The '%s' option is not supported by this server
\n
"
,
name
);
return
1
;
}
ref
+=
len
;
}
return
0
;
}
int
parse_arguments
(
int
argc
,
char
*
argv
[])
{
int
opt
;
int
option_index
;
char
*
ref
=
lp_refuse_options
(
module_id
);
while
((
opt
=
getopt_long
(
argc
,
argv
,
short_options
,
long_options
,
&
option_index
))
!=
-
1
)
{
if
(
ref
)
{
if
(
check_refuse_options
(
ref
,
opt
))
return
0
;
}
switch
(
opt
)
{
case
OPT_VERSION
:
rprintf
(
FINFO
,
"rsync version %s protocol version %d
\n\n
"
,
...
...
@@ -308,6 +356,7 @@ int parse_arguments(int argc, char *argv[])
#if SUPPORT_HARD_LINKS
preserve_hard_links
=
1
;
#else
slprintf
(
err_buf
,
sizeof
(
err_buf
),
"hard links are not supported on this server
\n
"
);
rprintf
(
FERROR
,
"ERROR: hard links not supported on this platform
\n
"
);
return
0
;
#endif
...
...
@@ -428,6 +477,7 @@ int parse_arguments(int argc, char *argv[])
break
;
default:
slprintf
(
err_buf
,
sizeof
(
err_buf
),
"unrecognised option
\n
"
);
return
0
;
}
}
...
...
rsyncd.conf.yo
View file @
cd8185f2
...
...
@@ -286,6 +286,14 @@ is specified in seconds. A value of zero means no timeout and is the
default. A good choice for anonymous rsync servers may be 600 (giving
a 10 minute timeout).
dit(bf(refuse options)) The "refuse options" option allows you to
specify a space separated list of rsync command line options that will
be refused by your rsync server. When an option is refused the server
prints an error message and exits.
The full names of the options must be used (ie. you must use
"compress" not "z" to disable compression).
enddit()
manpagesection(AUTHENTICATION STRENGTH)
...
...
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