Handle hostnames with upper-case letters
[webmin.git] / idmapd / save.cgi
1 #!/usr/local/bin/perl
2 # start.cgi
3 # Save config and restart rpc.idmapd
4
5 require './idmapd-lib.pl';
6
7 &ReadParse();
8 &error_setup($text{'save_err', $config{'idmap_conf'}});
9
10 # Check directory
11 -d $in{'pipefsdir'} || &error(&text('error_dir', $in{'pipefsdir'}));
12
13 # Write the config file
14 &lock_file($config{'idmapd_conf'});
15 open(FILE, "> $config{'idmapd_conf'}");
16 print FILE "[General]\n";
17 print FILE "Pipefs-Directory = $in{'pipefsdir'}\n";
18 print FILE "Domain = $in{'domain'}\n";
19 print FILE "\n[Mapping]\n";
20 print FILE "Nobody-User = $in{'nobody_user'}\n";
21 print FILE "Nobody-Group = $in{'nobody_group'}\n";
22 close(FILE);
23 &unlock_file($config{'idmapd_conf'});
24
25 # Restart rpc.idmapd
26 local $temp = &transname();
27 local $rv = &system_logged("($config{'restart_command'}) </dev/null >$temp 2>&1");
28 local $out = `cat $temp`;
29 unlink($temp);
30 if ($rv) { &error("$out"); }
31
32 &redirect("");