Handle hostnames with upper-case letters
[webmin.git] / file / makelink.cgi
1 #!/usr/local/bin/perl
2 # makelink.cgi
3 # Create a symbolic link
4
5 require './file-lib.pl';
6 $disallowed_buttons{'makelink'} && &error($text{'ebutton'});
7 &ReadParse();
8 &webmin_log("link", undef, $in{'from'}, \%in);
9 &switch_acl_uid_and_chroot();
10 print "Content-type: text/plain\n\n";
11 &lock_file($in{'from'});
12 if ($access{'ro'} || !&can_access($in{'from'})) {
13         print &text('link_efrom2', $in{'from'}),"\n";
14         }
15 elsif ($follow) {
16         print $text{'link_efollow'},"\n";
17         }
18 elsif (!symlink($in{'to'}, $in{'from'})) {
19         print "$!\n";
20         }
21 else {
22         print "\n";
23         print &file_info_line($in{'from'}),"\n";
24         &unlock_file($in{'from'});
25         }
26