Please report all spam threads, posts and suspicious members. We receive spam notifications and will take immediate action!
Results 1 to 5 of 5

Thread: Programming in Linux




  1. #1
    Join Date
    Feb 2010
    Location
    Baku
    Posts
    4

    Default Programming in Linux

    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

    Default Re: Programming in Linux

    A process started by a user has by default the same access rights as that user. For most applications that is more than enough.

    What kind of application and what esoteric needs do you have in mind?

  3. #3
    Join Date
    Feb 2010
    Location
    Baku
    Posts
    4

    Default Re: Programming in Linux

    thanks for respond first of all

    Quote Originally Posted by mv2devnull View Post
    A process started by a user has by default the same access rights as that user. For most applications that is more than enough.
    yes, this is what i know
    Quote Originally Posted by mv2devnull View Post
    What kind of application and what esoteric needs do you have in mind?
    for now i just want to understand the process ,during the that particular process that is started by user ,process has the same privileges, but what if we need the process for example accessthe sound card , that needs root user privileges i guess , so how the default privileges of a user are changed during execution and get back after it finishes

  4. #4

    Default Re: Programming in Linux

    Well, there is naturally the suid bit; a program executable file has uid and gid attributes, and executes having that uid as effective, rather than the uid of the account that did start it.

    Then, there are services (aka daemons), for example the 'ntpd', which accept as command line parameter the uid that they will use. So there must be API for on the fly changes.

    And then there is the divisions to "kernel space" and "user space". Kernel has API. A user program can call kernel API to execute kernel code, which has different permissions. Your soundcard example works so. The driver of the card is in the kernel space, and your tool will communicate with the driver. But sound is a horrid example too, because there are multiple implementations of sound-handling code for Linux.

  5. #5
    Join Date
    Feb 2010
    Location
    Baku
    Posts
    4

    Default Re: Programming in Linux

    yes, actually i have read about alsa(advanced linux sound architechture) for example, but nothing else came to mind then ,so , thatnx , for explanation

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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