* pwdgrp.h (pwdgrp::is_passwd): New inline method.

(pwdgrp::is_group): New inline method.
	(add_account_from_windows): Drop group argument from declaration.
	(fetch_account_from_windows): Ditto.
	(check_file): Ditto.
	(add_user_from_windows): Call add_account_from_windows accordingly.
	(add_group_from_windows): Ditto.
	* uinfo.cc (pwdgrp::add_account_from_windows): Drop group argument.
	Use is_group method instead.
	(pwdgrp::check_file): Ditto.
	(pwdgrp::fetch_account_from_windows): Ditto.
	* grp.cc: Accommodate aforementioned changes.
	* passwd.cc: Ditto.
This commit is contained in:
Corinna Vinschen
2014-03-07 20:38:48 +00:00
parent 0b3ad39364
commit 0e8dd88459
5 changed files with 63 additions and 49 deletions

View File

@@ -124,7 +124,7 @@ internal_getgrsid (cygpsid &sid, cyg_ldap *pldap)
cygheap->pg.nss_init ();
if (cygheap->pg.nss_grp_files ())
{
cygheap->pg.grp_cache.file.check_file (true);
cygheap->pg.grp_cache.file.check_file ();
if ((ret = cygheap->pg.grp_cache.file.find_group (sid)))
return ret;
if ((ret = cygheap->pg.grp_cache.file.add_group_from_file (sid)))
@@ -155,7 +155,7 @@ internal_getgrnam (const char *name, cyg_ldap *pldap)
cygheap->pg.nss_init ();
if (cygheap->pg.nss_grp_files ())
{
cygheap->pg.grp_cache.file.check_file (true);
cygheap->pg.grp_cache.file.check_file ();
if ((ret = cygheap->pg.grp_cache.file.find_group (name)))
return ret;
if ((ret = cygheap->pg.grp_cache.file.add_group_from_file (name)))
@@ -178,7 +178,7 @@ internal_getgrgid (gid_t gid, cyg_ldap *pldap)
cygheap->pg.nss_init ();
if (cygheap->pg.nss_grp_files ())
{
cygheap->pg.grp_cache.file.check_file (true);
cygheap->pg.grp_cache.file.check_file ();
if ((ret = cygheap->pg.grp_cache.file.find_group (gid)))
return ret;
if ((ret = cygheap->pg.grp_cache.file.add_group_from_file (gid)))
@@ -330,7 +330,7 @@ gr_ent::enumerate_caches ()
if (!max && from_files)
{
pwdgrp &grf = cygheap->pg.grp_cache.file;
grf.check_file (true);
grf.check_file ();
if (cnt < grf.cached_groups ())
return &grf.group ()[cnt++].g;
cnt = 0;
@@ -389,7 +389,7 @@ gr_ent::enumerate_local ()
fetch_user_arg_t arg;
arg.type = SID_arg;
arg.sid = &sid;
char *line = pg.fetch_account_from_windows (arg, true);
char *line = pg.fetch_account_from_windows (arg);
if (line)
return pg.add_account_post_fetch (line, false);
}