summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-23 19:50:45 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-23 19:50:45 +0000
commit0e8899e3f41e01d15f03727131dc71f9034eca12 (patch)
treef9fe1f8e1609d0d0b7f901b5b68545aed46a1b24 /perl-install/standalone
parenta76650096a8fd27d6fe07f27c54baa87b4f90fc5 (diff)
downloaddrakx-0e8899e3f41e01d15f03727131dc71f9034eca12.tar
drakx-0e8899e3f41e01d15f03727131dc71f9034eca12.tar.gz
drakx-0e8899e3f41e01d15f03727131dc71f9034eca12.tar.bz2
drakx-0e8899e3f41e01d15f03727131dc71f9034eca12.tar.xz
drakx-0e8899e3f41e01d15f03727131dc71f9034eca12.zip
add FIXME notes about missing parameters
(spot by perl_checker)
Diffstat (limited to 'perl-install/standalone')
0 files changed, 0 insertions, 0 deletions
>]); set<string> *deny = read_set(argv[2]); for (int i = 3; i < argc; i++) { Header header; FD_t fd = strcmp(argv[i], "-") == 0 ? fdDup(STDIN_FILENO) : fdOpen(argv[i], O_RDONLY, 0); if (fdFileno(fd) < 0) { fprintf(stderr, "%s: cannot open file %s\n", argv[0], argv[i]); exit(1); } while ((header=headerRead(fd, HEADER_MAGIC_YES))) { int_32 type, count; unsigned short *p; char **f, *name; int printed = 0; headerGetEntry(header, RPMTAG_NAME, &type, (void **) &name, NULL); headerGetEntry(header, RPMTAG_FILEMODES, &type, (void **) &p, &count); headerGetEntry(header, RPMTAG_OLDFILENAMES, &type, (void **) &f, NULL); char ** baseNames, ** dirNames; int_32 * dirIndexes; headerGetEntry(header, RPMTAG_BASENAMES, &type, (void **) &baseNames, NULL); headerGetEntry(header, RPMTAG_DIRINDEXES, &type, (void **) &dirIndexes, NULL); headerGetEntry(header, RPMTAG_DIRNAMES, &type, (void **) &dirNames, NULL); for (int i = 0; i < count; i++) { if ((p[i] & 040111) == 0111) { int ok; if (f) { char *s = strrchr(f[i], '/'); ok = s && s - 3 >= f[i] && strncmp(s - 3, "bin", 3) == 0 && (!allow || allow->count(s + 1)) && (!deny || !deny->count(s + 1)); } else { char *d = dirNames[dirIndexes[i]]; ok = strlen(d) >= 4 && strncmp(d + strlen(d) - 4, "bin/", 4) == 0 && (!allow || allow->count(baseNames[i])) && (!deny || !deny->count(baseNames[i])); } if (ok) { if (!printed) { printed = 1; cout << name; } if (f) cout << " " << f[i]; else cout << " " << dirNames[dirIndexes[i]] << baseNames[i]; } } } if (printed) cout << "\n"; } fdClose(fd); } return 0; }