[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nss-mysql-devel] Why just join table with user -> group
From: |
Manuel Mitnyan |
Subject: |
[Nss-mysql-devel] Why just join table with user -> group |
Date: |
Mon, 26 Aug 2002 15:34:03 -0400 (EDT) |
I found a problem by just making a join from the table of user->group.
If you make a change group on a file that the user is not a member of that
group , the system will show the gid and not the group name !!!! Have you
already take a look on that bug ?
I have make a patch for my personnal use that taking off the last join in
the file group.c but it's not a clean way to solve the problem. With my
patch I cannot associate user with group but in the shell, if a file it's
owned by the user and any group, you can see the good information.
The patch:
diff -dru nss-mysql-0.40-original/group.c nss-mysql-0.40/group.c
--- nss-mysql-0.40-original/group.c Mon Jul 8 08:33:56 2002
+++ nss-mysql-0.40/group.c Fri Aug 9 02:31:19 2002
@@ -166,13 +166,12 @@
options->where[0] ? options->where : "1=1");
} else {
/* we look by GID */
- sql = _nss_mysql_sqlprintf("select %s,%s,%s,%s from %s "
- "LEFT JOIN %s on %s=%s LEFT JOIN %s on
%s=%s "- "where %s = %d and %s and %s",
+ sql = _nss_mysql_sqlprintf("select %s,%s,%s from %s "
+ "LEFT JOIN %s on %s=%s "
+ "where %s = %d and %s",
goptions->groupnamecolumn,
goptions->gidcolumn,
goptions->passwordcolumn,
- options->usercolumn,
/* from */
goptions->groupinfotable,
/* left join */
@@ -180,17 +179,11 @@
/* on */
goptions->groupidcolumn,
goptions->mgroupidcolumn,
- /* left join */
- options->table,
- /* on */
- goptions->museridcolumn,
- options->useridcolumn,
/* where */
/* for bulk retrieval, we retrieve every entry */
bulk ? "1" : goptions->gidcolumn,
bulk ? 1 : gid,
- goptions->where[0] ? goptions->where : "1=1",
- options->where[0] ? options->where : "1=1");
+ goptions->where[0] ? goptions->where : "1=1");
}
if (! sql) {
--
To thine own self be true. (If not that, at least make some money.)
- [Nss-mysql-devel] Why just join table with user -> group,
Manuel Mitnyan <=