From c2e8129d123a0723a9597ef2faa1a2b6063f0c36 Mon Sep 17 00:00:00 2001 From: tmraz Date: Jul 25 2007 17:08:26 +0000 Subject: - add support for winbind offline login (#232955) --- diff --git a/authconfig-gtk.py b/authconfig-gtk.py index 909b1b6..7d8d7e1 100755 --- a/authconfig-gtk.py +++ b/authconfig-gtk.py @@ -162,6 +162,7 @@ class Authconfig: "realm" : ("smbRealm", ""), "servers" : ("smbServers", ""), "shell" : ("winbindTemplateShell", ["/bin/false"] + acutil.getusershells(), ()), + "offline" : ("winbindOffline", ""), "join" : ("winbindjoin_maybe_launch", "") } self.launch_map = { diff --git a/authconfig.glade b/authconfig.glade index deb21c3..8692532 100644 --- a/authconfig.glade +++ b/authconfig.glade @@ -17,6 +17,7 @@ GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True + False @@ -1277,6 +1278,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False True @@ -1458,6 +1460,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False True @@ -1639,6 +1642,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False True @@ -1914,6 +1918,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False True @@ -2095,6 +2100,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False True @@ -2327,6 +2333,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False True @@ -2645,6 +2652,39 @@ True + + + + True + False + 0 + + + + 5 + True + True + Allow offline login + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + True + False + + + + + 0 + True + True + + @@ -2663,6 +2703,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False True @@ -2900,6 +2941,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False True @@ -3094,6 +3136,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False True @@ -3243,6 +3286,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False True diff --git a/authconfig.py b/authconfig.py index 012e304..8b5f7f1 100755 --- a/authconfig.py +++ b/authconfig.py @@ -170,7 +170,11 @@ class Authconfig: parser.add_option("--enablewinbindusedefaultdomain", action="store_true", help=_("configures winbind to assume that users with no domain in their user names are domain users")) parser.add_option("--disablewinbindusedefaultdomain", action="store_true", - help=_("configures winbind to assume that users with no domain in their user names are not domain users")) + help=_("configures winbind to assume that users with no domain in their user names are not domain users")) + parser.add_option("--enablewinbindoffline", action="store_true", + help=_("configures winbind to allow offline login")) + parser.add_option("--disablewinbindoffline", action="store_true", + help=_("configures winbind to prevent offline login")) parser.add_option("--winbindjoin", metavar="", help=_("join the winbind domain or ads realm now as this administrator")) @@ -285,6 +289,7 @@ class Authconfig: "winbind":"enableWinbind", "winbindauth":"enableWinbindAuth", "winbindusedefaultdomain":"winbindUseDefaultDomain", + "winbindoffline":"winbindOffline", "wins":"enableWINS"} string_settings = {"hesiodlhs":"hesiodLHS", diff --git a/authconfig.spec.in b/authconfig.spec.in index f626896..66dbf6d 100644 --- a/authconfig.spec.in +++ b/authconfig.spec.in @@ -98,6 +98,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/pixmaps/* %changelog +* Wed Jul 25 2007 Tomas Mraz - 5.3.16-1 +- add support for winbind offline login (#232955) + * Wed Jul 18 2007 Tomas Mraz - 5.3.15-1 - dnsclient fixes by Simo Sorce - add Categories to .desktop file (#245868) diff --git a/authinfo.py b/authinfo.py index fab4c01..c0e36e4 100644 --- a/authinfo.py +++ b/authinfo.py @@ -717,6 +717,7 @@ class AuthInfo: self.winbindTemplatePrimaryGroup = "" self.winbindTemplateShell = "" self.winbindUseDefaultDomain = None + self.winbindOffline = None self.smartcardModule = "" self.smartcardAction = "" @@ -1017,6 +1018,15 @@ class AuthInfo: result = res f.close() return result + + def readWinbindGlobalBool(self, key): + tmp = self.readWinbindGlobal(key) + if tmp: + if tmp.lower() == "yes" or tmp.lower() == "true" or tmp == "1": + return True + else: + return False + return None # Read winbind settings from /etc/smb/samba.conf. def readWinbind(self): @@ -1062,12 +1072,12 @@ class AuthInfo: self.winbindTemplateShell = tmp if not self.winbindTemplateShell: self.winbindTemplateShell = "/bin/false" - tmp = self.readWinbindGlobal("winbind use default domain") - if tmp: - if tmp.lower() == "yes" or tmp.lower() == "true" or tmp == "1": - self.winbindUseDefaultDomain = True - else: - self.winbindUseDefaultDomain = False + tmp = self.readWinbindGlobalBool("winbind use default domain") + if tmp != None: + self.winbindUseDefaultDomain = tmp + tmp = self.readWinbindGlobalBool("winbind offline logon") + if tmp != None: + self.winbindOffline = tmp return True @@ -1420,6 +1430,7 @@ class AuthInfo: b.winbindTemplateShell, True) or (self.winbindUseDefaultDomain != b.winbindUseDefaultDomain) or + (self.winbindOffline != b.winbindOffline) or (self.enableCache != b.enableCache) or (self.enableDB != b.enableDB) or @@ -2169,6 +2180,9 @@ class AuthInfo: output += " winbind use default domain = " output += str(bool(self.winbindUseDefaultDomain)).lower() output += "\n" + output += " winbind offline logon = " + output += str(bool(self.winbindOffline)).lower() + output += "\n" output += "\n" output += "#--authconfig--end-line--\n" @@ -2196,7 +2210,8 @@ class AuthInfo: "domain logons", "domain master", "idmap uid", "idmap gid", "winbind separator", "template homedir", "template primary group", - "template shell", "winbind use default domain"] + "template shell", "winbind use default domain", + "winbind offline logon"] f = None output = "" try: @@ -2450,6 +2465,8 @@ class AuthInfo: args = self.localuserArgs if not args and module[ARGV]: args = " ".join(module[ARGV]) + if module[NAME] == "winbind" and self.winbindOffline: + output += " cached_login" if module[NAME] == "unix": if stack == "password": if self.enableMD5: @@ -2641,7 +2658,7 @@ class AuthInfo: ("smbRealm", "c"), ("smbSecurity", "i"), ("smbIdmapUid", "i"), ("smbIdmapGid", "i"), ("winbindSeparator", "c"), ("winbindTemplateHomedir", "c"), ("winbindTemplatePrimaryGroup", "c"), ("winbindTemplateShell", "c"), - ("winbindUseDefaultDomain", "b")]), + ("winbindUseDefaultDomain", "b"), ("winbindOffline", "b")]), SaveGroup(self.writeNSS, [("enableDB", "b"), ("enableDirectories", "b"), ("enableWinbind", "b"), ("enableOdbcbind", "b"), ("enableNIS3", "b"), ("enableNIS", "b"), ("enableLDAPbind", "b"), ("enableLDAP", "b"), ("enableHesiodbind", "b"), @@ -2654,7 +2671,7 @@ class AuthInfo: ("enableWinbindAuth", "b"), ("enableAFS", "b"), ("enableAFSKerberos", "b"), ("enableCracklib", "b"), ("enableEPS", "b"), ("enableOTP", "b"), ("enablePasswdQC", "b"), ("enableSMB", "b"), - ("enableLocAuthorize", "b"), ("enableSysNetAuth", "b")]), + ("enableLocAuthorize", "b"), ("enableSysNetAuth", "b"), ("winbindOffline", "b")]), SaveGroup(self.writeSysconfig, [("enableMD5", "b"), ("enableShadow", "b"), ("enableNIS", "b"), ("enableLDAP", "b"), ("enableLDAPAuth", "b"), ("enableKerberos", "b"), ("enableSmartcard", "b"), ("forceSmartcard", "b"), diff --git a/configure.in b/configure.in index 6a71a50..ebeb744 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -AC_INIT(authconfig,5.3.15) +AC_INIT(authconfig,5.3.16) AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip]) AC_PREFIX_DEFAULT(/usr) AC_PROG_CC