nscd vs. ports that add user/group (Was: Time to mark portupgrade deprecated?)

Michel Talon talon at lpthe.jussieu.fr
Sat Jul 30 13:00:42 UTC 2011


On Sat, Jul 30, 2011 at 04:02:55PM +0400, Test Rat wrote:
> > Did you have nscd(8) running at the time? Try invalidating its cache.
> 
> Nevermind previous patch. This one actually works.

You may be perfectly right, i think i have added nscd to the
installation after having added hald, etc. but before adding
avahi-app. However i have seen such problems in the past, before the
introduction of nscd, as far as i remember.

> 
> %% it's still an ugly hack
> Index: usr.sbin/pw/pwupd.c
> ===================================================================
> --- usr.sbin/pw/pwupd.c	(revision 224499)
> +++ usr.sbin/pw/pwupd.c	(working copy)
> @@ -191,6 +191,7 @@ pw_update(struct passwd * pwd, char const * user,
>  			}
>  		}
>  	}
> +	system("nscd -I passwd 2>/dev/null >&2");
>  	return rc;
>  }
>  
> Index: usr.sbin/pw/grupd.c
> ===================================================================
> --- usr.sbin/pw/grupd.c	(revision 224499)
> +++ usr.sbin/pw/grupd.c	(working copy)
> @@ -148,6 +148,7 @@ gr_update(struct group * grp, char const * group,
>  	}
>  	if (grbuf != NULL)
>  		free(grbuf);
> +	system("nscd -I group 2>/dev/null >&2");
>  	return l;
>  }
>  
> %%

Many thanks for the suggestion.

-- 

Michel TALON



More information about the freebsd-ports mailing list