Find the answer to your Linux question:
Results 1 to 7 of 7
hello im reading Programming in Linux, i havent used Linux either as just a user and as developer im just trying to get into it . and here is something ...
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    3

    new to Linux programming

    hello

    im reading Programming in Linux, i havent used Linux either as just a user and as developer im just trying to get into it . and here is something that made me think about , it is said that while developing applications in linux , we need to take into account the user rights thing. i mean for example during run time if the application needs to reach some restricted files, obviously if we didnt took it into account, access denied would happen . so how we resolve this , is there some system calls that we can write root user account info log into ,during run time, or what, give some clarifications plz !!
    thanks for attention!! Hafiz

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    what exactly are you trying to accomplish?

    you need a different mindset for this, because privilege is everything on linux and unix systems, and it is this way for a reason

    you can always run an application as root, but most of the time this isn't necessary

  3. #3
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Debian GNU/Linux -- You know you want it.

  4. #4
    Just Joined!
    Join Date
    May 2006
    Location
    San Jose, CA
    Posts
    67
    Quote Originally Posted by BHafiz View Post
    i mean for example during run time if the application needs to reach some restricted files, obviously if we didnt took it into account, access denied would happen
    Depends how restricted that file is. Most files tend to have "read" permission for non-privileged users (all the header files, libraries etc.) so applications can read them but not change them. Log files tend to not even have "read" permission for non-privilieged users for obvious reasons.

    So you will only get "access denied" if you try to make changes to such files. If you are simply reading from them you will be fine.

  5. #5
    Just Joined!
    Join Date
    Apr 2010
    Location
    reserved memory
    Posts
    3
    Quote Originally Posted by BHafiz View Post
    hello

    im reading Programming in Linux, i havent used Linux either as just a user and as developer im just trying to get into it . and here is something that made me think about , it is said that while developing applications in linux , we need to take into account the user rights thing. i mean for example during run time if the application needs to reach some restricted files, obviously if we didnt took it into account, access denied would happen . so how we resolve this , is there some system calls that we can write root user account info log into ,during run time, or what, give some clarifications plz !!
    thanks for attention!! Hafiz
    If you are just writing your first desktop app or computer game, you won't have to worry about permissions much. The general rule of thumb: you can always read and write to files in the user's home directory, but you only read from files everywhere else on the system. (Except, of course, during program installation.)

    If you decide to program something more advanced, like a system daemon or database server, permissions issues can become more complicated. But if you were knowledgeable enough to program one of those, I'm sure you wouldn't need to ask how Linux permissions work...

  6. #6
    Just Joined!
    Join Date
    Apr 2010
    Posts
    3
    thanks for your responses )

    what im trying to do is for now just to understand this process actually, im not programming yet. now i get something from your responses . but part of me still don't get it ) for example , as an user with some restrictions, i want to write some program that needs to access to sound card (for example) . how do i do that . i mean i need just general information, to understand the process
    thank you !!

  7. #7
    Just Joined!
    Join Date
    Apr 2010
    Posts
    3
    GNU-fan ,that is really helpful link , thank you!!

    ps: i cant quotes for now

Posting Permissions

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