Giter Site home page Giter Site logo

pbpst's Introduction

pbpst

Coverity Scan Build Status

pbpst is a small tool to make interacting with pb instances as simple as possible. pb is a versatile, free and open source pastebin which has more features, is more robust, and is faster than any other pastebin with which I am familiar. You can find the reference instance (which tracks pb's master branch) at ptpb. Ideally, pbpst will support as many features of pb as possible (hopefully, nearly all) in a simple, unassuming CLI.

Please see the wiki for some tips and for build-instructions.

pbpst's People

Contributors

aladw avatar buhman avatar escondida avatar halfwit avatar halosghost avatar jelly avatar k-orne avatar kyrias avatar meskarune avatar pid1 avatar tmplt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pbpst's Issues

Add option to list all providers which are in the paste db

Right now, -Dq respects the provider (including if it has been set by -P).

However, this means there is no way to list all pastes in the paste db (only all pastes present in the current provider).

It would be nice (and good for future-proofing) if we had an option to list all of the providers in the paste db, so you could at least run the following to list all pastes:

$ for i in "$(pbpst -DH)"; do pbpst -Dq '<search>' -P "$i"; done

  • Add -H|--providers under -D
  • Update tab completion
  • Update documentation
    • Include the above snippet in pbpst(1):Examples section

doc/pbpst.rst line 220+225 indentation errors?

Section of my build which gives non-fatal errors:

Running Sphinx v1.2.3
building [man]: 2 source files given on command line
updating environment: 2 added, 0 changed, 0 removed
reading sources... [ 50%] pbpst
reading sources... [100%] pbpst_db

/tmp/guix-build-pbpst-1.2.0-1.4aeb782.drv-0/source/doc/pbpst.rst:220: ERROR: Unexpected indentation.
/tmp/guix-build-pbpst-1.2.0-1.4aeb782.drv-0/source/doc/pbpst.rst:225: ERROR: Unexpected indentation.
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... pbpst.1 { } pbpst_db.5 { }
build succeeded, 2 warnings.

Have ./configure check for needed libraries

shaman's configure script checks for needed headers/libraries; it is likely helpful to have this so that you can know ahead of time if the compilation will fail.

We should go further than I did with shaman though:

  • Check for all #included header files
  • Check for all binaries used for build
  • Check for all .sos we link to

Support pb's formatters

pb just recently added the ability to specify pygments formatters (defaulting to a special case of the HTML formatter so that the general API remains unchanged).

As with lexers, this option just adds another item to be printed in the returned URL and nothing else.

  • add --list-formats
  • add --format
  • print pb_list()'s output more prettily

Encapsulate the in-memory db operations

As fun as it was having all the operations on the in-memory db take place in the write callback for libcurl, to handle -Dd, everything in life would be simpler if we had the callback write to a pointer we can do the actual operations on elsewhere.

In fact, given that -Dd touches the db without ever getting into the callback, our choices are to duplicate all that handling code or encapsulate it elsewhere. My choice would be the latter.

This is a hard pre-requisite for completing #25 and #26:

  • Separate the write callback from printing the URL and writing to the db
  • Separate printing the URL from writing to the db

pbpst returns with no message on use of -Sf with existing vanity pastes

The right option of course is -Uf, as documented in the man page. However, when using -Sf on a paste with existing vanity URL, pbpst returns 1, without error message.

archie@thinkpad ~/aurqueue % pbpst -Sf makequeue -v makequeue          
archie@thinkpad ~/aurqueue % !!                                      
pbpst -Sf makequeue -v makequeue
pbpst: Could not create the swap db: File exists
pbpst: Ensure no other instances of pbpst are running and that all pastes have been saved
pbpst: Then manually remove: /home/archie/.config/pbpst/.db.json.swp

strace: https://ptpb.pw/Zwfl

(version: v1.0.0.r7.ga391b3e-1)

Zsh completion caches UUIDs per shell

This means that after you tab-complete UUIDs once, zsh caches the completion options so that when you add or remove a paste, the tab-complete options will not update until you open a new shell.

cc @halfwit

Some cleanup opportunities

There are still a few places in the code that could do with some pretty significant cleanup.

  • #36
  • We opted for using goto to simplify cleanup code, but now that we are forced to keep our state global (to deal with signal handling), this is actually unnecessary and less clean than it could be
  • Option Validation (#31) still could use a bit of work; ideally, we should be able to completely remove the option validation function.

For the moment, an option validation function is the simplest way to handle some of the option incompatibilities.

Add Zsh Completion

Technically, this has no prerequisites, but I would rather hold off on implementing a completion file until we can do it for all features slated for 1.0.

The basic case for this is that command-line option completion is handy. However, zsh-completion can be very powerful. Easily the most tantalizing functionality this could offer would be the ability to tab-complete UUIDs so that users do not even need to query the database to determine which UUID to use and don't feel the need to copy and paste the UUID since tab-completion is easier.

I definitely want zsh completion, but if others are contributed, I am happy to accept them.

  • zsh
    • -f, -b
    • -s and -P
    • -d and -u

Implement Support for Lexers

Prerequisites

When a paste's content is text, the user can choose to have the paste processed with pygments for syntax-highlighting (and/or line-numbering). This is done through requesting the paste to be parsed with a lexer. Luckily, all we need to do is modify the URL returned to the user.

Implement Support for Line Highlighting

Prerequisites

Along with lexers (see #15), pb offers the ability to highlight a particular line of a text paste.

Luckily, all we have to do for this is modify the URL as it is returned to the user.

Default to stdin when -f is not passed

It'd be pretty nice if pbpst made stdin the default source of the paste when -f is not given on the command line for sync and update operations.

Progress to completion:

  • If -f (nor -s for paste-creation) is not specified, default to stdin
  • Document the change

Support pb's Automatic Sunsets

Automatic Sunsets allow you to specify a count of seconds from paste-time that the paste should persist before being automatically deleted.

Prerequisites:

Required Functionality:

  • Option to specify the second count -x (under -S and -U operations)
  • Option(s) for pruning the local db to reflect the removal of expired pastes (see below)

Additionally, the pb implementation of automatic sunsets does not actually delete the paste contents when the sunset passes. Rather, at that point, the paste is considered expired and the next attempt to GET the paste contents will delete them proper. As a result, I plan to offer two different options to prune the local database:

  • -y or --prune (under -D) which will do the equivalent of pbpst -Dd for each paste with a sunset time that has passed.
  • -y or --prune (under -R) which will do the equivalent of pbpst -Ru for each paste with a sunset time that has passed.

-Dy will be quite speedy; but for the paranoidcautious user, -Ry (much slower) will ensure the paste contents will actually be deleted.

add terminal handler support

Rougly, you need to reimplement/combine convert.rb and terminal.c in pbpst.

Then a combined 'upload recording to pb' function would look something like:

recpb() {
  asciinema rec /tmp/$$.json
  pbpst --convert /tmp/$$.json
}

I'm pretty sure the v1 json (asciinema output) contains things like recording duration information, whereas the player json (convert.rb/pbpst output) doesn't, so the other thing pbpst should do is emit that lost metadata in the query string: https://ptpb.pw/t/<id>?d=<duration>.

I believe in you.

Arbitrary Pygments Themes

Prerequisites

While the nice formatting of the pygments lexing is only available with the default pygments theme that pb uses, pb offers the ability to specify which pygments theme to use. Luckily, all we have to do is modify the URL returned to the user adding ?style=<theme> to the end.

Implement the Local Database

Prerequisites:

We need to get the local database up and running so we can simplify the output we give on successful completion and so we can support a lot of the planned options.

Things which must work to close:

  • Create and test for a lockfile
  • Locate the Database
  • Check for a temp/swap database
  • Read the database into an internal structure
  • Write needed pb response info into the db
  • Write modified database to a temp/swap file
  • If all went well, overwrite the old database with the new one

Request data from pb in JSON format

Right now, we use the default format for pb's return info (yaml). However, since the local database will be in JSON, it would be much simpler (and removes the need for a whole extra dependency) to just request the information in JSON.

Allow for specifying an extension for a file

Some browsers (I'm looking at your Firefox) do not understand file MIMEtypes quite right, so image pastes will be served as if they are text in Firefox.

Upstream is working on a possible fix, but allowing users to specify an extension for us to return in the modified URL is a decent stop-gap anyway. Note that we will not be automatically detecting an extension to use; the user will need to specify one, or one will not be added.

Luckily, this is just adding an option (most likely -e) to -S and -U and modifying the callback to write it correctly.

We're ISO C; are our external dependencies?

We should figure out if libcurl and libjansson are close enough to ISO C to, for example, be compilable under musl-libc. If so, that might be a decent thing to add to the README.

@oatberry has mentioned he might be interested in checking this.

--shorten makes no sense in -S

-s is not composable with any of the other options in -S. It does not create a paste and can therefore not be saved to the pastedb or manipulated afterwards.

It is a helpful feature that I want to keep, but being under -S has caused too much trouble and makes too little sense.

Stale lock file if -S produces an existing paste

Reproduce with:

pbpst -S
test
^D
^D
pbpst: Paste already existed.
pbpst -S
pbpst: Could not create the swap db: File exists
pbpst: Ensure no other instances of pbpst are running and that all pastes have been saved
pbpst: Then manually remove: /home/mouse/.config/pbpst//home/mouse/.config/pbpst/.db.json.swp

This also occasionally happens when not using Enter on stdin. Possibly related to #32

Compile errors on use of “fprintf(stderr,…”

5dcd648 leads to a fair number of warnings (which we treat as errors) on the use of stderr because it is a recursive macro. We use it liberally for error reporting. We could either use a lot of diagnostic #pragmas to ignore these warnings, or we could create a simple error-reporting function and only ignore its definition. The latter is, of course, simpler, and would actually allow us to save some space too. However, I am not convinced it will be universally better. Either way, this is a high priority as it has broken the build for clean clones.

Make the readme useful

  • Add list of dependencies and make dependencies
  • Add simple build instructions and installation recommendations

signal handling; lock cleanup

Testcase:

$ ./src/pbpst -S
^C
$ ./src/pbpst -S
pbpst: Could not lock the database: File exists
pbpst: If no other instances of pbpst are running, you can delete /tmp/pbpst.lck
  • Remove errant/error-prone lockfile code
  • Handle signals to gracefully exit where possible

Implement support for the Rendering Handler

Prerequisites

pb has the ability to take a paste in mdown or rst and render it to html. This is performed with the rendering handler. Luckily, all we have to do is modify the URL returned to the user if this option is requested (yes, this means the user will be able to request the rendering handler on a paste where that makes no sense—just like they would be able to do if they go to the web browser and do it manually).

pbpst says "Paste deleted" even when you pass it a silly UUID

This happens because pbpst does not check the HTTP status code response from pb on -Ru. Instead, if the status code returned from curl_easy_perform() is CURLE_OK, it assumes everything went as-planned.

The best way to solve this would be to check that the HTTP response code for -Ru is 200 (at which point, we know that there was a paste and that it was deleted).

Passing --provider and URL without the '/' suffix gives an invalid link

Present in e8a4bfb.

The shortid seems to be appended to the --provider string, so if the provider isn't suffixed with '/', an invalid link is printed.

Example:

$ pbpst -Sf file.png --provider=https://ptpb.pw
https://ptpb.pw<shortid> # invalid

Expected:

$ pbpst -Sf file.png --provider=https://ptpb.pw
https://ptpb.pw/<shortid> # valid

Stopping reading from stdin with -S requires a double Ctrl+D

Tools like gist interrupt the paste with ^C, and stop reading from stdin with ^D. With pbpst, it goes like this:

pbpst -S
new foo bar
^D
^D
https://ptpb.pw/S5rr

Additionally, if Enter is not pressed after "new foo bar", ^D is required three times to get the link.

Allow setting the default provider

This will most likely be something like --set-default under -D.

Brings us a step closer to being able to say, “Don't touch the paste db unless there was an error we could not recover from.”

Tab completion for -P

Right now, tab-completing -P will complete http{s,}://, but nothing else.

It was a solid start, but if we implement #58, we could ostensibly tab-complete all the providers that have been used so far which would be a significant improvement in tab completion quality.

  • zsh
  • bash

Simplify Output

Prerequisites:

The only thing that should be returned to the user by-default is the URL (note that the style of the URL returned will depend on what options the user passed).

Failout more gracefully where possible

There are a few circumstances where we fail out (which is correct) but do not clean up after ourselves (we are too overly cautious). We need to strike a balance between making sure we preserve user data and gracefully failing out when we know we can. Some of the cases we need to handle better are listed below:

  • We are passed a filename of a file that doesn't exist
    • Add a quick check to see if the file exists before attempting to paste it
  • We try to -Ru a uuid that returns Not Found.
    • This doesn't need to be treated as an error at all; we just need to detect the case and then follow our successful exit path
  • We try to -Ru a uuid that doesn't exist in the local paste db
    • At the moment, this is a fatal error. In reality, it should throw a warning (maybe), but definitely should not be a fatal error. Luckily, all we need to do here is accept that a paste we pb_remove() does not need to be in the paste db; this should only be a couple lines of change.
  • The user ^Cs before we begin uploading to pb (e.g., during reading from stdin)
    • This can be handled by adding a simple internal flag that will be set to true once we run curl_easy_perform(). At anytime before that, SIGINT should trigger an error but should not leave an unclean environment
    • We might even be able to tie into the curl callback and only set the flag to true once we hit 100 percent on the upload. This gives the user a greater amount of time to change their mind without leaving an unclean environment.
  • We fail out for some reason but the swap db is empty
    • Contingency: something went wrong, but there probably isn't any data to lose
    • This should be pretty easy to handle, we just need to stat the swap db. If its size is 0, then we can delete it and move on.
  • We fail out for some reason but the swap db is identical to the main db
    • Contingency: something went wrong, but any data that could be lost already has been.
    • This is really unlikely to be implemented since the only simple ways I can think of to do this are really slow.

Dramatically clean up Option Validation

Though what we have “works,” it is about as ugly as code comes (despite having already been cleaned up a bit). We need to set up a simpler, cleaner (and preferably faster) way of validating the use of particular arguments together.

One way to do this would be to forego validation altogether and make multiple calls to getopt_long(). Doing so would solve a lot of these cleanliness issues. But it would bloat our option declaration code a bit along with bloating main() a bit as well since it is hard to move getopt() calls outside of main().

Another option is to continue on the course we are on now, but declare problems with option compatibility in the getopt_long() call itself. This would mean we would fail out faster, and we would trade-off the horribly-ugly validation function with a bit more validation in-line. This would also, likely, be dramatically faster in most cases.

Finally, we could just keep the validation function we have now but work out a way to simplify it so that we only need to check validation in a single call, we bloat nothing else in the code and we keep things simple.

I'm leaning towards the last option for now, but I have am still open to suggestions.

Web Gallery

Prerequisites:

Have an html/css/js web front end that has a gallery of pastes pulled from the json db.

Ideally, this will include the following:

  • A single .htm with embedded CSS and JS
  • A command-line option which launches $BROWSER pointing to the .htm

FILES section for pbpst(1)

From man-pages(7)

FILES A list of the files the program or function uses, such as configuration files, startup files, and files the program directly operates on.
Give the full pathname of these files, and use the installation process to modify the directory part to match user preferences. For many programs, the default installation location is in /usr/local, so your base manual page should use /usr/local as the base.

This would include $XDG_CONFIG_HOME/pbpst/db.json, amongst others.

Upload progress indicator

A progress indicator would be great, especially for larger uploads.

For bonus points, also add an ILoveCandy easter egg.

Be graceful on file-too-large

We have the maximum file size allowed hard-coded; we should either remove it and fail-out gracefully when pb tells us that the file was too big, or use the hard-coded value to check the filesize first.

Both options have merits: the former is more general and lets pb scale up supported file-size without our changing anything; the latter is faster.

Add an option to output all the supported lexers and styles

Since the available lexers might change with a different version of pygments, it would be handy to have an option that just outputs the list of lexers supported by the selected pb instance.

Technically, this has no prerequisites, but it would be odd to support it before lexers themselves are supported. So, consider #15 a soft pre-req.

-Ry fails when there is more than one paste to be removed

*** Error in `pbpst': realloc(): invalid pointer: 0x000003611f719b98 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x72055)[0x3611f3ed055]
/usr/lib/libc.so.6(+0x779a6)[0x3611f3f29a6]
/usr/lib/libc.so.6(realloc+0x1db)[0x3611f3f6d0b]
pbpst(+0x2295)[0x7e92541295]
/usr/lib/libcurl.so.4(+0x16e32)[0x3611f942e32]
/usr/lib/libcurl.so.4(+0x2d9b2)[0x3611f9599b2]
/usr/lib/libcurl.so.4(+0x372e2)[0x3611f9632e2]
/usr/lib/libcurl.so.4(curl_multi_perform+0x10d)[0x3611f96415d]
/usr/lib/libcurl.so.4(curl_easy_perform+0x13b)[0x3611f95abfb]
pbpst(+0x3964)[0x7e92542964]
pbpst(+0x3c94)[0x7e92542c94]
pbpst(+0x286c)[0x7e9254186c]
/usr/lib/libc.so.6(__libc_start_main+0xf0)[0x3611f39b610]
pbpst(+0x2059)[0x7e92541059]
======= Memory map: ========
7e9253f000-7e92546000 r-xp 00000000 fe:00 3149422                        /usr/bin/pbpst
7e92746000-7e92747000 r--p 00007000 fe:00 3149422                        /usr/bin/pbpst
7e92747000-7e92748000 rw-p 00008000 fe:00 3149422                        /usr/bin/pbpst
7e92748000-7e959dd000 ---p 00000000 00:00 0
7e959dd000-7e95b33000 rw-p 00000000 00:00 0                              [heap]
36118000000-36118021000 rw-p 00000000 00:00 0
36118021000-3611c000000 ---p 00000000 00:00 0
3611c36d000-3611c383000 r-xp 00000000 fe:00 3149269                      /usr/lib/libgcc_s.so.1
3611c383000-3611c582000 ---p 00016000 fe:00 3149269                      /usr/lib/libgcc_s.so.1
3611c582000-3611c583000 rw-p 00015000 fe:00 3149269                      /usr/lib/libgcc_s.so.1
3611c583000-3611c588000 r-xp 00000000 fe:00 3149111                      /usr/lib/libnss_dns-2.22.so
3611c588000-3611c787000 ---p 00005000 fe:00 3149111                      /usr/lib/libnss_dns-2.22.so
3611c787000-3611c788000 r--p 00004000 fe:00 3149111                      /usr/lib/libnss_dns-2.22.so
3611c788000-3611c789000 rw-p 00005000 fe:00 3149111                      /usr/lib/libnss_dns-2.22.so
3611c789000-3611c794000 r-xp 00000000 fe:00 3149112                      /usr/lib/libnss_files-2.22.so
3611c794000-3611c993000 ---p 0000b000 fe:00 3149112                      /usr/lib/libnss_files-2.22.so
3611c993000-3611c994000 r--p 0000a000 fe:00 3149112                      /usr/lib/libnss_files-2.22.so
3611c994000-3611c995000 rw-p 0000b000 fe:00 3149112                      /usr/lib/libnss_files-2.22.so
3611c995000-3611c99b000 rw-p 00000000 00:00 0
3611c99b000-3611c99c000 ---p 00000000 00:00 0
3611c99c000-3611d19c000 rw-p 00000000 00:00 0
3611d262000-3611d276000 r-xp 00000000 fe:00 3149119                      /usr/lib/libresolv-2.22.so
3611d276000-3611d475000 ---p 00014000 fe:00 3149119                      /usr/lib/libresolv-2.22.so
3611d475000-3611d476000 r--p 00013000 fe:00 3149119                      /usr/lib/libresolv-2.22.so
3611d476000-3611d477000 rw-p 00014000 fe:00 3149119                      /usr/lib/libresolv-2.22.so
3611d477000-3611d479000 rw-p 00000000 00:00 0
3611d479000-3611d47c000 r-xp 00000000 fe:00 3156267                      /usr/lib/libkeyutils.so.1.5
3611d47c000-3611d67b000 ---p 00003000 fe:00 3156267                      /usr/lib/libkeyutils.so.1.5
3611d67b000-3611d67c000 r--p 00002000 fe:00 3156267                      /usr/lib/libkeyutils.so.1.5
3611d67c000-3611d67d000 rw-p 00003000 fe:00 3156267                      /usr/lib/libkeyutils.so.1.5
3611d67d000-3611d689000 r-xp 00000000 fe:00 3156303                      /usr/lib/libkrb5support.so.0.1
3611d689000-3611d888000 ---p 0000c000 fe:00 3156303                      /usr/lib/libkrb5support.so.0.1
3611d888000-3611d889000 r--p 0000b000 fe:00 3156303                      /usr/lib/libkrb5support.so.0.1
3611d889000-3611d88a000 rw-p 0000c000 fe:00 3156303                      /usr/lib/libkrb5support.so.0.1
3611d88a000-3611d88d000 r-xp 00000000 fe:00 3149116                      /usr/lib/libdl-2.22.so
3611d88d000-3611da8c000 ---p 00003000 fe:00 3149116                      /usr/lib/libdl-2.22.so
3611da8c000-3611da8d000 r--p 00002000 fe:00 3149116                      /usr/lib/libdl-2.22.so
3611da8d000-3611da8e000 rw-p 00003000 fe:00 3149116                      /usr/lib/libdl-2.22.so
3611da8e000-3611daa6000 r-xp 00000000 fe:00 3149029                      /usr/lib/libpthread-2.22.so
3611daa6000-3611dca5000 ---p 00018000 fe:00 3149029                      /usr/lib/libpthread-2.22.so
3611dca5000-3611dca6000 r--p 00017000 fe:00 3149029                      /usr/lib/libpthread-2.22.so
3611dca6000-3611dca7000 rw-p 00018000 fe:00 3149029                      /usr/lib/libpthread-2.22.so
3611dca7000-3611dcab000 rw-p 00000000 00:00 0
3611dcab000-3611dcc0000 r-xp 00000000 fe:00 3152096                      /usr/lib/libz.so.1.2.8
3611dcc0000-3611debf000 ---p 00015000 fe:00 3152096                      /usr/lib/libz.so.1.2.8
3611debf000-3611dec0000 r--p 00014000 fe:00 3152096                      /usr/lib/libz.so.1.2.8
3611dec0000-3611dec1000 rw-p 00015000 fe:00 3152096                      /usr/lib/libz.so.1.2.8
3611dec1000-3611dec4000 r-xp 00000000 fe:00 3153558                      /usr/lib/libcom_err.so.2.1
3611dec4000-3611e0c3000 ---p 00003000 fe:00 3153558                      /usr/lib/libcom_err.so.2.1
3611e0c3000-3611e0c4000 r--p 00002000 fe:00 3153558                      /usr/lib/libcom_err.so.2.1
3611e0c4000-3611e0c5000 rw-p 00003000 fe:00 3153558                      /usr/lib/libcom_err.so.2.1
3611e0c5000-3611e0f3000 r-xp 00000000 fe:00 3156305                      /usr/lib/libk5crypto.so.3.1
3611e0f3000-3611e2f2000 ---p 0002e000 fe:00 3156305                      /usr/lib/libk5crypto.so.3.1
3611e2f2000-3611e2f4000 r--p 0002d000 fe:00 3156305                      /usr/lib/libk5crypto.so.3.1
3611e2f4000-3611e2f5000 rw-p 0002f000 fe:00 3156305                      /usr/lib/libk5crypto.so.3.1
3611e2f5000-3611e2f6000 rw-p 00000000 00:00 0
3611e2f6000-3611e3cb000 r-xp 00000000 fe:00 3156306                      /usr/lib/libkrb5.so.3.3
3611e3cb000-3611e5cb000 ---p 000d5000 fe:00 3156306                      /usr/lib/libkrb5.so.3.3
3611e5cb000-3611e5d8000 r--p 000d5000 fe:00 3156306                      /usr/lib/libkrb5.so.3.3
3611e5d8000-3611e5db000 rw-p 000e2000 fe:00 3156306                      /usr/lib/libkrb5.so.3.3
3611e5db000-3611e625000 r-xp 00000000 fe:00 3156307                      /usr/lib/libgssapi_krb5.so.2.2
3611e625000-3611e824000 ---p 0004a000 fe:00 3156307                      /usr/lib/libgssapi_krb5.so.2.2
3611e824000-3611e826000 r--p 00049000 fe:00 3156307                      /usr/lib/libgssapi_krb5.so.2.2
3611e826000-3611e828000 rw-p 0004b000 fe:00 3156307                      /usr/lib/libgssapi_krb5.so.2.2
3611e828000-3611ea76000 r-xp 00000000 fe:00 3180708                      /usr/lib/libcrypto.so.1.0.0
3611ea76000-3611ec75000 ---p 0024e000 fe:00 3180708                      /usr/lib/libcrypto.so.1.0.0
3611ec75000-3611ec91000 r--p 0024d000 fe:00 3180708                      /usr/lib/libcrypto.so.1.0.0
3611ec91000-3611ec9d000 rw-p 00269000 fe:00 3180708                      /usr/lib/libcrypto.so.1.0.0
3611ec9d000-3611eca0000 rw-p 00000000 00:00 0
3611eca0000-3611ed10000 r-xp 00000000 fe:00 3180707                      /usr/lib/libssl.so.1.0.0
3611ed10000-3611ef0f000 ---p 00070000 fe:00 3180707                      /usr/lib/libssl.so.1.0.0
3611ef0f000-3611ef14000 r--p 0006f000 fe:00 3180707                      /usr/lib/libssl.so.1.0.0
3611ef14000-3611ef1b000 rw-p 00074000 fe:00 3180707                      /usr/lib/libssl.so.1.0.0
3611ef1b000-3611ef45000 r-xp 00000000 fe:00 3184865                      /usr/lib/libssh2.so.1.0.1
3611ef45000-3611f145000 ---p 0002a000 fe:00 3184865                      /usr/lib/libssh2.so.1.0.1
3611f145000-3611f146000 r--p 0002a000 fe:00 3184865                      /usr/lib/libssh2.so.1.0.1
3611f146000-3611f147000 rw-p 0002b000 fe:00 3184865                      /usr/lib/libssh2.so.1.0.1
3611f147000-3611f179000 r-xp 00000000 fe:00 3178391                      /usr/lib/libidn.so.11.6.15
3611f179000-3611f379000 ---p 00032000 fe:00 3178391                      /usr/lib/libidn.so.11.6.15
3611f379000-3611f37a000 r--p 00032000 fe:00 3178391                      /usr/lib/libidn.so.11.6.15
3611f37a000-3611f37b000 rw-p 00033000 fe:00 3178391                      /usr/lib/libidn.so.11.6.15
3611f37b000-3611f516000 r-xp 00000000 fe:00 3149066                      /usr/lib/libc-2.22.so
3611f516000-3611f715000 ---p 0019b000 fe:00 3149066                      /usr/lib/libc-2.22.so
3611f715000-3611f719000 r--p 0019a000 fe:00 3149066                      /usr/lib/libc-2.22.so
3611f719000-3611f71b000 rw-p 0019e000 fe:00 3149066                      /usr/lib/libc-2.22.so
3611f71b000-3611f71f000 rw-p 00000000 00:00 0
3611f71f000-3611f72b000 r-xp 00000000 fe:00 3177161                      /usr/lib/libjansson.so.4.7.0
3611f72b000-3611f92a000 ---p 0000c000 fe:00 3177161                      /usr/lib/libjansson.so.4.7.0
3611f92a000-3611f92b000 r--p 0000b000 fe:00 3177161                      /usr/lib/libjansson.so.4.7.0
3611f92b000-3611f92c000 rw-p 0000c000 fe:00 3177161                      /usr/lib/libjansson.so.4.7.0
3611f92c000-3611f99c000 r-xp 00000000 fe:00 3185726                      /usr/lib/libcurl.so.4.4.0
3611f99c000-3611fb9c000 ---p 00070000 fe:00 3185726                      /usr/lib/libcurl.so.4.4.0
3611fb9c000-3611fb9e000 r--p 00070000 fe:00 3185726                      /usr/lib/libcurl.so.4.4.0
3611fb9e000-3611fb9f000 rw-p 00072000 fe:00 3185726                      /usr/lib/libcurl.so.4.4.0
3611fb9f000-3611fba0000 rw-p 00000000 00:00 0
3611fba0000-3611fbc2000 r-xp 00000000 fe:00 3149065                      /usr/lib/ld-2.22.so
3611fd8a000-3611fd94000 rw-p 00000000 00:00 0
3611fdbc000-3611fdbd000 rw-p 00000000 00:00 0
3611fdbd000-3611fdbf000 r--p 00000000 00:00 0                            [vvar]
3611fdbf000-3611fdc1000 r-xp 00000000 00:00 0                            [vdso]
3611fdc1000-3611fdc2000 r--p 00021000 fe:00 3149065                      /usr/lib/ld-2.22.so
3611fdc2000-3611fdc3000 rw-p 00022000 fe:00 3149065                      /usr/lib/ld-2.22.so
3611fdc3000-3611fdc4000 rw-p 00000000 00:00 0
3be74af5000-3be74b17000 rw-p 00000000 00:00 0                            [stack]
ffffffffff600000-ffffffffff601000 r--p 00000000 00:00 0                  [vsyscall]
zsh: abort (core dumped)  pbpst -Ry

I think this is happening because of the realloc() call at callback.c:44. However, I am not wholly sure.

Improve clarity on SIGINT

When pbpst recieves SIGINT, it doesn't remove the swap db. Currently pbpst only says this:

^Cpbpst: Received Interrupt

Perhaps we could expand on the message, so that "Could not create swap db" does not come unexpected.

Database Interaction Options

Prerequisites:

Required functionality:

  • Add -m | --message support
  • Do nothing but initialize the database (will not overwrite a db): -i
  • Delete local paste data by UUID: -d
  • Query pastes locally matching any field in the paste: -q

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.