[Kde-kiosk] Problem with Applying Group Profiles to new Users

Murray Trainer mtrainer at central-data.net
Fri Jan 21 00:08:28 CET 2005


Martijn Klingens wrote:

>On Thursday 20 January 2005 18:21, Martijn Klingens wrote:
>  
>
>>The getgrnam function doesn't return the correct information for primary
>>groups. I'll see if I can come up with a fix tonight, but first there's
>>dinner :)
>>    
>>
>
>This one does return the rest of the information for me, but I just realized 
>I'm chasing the wrong thing now.
>
>Your primary group is 'users' and not 'external', so this is not the problem.
>
>Googling for getgrnam and ldap came up with this page:
>
>http://www.sudo.ws/pipermail/sudo-users/2004-February/001952.html
>
>Could it be that your nsswitch.conf is also configured incorrectly?
>
>Another interesting one:
>
>http://archives.neohapsis.com/archives/pam-li
>
>Could it be that you have a group external both in /etc/group and on LDAP?
>
>I'm inclined to say that this is a problem with your LDAP setup, but since 
>everything else works ok I can't really explain it. Based on the code of the 
>test app I see little other possible explanations though.
>
>  
>
>------------------------------------------------------------------------
>
>#include <stdlib.h>
>#include <unistd.h>
>#include <sys/types.h>
>#include <pwd.h>
>#include <grp.h>
>
>int main( int argc, char **argv )
>{
>    char *member = 0;
>
>    if( argc < 1 )
>    {
>        printf( "Missing group name parameter!\n" );
>        return -1;
>    }
>
>    struct group *grp_ent = getgrnam( argv[1] );
>    if (!grp_ent)
>    {
>        printf( "Cannot read group %s!\n", argv[1] );
>        return -1;
>    }
>
>    printf( "Members in group %s:\n", argv[1] );
>
>    char ** members = grp_ent->gr_mem;
>    for( ; (member = *members); ++members )
>        printf( "* %s\n", member );
>
>    struct passwd *pw = getpwuid(geteuid());
>    if ( !pw )
>    {
>        printf( "Cannot read user info!\n" );
>        return -1;
>    }
>
>    grp_ent = getgrgid( pw->pw_gid );
>    if (!grp_ent)
>    {
>        printf( "Cannot read group %d!\n", pw->pw_gid );
>        return -1;
>    }
>
>    printf( "Primary group for user %s: %s\n", pw->pw_name, grp_ent->gr_name );
>
>    return 0;
>}
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>kde-kiosk mailing list
>kde-kiosk at kde.org
>https://mail.kde.org/mailman/listinfo/kde-kiosk
>  
>
ldap:~ # grep external /etc/group
ldap:~ #

Definitely no external group in /etc/group.  I will run your latest code 
a bit later and post the results.


More information about the kde-kiosk mailing list