fun notTmp s =
String.sub (s, 0) <> #"."
+ andalso s <> "_darcs"
andalso CharVector.all (fn ch => Char.isAlphaNum ch orelse ch = #"." orelse ch = #"_" orelse ch = #"-") s
fun setupUser () =
let
val (_, context) = requestContext (fn () => ())
val bio = OpenSSL.connect true (context,
- Config.Dbms.dbmsNode ^ ":" ^ Int.toString Config.slavePort)
+ Domain.nodeIp Config.Dbms.dbmsNode ^ ":" ^ Int.toString Config.slavePort)
in
Msg.send (bio, MsgCreateDbUser dbtype);
case Msg.recv bio of
let
val (_, bio) = requestBio (fn () => ())
in
- Msg.send (bio, MsgPortalPasswdMailbox p);
- case Msg.recv bio of
- NONE => print "Server closed connection unexpectedly.\n"
- | SOME m =>
- case m of
- MsgOk => print ("The password for " ^ #user p ^ "@" ^ #domain p ^ " has been changed.\n")
- | MsgError s => print ("Set failed: " ^ s ^ "\n")
- | _ => print "Unexpected server reply.\n";
- OpenSSL.close bio
- end
+ (Msg.send (bio, MsgPortalPasswdMailbox p);
+ case Msg.recv bio of
+ NONE => (print "Server closed connection unexpectedly.\n"; OS.Process.failure)
+ | SOME m =>
+ case m of
+ MsgOk => (print ("The password for " ^ #user p ^ "@" ^ #domain p ^ " has been changed.\n");
+ OS.Process.success)
+ | MsgError s => (print ("Set failed: " ^ s ^ "\n"); OS.Process.failure)
+ | _ => (print "Unexpected server reply.\n"; OS.Process.failure))
+ before OpenSSL.close bio
+ end
fun requestRmMailbox p =
let
OpenSSL.close bio
end
-fun requestMysqlFixperms () =
- let
- val (_, context) = requestContext (fn () => ())
- val bio = OpenSSL.connect true (context,
- Config.Dbms.dbmsNode ^ ":" ^ Int.toString Config.slavePort)
- in
- Msg.send (bio, MsgMysqlFixperms);
- case Msg.recv bio of
- NONE => print "Server closed connection unexpectedly.\n"
- | SOME m =>
- case m of
- MsgOk => print "Permissions granted.\n"
- | MsgError s => print ("Failed: " ^ s ^ "\n")
- | _ => print "Unexpected server reply.\n";
- OpenSSL.close bio
- end
-
fun requestApt {node, pkg} =
let
val (user, context) = requestContext (fn () => ())
val ok = ref true
- fun contactNode (node, ip) =
+ fun contactNode (node, ip, ipv6) =
if node = Config.dispatcherName then
Domain.resetLocal ()
else let
ignore (foldl checker' (basis', SM.empty) files)
end
end
- else if String.isSuffix "_admin" user then
+ else if (String.isSuffix "_admin" user) orelse (String.isSuffix ".daemon" user) then
()
else
(print ("Couldn't access " ^ user ^ "'s ~/.domtool directory.\n");
("Invalid database name " ^ user ^ "_" ^ dbname,
SOME ("Invalid database name " ^ dbname)))
(fn () => ())
- | MsgMysqlFixperms =>
- (print "Starting mysql-fixperms\n";
- doIt (fn () => if OS.Process.isSuccess
- (OS.Process.system "/usr/bin/sudo -H /afs/hcoop.net/common/etc/scripts/mysql-grant-table-drop") then
- ("Requested mysql-fixperms",
- NONE)
- else
- ("Requested mysql-fixperms, but execution failed!",
- SOME "Script execution failed."))
- (fn () => ()))
| MsgFirewallRegen =>
doIt (fn () => (Acl.read Config.aclFile;
if Acl.query {user = user, class = "priv", value = "all"} then