FedoraForum.org - Fedora Support Forums and Community
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2005
    Location
    Lansing, Mi
    Age
    42
    Posts
    2,221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    anyone want to test

    in light of bee's beesu, i figured i should finish up a project i started by finally adding a gui. it was my first attempt at gtk, and its not to pretty, mostly a jumble of different tutorials till i found something that works. The program itself is quite useful for many beginners i think though.
    it launches a window that asks for a command, and the root password. it then executes that command as root. there should be no security risk as it never runs suidroot, and the only code it executes as root it needs the correct password to execute basically its a gui for su -l -c "command".
    so without further adu.
    www.nickstumpos.com/mygksu.tar.gz
    it is compiled with make
    and ran with ./mygksu
    if you want to take a looksee feel free. it took quite a while and lots a googleing to enter the password into su without it complaining about the not being run from a terminal. so take a look and enjoy, and thanks to bee for inspiring me to finish. bugs feedback and feature requests would be welcome. thanks
    edit:oh the only dependency i really forsee people not having is gtkmm-devel so if you dont have it that is needed
    Last edited by nick.stumpos; 17th October 2008 at 07:36 AM. Reason: dependency
    As always
    Love, Life, Loyalty, Wisdom, Knowledge, And Understanding
    FC6: Common Questions answered

  2. #2
    bee Guest
    dunno, for some reasons, i'm unable to decompress this file ".gz2", i don't know what software to use for that format!
    bye!!

  3. #3
    leigh123linux Guest
    Quote Originally Posted by bee
    dunno, for some reasons, i'm unable to decompress this file ".gz2", i don't know what software to use for that format!
    bye!!

    Rename the file from mygksu.tar.gz2 to mygksu.tar.gz

  4. #4
    bee Guest
    Quote Originally Posted by leigh123@linux
    Rename the file from mygksu.tar.gz2 to mygksu.tar.gz
    lol, yeah! you were right, after renaming the file i can open it!

    Thanks for sharing nick.stumpos!
    Ok, i'll now start with my boring opinions and suggestions
    If you compile the file with:
    Code:
    $ g++ -s -O2 -Wall `pkg-config gtkmm-2.4 --cflags --libs` -lutil -o mygksu my_gksu.cpp my_gksu_help.cpp pass_window.cpp
    this will make the executable file smaller and faster (you probably already knew it, but you haven't did it )
    By looking the source code of other software, i've looked that the password management is usually oriented to remove the password from the memory.... dunno something like:
    memset(pass,'a',strlen(pass));
    m_Entry_pass.set_text(pass);//not sure if it's right
    memset(pass,0,strlen(pass));
    free(pass);
    will do what i'm thinking... also when you are running "execvp("su", argv)" maybe it's better to use the full path to "su" ("/bin/su"), because maybe search paths aren't always the good and right paths.
    I've also look that your source is, anyway, much more complex than mine! yes, because beesu is a kinda of simple wrapper, and this keep my program very simple (and anyhow it work very well simple and good ideas are always bullet-proof)... your one is doing a lot of work: i've understood that your application is simulating the user typing the password on the console!!! wow, nice source, i'm sure i'll learn something from there! thanks!!
    Another suggestion, if you plan to continue to develop your application for any reasons, you can write a better user interface (and also showing it in the center of the screen) and also ask for the username, so you can also run "su" to impersonate other users!

    bye!!

  5. #5
    Join Date
    Feb 2005
    Location
    Lansing, Mi
    Age
    42
    Posts
    2,221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the replies, yeah adding a feature to run as any user is in the plans ahead, also that makefile will for sure not be the final, just thrown together for alpha testing. that idea about getting the password out off the heap it probably a good one. never even thought about that. i think ill leave using execvp as this allows the user to keep there su program anywhere and set their path variables accordingly. I think im gonna try try to get it so you can use it from the command line as well. at least for the command, so like ./mkgksu "command" would prefill in the command entry box. looks like more hw. this is starting to become a nick learns gtk project. maybe i should look at glade, might simplify things. and opps sorry about the two typo from usually using bz2
    Last edited by nick.stumpos; 17th October 2008 at 05:04 AM.
    As always
    Love, Life, Loyalty, Wisdom, Knowledge, And Understanding
    FC6: Common Questions answered

  6. #6
    Join Date
    Feb 2005
    Location
    Lansing, Mi
    Age
    42
    Posts
    2,221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    heres an update, added a dropdown box for users. it tries to make an educated guess at least. and it now works from the command line. biggest pitfall right now is it doesnt recover from errors well, i.e. wrong password or no valid display, command not valid. maybe i could implement this with a try throw catch type deal. i dunno more work for later this enough for tonight, fixed the extension too so here it is again
    www.nickstumpos.com/mygksu.tar.gz
    As always
    Love, Life, Loyalty, Wisdom, Knowledge, And Understanding
    FC6: Common Questions answered

  7. #7
    bee Guest
    thank you, you did what i was asking , i add another thing to fix: i've in the users list one user called ".Trash-root"...i've this folder under my /home/* but it's not a user (i've also solved this problem by deleting that folder , but you may remove from the list of home-folders the names of folders starting with a dot, like that folder; because they are for sure not users i think)

    bye!

  8. #8
    Join Date
    Feb 2005
    Location
    Lansing, Mi
    Age
    42
    Posts
    2,221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    good idea, yeah i was at a loss as too how to easily get a list of users without parsing the heck out of /etc/password, so i am making an educated guess by reading the contents of /home. so yeah probably no user would start with a . as those would be hidden folders
    As always
    Love, Life, Loyalty, Wisdom, Knowledge, And Understanding
    FC6: Common Questions answered

Similar Threads

  1. [Test-Announce] Fedora12 Beta RC2 install test
    By Demz in forum Fedora 12 Alpha, Beta & Release Candidates
    Replies: 1
    Last Post: 14th October 2009, 10:53 AM
  2. Replies: 1
    Last Post: 10th September 2009, 07:59 PM
  3. F12 Alpha test compose is ready now.please join us and execute > installation test
    By Demz in forum Fedora 12 Alpha, Beta & Release Candidates
    Replies: 28
    Last Post: 27th August 2009, 07:05 AM
  4. Core 4 Test 1 media test fails
    By trenths in forum Fedora Core 4 Test
    Replies: 8
    Last Post: 4th May 2005, 02:03 AM

Tags for this Thread

Posting Permissions

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