[LON-CAPA-cvs] cvs: loncom /build make_domain_coordinator.pl

raeburn raeburn at source.lon-capa.org
Fri Dec 20 16:13:02 EST 2013


raeburn		Fri Dec 20 21:13:02 2013 EDT

  Modified files:              
    /loncom/build	make_domain_coordinator.pl 
  Log:
  - Use passwd setting mechanism used for Ubuntu/Debian for SuSE 12.3 and 
    newer (LONCAPA-prerequisites need to include dependency on whois package).
  
  
Index: loncom/build/make_domain_coordinator.pl
diff -u loncom/build/make_domain_coordinator.pl:1.25 loncom/build/make_domain_coordinator.pl:1.26
--- loncom/build/make_domain_coordinator.pl:1.25	Thu Apr  4 15:50:05 2013
+++ loncom/build/make_domain_coordinator.pl	Fri Dec 20 21:13:02 2013
@@ -11,7 +11,7 @@
 # The LearningOnline Network
 # make_domain_coordinator.pl - Make a domain coordinator on a system
 #
-# $Id: make_domain_coordinator.pl,v 1.25 2013/04/04 15:50:05 raeburn Exp $
+# $Id: make_domain_coordinator.pl,v 1.26 2013/12/20 21:13:02 raeburn Exp $
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
 #
@@ -360,26 +360,22 @@
           "\n");
 }
  
-my $distro;
+my ($distro,$nostdin);
 if (open(PIPE,"perl distprobe|")) {
     $distro = <PIPE>;
     close(PIPE);
 }
-
-my $setpasswd = 0;
 if ($distro =~ /^ubuntu|debian/) {
-    open(OUT,"|usermod -p `mkpasswd $passwd` $username");
-    close(OUT);
-    $setpasswd = 1;
-} elsif ($distro =~ /^suse(\d+)\.(\d)$/) {
-    if (($1 > 12) || (($1 == 12) && ($2 > 1))) {
-        open(OUT,"|chpasswd");
-        print(OUT "$username:$passwd\n");
-        close(OUT);
-        $setpasswd = 1;
+    $nostdin = 1;
+} elsif ($distro =~ /^suse([\d.]+)$/) {
+    if ($1 > 12.2) {
+        $nostdin = 1;
     }
 }
-unless ($setpasswd) {
+if ($nostdin) {
+    open(OUT,"|usermod -p `mkpasswd $passwd` $username");
+    close(OUT);
+} else {
     open(OUT,"|passwd --stdin $username");
     print(OUT $passwd."\n");
     close(OUT);




More information about the LON-CAPA-cvs mailing list