zsh-workers
 help / color / mirror / code / Atom feed
* Re: 4.2.0-pre-2
       [not found] <20040303191540.GA20717@rabox>
@ 2004-03-04 12:01 ` Peter Stephenson
  2004-03-04 13:12   ` 4.2.0-pre-2 Ibraheem Umaru-Mohammed
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 2004-03-04 12:01 UTC (permalink / raw)
  To: Ibraheem Umaru-Mohammed, Zsh hackers list

Ibraheem Umaru-Mohammed wrote:
> however, removing "cap" from config.modules, and running 'make prep' then

Yes, this is utils.c which is part of the core shell...

> 	/usr/vac/bin/cc -qlanglvl=ansi -c -I.  -DHAVE_CONFIG_H -O  -o utils.o u
> tils.c
> "utils.c", line 3896.15: 1506-277 (S) Syntax error: possible missing ';' or '
> ,'?
> "utils.c", line 3896.9: 1506-045 (S) Undeclared identifier cap_t.
> "utils.c", line 3897.12: 1506-045 (S) Undeclared identifier caps.
> "utils.c", line 3900.30: 1506-275 (S) Unexpected text val encountered.
> "utils.c", line 3900.13: 1506-045 (S) Undeclared identifier cap_flag_value_t.
> "utils.c", line 3901.25: 1506-275 (S) Unexpected text n encountered.
> "utils.c", line 3901.13: 1506-045 (S) Undeclared identifier cap_value_t.
> "utils.c", line 3902.17: 1506-045 (S) Undeclared identifier n.
> "utils.c", line 3902.63: 1506-045 (S) Undeclared identifier val.
> "utils.c", line 3902.47: 1506-045 (S) Undeclared identifier CAP_EFFECTIVE.
> make: The error code from the last command is 1.

HAVE_CAP_GET_PROC is defined, but the shell isn't including appropriate
headers, or has a completely different system for capabilities.

Could you please try:
1. Undefining HAVE_CAP_GET_PROC in config.h.

2. Grepping the system headers for cap_t or cap_get_proc.  Presumably
it's there somewhere.  In that case searching for the right header
during configuration should fix it.

Unless we can satisfactorily resolve 2. the only way forward will be
to introduce an --enable-cap flag.  I have no way of testing this
code at all.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 4.2.0-pre-2
  2004-03-04 12:01 ` 4.2.0-pre-2 Peter Stephenson
@ 2004-03-04 13:12   ` Ibraheem Umaru-Mohammed
  2004-03-04 13:59     ` 4.2.0-pre-2 Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Ibraheem Umaru-Mohammed @ 2004-03-04 13:12 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 3265 bytes --]

On Thu, 2004-03-04 at 12:01, Peter Stephenson wrote:

> HAVE_CAP_GET_PROC is defined, but the shell isn't including appropriate
> headers, or has a completely different system for capabilities.
> 
> Could you please try:
> 1. Undefining HAVE_CAP_GET_PROC in config.h.
>

> 2. Grepping the system headers for cap_t or cap_get_proc.  Presumably
> it's there somewhere.  In that case searching for the right header
> during configuration should fix it.
> 
> Unless we can satisfactorily resolve 2. the only way forward will be
> to introduce an --enable-cap flag.  I have no way of testing this
> code at all.

Ok. I have included the capabilities.h which seems to have the "opaque"
definition for cap_t. Below is the result of running grep through
/usr/include:

[ibraheem@md000002s:~] $ find /usr/include -type f \
		-exec grep -E '(cap_t|cap_get_proc)' \
		/dev/null  {} \;
/usr/include/sys/capabilities.h: * cap_t
/usr/include/sys/capabilities.h: * cap_t is an opaque data type.  The
format used within the
/usr/include/sys/capabilities.h: * library and kernel is represented by
(struct __cap_t).
/usr/include/sys/capabilities.h:struct __cap_t {
/usr/include/sys/capabilities.h:typedef void * cap_t;
/usr/include/sys/capabilities.h:int kcap_get_proc (struct __cap_t *,
int);
/usr/include/sys/capabilities.h:int kcap_set_proc (struct __cap_t *,
int);
/usr/include/sys/capabilities.h:int kcap_is_null_set (cap_flag_t, struct
__cap_t *);
/usr/include/sys/capabilities.h:int kcap_is_subset (cap_flag_t, struct
__cap_t *, struct __cap_t *);
/usr/include/sys/capabilities.h:void kcap_exec (struct __cap_t *);
/usr/include/sys/cred.h:	struct	__cap_t cr_caps;	/* capabilities sets
64-bit and LDT */
/usr/include/sys/cred.h:	struct	__cap_t crx_caps;	/* capabilities sets
*/ 
/usr/include/sys/cred.h:void kcred_getcap (struct ucred *, struct
__cap_t *);
/usr/include/sys/cred.h:void kcred_setcap (struct ucred *, struct
__cap_t *);
/usr/include/pcap.h:typedef struct pcap pcap_t;
/usr/include/pcap.h:pcap_t	*pcap_open_live(char *, int, int, int, char
*);
/usr/include/pcap.h:pcap_t	*pcap_open_offline(const char *, char *);
/usr/include/pcap.h:void	pcap_close(pcap_t *);
/usr/include/pcap.h:int	pcap_loop(pcap_t *, int, pcap_handler, u_char
*);
/usr/include/pcap.h:int	pcap_dispatch(pcap_t *, int, pcap_handler,
u_char *);
/usr/include/pcap.h:	pcap_next(pcap_t *, struct pcap_pkthdr *);
/usr/include/pcap.h:int	pcap_stats(pcap_t *, struct pcap_stat *);
/usr/include/pcap.h:int	pcap_setfilter(pcap_t *, struct bpf_program *);
/usr/include/pcap.h:void	pcap_perror(pcap_t *, char *);
/usr/include/pcap.h:char	*pcap_geterr(pcap_t *);
/usr/include/pcap.h:int	pcap_compile(pcap_t *, struct bpf_program *,
char *, int,
/usr/include/pcap.h:int	pcap_freecode(pcap_t *, struct bpf_program *);
/usr/include/pcap.h:int	pcap_datalink(pcap_t *);
/usr/include/pcap.h:int	pcap_snapshot(pcap_t *);
/usr/include/pcap.h:int	pcap_is_swapped(pcap_t *);
/usr/include/pcap.h:int	pcap_major_version(pcap_t *);
/usr/include/pcap.h:int	pcap_minor_version(pcap_t *);
/usr/include/pcap.h:FILE	*pcap_file(pcap_t *);
/usr/include/pcap.h:int	pcap_fileno(pcap_t *);
/usr/include/pcap.h:pcap_dumper_t *pcap_dump_open(pcap_t *, const char
*);
[ibraheem@md000002s:~]

Hope this helps,

Cheers,

			--ibraheem

[-- Attachment #2: capabilities.h --]
[-- Type: text/x-c-header, Size: 3114 bytes --]

/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* bos520 src/bos/kernel/sys/capabilities.h 1.6                           */
/*                                                                        */
/* Licensed Materials - Property of IBM                                   */
/*                                                                        */
/* Restricted Materials of IBM                                            */
/*                                                                        */
/* (C) COPYRIGHT International Business Machines Corp. 2000,2002          */
/* All Rights Reserved                                                    */
/*                                                                        */
/* US Government Users Restricted Rights - Use, duplication or            */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.      */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

#ifndef _H_SYS_CAP
#define	_H_SYS_CAP

#include <sys/types.h>

/*
 * cap_flag_t
 *
 * Flag for selecting which capabilities set is requested.
 */

#define	CAP_EFFECTIVE	1
#define	CAP_INHERITABLE	2
#define	CAP_PERMITTED	3
typedef unsigned int cap_flag_t;

/*
 * cap_t
 *
 * cap_t is an opaque data type.  The format used within the
 * library and kernel is represented by (struct __cap_t).
 */

struct __cap_t {
	uint64_t cap_effective;
	uint64_t cap_inheritable;
	uint64_t cap_permitted;
};
typedef void * cap_t;

/*
 * cap_flag_value_t
 *
 * A flag to indicate if a capability should be or is set or cleared.
 */

#define CAP_CLEAR	0
#define	CAP_SET		1
typedef unsigned int cap_flag_value_t;

/*
 * cap_value_t
 *
 * The symbolic constants used to represent capabilities.
 */

typedef int cap_value_t;

#define	CAP_PROPAGATE	   1		/* inherit without file capabilities */
#define	CAP_PROPOGATE	   1		/* deprecated spelling */
#define	CAP_NUMA_ATTACH	   2		/* NUMA attachment capability */
#define CAP_BYPASS_RAC_VMM 3	        /* large page use capability */

#define CAP_MAXIMUM CAP_BYPASS_RAC_VMM	/* Highest valued capability */

/*
 * Kernel functions and exported services
 */

#ifdef _KERNEL

int kcap_get_proc (struct __cap_t *, int);
int kcap_set_proc (struct __cap_t *, int);
int kcap_is_set_cr (int, struct ucred *);
int kcap_is_set (int);

#if defined(__64BIT_KERNEL) || defined(__LDT__)
int kcap_is_null_set (cap_flag_t, struct __cap_t *);
int kcap_is_subset (cap_flag_t, struct __cap_t *, struct __cap_t *);
void kcap_exec (struct __cap_t *);
#else
int kcap_is_null_set (cap_flag_t, short *);
int kcap_is_subset (cap_flag_t, short *, short *);
void kcap_exec (short *);
#endif	/* defined(__64BIT_KERNEL) || defined(__LDT__) */

#endif	/* _KERNEL */

#endif	/* _H_SYS_CAP */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 4.2.0-pre-2
  2004-03-04 13:12   ` 4.2.0-pre-2 Ibraheem Umaru-Mohammed
@ 2004-03-04 13:59     ` Peter Stephenson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2004-03-04 13:59 UTC (permalink / raw)
  To: Zsh hackers list, Ibraheem Umaru-Mohammed

Ibraheem Umaru-Mohammed wrote:
> Ok. I have included the capabilities.h which seems to have the "opaque"
> definition for cap_t. Below is the result of running grep through
> /usr/include:

Thanks for the info... The important thing is if you managed to get
it to compile.  I don't see a prototype for cap_get_proc there.
The only thing I can see is to add the flag I suggested earlier.

If anyone has the ability to fix this properly, please do.

I've just noticed that the `term.h' problem hasn't gone away.
It looks like configure should test for curses.h first, then see if
it can include term.h using

#ifdef HAVE_CURSES_H
#include <curses.h>
#endif
#include <term.h>

and if that works unconditionally use term.h, so getting rid of the
current `needs curses.h' flag.

It would be great if someone else had a chance to do that.  I only have
limited time for all these endless configuration changes.


Index: configure.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.12
diff -u -r1.12 configure.ac
--- configure.ac	3 Mar 2004 19:38:00 -0000	1.12
+++ configure.ac	4 Mar 2004 13:47:44 -0000
@@ -313,6 +313,11 @@
 AC_HELP_STRING([--enable-pcre],
 [enable the search for the pcre library (may create run-time library dependencies)]))
 
+dnl Do you want to look for capability support?
+AC_ARG_ENABLE(cap,
+AC_HELP_STRING([--enable-cap],
+[enable the search for POSIX capabilities (may require additional headers to be added by hand)]))
+
 dnl ------------------
 dnl CHECK THE COMPILER
 dnl ------------------
@@ -709,7 +714,9 @@
   AC_CHECK_LIB(dl, dlopen)
 fi
 
-AC_CHECK_LIB(cap, cap_get_proc)
+if test x$enable_cap = xyes; then
+  AC_CHECK_LIB(cap, cap_get_proc)
+fi
 
 AC_CHECK_LIB(socket, socket)
 
@@ -1029,7 +1036,6 @@
 	       initgroups nis_list \
 	       setuid seteuid setreuid setresuid setsid \
 	       memcpy memmove strstr strerror \
-	       cap_get_proc \
 	       getrlimit \
 	       setlocale \
 	       uname \
@@ -1045,6 +1051,10 @@
 	       grantpt unlockpt ptsname)
 AC_FUNC_STRCOLL
 
+if test x$enable_cap = xyes; then
+  AC_CHECK_FUNCS(cap_get_proc)
+fi
+
 dnl  Check if tgetent accepts NULL (and will allocate its own termcap buffer)
 dnl  Some termcaps reportedly accept a zero buffer, but then dump core
 dnl  in tgetstr().
Index: INSTALL
===================================================================
RCS file: /cvsroot/zsh/zsh/INSTALL,v
retrieving revision 1.13
diff -u -r1.13 INSTALL
--- INSTALL	1 Mar 2004 17:58:53 -0000	1.13
+++ INSTALL	4 Mar 2004 13:47:44 -0000
@@ -359,20 +359,32 @@
 None of this is relevant for 64-bit systems; zsh should compile and run
 without problems if (sizeof(long) == 8).
 
-Searching for `pcre'
---------------------
+Searching for additional features
+---------------------------------
+
+Various additional features are turned off by default to avoid
+compatibility problems.
+
+--enable-pcre:
 
 Zsh has a module which allows the pcre regular expression library to be
 used via shell builtins.  Compiling this library into the shell with
 dynamic loading (the default where available) produces a dependency on the
 library libpcre.so.  This is a problem on systems where zsh needs to be
-available at boot before the directory containing libpcre.so (for
-example /usr/lib or /usr/local/lib) is mounted.  For this reason,
-pcre support will only be searched for if the option --enable-pcre
-is passed to configure.
+available at boot before the directory containing libpcre.so (for example
+/usr/lib or /usr/local/lib) is mounted.  For this reason, pcre support will
+only be searched for if the option --enable-pcre is passed to configure.
 
 (Future versions of the shell may have a better fix for this problem.)
 
+--enable-cap:
+
+This searches for POSIX capabilities; if found, the `cap' library
+is available and the shell will use these to determine if the
+shell is running in some privileged mode.  This is turned off by
+default as on some systems non-standard headers (in particular AIX) are
+required.  A direct fix for that problem would be appreciated.
+
 Options For Configure
 ---------------------
 

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 4.2.0-pre-2
       [not found] <20040303193902.GF9561@blorf.net>
@ 2004-03-04 10:44 ` Peter Stephenson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2004-03-04 10:44 UTC (permalink / raw)
  To: Zsh hackers list

Wayne Davison wrote:
> Q: Does "config.modules" need to depend on config.h.in?

Not directly... config.modules is now created only from
config.modules.sh plus the existing config.modules.
I don't think config.modules.sh needs to depend on
anything, since running config.status --recheck regenerates it, but
maybe there's some sequence that needs special handing.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-03-04 14:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20040303191540.GA20717@rabox>
2004-03-04 12:01 ` 4.2.0-pre-2 Peter Stephenson
2004-03-04 13:12   ` 4.2.0-pre-2 Ibraheem Umaru-Mohammed
2004-03-04 13:59     ` 4.2.0-pre-2 Peter Stephenson
     [not found] <20040303193902.GF9561@blorf.net>
2004-03-04 10:44 ` 4.2.0-pre-2 Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).