Problem in accessing root home folder....

This is a discussion on Problem in accessing root home folder.... within the Linux Programming forums, part of the Platform Specific Boards category; Hi, I am developing the application on which execution create (settings.xml) a file which saves some information and saved in ...

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    104

    Problem in accessing root home folder....

    Hi,

    I am developing the application on which execution create (settings.xml) a file which saves some information and saved in home folder of every user.....example If I logged in as bargi then the settings.xml will save in /home/bargi/Settings/settings.xml...... and when application restart then it read settings from this xml file.

    Again when I logged in as root the file saved in /root/Settings/settings.xml.

    I want to know that If I am logged in as user bargi and run command :

    sudo -s
    and logged in as root and then execute my application ...is it should not picked setting from root home folder ????

    but it is picking the settings from bargi home folder xml file ..........

    I want to know when I logged in as root from terminal then why should it not accessing root home folder or I have to make

    changes in coding ............. ?????

    I have also run application using sudo ./App ........but the same result...... please explain me the reason.......

    Thanks

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    No, when you do "sudo" you are only getting the privileges of root, not the identity of root - it's like you get an access pass into the oval office in the white-house, but you are not the president because of it.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  2. Replies: 5
    Last Post: 12-03-2003, 04:47 PM
  3. why is the input not working
    By mackol in forum C Programming
    Replies: 7
    Last Post: 11-07-2002, 03:28 AM
  4. problem with output
    By Garfield in forum C Programming
    Replies: 2
    Last Post: 11-18-2001, 07:34 PM
  5. can anyone find the problem in my code
    By ArseMan in forum C++ Programming
    Replies: 2
    Last Post: 09-20-2001, 09:02 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21