diff options
author | Paul Barker <pbarker@konsulko.com> | 2021-02-05 11:26:07 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-02-10 23:48:16 +0000 |
commit | 3b559bb16df9c178401be49c9cb8130b7d7568fd (patch) | |
tree | fe989962d371476edbb7702ec83234b8b9d8bfe3 /bitbake/bin | |
parent | f5188da2f12bee03e087c20d90720250e65e2922 (diff) | |
download | poky-3b559bb16df9c178401be49c9cb8130b7d7568fd.tar.gz |
bitbake: hashserv: Support read-only server
The -r/--readonly argument is added to the bitbake-hashserv app. If this
argument is given then clients may only perform read operations against
the server. The read-only mode is implemented by simply not installing
handlers for write operations, this keeps the permission model simple
and reduces the risk of accidentally allowing write operations.
As a sqlite database can be safely opened by multiple processes in
parallel, it's possible to start two hashserv instances against a single
database if you wish to export both a read-only port and a read-write
port.
(Bitbake rev: 492bb02eb0e071c792407ac3113f92492da1a9cc)
Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake-hashserv | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake-hashserv b/bitbake/bin/bitbake-hashserv index 1bc1f91f38..2669bbd130 100755 --- a/bitbake/bin/bitbake-hashserv +++ b/bitbake/bin/bitbake-hashserv | |||
@@ -33,6 +33,7 @@ def main(): | |||
33 | parser.add_argument('--bind', default=DEFAULT_BIND, help='Bind address (default "%(default)s")') | 33 | parser.add_argument('--bind', default=DEFAULT_BIND, help='Bind address (default "%(default)s")') |
34 | parser.add_argument('--database', default='./hashserv.db', help='Database file (default "%(default)s")') | 34 | parser.add_argument('--database', default='./hashserv.db', help='Database file (default "%(default)s")') |
35 | parser.add_argument('--log', default='WARNING', help='Set logging level') | 35 | parser.add_argument('--log', default='WARNING', help='Set logging level') |
36 | parser.add_argument('-r', '--read-only', action='store_true', help='Disallow write operations from clients') | ||
36 | 37 | ||
37 | args = parser.parse_args() | 38 | args = parser.parse_args() |
38 | 39 | ||
@@ -47,7 +48,7 @@ def main(): | |||
47 | console.setLevel(level) | 48 | console.setLevel(level) |
48 | logger.addHandler(console) | 49 | logger.addHandler(console) |
49 | 50 | ||
50 | server = hashserv.create_server(args.bind, args.database) | 51 | server = hashserv.create_server(args.bind, args.database, read_only=args.read_only) |
51 | server.serve_forever() | 52 | server.serve_forever() |
52 | return 0 | 53 | return 0 |
53 | 54 | ||