identify missing keys by type (Toshio Kuratomi)

CVS patchset: 2710
CVS date: 1999/01/18 00:13:45
This commit is contained in:
jbj 1999-01-18 00:13:45 +00:00
parent 260b5c18ce
commit 71171a5c04
3 changed files with 86 additions and 70 deletions

View File

@ -1,4 +1,5 @@
2.5.x -> 2.90 2.5.x -> 2.90
- identify missing keys by type (Toshio Kuratomi).
- package install/removal much smarter about symlinks - package install/removal much smarter about symlinks
- redid install/remove API to allow transaction semantics - redid install/remove API to allow transaction semantics
- support for GPG (Toshio Kuratomi <badger@prtr-13.ucsc.edu>) - support for GPG (Toshio Kuratomi <badger@prtr-13.ucsc.edu>)

View File

@ -145,12 +145,14 @@ int doReSign(int add, char *passPhrase, char **argv)
int doCheckSig(int flags, char **argv) int doCheckSig(int flags, char **argv)
{ {
FD_t fd, ofd; FD_t fd, ofd;
int res, res2, res3, missingKeys; int res, res2, res3;
struct rpmlead lead; struct rpmlead lead;
char *rpm; char *rpm;
char result[1024]; char result[1024];
const char * sigtarget; const char * sigtarget;
unsigned char buffer[8192]; unsigned char buffer[8192];
unsigned char missingKeys[7164];
char *tempKey;
Header sig; Header sig;
HeaderIterator sigIter; HeaderIterator sigIter;
int_32 tag, type, count; int_32 tag, type, count;
@ -209,7 +211,7 @@ int doCheckSig(int flags, char **argv)
sigIter = headerInitIterator(sig); sigIter = headerInitIterator(sig);
res2 = 0; res2 = 0;
missingKeys = 0; missingKeys[0] = '\0';
if (rpmIsVerbose()) { if (rpmIsVerbose()) {
sprintf(buffer, "%s:\n", rpm); sprintf(buffer, "%s:\n", rpm);
} else { } else {
@ -247,7 +249,9 @@ int doCheckSig(int flags, char **argv)
if (res3 == RPMSIG_NOKEY) { if (res3 == RPMSIG_NOKEY) {
/* Do not consider this a failure */ /* Do not consider this a failure */
strcat(buffer, "(PGP) "); strcat(buffer, "(PGP) ");
missingKeys = 1; strcat(missingKeys, " PGP#");
tempKey = strstr(result, "Key ID");
strncat(missingKeys, tempKey+7, 8);
} else { } else {
strcat(buffer, "PGP "); strcat(buffer, "PGP ");
res2 = 1; res2 = 1;
@ -257,7 +261,9 @@ int doCheckSig(int flags, char **argv)
if (res3 == RPMSIG_NOKEY) { if (res3 == RPMSIG_NOKEY) {
/* Do not consider this a failure */ /* Do not consider this a failure */
strcat(buffer, "(GPG) "); strcat(buffer, "(GPG) ");
missingKeys = 1; strcat(missingKeys, " GPG#");
tempKey = strstr(result, "key ID");
strncat(missingKeys, tempKey+7, 8);
} else { } else {
strcat(buffer, "GPG "); strcat(buffer, "GPG ");
res2 = 1; res2 = 1;
@ -302,15 +308,20 @@ int doCheckSig(int flags, char **argv)
if (rpmIsVerbose()) { if (rpmIsVerbose()) {
fprintf(stderr, "%s", (char *)buffer); fprintf(stderr, "%s", (char *)buffer);
} else { } else {
fprintf(stderr, "%s%s%s\n", (char *)buffer, _("NOT OK"), fprintf(stderr, "%s%s%s%s%s\n", (char *)buffer, _("NOT OK"),
missingKeys ? _(" (MISSING KEYS)") : ""); (missingKeys[0] != '\0') ? _(" (MISSING KEYS:") : "",
(char *)missingKeys,
(missingKeys[0] != '\0') ? _(")") : "");
} }
} else { } else {
if (rpmIsVerbose()) { if (rpmIsVerbose()) {
fprintf(stdout, "%s", (char *)buffer); fprintf(stdout, "%s", (char *)buffer);
} else { } else {
fprintf(stdout, "%s%s%s\n", (char *)buffer, _("OK"), fprintf(stdout, "%s%s%s%s%s\n", (char *)buffer, _("OK"),
missingKeys ? _(" (MISSING KEYS)") : ""); (missingKeys[0] != '\0') ? _(" (MISSING KEYS:") : "",
(char *)missingKeys,
(missingKeys[0] != '\0') ? _(")") : "");
} }
} }
} }

View File

@ -7,7 +7,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-01-13 14:17-0500\n" "POT-Creation-Date: 1999-01-17 19:10-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -98,12 +98,12 @@ msgstr ""
msgid "lookup I18N strings in specfile catalog" msgid "lookup I18N strings in specfile catalog"
msgstr "" msgstr ""
#: ../checksig.c:27 ../checksig.c:163 #: ../checksig.c:27 ../checksig.c:165
#, c-format #, c-format
msgid "%s: Open failed\n" msgid "%s: Open failed\n"
msgstr "" msgstr ""
#: ../checksig.c:31 ../checksig.c:168 #: ../checksig.c:31 ../checksig.c:170
#, c-format #, c-format
msgid "%s: readLead failed\n" msgid "%s: readLead failed\n"
msgstr "" msgstr ""
@ -118,12 +118,12 @@ msgstr ""
msgid "%s: Can't re-sign v2.0 RPM\n" msgid "%s: Can't re-sign v2.0 RPM\n"
msgstr "" msgstr ""
#: ../checksig.c:43 ../checksig.c:178 #: ../checksig.c:43 ../checksig.c:180
#, c-format #, c-format
msgid "%s: rpmReadSignature failed\n" msgid "%s: rpmReadSignature failed\n"
msgstr "" msgstr ""
#: ../checksig.c:56 ../checksig.c:192 #: ../checksig.c:56 ../checksig.c:194
msgid "Couldn't read the header/archive" msgid "Couldn't read the header/archive"
msgstr "" msgstr ""
@ -144,30 +144,34 @@ msgstr ""
msgid "Couldn't write package" msgid "Couldn't write package"
msgstr "" msgstr ""
#: ../checksig.c:173 #: ../checksig.c:175
#, c-format #, c-format
msgid "%s: No signature available (v1.0 RPM)\n" msgid "%s: No signature available (v1.0 RPM)\n"
msgstr "" msgstr ""
#: ../checksig.c:183 #: ../checksig.c:185
#, c-format #, c-format
msgid "%s: No signature available\n" msgid "%s: No signature available\n"
msgstr "" msgstr ""
#: ../checksig.c:199 #: ../checksig.c:201
#, c-format #, c-format
msgid "Unable to write %s" msgid "Unable to write %s"
msgstr "" msgstr ""
#: ../checksig.c:305 #: ../checksig.c:311
msgid "NOT OK" msgid "NOT OK"
msgstr "" msgstr ""
#: ../checksig.c:306 ../checksig.c:313 #: ../checksig.c:312 ../checksig.c:322
msgid " (MISSING KEYS)" msgid " (MISSING KEYS:"
msgstr "" msgstr ""
#: ../checksig.c:312 #: ../checksig.c:314 ../checksig.c:324
msgid ")"
msgstr ""
#: ../checksig.c:321
msgid "OK" msgid "OK"
msgstr "" msgstr ""
@ -1511,172 +1515,172 @@ msgstr ""
msgid "syntax error in expression" msgid "syntax error in expression"
msgstr "" msgstr ""
#: ../build/files.c:230 #: ../build/files.c:234
#, c-format #, c-format
msgid "TIMECHECK failure: %s\n" msgid "TIMECHECK failure: %s\n"
msgstr "" msgstr ""
#: ../build/files.c:275 ../build/files.c:287 ../build/files.c:356 #: ../build/files.c:279 ../build/files.c:291 ../build/files.c:360
#: ../build/files.c:368 ../build/files.c:394 #: ../build/files.c:372 ../build/files.c:398
#, c-format #, c-format
msgid "Bad %s() syntax: %s" msgid "Bad %s() syntax: %s"
msgstr "" msgstr ""
#: ../build/files.c:317 #: ../build/files.c:321
#, c-format #, c-format
msgid "Invalid %s token: %s" msgid "Invalid %s token: %s"
msgstr "" msgstr ""
#: ../build/files.c:379 #: ../build/files.c:383
msgid "No files after %%defattr(): %s" msgid "No files after %%defattr(): %s"
msgstr "" msgstr ""
#: ../build/files.c:404 #: ../build/files.c:408
#, c-format #, c-format
msgid "Bad %s() mode spec: %s" msgid "Bad %s() mode spec: %s"
msgstr "" msgstr ""
#: ../build/files.c:416 #: ../build/files.c:420
#, c-format #, c-format
msgid "Bad %s() dirmode spec: %s" msgid "Bad %s() dirmode spec: %s"
msgstr "" msgstr ""
#: ../build/files.c:467 #: ../build/files.c:471
msgid "Bad %%config() syntax: %s" msgid "Bad %%config() syntax: %s"
msgstr "" msgstr ""
#: ../build/files.c:485 #: ../build/files.c:489
msgid "Invalid %%config token: %s" msgid "Invalid %%config token: %s"
msgstr "" msgstr ""
#: ../build/files.c:508 ../build/files.c:520 ../build/files.c:533 #: ../build/files.c:512 ../build/files.c:524 ../build/files.c:537
msgid "Bad %%lang() syntax: %s" msgid "Bad %%lang() syntax: %s"
msgstr "" msgstr ""
#: ../build/files.c:539 #: ../build/files.c:543
msgid "%%lang() entries are 2 characters: %s" msgid "%%lang() entries are 2 characters: %s"
msgstr "" msgstr ""
#: ../build/files.c:545 #: ../build/files.c:549
msgid "Only one entry in %%lang(): %s" msgid "Only one entry in %%lang(): %s"
msgstr "" msgstr ""
#: ../build/files.c:627 #: ../build/files.c:631
msgid "Hit limit for %%docdir" msgid "Hit limit for %%docdir"
msgstr "" msgstr ""
#: ../build/files.c:633 #: ../build/files.c:637
msgid "Only one arg for %%docdir" msgid "Only one arg for %%docdir"
msgstr "" msgstr ""
#. We already got a file -- error #. We already got a file -- error
#: ../build/files.c:658 #: ../build/files.c:662
#, c-format #, c-format
msgid "Two files on one line: %s" msgid "Two files on one line: %s"
msgstr "" msgstr ""
#: ../build/files.c:671 #: ../build/files.c:675
#, c-format #, c-format
msgid "File must begin with \"/\": %s" msgid "File must begin with \"/\": %s"
msgstr "" msgstr ""
#: ../build/files.c:683 #: ../build/files.c:687
msgid "Can't mix special %%doc with other forms: %s" msgid "Can't mix special %%doc with other forms: %s"
msgstr "" msgstr ""
#: ../build/files.c:761 #: ../build/files.c:775
#, c-format #, c-format
msgid "File listed twice: %s" msgid "File listed twice: %s"
msgstr "" msgstr ""
#: ../build/files.c:914 #: ../build/files.c:928
#, c-format #, c-format
msgid "File doesn't match prefix (%s): %s" msgid "File doesn't match prefix (%s): %s"
msgstr "" msgstr ""
#: ../build/files.c:924 ../build/files.c:1039 #: ../build/files.c:938 ../build/files.c:1053
#, c-format #, c-format
msgid "File not found: %s" msgid "File not found: %s"
msgstr "" msgstr ""
#: ../build/files.c:970 #: ../build/files.c:984
#, c-format #, c-format
msgid "Bad owner/group: %s\n" msgid "Bad owner/group: %s\n"
msgstr "" msgstr ""
#: ../build/files.c:975 #: ../build/files.c:989
#, c-format #, c-format
msgid "File %d: %s\n" msgid "File %d: %s\n"
msgstr "" msgstr ""
#: ../build/files.c:1023 #: ../build/files.c:1037
#, c-format #, c-format
msgid "File needs leading \"/\": %s" msgid "File needs leading \"/\": %s"
msgstr "" msgstr ""
#: ../build/files.c:1085 #: ../build/files.c:1099
msgid "Could not open %%files file: %s" msgid "Could not open %%files file: %s"
msgstr "" msgstr ""
#: ../build/files.c:1091 ../build/pack.c:448 #: ../build/files.c:1105 ../build/pack.c:448
#, c-format #, c-format
msgid "line: %s" msgid "line: %s"
msgstr "" msgstr ""
#: ../build/files.c:1355 ../build/parsePrep.c:40 #: ../build/files.c:1369 ../build/parsePrep.c:40
#, c-format #, c-format
msgid "Bad owner/group: %s" msgid "Bad owner/group: %s"
msgstr "" msgstr ""
#: ../build/files.c:1409 #: ../build/files.c:1423
#, c-format #, c-format
msgid "Couldn't exec %s" msgid "Couldn't exec %s"
msgstr "" msgstr ""
#: ../build/files.c:1413 #: ../build/files.c:1427
#, c-format #, c-format
msgid "Couldn't fork %s" msgid "Couldn't fork %s"
msgstr "" msgstr ""
#: ../build/files.c:1463 #: ../build/files.c:1477
#, c-format #, c-format
msgid "%s failed" msgid "%s failed"
msgstr "" msgstr ""
#: ../build/files.c:1467 #: ../build/files.c:1481
#, c-format #, c-format
msgid "failed to write all data to %s" msgid "failed to write all data to %s"
msgstr "" msgstr ""
#: ../build/files.c:1501 #: ../build/files.c:1515
msgid "Finding provides...\n" msgid "Finding provides...\n"
msgstr "" msgstr ""
#: ../build/files.c:1508 #: ../build/files.c:1522
msgid "Failed to find provides" msgid "Failed to find provides"
msgstr "" msgstr ""
#: ../build/files.c:1527 #: ../build/files.c:1541
msgid "Finding requires...\n" msgid "Finding requires...\n"
msgstr "" msgstr ""
#: ../build/files.c:1534 #: ../build/files.c:1548
msgid "Failed to find requires" msgid "Failed to find requires"
msgstr "" msgstr ""
#: ../build/files.c:1568 #: ../build/files.c:1582
msgid "Provides:" msgid "Provides:"
msgstr "" msgstr ""
#: ../build/files.c:1583 #: ../build/files.c:1597
msgid "Prereqs:" msgid "Prereqs:"
msgstr "" msgstr ""
#: ../build/files.c:1595 #: ../build/files.c:1609
msgid "Requires:" msgid "Requires:"
msgstr "" msgstr ""
#: ../build/files.c:1619 #: ../build/files.c:1633
#, c-format #, c-format
msgid "Processing files: %s\n" msgid "Processing files: %s\n"
msgstr "" msgstr ""
@ -2128,32 +2132,32 @@ msgstr ""
msgid "getNextHeader: %s\n" msgid "getNextHeader: %s\n"
msgstr "" msgstr ""
#: ../lib/cpio.c:953 #: ../lib/cpio.c:983
#, c-format #, c-format
msgid "(error 0x%x)" msgid "(error 0x%x)"
msgstr "" msgstr ""
#: ../lib/cpio.c:956 #: ../lib/cpio.c:986
msgid "Bad magic" msgid "Bad magic"
msgstr "" msgstr ""
#: ../lib/cpio.c:957 #: ../lib/cpio.c:987
msgid "Bad header" msgid "Bad header"
msgstr "" msgstr ""
#: ../lib/cpio.c:975 #: ../lib/cpio.c:1005
msgid "Internal error" msgid "Internal error"
msgstr "" msgstr ""
#: ../lib/cpio.c:976 #: ../lib/cpio.c:1006
msgid "Header size too big" msgid "Header size too big"
msgstr "" msgstr ""
#: ../lib/cpio.c:977 #: ../lib/cpio.c:1007
msgid "Unknown file type" msgid "Unknown file type"
msgstr "" msgstr ""
#: ../lib/cpio.c:986 #: ../lib/cpio.c:1016
msgid " failed - " msgid " failed - "
msgstr "" msgstr ""
@ -2369,7 +2373,7 @@ msgstr ""
msgid "warning: %s saved as %s" msgid "warning: %s saved as %s"
msgstr "" msgstr ""
#: ../lib/install.c:419 ../lib/install.c:754 ../lib/uninstall.c:338 #: ../lib/install.c:419 ../lib/install.c:754 ../lib/uninstall.c:337
#, c-format #, c-format
msgid "rename of %s to %s failed: %s" msgid "rename of %s to %s failed: %s"
msgstr "" msgstr ""
@ -3094,21 +3098,21 @@ msgstr ""
msgid "removing database entry\n" msgid "removing database entry\n"
msgstr "" msgstr ""
#: ../lib/uninstall.c:290 #: ../lib/uninstall.c:289
msgid "execution of script failed" msgid "execution of script failed"
msgstr "" msgstr ""
#: ../lib/uninstall.c:349 #: ../lib/uninstall.c:348
#, c-format #, c-format
msgid "cannot remove %s - directory not empty" msgid "cannot remove %s - directory not empty"
msgstr "" msgstr ""
#: ../lib/uninstall.c:352 #: ../lib/uninstall.c:351
#, c-format #, c-format
msgid "rmdir of %s failed: %s" msgid "rmdir of %s failed: %s"
msgstr "" msgstr ""
#: ../lib/uninstall.c:360 #: ../lib/uninstall.c:359
#, c-format #, c-format
msgid "removal of %s failed: %s" msgid "removal of %s failed: %s"
msgstr "" msgstr ""