Release release_20141005
authorClinton Ebadi <clinton@unknownlamer.org>
Mon, 6 Oct 2014 03:45:12 +0000 (23:45 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Mon, 6 Oct 2014 03:45:12 +0000 (23:45 -0400)
scripts/domtool-addcert
scripts/domtool-publish
scripts/domtool-vmailpasswd
src/client.sig
src/client.sml
src/main-portal.sml
src/main.sml

index 9b5495b..21eddba 100755 (executable)
@@ -30,7 +30,7 @@ if [ "$2" != '-unsafe' ]; then
     if [ -z "`getent passwd $USER`" ]; then
        echo "$USER does not exist. This must be a server principal."
     else
-       chown -R $USER.nogroup $KEYDIR
+       chown -R $USER:nogroup $KEYDIR
     fi
 fi
 
index 0771867..cd5e196 100755 (executable)
@@ -64,7 +64,7 @@ case $1 in
                fi
                /usr/bin/rsync -r --delete ${VMAILDB}/ /etc/courier/userdb
                /usr/sbin/makeuserdb
-               /bin/chown -R domtool.nogroup /etc/courier/userdb
+               /bin/chown -R domtool:nogroup /etc/courier/userdb
                /bin/cat /etc/courier/userdb/* >/etc/courier/exim
                /bin/chmod o-r /etc/courier/exim
                /usr/sbin/exim_dbmbuild /etc/courier/exim /etc/courier/exim.dat
@@ -79,10 +79,10 @@ case $1 in
                /bin/grep $2 /var/log/exim4/mainlog
        ;;
         apache-fixperms)
-                /bin/chown -R domtool.nogroup /var/log/apache2/user
+                /bin/chown -R domtool:nogroup /var/log/apache2/user
         ;;
         apache1.3-fixperms)
-                /bin/chown -R domtool.nogroup /var/log/apache/user
+                /bin/chown -R domtool:nogroup /var/log/apache/user
         ;;
         users)
                 /bin/cp /var/domtool/waklog.conf /etc/apache2/
index 1ebb365..f2df2bf 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python
 # -*- python -*-
 
 # Helper for domtool to check if a vmail password matches the stored
index 8cf8cd4..4b4b571 100644 (file)
@@ -24,6 +24,8 @@ signature CLIENT = sig
           | Aborted
           | Error
 
+    val hastty : unit -> bool
+
     val getpass : unit -> passwd_result
     (* Standard non-echoed console password input with confirmation *)
 end
index 00000e7..a92b13f 100644 (file)
@@ -25,12 +25,15 @@ datatype passwd_result =
        | Aborted
        | Error
 
+fun hastty () =
+    Posix.ProcEnv.isatty Posix.FileSys.stdin
+
 fun getpass () =
     let
        val tty = Posix.FileSys.stdin
        val termios = SOME (Posix.TTY.TC.getattr tty)
                      handle OS.SysErr (reason, SOME syserr) =>
-                            if syserr = Posix.Error.notty then
+                            if syserr = Posix.Error.notty orelse syserr = Posix.Error.inval then
                                 (print "Warning: no terminal found, not hiding password\n";
                                  TextIO.flushOut TextIO.stdOut;
                                  NONE)
index 93f7612..068d16c 100644 (file)
@@ -29,16 +29,31 @@ fun die reason = (printerr reason; printerr "\n"; OS.Process.exit OS.Process.fai
 val _ =
     case CommandLine.arguments () of
        ["vmailpasswd", domain, user] =>
-       (case Client.getpass () of
-            Client.Passwd oldpasswd =>
-            (case Client.getpass () of 
-                 Client.Passwd newpasswd =>
-                 Main.requestPortalPasswdMailbox {domain = domain,
-                                                  user = user,
-                                                  oldpasswd = oldpasswd,
-                                                  newpasswd = newpasswd}
-                 | Client.Aborted => die "Aborted"
-                 | Client.Error => die "New passwords did not match")
-          | _ => die "Error entering old password")
+       if (Client.hastty ())
+       then
+           (case Client.getpass () of
+                Client.Passwd oldpasswd =>
+                (case Client.getpass () of 
+                     Client.Passwd newpasswd =>
+                     Main.requestPortalPasswdMailbox {domain = domain,
+                                                      user = user,
+                                                      oldpasswd = oldpasswd,
+                                                      newpasswd = newpasswd}
+                   | Client.Aborted => die "Aborted"
+                   | Client.Error => die "New passwords did not match")
+              | _ => die "Error entering old password")
+       else
+           let
+               val oldpasswd = TextIO.inputLine TextIO.stdIn
+               val newpasswd = TextIO.inputLine TextIO.stdIn
+           in
+               case (oldpasswd, newpasswd) of
+                   (SOME oldpasswd, SOME newpasswd) => 
+                   Main.requestPortalPasswdMailbox {domain = domain,
+                                                    user = user,
+                                                    oldpasswd = String.substring (oldpasswd, 0, size oldpasswd - 1),
+                                                    newpasswd = String.substring (newpasswd, 0, size newpasswd - 2)}
+                   | _ => die "Invalid input"
+           end
       | _  => die "Invalid command-line arguments"
        
index 1816f78..475d1aa 100644 (file)
@@ -56,6 +56,7 @@ fun check' G fname =
 
 fun basis () =
     let
+       val _ = ErrorMsg.reset ()
        val dir = Posix.FileSys.opendir Config.libRoot
 
        fun loop files =