mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 05:58:57 +00:00
Don't honor LANG or NLSPATH if we're setuid/setgid.
Fixes PR 2582 Submitted by: Julian Assange
This commit is contained in:
parent
79d71652cf
commit
3f2c98c480
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24197
@ -1,4 +1,4 @@
|
||||
/* $Id$ */
|
||||
/* $Id: msgcat.c,v 1.7 1997/02/22 15:00:50 peter Exp $ */
|
||||
|
||||
/***********************************************************
|
||||
Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
|
||||
@ -99,8 +99,13 @@ int type;
|
||||
catpath = name;
|
||||
if (stat(catpath, &sbuf)) return(0);
|
||||
} else {
|
||||
if ((lang = (char *) getenv("LANG")) == NULL) lang = "C";
|
||||
if ((nlspath = (char *) getenv("NLSPATH")) == NULL) {
|
||||
/* XXX Should really be issetguid(), but we don't have that */
|
||||
if ((lang = (char *) getenv("LANG")) == NULL ||
|
||||
getuid() != geteuid() || getgid() != getegid())
|
||||
lang = "C";
|
||||
/* XXX Should really be issetguid(), but we don't have that */
|
||||
if ((nlspath = (char *) getenv("NLSPATH")) == NULL ||
|
||||
getuid() != geteuid() || getgid() != getegid()) {
|
||||
nlspath = "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user