The Samba-Bugzilla – Attachment 12915 Details for
Bug 12576
popt aliases allow users to bypass sudo argument restrictions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Do not enable popt aliases if --server or --daemon is specified
patch1 (text/plain), 1.94 KB, created by
Paul Donohue
on 2017-02-11 22:22:48 UTC
(
hide
)
Description:
Do not enable popt aliases if --server or --daemon is specified
Filename:
MIME Type:
Creator:
Paul Donohue
Created:
2017-02-11 22:22:48 UTC
Size:
1.94 KB
patch
obsolete
>diff --git a/options.c b/options.c >index 6ba13b7..9ecbd87 100644 >--- a/options.c >+++ b/options.c >@@ -1320,40 +1320,18 @@ int parse_arguments(int *argc_p, const char ***argv_p) > if (pc) > poptFreeContext(pc); > pc = poptGetContext(RSYNC_NAME, argc, argv, long_options, 0); >- if (!am_server) >- poptReadDefaultConfig(pc, 0); > >+ /* Check for --server and --daemon >+ * before processing popt aliases */ > while ((opt = poptGetNextOpt(pc)) != -1) { >- /* most options are handled automatically by popt; >- * only special cases are returned and listed here. */ >- > switch (opt) { >- case OPT_VERSION: >- print_rsync_version(FINFO); >- exit_cleanup(0); >- > case OPT_SERVER: >- if (!am_server) { >- /* Disable popt aliases on the server side and >- * then start parsing the options again. */ >- poptFreeContext(pc); >- pc = poptGetContext(RSYNC_NAME, argc, argv, >- long_options, 0); >- am_server = 1; >- } >+ am_server = 1; > #ifdef ICONV_OPTION > iconv_opt = NULL; > #endif > break; > >- case OPT_SENDER: >- if (!am_server) { >- usage(FERROR); >- exit_cleanup(RERR_SYNTAX); >- } >- am_sender = 1; >- break; >- > case OPT_DAEMON: > if (am_daemon) { > strlcpy(err_buf, >@@ -1423,6 +1401,31 @@ int parse_arguments(int *argc_p, const char ***argv_p) > daemon_opt = 0; > am_daemon = 1; > return 1; >+ } >+ } >+ >+ /* Process popt aliases */ >+ if (!am_server) >+ poptFreeContext(pc); >+ pc = poptGetContext(RSYNC_NAME, argc, argv, long_options, 0); >+ poptReadDefaultConfig(pc, 0); >+ >+ while ((opt = poptGetNextOpt(pc)) != -1) { >+ /* most options are handled automatically by popt; >+ * only special cases are returned and listed here. */ >+ >+ switch (opt) { >+ case OPT_VERSION: >+ print_rsync_version(FINFO); >+ exit_cleanup(0); >+ >+ case OPT_SENDER: >+ if (!am_server) { >+ usage(FERROR); >+ exit_cleanup(RERR_SYNTAX); >+ } >+ am_sender = 1; >+ break; > > case OPT_MODIFY_WINDOW: > /* The value has already been set by popt, but
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 12576
: 12915 |
12916