/* Find how deeply inside an .RPM the real data is */ /* kept, and report the offset in bytes */ /* Wouldn't it be a lot more sane if we could just untar these things? */ #include #include main() { long int i; char p[3]; for (i=0, read(0,p,1) && read(0,p+1,1) && read(0,p+2,1); p+2 != NULL; p[0]=p[1],p[1]=p[2],read(0,p+2,1),i++) { if (*p == '\037' && p[1] == '\213' && p[2] == '\010') { printf("%ld\n",i); exit(0); } else if (*p == 'B' && p[1] == 'Z' && p[2] == 'h' ) { printf("%ld\n",i); exit(0); } } exit(1); }