473,471 Members | 2,040 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

get effective and real user-ids in a setuid program in linux

Hi,
I have to write a setuid program which is going to check for
accesslogs based on the real user who had invoked the executable.

I need to get the real and effective user-ids of the system
and based on the real user-id i need to filter logs only for that
user and give it for further activity. My idea was to get the real
userid, groupid and search for a pattern x:userid:groupid in the
/etc/password file. But again that involves fork, exec, write the
result to some file etc.....

Instead of doing all that is there any other way of getting
all this done???

-kellogy
Nov 13 '05 #1
1 2754
On 31 Jul 2003 04:28:00 -0700, vi****@ncb.ernet.in (vimala) wrote in
comp.lang.c:
Hi,
I have to write a setuid program which is going to check for
accesslogs based on the real user who had invoked the executable.


[snip]

Linux user ID's and setuid are part of Linux, not defined or supported
by standard C. Undoubtedly your compiler provides access to OS
provided mechanisms to do these things, but since they're not part of
the standard language their are not discussed here.

Try a group like news:comp.os.linux.development.apps for Linux
specific questions.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 13 '05 #2

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

Similar topics

5
by: Matt Priest | last post by:
I am trying to learn more about how to effectively mix low-level C code with C++. I am having trouble finding resources/papers/books that aren't in one or the other camp exclusively. Can anyone...
5
by: Ross Presser | last post by:
As our customers demand that we tighten our IT security in the company, I've been asked to prepare a report quarterly showing, for each user in Active directory, what his effective permissions are...
1
by: FBergemann | last post by:
Hi, i have a little question concerning Scott Meyer's Effective C++ (2nd edition), Item 7 "Be prepared for out-of-memory conditions". It's about his example for a class specific new_handler()...
2
by: Harry | last post by:
Hi, Quick question regarding dropdownlists. On one page I have 10 asp:dropdownlists. The user selects an option from a dropdown list and then it updates an asp:label with the relevant text....
1
by: kuntalshh | last post by:
I have automated setting the security permissions for a group "myGroup" for a folder "myfolder". Now the group contains user "myUser". I want to check whether myUser has same permissions as myGroup....
1
by: akkha1234 | last post by:
When I click on the properties of a 2005 sql server database and then permissions. If I select a group and then effective permission, I got an error, saying that "cannot execute as the principal...
1
by: mahesh.kanakaraj | last post by:
Hi All, I have a confusion in finding the 'effective content' of a complex type definition in a XML Schema. I shall give you an example situation to clearly explain my problem. Let's have...
8
by: arnuld | last post by:
Hi all, I have come to a point where I can comprehend C++ code much better. I will finish C++ Primer 4/e within next few days. Right now I am feeling the need to have have coding standards when I...
2
by: KiranJyothi | last post by:
Hello All, Can anyone please tell me what is an Effective User ID ? Thanks in advance. -Jyothi
3
by: Sendil kumar | last post by:
Hi All, I'm a developer of C++. Recently I was moved to QA,because of in-adequate resource, to test the WCF functionalities that have been implemented in my new project. I'm new to QA role as weel...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.