Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8652603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:20:44+00:00 2026-06-12T14:20:44+00:00

I need to manage Linux users accounts from within my program so I actually

  • 0

I need to manage Linux users accounts from within my program so I actually need some kind of root access but giving root to that program couldn’t be the best solution.
How can I manage that in a save way. At least I am not aware of a Multi process architecture.
For the whole “generic stuff” I use Qt. Only the OS-specific things are on my own.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:20:45+00:00Added an answer on June 12, 2026 at 2:20 pm

    The “classic” solution to implement privilege separation works like this:

    • install the program with setuid-0
    • early in the program startup (do this as early as possible, preferably “the first thing your program does”):
      • create a pair of sockets using socketpair()
      • fork() your process
      • have your main process drop all its root UIDs using setuid() and continue as usual
    • your child process will execute a loop to process commands sent from the main process

    The result will be that your main process has no special privileges, but you have a root-privileged child process that is connected to your main process via those sockets. These sockets are “unnamed”, meaning no other program can access them.

    You are still somewhat vulnerable to attacks, of course. Even if your code is “safe” until you get to the fork(), an attacker could still be able to get into your main program later on, and send commands to the privileged process. Even if the child process is good at validating its input and can’t be compromised, valid commands can still cause problems when issued by an attacker — like in your case, an attacker could probably create new accounts, possibly even one that has uid 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to manage hierarchy data storing in my database. But I have a
I have a Singleton to manage some variables I need in various places in
How can i manage user permission? i need a fast method to manage users
I am looking for some simple library for javascript to manage animations. I need
I need to manage a configuration file in Linux using a shell script, that
I am using php-ldap to manage posix accounts on a linux machine. I am
So, I've got a Linux process where I'm trying to manage some files on
I need a software to manage configurations of linux servers in one central location.
I am in desperate need of help, I need to manage an application dependency
I need to make an web application to manage posts, when a post is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.