Warning during compilations Server

54 views
Skip to first unread message

Kumar Mg

unread,
Jul 19, 2016, 1:32:28 PM7/19/16
to ossec...@googlegroups.com
Hi 

We are getting these message during compilation and not sure if any code update is required for the rename_ex function in src/shared/file_op.c.

Compiling on CentOS 7 for OSSEC 2.8.3 version.


*** Making shared ***

 

make[1]: Entering directory `/OSSECSRC/src/shared'

cc -c -g -Wall -I../ -I../headers   -DUSE_OPENSSL -DUSEINOTIFY   -DMAX_AGENTS=512   -DARGV0=\"shared-libs\" -DOSSECHIDS *.c

file_op.c: In function 'rename_ex':

file_op.c:660:9: warning: too many arguments for format [-Wformat-extra-args]

         );

         ^

ar cru lib_shared.a *.o

ranlib lib_shared.a

make[1]: Leaving directory `/OSSECSRC/src/shared'



Thanks
Kumar

dan (ddp)

unread,
Jul 19, 2016, 1:57:43 PM7/19/16
to ossec...@googlegroups.com
On Tue, Jul 19, 2016 at 1:32 PM, Kumar Mg <mkg...@gmail.com> wrote:
> Hi
>
> We are getting these message during compilation and not sure if any code
> update is required for the rename_ex function in src/shared/file_op.c.
>

I don't see any issues with it in the current source. I don't have
2.8.3 handy to check that.

> Compiling on CentOS 7 for OSSEC 2.8.3 version.
>
>
> *** Making shared ***
>
>
>
> make[1]: Entering directory `/OSSECSRC/src/shared'
>
> cc -c -g -Wall -I../ -I../headers -DUSE_OPENSSL -DUSEINOTIFY
> -DMAX_AGENTS=512 -DARGV0=\"shared-libs\" -DOSSECHIDS *.c
>
> file_op.c: In function 'rename_ex':
>
> file_op.c:660:9: warning: too many arguments for format
> [-Wformat-extra-args]
>
> );
>
> ^
>
> ar cru lib_shared.a *.o
>
> ranlib lib_shared.a
>
> make[1]: Leaving directory `/OSSECSRC/src/shared'
>
>
>
> Thanks
> Kumar
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ossec-list" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ossec-list+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Kumar Mg

unread,
Jul 19, 2016, 3:14:03 PM7/19/16
to ossec...@googlegroups.com
Thanks Dan.

Let me check with the new code and see.

R Brandt

unread,
Aug 14, 2017, 1:03:29 PM8/14/17
to ossec-list
Was this issue resolved?
I am getting the same error on CentOS 7.2 with ossec 2.8.3.
Richard

dan (ddp)

unread,
Aug 14, 2017, 1:07:09 PM8/14/17
to ossec...@googlegroups.com


On Aug 14, 2017 1:03 PM, "R Brandt" <blind.gra...@gmail.com> wrote:
Was this issue resolved?
I am getting the same error on CentOS 7.2 with ossec 2.8.3.
Richard

Have you tried a more up to date version? I haven't tried with centos, but haven't seen issues compiling on ubuntu

To unsubscribe from this group and stop receiving emails from it, send an email to ossec-list+unsubscribe@googlegroups.com.

R Brandt

unread,
Aug 14, 2017, 2:22:15 PM8/14/17
to ossec-list
I'm sorry, are you referring to OS or Ossec?
Richard
To unsubscribe from this group and stop receiving emails from it, send an email to ossec-list+...@googlegroups.com.

dan (ddp)

unread,
Aug 14, 2017, 2:24:03 PM8/14/17
to ossec...@googlegroups.com


On Aug 14, 2017 2:22 PM, "R Brandt" <blind.gra...@gmail.com> wrote:
I'm sorry, are you referring to OS or Ossec?
Richard

OSSEC. I'm not very involved with the centos project.


To unsubscribe from this group and stop receiving emails from it, send an email to ossec-list+unsubscribe@googlegroups.com.

Noilson Caio

unread,
Aug 14, 2017, 3:01:58 PM8/14/17
to ossec...@googlegroups.com
I've been installing Ossec on centOs successfully for years. maybe you could try install "Development Tools" packages =]

yum groupinstall "Development Tools"


R Brandt

unread,
Aug 15, 2017, 12:29:45 PM8/15/17
to ossec-list
I did load the Dev Tools, including openssl, but the error still persists.
I am on an isolated network and it takes a long time to get newer versions approved for transfer.
Since it was only a warning, I proceeded with the compile and install.
It's running but I'm not sure if I'll be able to notice any issues or not.
Richard.
To unsubscribe from this group and stop receiving emails from it, send an email to ossec-list+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "ossec-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ossec-list+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Noilson Caio

unread,
Aug 15, 2017, 12:50:33 PM8/15/17
to ossec...@googlegroups.com
* It's running but I'm not sure if I'll be able to notice any issues or not.

i agree. there are many ways to test your instance. look at your logs - enable debugging mode - http://ossec-docs.readthedocs.io/en/latest/faq/unexpected.html#how-to-debug-ossec  

To unsubscribe from this group and stop receiving emails from it, send an email to ossec-list+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

dan (ddp)

unread,
Aug 16, 2017, 5:46:35 PM8/16/17
to ossec...@googlegroups.com
2 minute analysis:
This function is mentioned in the error message. log2file is one of
those fancy "..." functions, allowing you to create a message and
populate it with the values of variables.
int rename_ex(const char *source, const char *destination)
{
if (rename(source, destination)) {
log2file(
RENAME_ERROR,
__local_name,
source,
destination,
errno,
strerror(errno)
);

return (-1);
}

return (0);
}

RENAME_ERROR:
#define RENAME_ERROR "%s(1124): ERROR: Unable to rename file: '%s'."
It takes 2 values, both strings. The rename function above passes 5 to
it, a mix of strings and ints.
5 > 2, hence the error. I'm not sure how it will affect any important
functionality, maybe just logging.

In master RENAME_ERROR has been changed to:
#define RENAME_ERROR "%s(1124): ERROR: Could not rename file '%s' to
'%s' due to [(%d)-(%s)]."
allowing all 5 variables to be used.

There are only a couple of instances where this message is used (from 2.8.3):
agentlessd/agentlessd.c: merror(RENAME_ERROR, ARGV0, new_location);
shared/file_op.c: RENAME_ERROR,
syscheckd/seechanges.c: merror(RENAME_ERROR, ARGV0, filename);

It looks like the other instances have the correct number of
variables. The easiest fix is probably to copy the RENAME_ERROR from
master to RENAME_ERROR2, and modify file_op.c to use RENAME_ERROR2
instead.

These warnings all appear to be fixed in master though, so as usual I
recommend upgrading to a recent version of OSSEC. ;-)
Reply all
Reply to author
Forward
0 new messages