From 3fd074155fc14d25db04c4af1565a4776326996a Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 3 Oct 2009 21:37:55 +0000 Subject: [PATCH] Move loginStatus to ldapns.schema --- contrib/slapd-modules/nssov/ldapns.schema | 14 ++++++++++++++ contrib/slapd-modules/nssov/pam.c | 14 +++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/contrib/slapd-modules/nssov/ldapns.schema b/contrib/slapd-modules/nssov/ldapns.schema index 22a4daf800..f6f7c9f9fc 100644 --- a/contrib/slapd-modules/nssov/ldapns.schema +++ b/contrib/slapd-modules/nssov/ldapns.schema @@ -1,4 +1,5 @@ # $OpenLDAP$ +# $Id: ldapns.schema,v 1.3 2009-10-01 19:17:20 tedcheng Exp $ # LDAP Name Service Additional Schema # http://www.iana.org/assignments/gssapi-service-names @@ -11,6 +12,13 @@ attributetype ( 1.3.6.1.4.1.5322.17.2.1 NAME 'authorizedService' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} ) +attributetype ( 1.3.6.1.4.1.5322.17.2.2 NAME 'loginStatus' + DESC 'Currently logged in sessions for a user' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + ORDERING caseIgnoreOrderingMatch + SYNTAX OMsDirectoryString ) + objectclass ( 1.3.6.1.4.1.5322.17.1.1 NAME 'authorizedServiceObject' DESC 'Auxiliary object class for adding authorizedService attribute' SUP top @@ -22,3 +30,9 @@ objectclass ( 1.3.6.1.4.1.5322.17.1.2 NAME 'hostObject' SUP top AUXILIARY MAY host ) + +objectclass ( 1.3.6.1.4.1.5322.17.1.3 NAME 'loginStatusObject' + DESC 'Auxiliary object class for login status attribute' + SUP top + AUXILIARY + MAY loginStatus ) diff --git a/contrib/slapd-modules/nssov/pam.c b/contrib/slapd-modules/nssov/pam.c index 50e91adc0e..8980c148e9 100644 --- a/contrib/slapd-modules/nssov/pam.c +++ b/contrib/slapd-modules/nssov/pam.c @@ -21,16 +21,6 @@ static int ppolicy_cid; static AttributeDescription *ad_loginStatus; -const char *at_loginStatus = - "( 1.3.6.1.4.1.4745.1.20.1 " - "NAME ( 'loginStatus' ) " - "DESC 'Currently logged in sessions for a user' " - "EQUALITY caseIgnoreMatch " - "SUBSTR caseIgnoreSubstringsMatch " - "ORDERING caseIgnoreOrderingMatch " - "SYNTAX OMsDirectoryString " - "USAGE directoryOperation )"; - struct paminfo { struct berval uid; struct berval dn; @@ -667,7 +657,9 @@ int pam_pwmod(nssov_info *ni,TFILE *fp,Operation *op) int nssov_pam_init() { int code = 0; + const char *text; if (!ad_loginStatus) - code = register_at( at_loginStatus, &ad_loginStatus, 0 ); + code = slap_str2ad("loginStatus", &ad_loginStatus, &text); + return code; } -- 2.39.5