8000 config.c:155:53: error: passing argument 1 of ‘RB_INT2FIX’ makes integer from pointer · Issue #27 · domcleal/rkerberos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

config.c:155:53: error: passing argument 1 of ‘RB_INT2FIX’ makes integer from pointer #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ekohl opened this issue Feb 18, 2025 · 1 comment

Comments

@ekohl
Copy link
ekohl commented Feb 18, 2025

When installing on Fedora 41 (and could replicate on EL10) I get the following in gem_make.out:

current directory: /home/ekohl/.gem/ruby/gems/rkerberos-0.1.5/ext/rkerberos
/usr/bin/ruby -I/usr/share/rubygems extconf.rb
checking for krb5.h... yes
checking for -lkrb5... yes
checking for pkg-config for com_err... ["-I/usr/include/et ", "", "-lcom_err"]
checking for kadm5/admin.h... yes
checking for -lkadm5clnt... yes
checking for kdb.h... yes
checking for -llibkdb5... no
creating Makefile

current directory: /home/ekohl/.gem/ruby/gems/rkerberos-0.1.5/ext/rkerberos
make DESTDIR\= sitearchdir\=./.gem.20250218-305276-gt98yl sitelibdir\=./.gem.20250218-305276-gt98yl clean
rm -f 
rm -fr rkerberos.so false ccache.o config.o context.o kadm5.o keytab.o keytab_entry.o policy.o principal.o rkerberos.o *.bak mkmf.log .*.time

current directory: /home/ekohl/.gem/ruby/gems/rkerberos-0.1.5/ext/rkerberos
make DESTDIR\= sitearchdir\=./.gem.20250218-305276-gt98yl sitelibdir\=./.gem.20250218-305276-gt98yl
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -I/usr/include/et -DHAVE_KRB5_H -DHAVE_KADM5_ADMIN_H -DHAVE_KDB_H -I/usr/local/include    -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC  -std=c99 -Wall -pedantic -m64 -o ccache.o -c ccache.c
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -I/usr/include/et -DHAVE_KRB5_H -DHAVE_KADM5_ADMIN_H -DHAVE_KDB_H -I/usr/local/include    -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC  -std=c99 -Wall -pedantic -m64 -o config.o -c config.c
In file included from /usr/include/ruby/internal/arithmetic/int.h:26,
                 from /usr/include/ruby/internal/arithmetic/char.h:23,
                 from /usr/include/ruby/internal/arithmetic.h:24,
                 from /usr/include/ruby/ruby.h:28,
                 from /usr/include/ruby.h:38,
                 from ./rkerberos.h:4,
                 from config.c:1:
config.c: In function ‘rkadm5_config_initialize’:
config.c:155:53: error: passing argument 1 of ‘RB_INT2FIX’ makes integer from pointer without a cast [-Wint-conversion]
  155 |     rb_iv_set(self, "@keysalts", INT2FIX(ptr->config.keysalts));
      |                                          ~~~~~~~~~~~^~~~~~~~~
      |                                                     |
      |                                                     krb5_key_salt_tuple *
/usr/include/ruby/internal/arithmetic/long.h:111:17: note: expected ‘long int’ but argument is of type ‘krb5_key_salt_tuple *’
  111 | RB_INT2FIX(long i)
      |            ~~~~~^
make: *** [Makefile:249: config.o] Error 1

make failed, exit code 2

That's this bit of code:

// Not very useful at the moment. How do you iterate over an enum in C?
if(ptr->config.keysalts)
rb_iv_set(self, "@keysalts", INT2FIX(ptr->config.keysalts));
else
rb_iv_set(self, "@keysalts", Qnil);

I suppose the TODO finally caught up and came back to bite.

@djberg96
Copy link
Collaborator

Looks like that parameter is a krb5_key_salt_tuple as defined at https://github.com/krb5/krb5/blob/master/src/include/kdb.h#L239-L242. So, it will require a mapped struct (Ruby object), and a loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0