Skip to content
Advanced search
Cheat sheet

Search cheat sheet

GitHub’s search supports a variety of different operations. Here’s a quick cheat sheet for some of the common searches.

For more information, visit our search help section.

Basic search

This search Finds repositories with…
cat stars:>100 Find cat repositories with greater than 100 stars.
user:defunkt Get all repositories from the user defunkt.
tom location:"San Francisco, CA" Find all tom users in "San Francisco, CA".
join extension:coffee Find all instances of join in code with coffee extension.
NOT cat Excludes all results containing cat.

Repository search

Repository search looks through the projects you have access to on GitHub. You can also filter the results:

This search Finds repositories with…
cat stars:>100 Find cat repositories with greater than 100 stars.
user:defunkt Get all repositories from the user defunkt.
pugs pushed:>2013-01-28 Pugs repositories pushed to since Jan 28, 2013.
node.js forks:<200 Find all node.js repositories with less than 200 forks.
jquery size:1024..4089 Find jquery repositories between the sizes 1024 and 4089 kB.
gitx fork:true Repository search includes forks of gitx.
gitx fork:only Repository search returns only forks of gitx.

Code search

Code search looks through the files hosted on GitHub. You can also filter the results:

This search Finds repositories with…
install repo:charles/privaterepo Find all instances of install in code from the repository charles/privaterepo.
shogun user:heroku Find references to shogun from all public heroku repositories.
join extension:coffee Find all instances of join in code with coffee extension.
system size:>1000 Find all instances of system in code of file size greater than 1000kbs.
examples path:/docs/ Find all examples in the path /docs/.
replace fork:true Search replace in the source code of forks.

Issue search

Issue search looks through issues and pull requests on GitHub. You can also filter the results:

This search Finds issues…
encoding user:heroku Encoding issues across the Heroku organization.
cat is:open Find cat issues that are open.
strange comments:>42 Issues with more than 42 comments.
hard label:bug Hard issues labeled as a bug.
author:mojombo All issues authored by mojombo.
mentions:tpope All issues mentioning tpope.
assignee:rtomayko All issues assigned to rtomayko.
exception created:>2012-12-31 Created since the beginning of 2013.
exception updated:<2013-01-01 Last updated before 2013.

User search

User search finds users with an account on GitHub. You can also filter the results:

This search Finds repositories with…
fullname:"Linus Torvalds" Find users with the full name "Linus Torvalds".
tom location:"San Francisco, CA" Find all tom users in "San Francisco, CA".
chris followers:100..200 Find all chris users with followers between 100 and 200.
ryan repos:>10 Find all ryan users with more than 10 repositories.
          This is also not strictly necessary, but i found it rather helpful to
be able to identify and distinguish the individual clamonacc threads in
the usual Linux system tools ("ps", "top", "gdb", etc.).
Setting the thread name is already done for the threads started by the
bundled c-thread-pool library ("thread-pool-N"). Only the clamonacc
threads all identify themselfes as "clamonacc".
This commit now sets the following - shortened (due to the 16 character
limit) - thread names:
 - "clamonacc-ddd" for the ddd/inotify thread.
 - "clamonacc-sq" for the scan queue thread.
 - the main clamonacc thread currently keeps the name "clamonacc" in-
   herited from the main process.
        
frank-fegert authored and micahsnyder committed Feb 25, 2022
          The clamonacc-ddd thread (clamonacc/inotif/inotif.c) currently and in-
discriminately stops processing of inotify watch descriptors in the
function "onas_ddd_unwatch_hierarchy" upon any error returned from the
call to "inotify_rm_watch". This in turn also prevents further updates
and cleanup of the internal data structures "ddd_ht" and "wdlt", which
leads to a invalid value of the "path" variable.
This causes a leak of inotify watch descriptors in the case of e.g. a
move of a directory containing a hierarchy of watched subdirectories.
See the inotify watch descriptor ("wd:") values in the section "Example
and reproducer" below.
This commit adds a workaround for this issue by specifically ignoring
the "ENOENT" errno in case the call to "inotify_rm_watch" results in
a non-zero return code. This allows the cleanup to properly proceed
for all children.

Example and reproducer:
 - Starting point:
   Log:
    ClamInotif: created watch descriptor (wd:1) for path: /clamonacc/monitored
    [...]
    ClamInotif: created watch descriptor (wd:129637) for path: /clamonacc/monitored/[...]
 - Initial directory and subdirectory creation:
    mkdir -p /clamonacc/monitored/.test_ff/{1,2,3,4,5}
   Log:
    ClamInotif: inotify event wd:1, mask:1073742080, cookie:0, length:16, child:.test_ff
    ClamInotif: inotify event path: /clamonacc/monitored
    ClamInotif: CREATE - adding /clamonacc/monitored/.test_ff to /clamonacc/monitored with wd:1
    ClamInotif: created watch descriptor (wd:129638) for path: /clamonacc/monitored/.test_ff
    ClamInotif: created watch descriptor (wd:129639) for path: /clamonacc/monitored/.test_ff/3
    ClamInotif: created watch descriptor (wd:129640) for path: /clamonacc/monitored/.test_ff/4
    ClamInotif: created watch descriptor (wd:129641) for path: /clamonacc/monitored/.test_ff/1
    ClamInotif: created watch descriptor (wd:129642) for path: /clamonacc/monitored/.test_ff/5
    ClamInotif: created watch descriptor (wd:129643) for path: /clamonacc/monitored/.test_ff/2
 - Move / rename of the parent directory:
    mv -i /clamonacc/monitored/.test_ff/ /clamonacc/monitored/test_ff
   Log:
    ClamInotif: inotify event wd:1, mask:1073741888, cookie:12094045, length:16, child:.test_ff
    ClamInotif: inotify event path: /clamonacc/monitored
    ClamInotif: MOVED_FROM - removing /clamonacc/monitored/.test_ff from /clamonacc/monitored with wd:1
    ERROR: ClamInotif: error removing watch descriptor (wd:129638) for path: /clamonacc/monitored/.test_ff, No such file or directory
    ClamInotif: inotify event wd:1, mask:1073741952, cookie:12094045, length:16, child:test_ff
    ClamInotif: inotify event path: /clamonacc/monitored
    ClamInotif: MOVED_TO - adding /clamonacc/monitored/test_ff to /clamonacc/monitored with wd:1
    ClamInotif: created watch descriptor (wd:129644) for path: /clamonacc/monitored/test_ff
    ClamInotif: created watch descriptor (wd:129639) for path: /clamonacc/monitored/test_ff/3
    ClamInotif: created watch descriptor (wd:129640) for path: /clamonacc/monitored/test_ff/4
    ClamInotif: created watch descriptor (wd:129641) for path: /clamonacc/monitored/test_ff/1
    ClamInotif: created watch descriptor (wd:129642) for path: /clamonacc/monitored/test_ff/5
    ClamInotif: created watch descriptor (wd:129643) for path: /clamonacc/monitored/test_ff/2
 - Removal of the parent directory unter the new name:
    rm -r /clamonacc/monitored/test_ff
   Log:
    ClamInotif: inotify event wd:129644, mask:1073742336, cookie:0, length:16, child:3
    ClamInotif: inotify event path: /clamonacc/monitored/test_ff
    ClamInotif: DELETE - removing /clamonacc/monitored/test_ff/3 from /clamonacc/monitored/test_ff with wd:129644
    ClamInotif: removed watch descriptor (wd:129639) for path: /clamonacc/monitored/test_ff/3
    ClamInotif: inotify event wd:129644, mask:1073742336, cookie:0, length:16, child:4
    ClamInotif: inotify event path: /clamonacc/monitored/test_ff
    ClamInotif: DELETE - removing /clamonacc/monitored/test_ff/4 from /clamonacc/monitored/test_ff with wd:129644
    ClamInotif: removed watch descriptor (wd:129640) for path: /clamonacc/monitored/test_ff/4
    ClamInotif: inotify event wd:129644, mask:1073742336, cookie:0, length:16, child:1
    ClamInotif: inotify event path: /clamonacc/monitored/test_ff
    ClamInotif: DELETE - removing /clamonacc/monitored/test_ff/1 from /clamonacc/monitored/test_ff with wd:129644
    ClamInotif: removed watch descriptor (wd:129641) for path: /clamonacc/monitored/test_ff/1
    ClamInotif: inotify event wd:129644, mask:1073742336, cookie:0, length:16, child:5
    ClamInotif: inotify event path: /clamonacc/monitored/test_ff
    ClamInotif: DELETE - removing /clamonacc/monitored/test_ff/5 from /clamonacc/monitored/test_ff with wd:129644
    ClamInotif: removed watch descriptor (wd:129642) for path: /clamonacc/monitored/test_ff/5
    ClamInotif: inotify event wd:129644, mask:1073742336, cookie:0, length:16, child:2
    ClamInotif: inotify event path: /clamonacc/monitored/test_ff
    ClamInotif: DELETE - removing /clamonacc/monitored/test_ff/2 from /clamonacc/monitored/test_ff with wd:129644
    ClamInotif: removed watch descriptor (wd:129643) for path: /clamonacc/monitored/test_ff/2
    ClamInotif: inotify event wd:1, mask:1073742336, cookie:0, length:16, child:test_ff
    ClamInotif: inotify event path: /clamonacc/monitored
    ClamInotif: DELETE - removing /clamonacc/monitored/test_ff from /clamonacc/monitored with wd:1
    ClamInotif: removed watch descriptor (wd:129644) for path: /clamonacc/monitored/test_ff
        
frank-fegert authored and micahsnyder committed Feb 25, 2022
          A race condition existed where clamonacc would call logg and attempt to
write to a logfile either before the logg interface had been initialized
or after it had been cleaned up.

This happens due to logg calls at cleanup during asynchronous thread
shutdowns, and during startup when watching directories with ongoing
event triggers.

This resulted in new files with garbage-filled names being created and
written to under the initial process' runtime path.

Changes:
Move logg setup to start of clamonacc.c main()
Change all raceable calls to logg to mprintf instead
        
Mickey Sola authored and micahsnyder committed Nov 21, 2022
          The clamonacc-ddd thread (clamonacc/inotif/inotif.c) has currently no
explicit handling for the special inotify kernel events IN_UNMOUNT,
IN_Q_OVERFLOW and IN_IGNORED. It treats the inotify_event structs in
the same way as regular inotify events, although for those special
events the "len" and "name" fields a value of zero respectively NULL.
This can lead to a SIGSEGV of the clamonacc-ddd thread when calling
"strlen(name)" on a NULL value.
This commit adds just a quick'n'dirty workaround for the SIGSEGV and
some logging output. It DOES NOT fix the more overall issue, that a
IN_Q_OVERFLOW inotify event also leads to an out-of-sync situation
between the monitored filesystem/directory and the internal data
structures "ddd_ht" and "wdlt" of clamonacc.
        
frank-fegert authored and micahsnyder committed Feb 27, 2022
          The clamonacc-ddd thread (clamonacc/inotif/inotif.c) has currently no
handling for inotify events where the passed watch descriptor is lower
than zero (e.g.: "-1"). Although not actually mentioned in the inotify
documentation, this case has actually been observed:
  [...]
  ClamInotif: inotify event wd:-1, mask:1073742080, cookie:0, length:16, child:<CHILD-PATH>
  Clamonacc: onas_clamonacc_exit(), signal 11

Assumption: This probably occurs when a inotify event is generated for
the creation of a directory including subdirectories. The clamonacc-ddd
thread then discovers all children of the directory and is generating
inotify watch descriptors for all children. A subsequent inotify event
is generated for a subdirectory, but an inotify watch descriptor already
exists from the previous discovery.

In any case, this leads to an out-of-bounds array access on the internal
data structure "wdlt" of clamonacc while trying to look up the "path"
from there. This in turn can lead to a SIGSEGV of the clamonacc-ddd
thread.
        
frank-fegert authored and micahsnyder committed Feb 27, 2022
          Patch provides more insight into error conditions which may arise
when adding a directory to the watch hierarchy. If a specific file
caused the issue, the filename is provided to help users with any
troubleshooting needed.
        
Mickey Sola authored and micahsnyder committed Feb 9, 2023
          * clamonacc: fix unused variable compile-time warning

Remove unused variable 'ret' from onas_queue.c and get rid of the
following compile-time warning:

~/clamav/clamonacc/scan/onas_queue.c: In function ‘onas_scan_queue_th’:
~/clamav/clamonacc/scan/onas_queue.c:161:9: warning: unused variable ‘ret’ [-Wunused-variable]
 161 |     int ret;
     |         ^~~

* libclamav: fix unused variable compile-time warning

Remove unused variable 'err' from libclamav/png.c, and get rid of
the following compile-time warning:

~/clamav/libclamav/png.c: In function ‘cli_parsepng’:
~/clamav/libclamav/png.c:101:9: warning: unused variable ‘err’ [-Wunused-variable]
  101 |     int err = Z_OK;
      |         ^~~
        
rzvncj committed Apr 13, 2022
          Explicit setting of pthread_sigmask in the individual threads
should not be necessary at all(?), since it is already done in
the main process/thread and should be inherited from there. But
since the sigfillset/sigdelset lines are already there, at least
they should be consistent with regard to the undefined behaviour
caused by ignoring SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals.
        
frank-fegert authored and micahsnyder committed Feb 25, 2022
          This is not strictly necessary, but i found it rather helpful to know
what is going on during the debugging process and while trying to under-
stand how clamonacc actually works.
        
frank-fegert authored and micahsnyder committed Feb 25, 2022