Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_linux_programming thread: Adding user problem through GTK+


Message #1 by kishore kumar <nlkiforum@y...> on Fri, 8 Mar 2002 23:10:04 -0800 (PST)
Hi Friends ,
i have a problem while working a app with GTK+ using
glade.

The problem is ,

If root created a user called admin , and he will be
in the group of root , so he has ability to add users
. So if admin adds a user called nlk .and he in turn
should be able to create another user . all this is
should be down through  c++ program . All the users at
the level of nlk will create users. this creation of
users stops at this level. we are using GTK+ as a
front. Is this possible ????

I have written an application which allows me to
create users. This application runs under myUser which
is a member of group root. To run this application, I
do setreuid(0,0) in the application, so that the
application gets previliges to create a user(run the
useradd command). Before running the application I do
chmod +s <exectable name> to set uid.
All this is a GTK application.
This works fine, since the effective group Id is root.

Now, the same application I try to run as user1 who is
a member of group group1(Not root as in previous case)
I do the same procedure of doing chmod +s <exec name>
and try to launch the application. This will kick me
back saying GTK will not allow to run setuid. (This is
the same app as before which has setreuid in the
program).

Can you explain the difference in behaviour.
If setuid is not allowed by GTK how did it allow
previously, and how not now?

hope i'm clear ..

Thanx in Advance :-})

kishore

__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

  Return to Index