diff --git a/scripts/upload.cgi/README b/scripts/upload.cgi/README index fbf142a..4678a82 100644 --- a/scripts/upload.cgi/README +++ b/scripts/upload.cgi/README @@ -5,23 +5,23 @@ to date ;) Alias /repo/pkgs/ /repo/pkgs/ - - SSLVerifyClient optional - SSLVerifyDepth 1 - SSLOptions +StrictRequire +StdEnvVars +OptRenegotiate - # require that the access comes from internal or that - # the client auth cert was created by us and signed by us - SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \ - and %{SSL_CLIENT_S_DN_O} eq "Fedora Project" \ - and %{SSL_CLIENT_I_DN_O} eq "Fedora Project" \ - and %{SSL_CLIENT_I_DN_OU} eq "Upload Files" ) - + + SSLVerifyClient optional + SSLVerifyDepth 1 + SSLOptions +StrictRequire +StdEnvVars +OptRenegotiate + # require that the access comes from internal or that + # the client auth cert was created by us and signed by us + SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \ + and %{SSL_CLIENT_S_DN_O} eq "Fedora Project" \ + and %{SSL_CLIENT_I_DN_O} eq "Fedora Project" \ + and %{SSL_CLIENT_I_DN_OU} eq "Upload Files" ) + - - SetHandler cgi-script - Options ExecCGI - Order Allow,Deny - Allow from all - SSLRequireSSL - + + SetHandler cgi-script + Options ExecCGI + Order Allow,Deny + Allow from all + SSLRequireSSL + diff --git a/scripts/upload.cgi/upload.cgi b/scripts/upload.cgi/upload.cgi index 0921597..f864942 100644 --- a/scripts/upload.cgi/upload.cgi +++ b/scripts/upload.cgi/upload.cgi @@ -96,8 +96,7 @@ else: print >> sys.stderr, 'Processing upload request: NAME=%s FILENAME=%s MD5SUM=%s' % (name, filename, md5sum) module_dir = os.path.join(CACHE_DIR, name) -file_dir = os.path.join(module_dir, filename) -md5_dir = os.path.join(file_dir, md5sum) +md5_dir = os.path.join(module_dir, filename, md5sum) # first test if the module really exists cvs_dir = os.path.join(CVSREPO, name) @@ -126,19 +125,20 @@ if not os.path.isdir(module_dir): os.makedirs(module_dir, 02775) # grab a temporary filename and dump our file in there -tempfile.tempdir = my_moddir +tempfile.tempdir = module_dir tmpfile = tempfile.mktemp(md5sum) tmpfd = open(tmpfile, 'w') # now read the whole file in m = md5_constructor() filesize = 0 -while s = upload_file.file.read(BUFFER_SIZE): - if not s: +while True: + data = upload_file.file.read(BUFFER_SIZE) + if not data: break - tmpfd.write(s) - m.update(s) - filesize += len(s) + tmpfd.write(data) + m.update(data) + filesize += len(data) # now we're done reading, check the MD5 sum of what we got tmpfd.close()