LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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
 
LinkBack Search this Thread
Old 08-09-2011, 03:25 PM   #1
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,766
Blog Entries: 4

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
RHEL6 using real rather than effective UID in sendmail


How do I change it to use effective UID?

Background:
We run NetBackup as the root user on our RHEL6 server. It sends emails for various things and has always sent them as root@<host.domain.ext>.

Recently I created an account for myself on the server and yesterday did a "sudo su -" to become root. After that I stopped and started NetBackup as the root user.

This morning I realized that it is now sending emails as my real user ID rather than the effective (root) user ID I'd become. The processes are definitely running as root so it appears to still know my real user ID.

As a test I sent email from command line using mailx after doing a "sudo su -" and sure enough found it is sending as my real user ID instead of the effective (root) user ID. Comparing this with my RHEL5 installations I don't see this behavior so it appears something has changed in RHEL6 or the Sendmail version it runs that is forcing this.

I made no configuration changes to Sendmail when I setup my account and there is nothing in /etc/mail files that knows my real user ID.

Clearly restarting the application by doing direct login as root solves the issue with that application. However, I'd much rather be able to do it with "sudo su -". How can I make Sendmail use effective ID rather than real ID when sending email? (Or maybe - how can I get Sendmail to forget real ID altogether?)

p.s. I'm not talking about running something like "mailx -r" to set return user - that works - I'm talking about configuring sendmail itself so that it always uses effective user rather than real user.

Last edited by MensaWater; 08-09-2011 at 03:39 PM.
 
Old 08-10-2011, 06:16 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,716

Rep: Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634
Interesting ... could you please run a few commands to see whether it's sudo or su that's causing the problem? Or at least rule them out..

Code:
sudo su -
echo $EUID
echo $UID

su -
echo $EUID
echo $UID

Last edited by kbp; 08-10-2011 at 06:19 PM.
 
Old 08-10-2011, 07:11 PM   #3
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,716

Rep: Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634
Did a bit more digging and it seems it's by design .. apparently you may be able to bypass this by using the 'S' mailer flag to sendmail, but I know bugger all about sendmail configuration so I can't give you the exact syntax

hth
 
Old 08-11-2011, 03:17 PM   #4
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,766
Blog Entries: 4

Original Poster
Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
$UID and $EUID both return 0 which is root. The sudo man page says it sets real and effective user ID to root (or whatever user you specify). The id command and these variables seem to bear that out.

However, who am i shows my real user name whereas whoami shows my effective user name (root).

You can change sender when sending an email at command line. What I need is a way to change it so when Sendmail daemon gets it that it automatically uses root. The issue is this appears to have changed because it is happening on a couple of newer systems (including RHEL6) but on older RHEL5 systems it uses root as the sender as expected.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Real uid and effective uid palisetty_suman Linux - Newbie 2 02-15-2009 12:59 PM
Difference between UID and effective UID chakribobby Linux - Newbie 2 10-23-2007 10:56 AM
Effective UID and real UID Milosevic Linux - General 1 01-06-2007 03:01 PM
Effective UID and Real UID Milosevic Linux - Newbie 1 01-06-2007 10:41 AM


All times are GMT -5. The time now is 10:53 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration