Files
webmin/servers/logout.cgi
Ilia Ross dfce125874
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
Fix server login and logout cookie validation to be numeric
2026-10-19 15:58:59 +02:00

21 lines
432 B
Perl
Executable File

#!/usr/local/bin/perl
# logout.cgi
# Cancel the username and password cookie for a server
use strict;
use warnings;
no warnings 'redefine';
no warnings 'uninitialized';
require './servers-lib.pl';
&ReadParse();
our (%in);
$in{'id'} =~ s/\r|\n|\0//g;
$in{'id'} =~ /\A[0-9]+\z/ || &error("Invalid server ID");
print "Set-Cookie: $in{'id'}=; path=/";
if (uc($ENV{'HTTPS'}) eq 'ON') {
print "; secure";
}
print "\n";
&redirect("");