diff options
author | Guillem Jover <guillem@debian.org> | 2014-08-07 01:17:50 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-08-10 01:37:48 +0200 |
commit | d6838f2dca3da5a9eb8615002a1e7fef7766b81b (patch) | |
tree | 8aa412efd8514845490303ef3180b7e0f2847750 | |
parent | e161b733cf23716f35328afcd6f0ac23dc4f8e03 (diff) | |
download | dpkg-d6838f2dca3da5a9eb8615002a1e7fef7766b81b.tar.gz |
dpkg: Fix --add-architecture and --remove-architecture to take one argument
These commands take exactly one argument, check that and error out.
Closes: #757254
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | src/main.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index 8999982e0..cb8c8930c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -102,6 +102,8 @@ dpkg (1.17.11) UNRELEASED; urgency=low one of the build types excluding them. * Add new -g and -G options to dpkg-genchanges and dpkg-buildpackage for source plus arch-indep/specific builds. Closes: #756975 + * Fix dpkg --add-architecture and --remove-architecture to check that they + get exactly one argument. Closes: #757254 [ Updated programs translations ] * Danish (Joe Dalton). Closes: #754127 diff --git a/src/main.c b/src/main.c index 6e15f3fd3..65c36268c 100644 --- a/src/main.c +++ b/src/main.c @@ -498,8 +498,8 @@ arch_add(const char *const *argv) struct dpkg_arch *arch; const char *archname = *argv++; - if (archname == NULL) - badusage(_("--%s takes one argument"), cipaction->olong); + if (archname == NULL || *argv) + badusage(_("--%s takes exactly one argument"), cipaction->olong); dpkg_arch_load_list(); @@ -528,8 +528,8 @@ arch_remove(const char *const *argv) struct pkgiterator *iter; struct pkginfo *pkg; - if (archname == NULL) - badusage(_("--%s takes one argument"), cipaction->olong); + if (archname == NULL || *argv) + badusage(_("--%s takes exactly one argument"), cipaction->olong); modstatdb_open(msdbrw_readonly); |