]> Untitled Git - public.git/commitdiff
Lengthened nonce to 20 chars.
authorClifton Palmer <Clifton.Palmer@gmail.com>
Mon, 3 Apr 2017 23:48:34 +0000 (23:48 +0000)
committerClifton Palmer <Clifton.Palmer@gmail.com>
Mon, 3 Apr 2017 23:49:27 +0000 (23:49 +0000)
Fixed n-length nonce usage.

public

diff --git a/public b/public
index 8c6f828d0ce69193198a4c1e2f32a1c702c8f2ef..0d106314438b4d6d186a46e93b770b0d3b5d8cf9 100755 (executable)
--- a/public
+++ b/public
@@ -12,11 +12,11 @@ my $http_uri = 'http://136.63.171.222/public';
 
 sub nonce {
        my $n = shift;
-       $n = 10 unless $n;
+       $n = 10 unless $n > 0;
 
        my @chars = ( 'a' .. 'z', 'A' .. 'Z', '0' .. '9' );
        my @path = ();
-       push @path, $chars[ rand @chars ] for 1 .. 10;
+       push @path, $chars[ rand @chars ] for 1 .. $n;
 
        return join '', @path;
 }
@@ -41,7 +41,7 @@ sub addFiles {
        die "No match: $name\n" unless @files;
 
        # create nonce dir and add symbolic links
-       my $nonce = nonce();
+       my $nonce = nonce(20);
        my $nonce_dir = makeNonceDir($nonce);
 
        for my $file (@files) {