[Kde-kiosk] Problem with Applying Group Profiles to new Users
Murray Trainer
mtrainer at central-data.net
Wed Jan 19 16:09:45 CET 2005
Martijn Klingens wrote:
>On Monday 17 January 2005 14:10, Murray Trainer wrote:
>
>
>>mtrainer at ldap:~> groups mtrainer
>>mtrainer : users Domain Users external
>>mtrainer at ldap:~> kiosktool-kdedirs --check
>>/home/mtrainer/.kde/:/var/lib/kde-profiles/default/:/etc/opt/kde3/:/opt/kde
>>3/
>>
>>Obviously the problem is the /var/lib/kde-profiles/default value which
>>should be /var/lib/kde-profiles/external/. My question is where and
>>when is that value generated?
>>
>>
>
>As far as I understand the Kiosk framework that should be automatically
>determined. The relevant code in kiosktool-kdedirs is as follows:
>
>---------
> mapCfg.setGroup("Groups");
>
> for( QStringList::ConstIterator it = groups.begin();
> it != groups.end(); ++it )
> {
> QCString grp = (*it).utf8();
> // Check if user is in this group
> struct group *grp_ent = getgrnam(grp);
> if (!grp_ent) continue;
>
> char ** members = grp_ent->gr_mem;
> for(char * member; (member = *members); ++members)
> {
> if (user == member)
> {
> // User is in this group --> add profiles
> profiles += mapCfg.readListEntry(*it);
> break;
> }
> }
> }
>---------
>
>It would be interesting to see the result of this on your system using
>hardcoded values.
>
>In case you didn't compile KioskTool on your own you could try writing a small
>C app that roughly does this (*WARNING* untested, might not even compile!):
>
>-------
>#include <stdlib.h>
>#include <unistd.h>
>#include <sys/types.h>
>#include <pwd.h>
>#include <grp.h>
>
>int main( void )
>{
> struct group *grp_ent = getgrnam( "external" );
> if (!grp_ent)
> {
> printf( "Cannot read group external!\n" );
> return -1;
> }
>
> char ** members = grp_ent->gr_mem;
> for( char * member; (member = *members); ++members )
> {
> if (user == member)
> printf( "User is in group 'external'\n" );
> else
> printf( "User is *NOT* in group 'external'!\n" );
> }
> return 0;
>}
>-------
>
>I hope Waldo returns home soon BTW, since this is getting darn close to the
>limits of my own abilities. :(
>
>
>
ldap:~ # cc -o test test.c
test.c: In function `main':
test.c:17: error: `for' loop initial declaration used outside C99 mode
test.c:19: error: `user' undeclared (first use in this function)
test.c:19: error: (Each undeclared identifier is reported only once
test.c:19: error: for each function it appears in.)
ldap:~ #
More information about the kde-kiosk
mailing list