Merge commit 'upstream/1.7.2p1'
[debian/sudo] / debian / sudo-ldap.postinst
index 36cdd235c89e4de80576edfa280def1318d16944..9dea6d781347268e6470b7b098d6dceb4ecd4634 100644 (file)
@@ -16,12 +16,16 @@ if ( ! -f "/etc/sudoers") {
          "#\n",
          "# See the man page for details on how to write a sudoers file.\n",
          "#\n\nDefaults\tenv_reset\n\n",
-         "# Uncomment to allow members of group sudo to not need a password\n",
-         "# %sudo ALL=NOPASSWD: ALL\n\n",
          "# Host alias specification\n\n",
          "# User alias specification\n\n",
          "# Cmnd alias specification\n\n",
-         "# User privilege specification\nroot\tALL=(ALL) ALL\n";
+         "# User privilege specification\nroot\tALL=(ALL) ALL\n\n",
+         "# Allow members of group sudo to not need a password\n",
+         "# (Note that later entries override this, so you might need to move\n",
+          "# it further down)\n",
+         "%sudo ALL=(ALL) ALL\n",
+         "#\n",
+         "#includedir /etc/sudoers.d\n";
        close SUDOERS;
 
 }
@@ -61,4 +65,10 @@ if ($gid != 27) {
 print "Creating group 'sudo' with gid = $gid\n";
 system("groupadd -g $gid sudo");
 
+# create symlink to ease transition to new path for ldap config
+# if old config file exists and new one doesn't
+if (-e "/etc/ldap/ldap.conf" && ! -e "/etc/sudo-ldap.conf") {
+  system("ln -s ldap/ldap.conf /etc/sudo-ldap.conf");
+}
+
 print "";