The Samba-Bugzilla – Attachment 4974 Details for
Bug 6915
Reject passing an argument to an option that doesn't take one
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for rsync's included popt
popt-unwanted-arg-rsync.diff (text/plain), 1.52 KB, created by
Matt McCutchen
on 2009-11-20 20:47:27 UTC
(
hide
)
Description:
Patch for rsync's included popt
Filename:
MIME Type:
Creator:
Matt McCutchen
Created:
2009-11-20 20:47:27 UTC
Size:
1.52 KB
patch
obsolete
>diff --git a/popt/popt.c b/popt/popt.c >index a01b6b9..dc50504 100644 >--- a/popt/popt.c >+++ b/popt/popt.c >@@ -866,9 +866,13 @@ int poptGetNextOpt(poptContext con) > > if (opt == NULL) return POPT_ERROR_BADOPT; /* XXX can't happen */ > if (opt->arg && (opt->argInfo & POPT_ARG_MASK) == POPT_ARG_NONE) { >+ if (longArg) >+ return POPT_ERROR_UNWANTEDARG; > if (poptSaveInt((int *)opt->arg, opt->argInfo, 1L)) > return POPT_ERROR_BADOPERATION; > } else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_VAL) { >+ if (longArg) >+ return POPT_ERROR_UNWANTEDARG; > if (opt->arg) { > if (poptSaveInt((int *)opt->arg, opt->argInfo, (long)opt->val)) > return POPT_ERROR_BADOPERATION; >@@ -1202,6 +1206,8 @@ const char * poptStrerror(const int error) > switch (error) { > case POPT_ERROR_NOARG: > return POPT_("missing argument"); >+ case POPT_ERROR_UNWANTEDARG: >+ return POPT_("option does not take an argument"); > case POPT_ERROR_BADOPT: > return POPT_("unknown option"); > case POPT_ERROR_BADOPERATION: >diff --git a/popt/popt.h b/popt/popt.h >index 4f85d9e..8d85f73 100644 >--- a/popt/popt.h >+++ b/popt/popt.h >@@ -82,6 +82,7 @@ > /*@{*/ > #define POPT_ERROR_NOARG -10 /*!< missing argument */ > #define POPT_ERROR_BADOPT -11 /*!< unknown option */ >+#define POPT_ERROR_UNWANTEDARG -12 /*!< option does not take an argument */ > #define POPT_ERROR_OPTSTOODEEP -13 /*!< aliases nested too deeply */ > #define POPT_ERROR_BADQUOTE -15 /*!< error in paramter quoting */ > #define POPT_ERROR_ERRNO -16 /*!< errno set, use strerror(errno) */
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 6915
:
4974
|
4975