On Mon, Oct 10, Tomas Mraz wrote:
On Thu, 2011-09-29 at 12:07 +0200, Tomas Mraz wrote:
> What do you think of the following patch, that makes pam_access to
> "wildcard" the domainname in the netgroup match if the domainname
> returned by getdomainname() is '(none)' or empty string. This better
> matches the behaviour when yp_get_default_domain() is used instead of
> getdomainname(). Or should we keep mydomain as NULL only in case (none)
> is returned?
>
> diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c
> index 472116c..5fe0790 100644
> --- a/modules/pam_access/pam_access.c
> +++ b/modules/pam_access/pam_access.c
> @@ -476,12 +476,10 @@ netgroup_match (pam_handle_t *pamh, const char *netgroup,
>
> if (getdomainname (domainname_res, sizeof (domainname_res)) == 0)
> {
> - if (strcmp (domainname_res, "(none)") == 0)
> + if (domainname_res[0] != '\0' && strcmp (domainname_res,
"(none)") != 0)
> {
> - /* If domainname is not set, some systems will return "(none)"
*/
> - domainname_res[0] = '\0';
> - }
> - mydomain = domainname_res;
> + mydomain = domainname_res;
> + }
> }
> #endif
Any comments on this change?
Sorry, forgot to send it.
Yes, fine with me.
Thorsten
--
Thorsten Kukuk, Project Manager/Release Manager SLES
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)