Commit b60444f1 authored by Bernhard Link's avatar Bernhard Link

Some more checking of values used as part of directory/filenames

parent 3d5e4ac0
......@@ -140,6 +140,10 @@ retvalue binaries_calcfilekeys(const char *component,const char *sourcename,cons
char *filekey;
retvalue r;
r = propername(sourcename);
if( RET_WAS_ERROR(r) ) {
return r;
}
filekey = calc_filekey(component,sourcename,basename);
if( !filekey )
return RET_ERROR_OOM;
......@@ -157,6 +161,7 @@ static inline retvalue calcnewcontrol(const char *chunk,const char *sourcename,c
if( RET_WAS_ERROR(r) )
return r;
assert( filekeys->count == 1 );
*newchunk = chunk_replacefield(chunk,"Filename",filekeys->values[0]);
if( !*newchunk ) {
strlist_done(filekeys);
......
/* This file is part of "reprepro"
* Copyright (C) 2003 Bernhard R. Link
* Copyright (C) 2003,2004 Bernhard R. Link
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
......@@ -161,6 +161,20 @@ static inline retvalue calcnewcontrol(
struct strlist *filekeys,char **newchunk,struct strlist *origfiles) {
char *directory;
retvalue r;
int i;
r = properpackagename(package);
assert( r != RET_NOTHING );
i = 0;
while( RET_IS_OK(r) && i < basenames->count ) {
r = propername(basenames->values[i]);
assert( r != RET_NOTHING );
i++;
}
if( RET_WAS_ERROR(r) ) {
fprintf(stderr,"Forbidden characters in source package '%s'!\n",package);
return r;
}
directory = calc_sourcedir(component,package);
if( !directory )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment