summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-05-24 17:41:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:12 -0500
commit7fb1be73734915e027f86aca9ba62b86c56ca787 (patch)
treeb66be4fc8eedb1ed5c20bbc29493e3a6353bcfff /source4/lib
parentf1a8a690fcd9e8824dade9278e83902a6229b092 (diff)
downloadsamba-7fb1be73734915e027f86aca9ba62b86c56ca787.tar.gz
samba-7fb1be73734915e027f86aca9ba62b86c56ca787.tar.bz2
samba-7fb1be73734915e027f86aca9ba62b86c56ca787.zip
r853: remove a real big bunch of unused code
I really think that this is needed to get a better overview of what is currently used Also this stuff is really out of date so if we really ever need some of this stuff back, a 'svn copy' from the SAMBA_3_0 branch should be no big problem... metze (This used to be commit 972598d511c64f29bdc849fe58c9c82fbcf6a4a2)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/basic.mk2
-rw-r--r--source4/lib/username.c83
2 files changed, 1 insertions, 84 deletions
diff --git a/source4/lib/basic.mk b/source4/lib/basic.mk
index 78acb5bb1c..55254498d9 100644
--- a/source4/lib/basic.mk
+++ b/source4/lib/basic.mk
@@ -43,8 +43,6 @@ ADD_OBJ_FILES = \
lib/tallocmsg.o \
lib/dmallocmsg.o \
lib/smbpasswd.o \
- nsswitch/wb_client.o \
- nsswitch/wb_common.o \
lib/pam_errors.o \
intl/lang_tdb.o \
lib/account_pol.o \
diff --git a/source4/lib/username.c b/source4/lib/username.c
index 3af9dbd027..2d9d212858 100644
--- a/source4/lib/username.c
+++ b/source4/lib/username.c
@@ -169,82 +169,6 @@ struct passwd *Get_Pwnam(const char *user)
}
/****************************************************************************
- Check if a user is in a winbind group.
-****************************************************************************/
-
-static BOOL user_in_winbind_group_list(const char *user, const char *gname, BOOL *winbind_answered)
-{
- int num_groups;
- int i;
- gid_t *groups = NULL;
- gid_t gid, gid_low, gid_high;
- BOOL ret = False;
-
- *winbind_answered = False;
-
- if ((gid = nametogid(gname)) == (gid_t)-1) {
- DEBUG(0,("user_in_winbind_group_list: nametogid for group %s failed.\n",
- gname ));
- goto err;
- }
-
- if (!lp_winbind_gid(&gid_low, &gid_high)) {
- DEBUG(4, ("winbind gid range not configured, therefore %s cannot be a winbind group\n", gname));
- goto err;
- }
-
- if (gid < gid_low || gid > gid_high) {
- DEBUG(4, ("group %s is not a winbind group\n", gname));
- goto err;
- }
-
- /*
- * Get the gid's that this user belongs to.
- */
-
- if ((num_groups = winbind_getgroups(user, 0, NULL)) == -1)
- return False;
-
- if (num_groups == 0) {
- *winbind_answered = True;
- return False;
- }
-
- if ((groups = (gid_t *)malloc(sizeof(gid_t) * num_groups )) == NULL) {
- DEBUG(0,("user_in_winbind_group_list: malloc fail.\n"));
- goto err;
- }
-
- if ((num_groups = winbind_getgroups(user, num_groups, groups)) == -1) {
- DEBUG(0,("user_in_winbind_group_list: second winbind_getgroups call \
-failed with error %s\n", strerror(errno) ));
- goto err;
- }
-
- /*
- * Now we have the gid list for this user - convert the gname
- * to a gid_t via either winbind or the local UNIX lookup and do the comparison.
- */
-
- for (i = 0; i < num_groups; i++) {
- if (gid == groups[i]) {
- ret = True;
- break;
- }
- }
-
- *winbind_answered = True;
- SAFE_FREE(groups);
- return ret;
-
- err:
-
- *winbind_answered = False;
- SAFE_FREE(groups);
- return False;
-}
-
-/****************************************************************************
Check if a user is in a UNIX group.
****************************************************************************/
static BOOL user_in_unix_group_list(const char *user,const char *gname)
@@ -298,7 +222,6 @@ exit:
****************************************************************************/
static BOOL user_in_group_list(const char *user, const char *gname, gid_t *groups, size_t n_groups)
{
- BOOL winbind_answered = False;
BOOL ret;
gid_t gid;
unsigned i;
@@ -317,11 +240,7 @@ static BOOL user_in_group_list(const char *user, const char *gname, gid_t *group
}
/* fallback if we don't yet have the group list */
-
- ret = user_in_winbind_group_list(user, gname, &winbind_answered);
- if (!winbind_answered)
- ret = user_in_unix_group_list(user, gname);
-
+ ret = user_in_unix_group_list(user, gname);
if (ret)
DEBUG(10,("user_in_group_list: user |%s| is in group |%s|\n", user, gname));
return ret;