473,569 Members | 2,731 Online
Bytes | Software Development & Data Engineering Community
+ 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:groupi d 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 2765
On 31 Jul 2003 04:28:00 -0700, vi****@ncb.erne t.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.li nux.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.l earn.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
5764
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 point me toward a good place to start? I want to understand how to make decisions about the development environment, code structure and planning,...
5
11608
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 for every table in every database that he has permission for on our SQL Server 2000 server. I searched a bit for a tool to do this, but all I found...
1
1613
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() management. Please note that i don't want to start a discussion about the purpose/usability of the approach. But i just want to understand some...
2
1317
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. The user must select an option from each dropdown list. All the dropdownlists are to be populated from a SQL database.
1
3410
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. We can view it through folder properties->Security->Advanced->Effective Permission. I want to automate this thing in C# and I am not able to get...
1
9763
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 server because the 'xxx \group' does not exist, this type of principal cannot be impersonated, or you do not have permission (Microsoft SQL Server;...
1
1929
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 an element declaration as follows:
8
1986
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 write programs and I feel I must apply some better ways to design my code e.g. all of my the programmers at my college use to write this code: ...
2
20299
by: KiranJyothi | last post by:
Hello All, Can anyone please tell me what is an Effective User ID ? Thanks in advance. -Jyothi
3
1030
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 as I'm also learning about the WCF. My ultimate goal is to do an effective testing on WCF and to make sure that the product never got released with...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7673
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
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 we have to send another system
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.