#!/usr/bin/perl -w # -*- perl -*- use P4CGI ; use strict ; # ################################################################# # CONFIGURATION INFORMATION # All config info should be in P4CGI.pm # ################################################################# # # P4 file download # Download a file # ################################################################# # Get file spec argument my $file = P4CGI::cgi()->param("FSPC") ; &P4CGI::bail("No file specified") unless defined $file ; $file = &P4CGI::htmlEncode($file) ; my $filename = $file ; $filename =~ s/.*\/// ; my $revision = P4CGI::cgi()->param("REV") ; &P4CGI::bail("No revision specified") unless defined $revision ; $revision=~ s/^(\d+).*/$1/ ; local *P4 ; &P4CGI::p4call( *P4, "print -q \"$file#$revision\"" ); $file = join('',<P4>) ; close P4 ; my $len = length($file) ; print "Content-type: application/octet-stream\n", "Content-Disposition: attachment;filename=$filename;size=$len\n", "Content-Description: Download file:$filename Rev:$revision\n", "\n" ; print $file ; # # That's all folks #
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 4306 | Fredric Fredricson |
P4DB: Hardened P4DB against malicious parameters (cross site scripting), performed some cleanup and increased version to 3.1.1. |
||
#1 | 1638 | Fredric Fredricson | P4DB: Added all (I think) files for P4DB |