Bug 68642 - newgrp loses functions defined in /etc/bashrc & .bash_profile
newgrp loses functions defined in /etc/bashrc & .bash_profile
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: util-linux (Show other bugs)
7.2
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Elliot Lee
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-07-11 19:39 EDT by John V. Kjellman
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-07-15 09:28:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John V. Kjellman 2002-07-11 19:39:10 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)

Description of problem:
'newgrp' not listed in your bug list! I know problem is not with 'release' 
file.  The problem with 'newgrp' is that when executed it causes functions 
defined in /etc/bashrc and .bash/profile files to become undefined. The man 
page does not describe this as a feature, so I assume it is a bug. It is 
annoying!  The execution of 'newgrp' should only change a user's group ID, 
nothing more.  Thank you.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. create a simple function in /etc/profile if there is not one already defined
2. logon as user with permission to be in two or more groups
3. test use of function
4. newgrp {alt-group from login group}
5. test use of function [it will fail]
	

Actual Results:  The function no longer works

Expected Results:  I would think that all functions defined previous to 
execution of 'newgrp' would continue to be defined after assigned to the new 
group.

Additional info:

This applies to RH 6.2 and RH 7.2. The man page does not mention this behavior 
as being a feature of the program.
Comment 1 Tim Powers 2002-07-15 09:28:22 EDT
It's part of the util-linux package. I'm changing the component and assigning to
the owner of that package.

Tim
Comment 2 Elliot Lee 2002-08-13 08:03:47 EDT
newgrp does not change the group of the current shell, but runs a new shell with the new 
group, as a subprocess of the current shell. This new shell is not a login shell and won't 
behave the same way.
Comment 3 John V. Kjellman 2002-08-13 09:11:49 EDT
May I respectfully suggest that the man page be updated to reflect this 
information.  The current man page refers to "login." Thanks.  John Kjellman

Note You need to log in before you can comment on or make changes to this bug.