Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 4.2.0-pre-2



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
/* 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 */


Messages sorted by: Reverse Date, Date, Thread, Author