[Bug] - `audit-libs` rebuild fail
Describe the bug I am trying to rebuild 'audit-libs' using 'rpmbuild'.
To Reproduce Steps to reproduce the behavior:
rpmdev-setuptree && cd ~/rpmbuild/SOURCESdnf download --source audit-libs- Resolve dependecies. I am using
sudo dnf builddep audit-3.0.6-1.amzn2023.0.2.src.rpm rpmbuild -rb audit-3.0.6-1.amzn2023.0.2.src.rpm
Expected behavior The rebuild ends with no errors.
Server:
- Host OS: Ubuntu 5.15.0-97-generic
- KVM OS: AL2023 6.1.77-99.164.amzn2023.x86_64
Additional context
audit_wrap.c: In function '_wrap_audit_rule_data_buf_set':
audit_wrap.c:5010:17: error: cast specifies array type
5010 | arg1->buf = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
| ^
audit_wrap.c:5010:15: error: invalid use of flexible array member
5010 | arg1->buf = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
| ^
audit_wrap.c:5012:15: error: invalid use of flexible array member
5012 | arg1->buf = 0;
| ^
make[4]: *** [Makefile:516: _audit_la-audit_wrap.lo] Error 1
make[4]: Leaving directory '/home/ec2-user/rpmbuild/BUILD/audit-3.0.6/bindings/swig/python3'
make[3]: *** [Makefile:415: all-recursive] Error 1
make[3]: Leaving directory '/home/ec2-user/rpmbuild/BUILD/audit-3.0.6/bindings/swig'
make[2]: *** [Makefile:412: all-recursive] Error 1
make[2]: Leaving directory '/home/ec2-user/rpmbuild/BUILD/audit-3.0.6/bindings'
make[1]: *** [Makefile:467: all-recursive] Error 1
make[1]: Leaving directory '/home/ec2-user/rpmbuild/BUILD/audit-3.0.6'
make: *** [Makefile:399: all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.P8nCxt (%build)
RPM build errors:
user mockbuild does not exist - using root
group mock does not exist - using root
user mockbuild does not exist - using root
group mock does not exist - using root
user mockbuild does not exist - using root
group mock does not exist - using root
Bad exit status from /var/tmp/rpm-tmp.P8nCxt (%build)
From what I have read online this code was fixed in version 3.0.8. If am rebuilding in the exact same environment audit-3.1.2-2.el9.src.rpm downloaded from CentOS 9 package repository, then it succeeds.
@denisgabriel5 you mentioned the code was fixed in 3.0.8. You're building a 3.0.6 package!
@denisgabriel5 you mentioned the code was fixed in
3.0.8. You're building a3.0.6package!
Well, that's because AL2023 repo doesn't have the package up-to-date. I am trying to use only packages from AL2023 repo.