Skip to contentSkip to conversation

Have mkhomedir_helper working for sshd

PATCH New Sven Vermeulen 2 participants 4 messages Dec 28, 2011 – Jan 4, 2012

lore
Share & tools
lore
#0 lore raw

cover Have mkhomedir_helper working for sshd

The next two patches allow SSHd (through PAM) to create home dirs when new users log on to the system (as is used on larger environments with centralized authentication services).

The necessary services (interfaces) for this are already available in the reference policy through the oddjob module. All we need to do is have sshd be able to domtrans to the proper oddjob domain and mark the mkhomedir_helper as a proper entry point.

Wkr,
Sven Vermeulen

#1 lore raw

PATCH 1/2 Mark mkhomedir_helper as oddjob_mkhomedir_exec_t

The mkhomedir_helper application (part of the PAM distribution) is here marked as an oddjob_mkhomedir_exec_t type so that calls from applications that have oddjob_mkhomedir_domtrans() rights (or _run()) succeed in the correct domain.

---
 oddjob.fc |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
oddjob.fc +2 -0
index bdf8c89..734253e 100644
@@ -2,4 +2,6 @@
 
 /usr/sbin/oddjobd		--	gen_context(system_u:object_r:oddjob_exec_t,s0)
 
+/sbin/mkhomedir_helper		--	gen_context(system_u:object_r:oddjob_mkhomedir_exec_t,s0)
+
 /var/run/oddjobd\.pid			gen_context(system_u:object_r:oddjob_var_run_t,s0)
Signature · 1 line
1.7.3.4
#2 lore raw

PATCH 2/2 sshd can call mkhomedir when a new user logs on

In reply to Sven Vermeulen

These services are offered through the oddjob module.

---
 policy/modules/services/ssh.te |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
policy/modules/services/ssh.te +4 -0
index 3f1dc47..83d44e2 100644
@@ -269,6 +269,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	oddjob_domtrans_mkhomedir(sshd_t)
+')
+
+optional_policy(`
 	rpm_use_script_fds(sshd_t)
 ')
 
Signature · 1 line
1.7.3.4
#3 lore raw

cover Have mkhomedir_helper working for sshd

In reply to Sven Vermeulen
Quoted 8 lines · Sven Vermeulen

The next two patches allow SSHd (through PAM) to create home dirs when new users log on to the system (as is used on larger environments with centralized authentication services).

The necessary services (interfaces) for this are already available in the reference policy through the oddjob module. All we need to do is have sshd be able to domtrans to the proper oddjob domain and mark the mkhomedir_helper as a proper entry point.

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com