mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Produce importpath warning only for true interactive shells,
close PR 598
This commit is contained in:
parent
799d8c1a69
commit
e4cff55ea3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9432
|
@ -30,7 +30,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: csh.c,v 1.2 1994/09/24 02:53:51 davidg Exp $
|
||||
* $Id: csh.c,v 1.3 1995/05/30 00:06:30 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
|
@ -618,7 +618,8 @@ importpath(cp)
|
|||
for (;;) {
|
||||
if ((c = *dp) == ':' || c == 0) {
|
||||
*dp = 0;
|
||||
if ((*cp != '/' || *cp == '\0') && (euid == 0 || uid == 0))
|
||||
if ((*cp != '/' || *cp == '\0') && (euid == 0 || uid == 0) &&
|
||||
(intact || intty && isatty(SHOUT)))
|
||||
(void) fprintf(csherr,
|
||||
"Warning: imported path contains relative components\n");
|
||||
pv[i++] = Strsave(*cp ? cp : STRdot);
|
||||
|
|
Loading…
Reference in a new issue