aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/ncurses/tinfo/access.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2001-05-17 08:21:06 +0000
committerPeter Wemm <peter@FreeBSD.org>2001-05-17 08:21:06 +0000
commit7a69bbfb278952228c9aa1eca241e65fcdef425e (patch)
treee83b2ef47811e687a6c54035c9af6d4a2b7f14e1 /contrib/ncurses/ncurses/tinfo/access.c
parent18259542b2f8fa7e3f76f4bb0dd37995dfd424aa (diff)
downloadsrc-7a69bbfb278952228c9aa1eca241e65fcdef425e.tar.gz
src-7a69bbfb278952228c9aa1eca241e65fcdef425e.zip
Import ncurses-5.2-20010512 onto the vendor branch
Obtained from: ftp://dickey.his.com/ncurses/
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=76726
Diffstat (limited to 'contrib/ncurses/ncurses/tinfo/access.c')
-rw-r--r--contrib/ncurses/ncurses/tinfo/access.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/ncurses/ncurses/tinfo/access.c b/contrib/ncurses/ncurses/tinfo/access.c
index 6fbe92176045..c8071d81dbe0 100644
--- a/contrib/ncurses/ncurses/tinfo/access.c
+++ b/contrib/ncurses/ncurses/tinfo/access.c
@@ -33,9 +33,9 @@
#include <curses.priv.h>
#include <tic.h>
-MODULE_ID("$Id: access.c,v 1.4 2000/10/08 01:25:06 tom Exp $")
+MODULE_ID("$Id: access.c,v 1.7 2000/12/10 02:55:07 tom Exp $")
-char *
+NCURSES_EXPORT(char *)
_nc_basename(char *path)
{
char *result = strrchr(path, '/');
@@ -50,7 +50,7 @@ _nc_basename(char *path)
return result;
}
-int
+NCURSES_EXPORT(int)
_nc_access(const char *path, int mode)
{
if (access(path, mode) < 0) {
@@ -78,7 +78,7 @@ _nc_access(const char *path, int mode)
* Returns true if we allow application to use environment variables that are
* used for searching lists of directories, etc.
*/
-int
+NCURSES_EXPORT(int)
_nc_env_access(void)
{
#if HAVE_ISSETUGID
@@ -86,9 +86,9 @@ _nc_env_access(void)
return FALSE;
#elif HAVE_GETEUID && HAVE_GETEGID
if (getuid() != geteuid()
- || getgid() != getegid())
+ || getgid() != getegid())
return FALSE;
#endif
- return getuid() != 0; /* ...finally, disallow root */
+ return getuid() != 0 && geteuid() != 0; /* ...finally, disallow root */
}
#endif