Hello community,
here is the log from the commit of package yast2-pam
checked in at Fri Aug 25 15:43:38 CEST 2006.
--------
--- yast2-pam/yast2-pam.changes 2006-07-26 14:55:17.000000000 +0200
+++ yast2-pam/yast2-pam.changes 2006-08-25 15:15:05.000000000 +0200
@@ -1,0 +2,7 @@
+Thu Aug 24 14:52:31 CEST 2006 - jsuchome@suse.cz
+
+- adapted for pam-config usage (F300956)
+- API of PamSettings module is obsolete
+- 2.14.0
+
+-------------------------------------------------------------------
Old:
----
yast2-pam-2.13.5.tar.bz2
New:
----
yast2-pam-2.14.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-pam.spec ++++++
--- /var/tmp/diff_new_pack.ENFRTf/_old 2006-08-25 15:41:15.000000000 +0200
+++ /var/tmp/diff_new_pack.ENFRTf/_new 2006-08-25 15:41:15.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-pam (Version 2.13.5)
+# spec file for package yast2-pam (Version 2.14.0)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,15 +11,16 @@
# norootforbuild
Name: yast2-pam
-Version: 2.13.5
+Version: 2.14.0
Release: 1
License: GPL
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-pam-2.13.5.tar.bz2
+Source0: yast2-pam-2.14.0.tar.bz2
prefix: /usr
BuildRequires: doxygen perl-XML-Writer yast2 yast2-core-devel yast2-devtools yast2-testsuite
Requires: yast2
+Requires: pam-config >= 0.8
Provides: yast2-agent-pam
Obsoletes: yast2-agent-pam
Provides: yast2-agent-pam-devel
@@ -38,7 +39,7 @@
Jiri Suchomel
%prep
-%setup -n yast2-pam-2.13.5
+%setup -n yast2-pam-2.14.0
%build
%{prefix}/bin/y2tool y2autoconf
@@ -69,6 +70,10 @@
%doc %{prefix}/share/doc/packages/yast2-pam
%changelog -n yast2-pam
+* Thu Aug 24 2006 - jsuchome@suse.cz
+- adapted for pam-config usage (F300956)
+- API of PamSettings module is obsolete
+- 2.14.0
* Wed Jul 26 2006 - jsuchome@suse.cz
- added Pam.ycp module to handle /etc/pam.d/* files (#190330)
- 2.13.5
++++++ yast2-pam-2.13.5.tar.bz2 -> yast2-pam-2.14.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pam-2.13.5/VERSION new/yast2-pam-2.14.0/VERSION
--- old/yast2-pam-2.13.5/VERSION 2006-07-26 14:32:25.000000000 +0200
+++ new/yast2-pam-2.14.0/VERSION 2006-08-24 14:52:29.000000000 +0200
@@ -1 +1 @@
-2.13.5
+2.14.0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pam-2.13.5/configure new/yast2-pam-2.14.0/configure
--- old/yast2-pam-2.13.5/configure 2006-07-26 14:07:32.000000000 +0200
+++ new/yast2-pam-2.14.0/configure 2006-06-01 15:21:32.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for yast2-pam 2.13.4.
+# Generated by GNU Autoconf 2.59 for yast2-pam 2.13.3.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -269,8 +269,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-pam'
PACKAGE_TARNAME='yast2-pam'
-PACKAGE_VERSION='2.13.4'
-PACKAGE_STRING='yast2-pam 2.13.4'
+PACKAGE_VERSION='2.13.3'
+PACKAGE_STRING='yast2-pam 2.13.3'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -728,7 +728,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures yast2-pam 2.13.4 to adapt to many kinds of systems.
+\`configure' configures yast2-pam 2.13.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -795,7 +795,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-pam 2.13.4:";;
+ short | recursive ) echo "Configuration of yast2-pam 2.13.3:";;
esac
cat <<\_ACEOF
@@ -908,7 +908,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-yast2-pam configure 2.13.4
+yast2-pam configure 2.13.3
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -922,7 +922,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-pam $as_me 2.13.4, which was
+It was created by yast2-pam $as_me 2.13.3, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1652,7 +1652,7 @@
# Define the identity of the package.
PACKAGE='yast2-pam'
- VERSION='2.13.4'
+ VERSION='2.13.3'
cat >>confdefs.h <<_ACEOF
@@ -1863,7 +1863,7 @@
-VERSION="2.13.4"
+VERSION="2.13.3"
RPMNAME="yast2-pam"
MAINTAINER="Jiri Suchomel "
@@ -2693,7 +2693,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by yast2-pam $as_me 2.13.4, which was
+This file was extended by yast2-pam $as_me 2.13.3, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -2748,7 +2748,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-pam config.status 2.13.4
+yast2-pam config.status 2.13.3
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pam-2.13.5/configure.in new/yast2-pam-2.14.0/configure.in
--- old/yast2-pam-2.13.5/configure.in 2006-07-26 14:07:27.000000000 +0200
+++ new/yast2-pam-2.14.0/configure.in 2006-06-01 15:21:28.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.13.18 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-pam, 2.13.4, http://bugs.opensuse.org/, yast2-pam)
+AC_INIT(yast2-pam, 2.13.3, http://bugs.opensuse.org/, yast2-pam)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -17,7 +17,7 @@
AM_INIT_AUTOMAKE(tar-ustar) dnl searches for some needed programs
dnl Important YaST2 variables
-VERSION="2.13.4"
+VERSION="2.13.3"
RPMNAME="yast2-pam"
MAINTAINER="Jiri Suchomel "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pam-2.13.5/src/Pam.ycp new/yast2-pam-2.14.0/src/Pam.ycp
--- old/yast2-pam-2.13.5/src/Pam.ycp 2006-07-26 14:17:51.000000000 +0200
+++ new/yast2-pam-2.14.0/src/Pam.ycp 2006-08-25 11:30:58.000000000 +0200
@@ -5,7 +5,7 @@
* Authors: Jiri Suchomel
* Flags: Unstable
*
- * $Id: PamSettings.ycp 31244 2006-06-01 13:06:03Z jsuchome $
+ * $Id: Pam.ycp 32004 2006-07-26 12:59:43Z jsuchome $
*
*/
@@ -13,123 +13,79 @@
module "Pam";
-import "FileUtils";
-
-/**
- * if pam_mkhomedir is set in /etc/pam.d/commond-session
- */
-boolean mkhomedir = false;
-
-// if it mkhomedir was modified
-boolean mkhomedir_modified = false;
-
/**
- * Read the state of mkhomedir in /etc/pam.d/common-session (bug #143519)
- */
-global define boolean ReadMkHomeDir () {
-
- boolean ret = false;
- string file_path = "/etc/pam.d/common-session";
-
- if (!FileUtils::Exists (file_path))
- return false;
-
- string file = (string) SCR::Read (.target.string, file_path);
- foreach (string line, splitstring (file, "\n"), {
- if (regexpmatch (line, "[\t ]*#"))
- return;
- if (issubstring (line,"pam_mkhomedir.so"))
- ret = true;
+ * Query PAM configuration for status of given module
+ * @param string PAM module (e.g. ldap, pwcheck)
+ * @return map keys are 'management groups' (e.g. auth), values
+ * are lists of options
+ */
+global map Query (string mod) {
+
+ map ret = $[];
+ map out = (map)SCR::Execute (.target.bash_output, "pam-config -q --" + mod);
+ if (out["exit"]:0 != 0)
+ {
+ y2warning ("pam-config for %1 returned %2", mod, out);
+ return ret;
+ }
+ foreach (string line, splitstring (out["stdout"]:"", "\n"), {
+ list l = splitstring (line, ":");
+ if (line == "" || size (l) < 2) return;
+ string key = l[0]:"";
+ ret[key] =
+ filter (string o, splitstring (l[1]:"", " \t"), ``(o != ""));
});
return ret;
}
-
/**
- * Write the new value of pam_mkhomedir to /etc/pam.d/common-session
- * @param boolean new status
+ * Ask if given PAM module is enabled
*/
-global define boolean WriteMkHomeDir (boolean enabled) {
+global boolean Enabled (string mod) {
- string the_line = "session optional\tpam_mkhomedir.so";
- string file_path = "/etc/pam.d/common-session";
- if (!FileUtils::Exists (file_path))
- {
- SCR::Write (.target.string, file_path, the_line);
- return true;
- }
- string cont = (string) SCR::Read(.target.string, file_path);
- list<string> new_cont = [];
- boolean done = false;
- foreach (string line, splitstring (cont, "\n"), {
- if (regexpmatch (line, "[\t ]*#"))
- {
- new_cont = add (new_cont, line);
- return;
- }
- else if (!done && enabled)
- {
- new_cont = add (new_cont, the_line);
- done = true;
- }
- if (enabled || !issubstring (line,"pam_mkhomedir.so"))
- new_cont = add (new_cont, line);
- });
- SCR::Execute (.target.bash, sformat ("/bin/cp %1 %1.YaST2save", file_path));
- return SCR::Write (.target.string, file_path, mergestring (new_cont, "\n"));
+ return size (Query(mod)) > 0;
}
/**
- * Set the new value of mkhomedir
+ * Add options or new PAM module
+ * @param string PAM module or option
+ * @return success
*/
-global define boolean SetMkHomeDir (boolean new_value) {
+global boolean Add (string mod) {
- if (mkhomedir != new_value)
+ map out = (map)SCR::Execute (.target.bash_output, "pam-config -a --" + mod);
+ if (out["exit"]:0 != 0)
{
- mkhomedir_modified = true;
- mkhomedir = new_value;
+ y2warning ("pam-config for %1 returned %2", mod, out);
+ return false;
}
- return mkhomedir;
-
-}
-
-/**
- * Was anything handled by this module modified by user?
- */
-global boolean Modified () {
-
- return mkhomedir_modified;
-}
-
-/**
- * return the value of mkhomedir
- */
-global boolean MkHomeDir () {
- return mkhomedir;
+ return true;
}
/**
- * Reads all envolved files and stores their status
- * @return true on success
+ * Remove options or PAM module
+ * @param string PAM module or option
+ * @return success
*/
-global boolean Read () {
+global boolean Remove (string mod) {
- mkhomedir = ReadMkHomeDir ();
+ map out = (map)SCR::Execute (.target.bash_output, "pam-config -d --" + mod);
+ if (out["exit"]:0 != 0)
+ {
+ y2warning ("pam-config for %1 returned %2", mod, out);
+ return false;
+ }
return true;
}
/**
- * Writes all edited files to the disk
- * @param force - write everything, even if modification was not detected
- * @return true on success
- */
-global boolean Write (boolean force) {
-
- boolean ret = true;
- if (mkhomedir_modified || force)
- ret = WriteMkHomeDir (mkhomedir);
- return ret;
+ * Add/Remove option or PAM module
+ * @param string PAM module or option
+ * @param boolean true for adding, false for removing
+ * @return success
+ */
+global boolean Set (string mod, boolean set) {
+ return set ? Add (mod) : Remove (mod);
}
-
}//EOF
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pam-2.13.5/src/PamSettings.ycp new/yast2-pam-2.14.0/src/PamSettings.ycp
--- old/yast2-pam-2.13.5/src/PamSettings.ycp 2006-06-23 14:37:56.000000000 +0200
+++ new/yast2-pam-2.14.0/src/PamSettings.ycp 2006-08-25 13:43:42.000000000 +0200
@@ -1,10 +1,9 @@
/**
* File: modules/PamSettings.ycp
* Package: yast2-pam
- * Summary: YaST intrerface for security agent (/etc/security/*.conf)
- * and /etc/default/passwd agent
+ * Summary: YaST intrerface for /etc/default/passwd agent
* Authors: Jiri Suchomel
- * Flags: Stable
+ * Flags: Unstable
*
* $Id: PamSettings.ycp 31244 2006-06-01 13:06:03Z jsuchome $
*
@@ -14,16 +13,13 @@
module "PamSettings";
+import "Pam";
+
/**
* Was /etc/default/passwd modified?
*/
boolean default_passwd_modified = false;
-/**
- * Was anything under /etc/security/ modified?
- */
-boolean security_modified = false;
-
list<string> security_files = [];
//---------------------------- functions for handling /etc/security/*.conf
@@ -34,6 +30,7 @@
*/
global define list<string> GetFiles () ``{
+ y2warning ("this function is obsolete, use Pam module instead");
if (security_files == [])
security_files = (list<string>) SCR::Dir (.etc.security.section);
if (security_files == nil)
@@ -48,12 +45,8 @@
*/
define string Filename (string name) ``{
- string ret = name;
- foreach (string file, GetFiles (), ``{
- if (issubstring (file, name))
- ret = file;
- });
- return ret;
+ y2warning ("this function is obsolete, use Pam module instead");
+ return "";
}
/**
@@ -67,10 +60,14 @@
*/
global define list<string> GetValues (string file, string type) ``{
- string filename = Filename (file);
- string ret = (string) SCR::Read (add (add (.etc.security.v, filename), type));
- if(ret == nil) return [];
- return splitstring (ret, " \t");
+ y2warning ("this function is obsolete, use Pam module instead");
+ // FIXME temporary hack for backward compatibility
+ if (file == "pam_pwcheck" && type == "password")
+ {
+ map pwcheck = Pam::Query ("pwcheck");
+ return pwcheck["password"]:[];
+ }
+ return [];
}
/**
@@ -82,60 +79,92 @@
*/
global define map GetFile (string file) ``{
- map ret = $[];
- string filename = Filename (file);
- foreach (string type, SCR::Dir (add (.etc.security.v, filename)), ``{
- ret [type] = GetValues (filename, type);
- });
- return ret;
+ y2warning ("this function is obsolete, use Pam module instead");
+ return $[];
}
+
/**
- * Saves the new list of options of one type to given file
+ * Adds a new options to the current list of options
* @param file file name
* @param type type of management group
* @return success
* @example
- * SetValues ("pwcheck", "password", [ "cracklib", "md5" ])
+ * AddValue ("pwcheck", "password", "md5" ])
*/
-global define boolean SetValues (string file, string type, list<string> values) ``{
- string filename = Filename (file);
- security_modified = true;
- return SCR::Write (add (add (.etc.security.v, filename), type),
- mergestring ((list<string>)values, " ")) == true;
+global define boolean AddValue (string file, string type, string value) ``{
+ y2warning ("this function is obsolete, use Pam module instead");
+ if (file == "pam_pwcheck")
+ {
+ if (value == "no_obscure_checks")
+ return Pam::Add ("pwcheck-no_obscure_checks");
+ if (value == "cracklib")
+ return Pam::Add ("pwcheck-cracklib");
+ list split = splitstring (value, "=");
+ string pth = split[1]:"";
+ if (issubstring (value, "cracklib="))
+ return Pam::Add ("pwcheck-cracklib-path=" + pth);
+ if (issubstring (value, "minlen="))
+ return Pam::Add ("pwcheck-minlen=" + pth);
+ if (issubstring (value, "remember="))
+ return Pam::Add ("pwcheck-remember=" + pth);
+ }
+ else if (file == "unix2" || file == "pam_unix2")
+ {
+ if (value == "use_ldap")
+ return Pam::Add ("ldap");
+ if (value == "use_krb5")
+ return Pam::Add ("krb5");
+ if (value == "winbind")
+ return Pam::Add ("winbind");
+ }
+ return false;
}
/**
- * Adds a new options to the current list of options
+ * Deletes an options from the current list of options
* @param file file name
* @param type type of management group
* @return success
* @example
- * AddValue ("pwcheck", "password", "md5" ])
+ * RemoveValue ("pwcheck", "password", "md5" ])
*/
-global define boolean AddValue (string file, string type, string value) ``{
- list<string> values = GetValues (file, type);
- // value must be first (to avoid adding to the commented rest of line)
- return SetValues (file, type, (list<string>) union ([value], values));
+global define boolean RemoveValue (string file, string type, string value) ``{
+ y2warning ("this function is obsolete, use Pam module instead");
+ if (file == "pam_pwcheck")
+ {
+ if (value == "no_obscure_checks")
+ return Pam::Remove ("pwcheck-no_obscure_checks");
+ if (issubstring (value, "cracklib"))
+ return Pam::Remove ("pwcheck-cracklib");
+ if (issubstring (value, "minlen="))
+ return Pam::Remove ("pwcheck-minlen=");
+ if (issubstring (value, "remember="))
+ return Pam::Remove ("pwcheck-remember=");
+ }
+ else if (file == "unix2" || file == "pam_unix2")
+ {
+ if (value == "use_ldap")
+ return Pam::Remove ("ldap");
+ if (value == "use_krb5")
+ return Pam::Remove ("krb5");
+ if (value == "winbind")
+ return Pam::Remove ("winbind");
+ }
+ return false;
}
/**
- * Deletes an options from the current list of options
+ * Saves the new list of options of one type to given file
* @param file file name
* @param type type of management group
* @return success
* @example
- * RemoveValue ("pwcheck", "password", "md5" ])
+ * SetValues ("pwcheck", "password", [ "cracklib", "md5" ])
*/
-global define boolean RemoveValue (string file, string type, string value) ``{
- list<string> values = GetValues (file, type);
- return SetValues (file, type, filter (string v, values, ``{
- // this is for options like "minlen=5" etc.
- if (!issubstring (v, "="))
- return v != value;
- else
- return !issubstring (v,value);
- }));
+global define boolean SetValues (string file, string type, list<string> values) ``{
+ y2warning ("this function is obsolete, use Pam module instead");
+ return false;
}
//---------------------------- functions for handling /etc/default/passwd
@@ -215,8 +244,6 @@
global define boolean Write (boolean force) {
boolean ret = true;
- if (security_modified || force)
- ret = ret && SCR::Write (.etc.security, nil);
if (default_passwd_modified || force)
ret = ret && SCR::Write (.etc.default.passwd, nil);
return ret;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pam-2.13.5/testsuite/tests/Read.out new/yast2-pam-2.14.0/testsuite/tests/Read.out
--- old/yast2-pam-2.13.5/testsuite/tests/Read.out 2006-06-23 14:37:56.000000000 +0200
+++ new/yast2-pam-2.14.0/testsuite/tests/Read.out 2006-08-25 13:07:06.000000000 +0200
@@ -1,8 +0,0 @@
-Dump ==== PamSettings::GetFiles: =============================
-Dir .etc.security.section: ["/etc/security/pam_pwcheck.conf", "/etc/security/pam_unix2.conf"]
-Return ["/etc/security/pam_pwcheck.conf", "/etc/security/pam_unix2.conf"]
-Dump ==== PamSettings::GetValues ("unix2", "passwd") =====
-Read .etc.security.v."/etc/security/pam_unix2.conf"."passwd" "nullok use_ldap"
-Return ["nullok", "use_ldap"]
-Read .etc.security.v."/etc/security/pam_unix2.conf"."auth" nil
-Return []
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pam-2.13.5/testsuite/tests/Read.ycp new/yast2-pam-2.14.0/testsuite/tests/Read.ycp
--- old/yast2-pam-2.13.5/testsuite/tests/Read.ycp 2006-06-23 14:37:56.000000000 +0200
+++ new/yast2-pam-2.14.0/testsuite/tests/Read.ycp 2006-08-25 13:06:54.000000000 +0200
@@ -7,6 +7,7 @@
*/
{
+ // FIXME no sense, make testsuite for default files...
include "testsuite.ycp";
import "PamSettings";
@@ -33,6 +34,7 @@
]
];
+ /*
DUMP ("==== PamSettings::GetFiles: =============================");
TEST(``(PamSettings::GetFiles ()), [ READ, [], [] ], 0);
@@ -42,5 +44,6 @@
TEST(``(PamSettings::GetValues ("unix2", "passwd")), [ READ, [], [] ], 0);
TEST(``(PamSettings::GetValues ("unix2", "auth")), [ READ, [], [] ], 0);
+ */
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org