LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-10-2011, 12:07 PM   #1
alephan
Member
 
Registered: Dec 2010
Location: Bucharest
Distribution: ubuntu
Posts: 45

Rep: Reputation: 0
Exclamation seteuid down't work without getting no error


I have GNU C Library (EGLIBC) stable release version 2.11.1

In an application i want to use seteuid function from #include <unistd.h> and check that it did what it was supposed to do...

Code:
[..]
/*
 * Seteuid to testuser1
 */
printf("\t[%d] seteuid to %d ... ", getpid(), getuserid(username1));
if (seteuid(getuserid(username1)) == -1) {
	rmuser(username1);
	rmuser(username2);
	die(ERRSEUID, vm, "error.\n", REQUIREMENT);
}
myprintf("done.\n");

myprintf(vm, "\t[%d] I am now ... ", getpid());
system("whoami");
[...]
Running this as root (sudo):
Code:
[...]
[528] seteuid to 65535 ... done.
[528] I am now ... root
[...]
getuserid is a function that returns correctly the uid of a user.

Need help. Thanks a lot.
 
Old 05-10-2011, 12:30 PM   #2
alephan
Member
 
Registered: Dec 2010
Location: Bucharest
Distribution: ubuntu
Posts: 45

Original Poster
Rep: Reputation: 0
Sorry for the typo in the post's name. If anybody a moderator can edit this...

seteuid doesn't work and it returns no error

Last edited by alephan; 05-10-2011 at 12:34 PM.
 
Old 05-10-2011, 12:56 PM   #3
alephan
Member
 
Registered: Dec 2010
Location: Bucharest
Distribution: ubuntu
Posts: 45

Original Poster
Rep: Reputation: 0
This can be closed. It's not a bug as i thought. whoami it acting strange on some systems.

I could check this with geteuid and this works fine.

Can be closed.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hi, I upgraged the OS from 4.6 to 4.7. it work ok but after 1 day i get this error. dasyogesh Linux - Newbie 3 03-12-2009 08:10 PM
ERROR: iptables + imq not work duyuyang Linux - Networking 1 12-06-2008 01:42 AM
easy_17 script error. what's this work around mean? Drone4four Slackware 5 07-21-2006 09:13 AM
Make Error (please help i need my webcam to work)... ephman Linux - General 1 12-27-2005 11:15 PM
error trying to get usenet / pan to work mjl3434 Linux - Software 4 09-02-2004 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration