disallow - chars in version and release

CVS patchset: 969
CVS date: 1996/08/20 14:19:10
This commit is contained in:
root 1996-08-20 14:19:10 +00:00
parent d25b955f3b
commit 9c30ac18f9
1 changed files with 16 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Here's what we do
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "header.h"
#include "spec.h"
@ -159,6 +160,7 @@ int verifySpec(Spec s)
struct PackageRec *pr;
struct packageFieldsRec *fields;
char name[1024];
char *val;
if (EMPTY(s->name)) {
OOPS("No Name field");
@ -182,6 +184,20 @@ int verifySpec(Spec s)
if (checkHeaderTags(pr->header, fields)) {
res = 1;
}
val = NULL;
getEntry(pr->header, RPMTAG_VERSION, NULL, (void *) &val, NULL);
if (val && strchr(val, '-')) {
error(RPMERR_BADSPEC, "Illegal '-' char in version: %s\n", val);
res = 1;
}
val = NULL;
getEntry(pr->header, RPMTAG_RELEASE, NULL, (void *) &val, NULL);
if (val && strchr(val, '-')) {
error(RPMERR_BADSPEC, "Illegal '-' char in release: %s\n", val);
res = 1;
}
pr = pr->next;
fields = subpackageFields;
}