5 require './file-lib.pl';
6 $disallowed_buttons{'edit'} && &error($text{'ebutton'});
7 $p = $ENV{'PATH_INFO'};
8 &webmin_log("save", undef, $p) if ($access{'uid'});
9 &switch_acl_uid_and_chroot();
10 print "Content-type: text/plain\n\n";
13 $clen = $ENV{'CONTENT_LENGTH'};
14 &read_fully(STDIN, \$buf, $clen) == $clen ||
15 &error("Failed to read POST input : $!");
17 if (defined($in{'length'}) && length($buf) != $in{'length'}) {
18 print &text('edit_elength'),"\n";
22 if ($access{'ro'} || !&can_access($p)) {
23 print &text('edit_eaccess', $p),"\n";
25 elsif (-l $p && !&must_follow($p)) {
26 print &text('edit_efollow', $p),"\n";
28 elsif (!&open_tempfile(FILE, ">$p", 1)) {
32 &print_tempfile(FILE, $buf);
33 &close_tempfile(FILE);
36 print &file_info_line($p),"\n";
37 &webmin_log("save", undef, $p) if (!$access{'uid'});