From 27ee1916248d6748316aea2985344ab7b4d53349 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 19 Nov 2019 22:50:09 +0100 Subject: [PATCH] ud-generate: deal with users without loginShell --- debian/changelog | 1 + ud-generate | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 1ea927e..bdf0c40 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,6 +28,7 @@ userdir-ldap (0.3.97) UNRELEASED; urgency=medium * ud-host: use subprocess.Popen instead of os.popen. * Use ldap.initialize instead of ldap.open for compatibility with python-ldap 3.2.0. * ud-fingerserv: fix logging when using ipv6 and inetd + * ud-generate: deal with users without loginShell -- Peter Palfrader Sat, 06 Apr 2019 22:04:34 +0200 diff --git a/ud-generate b/ud-generate index eb38748..db6770d 100755 --- a/ud-generate +++ b/ud-generate @@ -215,6 +215,8 @@ def GenPasswd(accounts, File, HomePrefix, PwdMarker): userlist = {} i = 0 for a in accounts: + if 'loginShell' not in a: + continue # Do not let people try to buffer overflow some busted passwd parser. if len(a['gecos']) > 100 or len(a['loginShell']) > 50: continue -- 2.20.1