OwlCyberDefense / setools

setools has moved to https://github.com/SELinuxProject/setools
Other
91 stars 34 forks source link

A error about build and installation on Ubuntu 16.10 x64 #167

Closed hongfeiyucode closed 7 years ago

hongfeiyucode commented 7 years ago

When I built and installed SETools (4.1, a484867) on Ubuntu 16.10 x64. During this process I encountered with several problems:

libqpol/ftrule_query.c: In function ‘filename_trans_state_next’:
libqpol/ftrule_query.c:84:40: error: ‘filename_trans_t {aka struct filename_trans}’ has no member named ‘size’
   if (fts->bucket >= db->filename_trans->size) {
                                        ^
libqpol/ftrule_query.c:88:37: error: ‘filename_trans_t {aka struct filename_trans}’ has no member named ‘htable’
   fts->cur_item = db->filename_trans->htable[fts->bucket];
                                     ^
libqpol/ftrule_query.c: In function ‘filename_trans_state_size’:
libqpol/ftrule_query.c:113:36: error: ‘filename_trans_t {aka struct filename_trans}’ has no member named ‘size’
  for (i = 0; i < db->filename_trans->size; i++) {
                                    ^
libqpol/ftrule_query.c:114:27: error: ‘filename_trans_t {aka struct filename_trans}’ has no member named ‘htable’
   cur = db->filename_trans->htable[i];
                           ^
libqpol/ftrule_query.c: In function ‘qpol_policy_get_filename_trans_iter’:
libqpol/ftrule_query.c:149:36: error: ‘filename_trans_t {aka struct filename_trans}’ has no member named ‘htable’
  fts->cur_item = db->filename_trans->htable[0];
                                    ^
libqpol/ftrule_query.c:152:36: error: ‘filename_trans_t {aka struct filename_trans}’ has no member named ‘htable’
  fts->cur_item = db->filename_trans->htable[fts->bucket];
                                    ^
libqpol/ftrule_query.c:155:40: error: ‘filename_trans_t {aka struct filename_trans}’ has no member named ‘size’
   if (fts->bucket >= db->filename_trans->size) {
                                        ^
libqpol/ftrule_query.c:159:37: error: ‘filename_trans_t {aka struct filename_trans}’ has no member named ‘htable’
   fts->cur_item = db->filename_trans->htable[fts->bucket];
                                     ^
libqpol/ftrule_query.c: In function ‘qpol_filename_trans_get_default_type’:
libqpol/ftrule_query.c:269:2: error: unknown type name ‘filename_trans_datum_t’
  filename_trans_datum_t *datum = hashtab_search(db->filename_trans, (hashtab_key_t)ft);
  ^
libqpol/ftrule_query.c:269:49: error: passing argument 1 of ‘hashtab_search’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  filename_trans_datum_t *datum = hashtab_search(db->filename_trans, (hashtab_key_t)ft);
                                                 ^
In file included from /usr/include/sepol/policydb/symtab.h:16:0,
                 from /usr/include/sepol/policydb/policydb.h:59,
                 from libqpol/iterator_internal.h:36,
                 from libqpol/ftrule_query.c:29:
/usr/include/sepol/policydb/hashtab.h:100:24: note: expected ‘hashtab_t {aka struct hashtab_val *}’ but argument is of type ‘filename_trans_t * {aka struct filename_trans *}’
 extern hashtab_datum_t hashtab_search(hashtab_t h, const hashtab_key_t k);
                        ^
libqpol/ftrule_query.c:275:54: error: request for member ‘otype’ in something not a structure or union
  *dflt = (qpol_type_t *) db->type_val_to_struct[datum->otype - 1];
                                                      ^
cc1: all warnings being treated as errors
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I follow this step: https://github.com/TresysTechnology/setools/wiki/SETools-4-on-Ubuntu-16.10

pebenito commented 7 years ago

The master branch of setools currently requires the master branch of libsepol (what will become libsepol 2.7)

hongfeiyucode commented 7 years ago

in 4.1 ,there is another error :

ibqpol/policy_scan.c:398:0: error: "yywrap" redefined [-Werror]

 ^
libqpol/policy_scan.c:74:0: note: this is the location of the previous definition

 ^
cc1: all warnings being treated as errors
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
fishilico commented 7 years ago

This is an error from flex 2.6.3 (https://github.com/westes/flex/issues/162). You need to backport https://github.com/westes/flex/commit/f5d87f1a26f4a5c3402497008ae10e9a1345d327 to the flex you are using, or disable -Werror in setup.py.

hongfeiyucode commented 7 years ago

Thanks! you are right. Although i can not start it normally.There are some other problems