Bug 68642 - newgrp loses functions defined in /etc/bashrc & .bash_profile
Summary: newgrp loses functions defined in /etc/bashrc & .bash_profile
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: util-linux
Version: 7.2
Hardware: i686
OS: Linux
medium
low
Target Milestone: ---
Assignee: Elliot Lee
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-07-11 23:39 UTC by John V. Kjellman
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-07-15 13:28:26 UTC
Embargoed:


Attachments (Terms of Use)

Description John V. Kjellman 2002-07-11 23:39:10 UTC
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 13:28:22 UTC
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 12:03:47 UTC
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 13:11:49 UTC
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.