Results 1 to 5 of 5

Thread: GTK and suid

  1. #1

    GTK and suid

    I want to be able to run gkrellm as root, with out having to su. (mandy's secure kernel won't let you look at the inet details unless you're root), but GTK doesn't like running with the suid bit set. The info it gives tells me it's posible and points me to a website that tell me why it doesn't like it, but not how to get round it. Anyone know of a way I can get this to run the way I want?

  2. #2

    Re: GTK and suid

    The only thing I can think of would be to write a wrapper (in pretty much anything but bash, as far as I know) that will su for you, then run the program.

    Basically all you need to do is make a C program that runs the GTK program, and then get make the wrapper setuid (note, you can't suid a script, afaik).

    So find yourself a language that can be compiled into an ELF, write a wrapper, make it setuid, and you're set. I haven't tested this at all but I don't see why it wouldn't work.

  3. #3

    Re: GTK and suid

    OK, when you say anything but bash, why not bash? (I only ask because this was the first thing I tried)

    I'll ask my resident C programer (housemate) how I could go about it.


  4. #4

    Re: GTK and suid

    Because you can't make a bash script suid

    I'm not sure if the same is true for other scripting languages, though. Probably is.

    If you were to work around bash and no suid, then you'd have to use the 'su' program in the bash script. 'su' won't take a root password from stdin, so there is no way to write a bash script to run a program with root privs without asking for root's password.

    I don't know if there are other scripting languages that have the ability to change their own UIDs, but if there are you could use one of those, because you'd be able to put root's password in the script and it would work.

    But your best bet would be to just use C, and write a program that launches the GTK program (~3 lines of code max), then make that C program setuid.

  5. #5

    Re: GTK and suid

    That sounds quite simple really. I'll give it a go.


Similar Threads

  1. When do you guys use suid?
    By flashingcurser in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 05-12-2003, 02:42 AM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts