Skip to content

Commit

Permalink
Initial source release
Browse files Browse the repository at this point in the history
Co-authored-by: Johnny Willemsen <jwillemsen@remedy.nl>
Co-authored-by: Martin Corino <mcorino@remedy.nl>
  • Loading branch information
jwillemsen and Martin Corino committed Feb 27, 2020
0 parents commit 31a66d9
Show file tree
Hide file tree
Showing 38 changed files with 1,953 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Ruby Gem Release

on:
release:
types: [published]

jobs:
build:
name: Publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
rake gem
gem push pkg/*.gem
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.*
*~
pkg*

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Remedy IT Expertise BV

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
28 changes: 28 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{<img src="https://badge.fury.io/rb/fuzzr.svg" alt="Gem Version" />}[https://badge.fury.io/rb/fuzzr]
{<img src="https://www.codefactor.io/repository/github/remedyit/fuzzr/badge" alt="CodeFactor" />}[https://www.codefactor.io/repository/github/remedyit/fuzzr]

= fuzz

== DESCRIPTION:

{fuzzr}[https://github.com/RemedyIT/fuzzr] is an open source fuzz check tool

== Bugs

If you find a bug, please report it as {fuzzr issue}[https://github.com/RemedyIT/fuzzr/issues].

== Warranty

This software is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.

== Installing fuzzr

fuzzr is distributed as a Ruby Gem. You can download and install fuzzr as a Ruby Gem from the common {Rubygems.org}[https://www.rubygems.org/gems/fuzzr] repository by executing the following command:

$ gem install fuzzr

The RIDL Gem is a Ruby-only Gem without any dependencies.

== Releasing new RIDL Ruby Gem

A new fuzzr ruby gem release can be made by incrementing the fuzzr version in link:lib/fuzz.rb and create a new release on {github}[https://github.com/RemedyIT/fuzzr/releases] matching the new version (for example v2.7.0). The github {Ruby Gem Release}[https://github.com/RemedyIT/ridl/actions?query=workflow%3A%22Ruby+Gem+Release%22] action will automatically create a new gem and push it to {Rubygems.org}[https://www.rubygems.org/gems/fuzzr].
13 changes: 13 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#--------------------------------------------------------------------
# Rakefile - main build file for fuzzr
#
# Author: Martin Corino
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the R2CORBA LICENSE which is
# included with this program.
#
# Copyright (c) Remedy IT Expertise BV
#--------------------------------------------------------------------

task :default => 'help'
11 changes: 11 additions & 0 deletions bin/fuzz
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby
# encoding: utf-8
#---------------------------------
#---------------------------------
if File.directory?(File.join(File.dirname(File.symlink?(__FILE__) ? File.expand_path(File.readlink(__FILE__)) : __FILE__), '..', 'lib','fuzz'))
$: << File.expand_path((File.join(File.dirname(File.symlink?(__FILE__) ? File.expand_path(File.readlink(__FILE__)) : __FILE__), '..', 'lib')))
end

require 'fuzz.rb'

exit(Fuzz.run ? 0 : 1)
5 changes: 5 additions & 0 deletions fuzzers/check_ace_error.excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
taox11\/tao\/x11\/.*
taox11\/lichk\/.*
taox11\/util\/md5\.cpp
.*(C|S|P|SP)\.(h|inl|cpp)
test\/.*\/tao\/.*
37 changes: 37 additions & 0 deletions fuzzers/check_ace_error.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# encoding: utf-8
# -------------------------------------------------------------------
# check_ace_error.rb - TAOX11 ACE_ERROR checker
#
# Author: Martin Corino
#
# Copyright (c) Remedy IT Expertise BV
# -------------------------------------------------------------------

module Fuzzers
class TAOX11AceErrorChecker
include Fuzz::Fzzr
def initialize
@fuzz_id = :check_ace_error
@description = 'checks against the use of the old ACE logging macros in test code'
@errormsg = 'detected use of ACE_ERROR, ACE_DEBUG, and/or ACE_ERROR_RETURN'
end

OBJECT_EXTS = ['h', 'hxx', 'hpp', 'c', 'cc', 'cxx', 'cpp', 'H', 'C', 'asm']

def applies_to?(object)
Fuzz::FileObject === object &&
OBJECT_EXTS.include?(object.ext) &&
!is_excluded?(object)
end

def run(object, apply_fix)
object.iterate(fuzz_id) do |lnptr|
if lnptr.text =~ /(^|\s+)(ACE_ERROR|ACE_ERROR_RETURN|ACE_DEBUG)(\s+|$)/
lnptr.mark_error
end
end
end
end

Fuzz.register_fzzr(TAOX11AceErrorChecker.new)
end
41 changes: 41 additions & 0 deletions fuzzers/check_catch_ex_as_const.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# encoding: utf-8
# -------------------------------------------------------------------
# check_catch_ex_as_const.rb - Checks whether an exception is caught as const
#
# Author: Marcel Smit
#
# Copyright (c) Remedy IT Expertise BV
# -------------------------------------------------------------------

module Fuzzers
class ExAsConstChecker
include Fuzz::Fzzr
def initialize
@fuzz_id = :check_catch_ex_as_const
@description = 'checks whether an exception is caught as const'
@errormsg = 'exceptions should be caught as const'
end

OBJECT_EXTS = ['h', 'hxx', 'hpp', 'c', 'cc', 'cxx', 'cpp', 'H', 'C']

def applies_to?(object)
Fuzz::FileObject === object &&
OBJECT_EXTS.include?(object.ext) &&
!is_excluded?(object)
end

def run(object, apply_fix)
object.iterate(fuzz_id) do |lnptr|
if lnptr.text =~ /^\s*(catch\(|catch \()/
unless lnptr.text =~ /([...])/
if not lnptr.text =~ /const/
lnptr.mark_error
end
end
end
end
end
end

Fuzz.register_fzzr(ExAsConstChecker.new)
end
5 changes: 5 additions & 0 deletions fuzzers/check_cout_cerr.excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
taox11\/util\/.*
taox11\/orbsvcs\/tests\/.*
public\/.*
test\/.*\/tao\/.*
.*(C|S|P|SP)\.(h|inl|cpp)
37 changes: 37 additions & 0 deletions fuzzers/check_cout_cerr.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# encoding: utf-8
# -------------------------------------------------------------------
# check_cout_cerr.rb - TAOX11 cout/cerr in core checker
#
# Author: Marcel Smit
#
# Copyright (c) Remedy IT Expertise BV
# -------------------------------------------------------------------

module Fuzzers
class TAOX11CoutCerrChecker
include Fuzz::Fzzr
def initialize
@fuzz_id = :check_cout_cerr
@description = 'checks against the use of cout and cerr in the CORE code (to be expanded to all code)'
@errormsg = 'detected use of cout and/or cerr'
end

OBJECT_EXTS = ['h', 'hxx', 'hpp', 'c', 'cc', 'cxx', 'cpp', 'H', 'C']

def applies_to?(object)
Fuzz::FileObject === object &&
OBJECT_EXTS.include?(object.ext) &&
!is_excluded?(object)
end

def run(object, apply_fix)
object.iterate(fuzz_id) do |lnptr|
if lnptr.text =~ /(^|\s+)(cout|cerr|std::cout|std::cerr|std::wcout|std::wcerr|wcout|wcerr)(\s+|$)/
lnptr.mark_error
end
end
end
end

Fuzz.register_fzzr(TAOX11CoutCerrChecker.new)
end
37 changes: 37 additions & 0 deletions fuzzers/check_executablebit.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# encoding: utf-8
# -------------------------------------------------------------------
# check_executablebit.rb - executable bit checker
#
# Author: Johnny Willemsen
#
# Copyright (c) Remedy IT Expertise BV
# -------------------------------------------------------------------

module Fuzzers
class ExecutablebitChecker
include Fuzz::Fzzr
def initialize
@fuzz_id = :check_executablebit
@description = 'checks for executable bit set'
end

OBJECT_EXTS = ['pl', 'sh', 'bat']

def applies_to?(object)
Fuzz::FileObject === object &&
OBJECT_EXTS.include?(object.ext) &&
!is_excluded?(object)
end

def run(object, apply_fix)
if !File::executable?(object.path)
Fuzz.log_error(%Q{#{object.path} - lacks executable bit})
false
end
true
end

end

Fuzz.register_fzzr(ExecutablebitChecker.new)
end
2 changes: 2 additions & 0 deletions fuzzers/check_exit_keyword.excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.*(C|S|P|SP)\.(h|inl|cpp)
test\/.*\/tao\/.*
37 changes: 37 additions & 0 deletions fuzzers/check_exit_keyword.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# encoding: utf-8
# -------------------------------------------------------------------
# check_exit_keyword.rb - TAOX11 exit checker
#
# Author: Marcel Smit
#
# Copyright (c) Remedy IT Expertise BV
# -------------------------------------------------------------------

module Fuzzers
class TAOX11ExitChecker
include Fuzz::Fzzr
def initialize
@fuzz_id = :check_exit_keyword
@description = 'checks against the use of the exit keyword in test code'
@errormsg = 'detected use of exit'
end

OBJECT_EXTS = ['h', 'hxx', 'hpp', 'c', 'cc', 'cxx', 'cpp', 'H', 'C']

def applies_to?(object)
Fuzz::FileObject === object &&
OBJECT_EXTS.include?(object.ext) &&
!is_excluded?(object)
end

def run(object, apply_fix)
object.iterate(fuzz_id) do |lnptr|
if lnptr.text =~ /(^|\s+)(exit)(\s+|$)/
lnptr.mark_error
end
end
end
end

Fuzz.register_fzzr(TAOX11ExitChecker.new)
end
5 changes: 5 additions & 0 deletions fuzzers/check_fileheader.excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.*(C|S|P)\.(h|inl|cpp)
test\/.*\/tao\/.*
ridl\/.*
.*\.erb
.*\.cmd
Loading

0 comments on commit 31a66d9

Please sign in to comment.