#!/usr/local/bin/perl # edit_mount.cgi # Display a form for editing or creating a permanent or temporary mounting. require './mount-lib.pl'; &error_setup($text{'edit_err'}); &ReadParse(); if (defined($in{index})) { if ($in{temp}) { # Edit a temporary mount, existing only in the mnttab @mlist = &list_mounted(); @minfo = @{$mlist[$in{index}]}; $mnow = 1; $msave = 0; } else { # Edit a permanent mount, which may or may not be currently # mounted. @mlist = &list_mounts(); @minfo = @{$mlist[$in{index}]}; $msave = 1; $mnow = (&get_mounted($minfo[0], $minfo[1]) >= 0); } if ($in{index} >= @mlist) { &error($text{'edit_egone'}); } &can_edit_fs(@minfo) && !$access{'only'} || &error($text{'edit_ecannot'}); $type = $minfo[2]; &ui_print_header(undef, $text{'edit_title'}, ""); $newm = 0; } else { # creating a new mount (temporary or permanent) $type = $in{type}; &ui_print_header(undef, $text{'create_title'}, ""); $newm = 1; } @mmodes = &mount_modes($type); $msave = ($mmodes[0]==0 ? 0 : $msave); $mnow = ($mmodes[1]==0 ? $msave : $mnow); print "
\n"; } else { # Save and other buttons print ""; } elsif ($mnow && $minfo[2] ne "swap") { print " | \n"; print " |