Skip to contentSkip to conversation

sudo: Add ldap support for sudoers rules

PATCH New Chris Frederick 2 participants 4 messages Oct 24, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sudo: Add ldap support for sudoers rules

Added Config.in options to enable/disable the option, and check options in sudo.mk to add openldap as a dependancy and compile with --with-ldap. Also added more help text to describe behaviour changes.

---
 package/sudo/Config.in | 14 ++++++++++++++
 package/sudo/sudo.mk   |  7 +++++++
 2 files changed, 21 insertions(+)
package/sudo/Config.in +14 -0
index cbef15d..ae8dbf9 100644
@@ -9,3 +9,17 @@ config BR2_PACKAGE_SUDO
 	  but still allow people to get their work done.
 
 	  http://www.sudo.ws/sudo/
+
+if BR2_PACKAGE_SUDO && BR2_PACKAGE_OPENLDAP
+config BR2_PACKAGE_SUDO_LDAP
+	bool "ldap integration"
+	depends on BR2_PACKAGE_SUDO
+	help
+	  Allows you to manage sudoers rules in a centralized ldap
+	  directory. This restricts the /etc/sudoers file from
+	  defining rules, only defaults will be read. All rules will
+	  need to be provided via ldap configured in /etc/ldap.conf
+
+	  http://www.sudo.ws/man/1.8.15/sudoers.ldap.man.html
+endif
+
package/sudo/sudo.mk +7 -0
index f28312a..45273bb 100644
@@ -30,6 +30,13 @@ else
 SUDO_CONF_OPTS += --without-pam
 endif
 
+ifeq ($(BR2_PACKAGE_SUDO_LDAP),y)
+SUDO_DEPENDENCIES += openldap
+SUDO_CONF_OPTS += --with-ldap
+else
+SUDO_CONF_OPTS += --without-ldap
+endif
+
 # mksigname/mksiglist needs to run on build host to generate source files
 define SUDO_BUILD_MKSIGNAME_MKSIGLIST_HOST
 	$(MAKE) $(HOST_CONFIGURE_OPTS) \
Signature · 1 line
2.7.3
#1 lore raw

PATCH 1/2 sudo: Add ldap support for sudoers rules

Disregard this patch. A new one is on the way.

Quoted 51 lines · Chris Frederick

Added Config.in options to enable/disable the option, and check options in sudo.mk to add openldap as a dependancy and compile with --with-ldap. Also added more help text to describe behaviour changes.

---
 package/sudo/Config.in | 14 ++++++++++++++
 package/sudo/sudo.mk   |  7 +++++++
 2 files changed, 21 insertions(+)
package/sudo/Config.in +14 -0
index cbef15d..ae8dbf9 100644
@@ -9,3 +9,17 @@ config BR2_PACKAGE_SUDO
 	  but still allow people to get their work done.
 
 	  http://www.sudo.ws/sudo/
+
+if BR2_PACKAGE_SUDO && BR2_PACKAGE_OPENLDAP
+config BR2_PACKAGE_SUDO_LDAP
+	bool "ldap integration"
+	depends on BR2_PACKAGE_SUDO
+	help
+	  Allows you to manage sudoers rules in a centralized ldap
+	  directory. This restricts the /etc/sudoers file from
+	  defining rules, only defaults will be read. All rules will
+	  need to be provided via ldap configured in /etc/ldap.conf
+
+	  http://www.sudo.ws/man/1.8.15/sudoers.ldap.man.html
+endif
+
package/sudo/sudo.mk +7 -0
index f28312a..45273bb 100644
@@ -30,6 +30,13 @@ else
 SUDO_CONF_OPTS += --without-pam
 endif
 
+ifeq ($(BR2_PACKAGE_SUDO_LDAP),y)
+SUDO_DEPENDENCIES += openldap
+SUDO_CONF_OPTS += --with-ldap
+else
+SUDO_CONF_OPTS += --without-ldap
+endif
+
 # mksigname/mksiglist needs to run on build host to generate source files
 define SUDO_BUILD_MKSIGNAME_MKSIGLIST_HOST
 	$(MAKE) $(HOST_CONFIGURE_OPTS) \
#2 lore raw

PATCH 2/2 postgresql: enable ldap support for pg_service.conf

In reply to Chris Frederick

Just needed to add --with-ldap to POSTGRESQL_CONF_OPTS and add openldap to POSTGRESQL_DEPENDENCIES when BR2_PACKAGE_OPENLDAP is on

---
 package/postgresql/postgresql.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/postgresql/postgresql.mk +7 -0
index e2756bf..1b184e7 100644
@@ -57,6 +57,13 @@ POSTGRESQL_DEPENDENCIES += openssl
 POSTGRESQL_CONF_OPTS += --with-openssl
 endif
 
+ifeq ($(BR2_PACKAGE_OPENLDAP),y)
+POSTGRESQL_DEPENDENCIES += openldap
+POSTGRESQL_CONF_OPTS += --with-ldap
+else
+POSTGRESQL_CONF_OPTS += --without-ldap
+endif
+
 define POSTGRESQL_USERS
 	postgres -1 postgres -1 * /var/lib/pgsql /bin/sh - PostgreSQL Server
 endef
Signature · 1 line
2.7.3
#3 lore raw

PATCH 2/2 postgresql: enable ldap support for pg_service.conf

Hello,

Quoted 7 lines · Chris Frederick

Just needed to add --with-ldap to POSTGRESQL_CONF_OPTS and add openldap to POSTGRESQL_DEPENDENCIES when BR2_PACKAGE_OPENLDAP is on

---
 package/postgresql/postgresql.mk | 7 +++++++
 1 file changed, 7 insertions(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com