473,388 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Change environment after setreuid

I have a program (which normally runs as root) which can start child
processes as different users.
Effectively, my program is a modified version of popen2's Popen3 class
where the child process (after the fork) does:

os.setregid (gid, gid)
os.setreuid (uid, uid)
session_pid = os.setsid ()

This all seems to work. However, I am running into a problem where the
environment of the new process still carries values that were set
before the setreuid() call.

What would be the best way to go about modifying the environment
without having to re-implement all the functionality of the 'su'
command?

I could use it (the 'su' command) to start the new process but I'd like
to avoid external dependencies like that.

Thank you
--
Mitko Haralanov
==========================================
The program isn't debugged until the last user is dead.
Sep 30 '08 #1
0 820

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steve Mew | last post by:
Has anyone come across a change tracking tool for SQL Server. Specifically the scenario I want is the following : A Production DB needs some modifications to its content. This tool will copy the...
12
by: DJ | last post by:
I have a .NET datagrid that has a column of dropdownlist controls. If the user changes the value in the dropdown in one or more rows I will set a flag. If the user subsequently attempts to (1)...
2
by: Samuel Yin | last post by:
Hi, guys, This should be a simple problem, but I just can not resolve it. I just want to use a python script to change my working directory. see my following code: # mycd.py 1) destdir =...
3
by: Xiaopeng Qu | last post by:
Hi, I installed DB2 8.1 Express with multiple language: English and Chinese, but the interface like: Control Center, CLP, etc alway display Chinese, is there a way to change the display language...
3
by: Terry Bell | last post by:
I have some code that adds entries to the "Module Compiled" popup menu. Works fine in A97. You can open a module, right click, and the new entries are there for you to click. I converted it to...
3
by: vatsa | last post by:
Hi all, we can simply change value of PS1 from command prompt . but I want to change the value of PS1 from within a c program. i tried to do that using getenv & putenv. but it is n't...
19
by: Ju Hui | last post by:
is python search module by paths in sys.path? how to change it manuallly?
4
by: Ron Garret | last post by:
Is there a way to change the default string encoding used by the string.encode() method? My default environment is utf-8 but I need it to be latin-1 to avoid errors like this: Traceback (most...
2
by: Gilbert Tordeur | last post by:
Hello, It is about a VB2008 intranet application. It uses a SQL Server database. The ConnectionString is defined in the connectionStrings section of the web.config file. This application uses...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.