killdash9 / MacClam

The Non-Graphical ClamAV Antivirus Solution for Mac OS X
MIT License
48 stars 15 forks source link

awk: illegal statement at script run #8

Closed grogcw closed 3 years ago

grogcw commented 3 years ago

Hi !

When I run the script in order to view activity, I have the following message near the end of execution :

------------------
 Current Activity
------------------

You can press Control-C to stop viewing activity.  Scanning services will continue running.

==> /Users/MyUser/MacClam/log/clamd.log <==
awk: illegal statement
 input record number 2, file
 source line number 59

Stopped showing activity.  Scan services continue to run.
Run the script again at any time to view activity.
Run 'MacClam.sh help' for more commands.

As far as I can tell, it may be an error in the awk call of the script, maybe around line 777.

Meanwhile I'm no good around awk to fix it, both script and clamd seems to run fine.

If you have any fix idea, I'm all ears !

Thanks for taking care,

Cheers !

harens commented 3 years ago

Hi @grogcw! 👋

Does reverting https://github.com/killdash9/MacClam/commit/5f565a4b8ebc92d7d6cf70ca6b3b80be57533b52 fix this for you? (i.e. replacing flush with fflush)?

grogcw commented 3 years ago

Hi !

Yes, this solution appears to fix the problem !

Thanks !

harens commented 3 years ago

That's great that it fixed it for you! 🎉

In the long term though, that means that there's a runtime bug in the code that won't be fixed since the project isn't maintained anymore. Only @killdash9 has write permissions.

Maybe we can reopen the fork https://github.com/killdash9/MacClam/pull/5, and maintain it for general bugfixes.

CC @jgreever. Anyway we can remove the deprecated syntax without having a runtime error?

jgreever commented 3 years ago

Yeah, I have some free time this weekend, I can kick out some quick tests and put in a check to see if it's macOS 11 and newer to use flush, and macOS 10 and earlier to use fflush, that way we don't have to worry about removing any working code and cut off anything older than macOS Big Sur.

killdash9 commented 3 years ago

@harens Let's get you added as a maintainer

harens commented 3 years ago

@harens Let's get you added as a maintainer

Thank you @killdash9! Greatly appreciated.