Commit Graph

73 Commits

Author SHA1 Message Date
Andreas Jaeger a0a0be8d0e Retire repo
This repo was created by accident, use deb-python-oslo.privsep
instead.

Needed-By: I1ac1a06931c8b6dd7c2e73620a0302c29e605f03
Change-Id: I81894aea69b9d09b0977039623c26781093a397a
2017-04-17 19:38:50 +02:00
Bogdan Teleaga 4982b93c4e Fixes unit tests on Windows.
An exception is being thrown when tests are skipped if
the class name starts with Test causing the suite to
fail. Changing the  name to .*Test fixes the problem.

Closes-Bug: #1609782
Change-Id: I8ef761a53737d82f1cf6288a655d014c98407e1c
2016-08-08 13:48:07 +02:00
OpenStack Proposal Bot 108b2016a9 Updated from global requirements
Change-Id: I6c2663aa86430efa6dba6eb6ad6a6254cf597e10
2016-07-29 02:33:59 +00:00
Jenkins 8cc44771d5 Merge "Drop python3.3 support in classifier" 2016-07-12 09:50:04 +00:00
OpenStack Proposal Bot e46eebfebe Updated from global requirements
Change-Id: I8732b615f3947d5c0ae8160478964ceece73385c
2016-07-09 19:26:00 +00:00
OpenStack Proposal Bot b5e1c13884 Updated from global requirements
Change-Id: Iac37d82a5bbfcf289ca13bf957b513f938c4e8e7
2016-06-30 18:48:32 +00:00
OpenStack Proposal Bot 021c9116b0 Updated from global requirements
Change-Id: I47cd9c82c5cedc5b0597e70fb855faea5309f283
2016-06-21 18:04:32 +00:00
Angus Lees 9bf606327d Provide way to "initialise" oslo.privsep
Specifically, the goal here is to provide a default that can use
rootwrap.

This change implements a `priv_context.init` function that allows
oslo.privsep to hook into the startup of programs using oslo.privsep.
The intention is to call this function near the top of main() - after
oslo.config is available but before anything "interesting" is performed.

In this change, this init function just allows you to set the default
"run as root" prefix for helper_command to include something like
rootwrap.

In the future, it is expected to use this same call point to do other
"early" tasks like immediately forking privileged helpers and dropping
root if already running as root.

Change-Id: I3ea73e16b07a870629e7d69e897f2524d7068ae8
Partial-Bug: #1592043
2016-06-16 15:17:00 +10:00
Jenkins 8e981daaf3 Merge "Imported Translations from Zanata" 2016-06-14 18:01:22 +00:00
Jenkins 324f78bb7b Merge "PrivContext: Sets client_mode to False on Windows" 2016-06-14 11:41:08 +00:00
Claudiu Belu ecabeaff2f PrivContext: Sets client_mode to False on Windows
oslo.privsep is not currently supported on Windows,
as it uses Linux-specific functionality (os.fork,
socker.AF_UNIX).

The client_mode should be set to False on Windows.

Change-Id: I545caa5528e629da477615f7e14d10602ad96abd
Closes-Bug: #1591122
2016-06-13 13:18:50 -07:00
OpenStack Proposal Bot 595b75993b Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: Ifb9f2485cd8f8382a5b2fbfc3b5353c2108fa9f2
2016-06-11 06:52:08 +00:00
OpenStack Proposal Bot 6bcde24765 Updated from global requirements
Change-Id: Ib8ad8485602c2cf46c9dfce64191c7647bd56f6b
2016-06-03 18:18:08 +00:00
ChangBo Guo(gcb) 9510ac0bed Drop python3.3 support in classifier
We don't run python 3.3 CI jobs anymore,
so just drop it from classifier.

Change-Id: I04e204ec8e0a486ead6d57ce408b8d3e57860eca
2016-05-25 15:13:31 +08:00
Jenkins be46f78fc3 Merge "Remove unused py27 socketpair/makefile workaround" 2016-04-22 01:37:53 +00:00
OpenStack Proposal Bot 05ba634988 Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I48ef9148710ebaf64acf683352109e261a7743d2
2016-04-21 06:27:20 +00:00
Angus Lees 79ab8a755c Remove unused py27 socketpair/makefile workaround
Python2.7 has a bug that means the sockets returned from socketpair()
are not wrapped in the usual socket.socket class, and contain a broken
makefile() method.

This was important a long time ago when privsep used file
operations (and sock.makefile()) for communication.  Privsep now uses
socket operations directly, and never calls makefile() on the
communication socket.

Further, the workaround breaks on py34 where the socket classes are
completely different (and don't have the original issue).  Well past
time for the workaround to be removed and forgotten.

Change-Id: Id6395b8497b9f5449893e17d07fc4b664ee041ce
2016-04-21 16:25:10 +10:00
Joshua Harlow 54e2d2f7f5 Remove direct dependency on babel
The dependency on oslo.i18n already forces this requirement.

Change-Id: I8c17d04110c23b30d569baf7c40ce0ee7d1046b0
2016-04-18 14:16:00 -07:00
OpenStack Proposal Bot 0e5d1c922b Updated from global requirements
Change-Id: I9cd5384ef594651f2eac3a68b1eee931f744337d
2016-04-13 12:47:36 +00:00
OpenStack Proposal Bot 559e035a4e Updated from global requirements
Change-Id: Ibe0546138c9374c5a95db58486b9a9b3ab2b849b
2016-04-08 00:32:15 +00:00
OpenStack Proposal Bot 8b2563fdf0 Updated from global requirements
Change-Id: Ibb670a4e75ccce58f03971f2e7a963736c191c2b
2016-04-07 17:13:21 +00:00
Angus Lees 030f36f556 Switch to msgpack for serialization
This change switches from JSON to msgpack for encoding messages on the
privileged channel.  The binary encoding is faster(*) and msgpack's
primitives are a better fit for Python's.  In particular, bytes and
non-string dict keys are supported without an additional layer of
encoding.

Note that lists are now converted to tuples across
serialization/deserialization, and this is the opposite of the previous
behaviour.  There is no point modifying arguments to privsep
entrypoints, and this makes the values hashable (if desired) without an
additional conversion step.

(*) Since you asked: For a trivial arg/return value, this version is
about 1.5x faster than the previous json version - and many times faster
for non-trivial cases.  Please focus on the "better fit for python's
datatypes" aspect however.

Change-Id: I4299c2fc059807610f83e12a2d470e020930c64c
2016-03-22 15:16:23 +11:00
OpenStack Proposal Bot bd0baf506c Updated from global requirements
Change-Id: Ia731a3f36c25a715d6eec79ceeb557512ba6ef0a
2016-02-26 01:52:32 +00:00
Jenkins b531d4807a Merge "fdopen: Use better "is using eventlet" test" 2016-02-22 08:16:48 +00:00
OpenStack Proposal Bot b6f64b1971 Updated from global requirements
Change-Id: I57f2b7ff133721e6167ccc872db518c7c614338d
2016-02-20 21:59:40 +00:00
OpenStack Proposal Bot 693213039f Updated from global requirements
Change-Id: I84ccc7390d0fc72dea41a422a877e22824710296
2016-02-19 18:55:41 +00:00
Angus Lees b9a9d412d7 fdopen: Use better "is using eventlet" test
The earlier[*] fdopen/GreenPipe workaround is ineffective in nova, since
it uses the wrong guard predicate. Nova doesn't monkey_patch `os`, so
this change switches to checking against `socket` module instead.
Neither of these is strictly "correct" for our os.pipe/fdopen case, but
we just want to get some indication of "is eventlet being used".

[*] fdopen change: I4a6c0d4247aca17536316fb0ab163241ad545b20

Change-Id: I2bba4c45a66f49d5014f218a0ce24f221c9196bd
2016-02-19 09:33:20 +11:00
Jenkins eb9ed356a3 Merge "Ensure fdopen uses greenio object under eventlet" 2016-02-18 10:39:57 +00:00
Angus Lees 4fba8f505b Ensure fdopen uses greenio object under eventlet
The _fd_logger function works around a regular Unix pipe, with a python
file object wrapped around both pipe file descriptors.  This would be
stupidly simple and obvious, except eventlet.

We need to use the fdopen from io.open(), and not os.fdopen() (on py2;
on py3 they're the same), because the older python file objects have
broken behaviour regarding blocking reads.  Eventlet doesn't monkey
patch os.pipe, nor anything in io.* - so none of the existing eventlet
monkey_patching will "just work" for our case.

This change adds a custom `fdopen` function that explicitly uses
greenio.GreenPipe or io.open as appropriate - and uses this to always
return an eventlet-safe file object.

Change-Id: I4a6c0d4247aca17536316fb0ab163241ad545b20
2016-02-18 09:57:33 +11:00
Jenkins 73ec44f2d9 Merge "UnprivilegedPrivsepFixture: Clear capabilities config" 2016-02-12 01:51:15 +00:00
Angus Lees 539ff4e4e0 UnprivilegedPrivsepFixture: Clear capabilities config
When a context's 'capabilities' property was a non-empty list,
Daemon.run() would try to manipulate Linux capabilities, and fail if the
original user didn't already have (at least) these capabilities.  This
is appropriate for the regular use case, but the intention of
UnprivilegedPrivsepFixture is that it would be a no-op that works for
zero-privilege test environments.

This change clears the capabilities list (setting/expecting zero
privileges) in UnprivilegedPrivsepFixture, as was originally intended.

Change-Id: I8a0d8275877a1f9e139127049b7e234003f901ea
2016-02-10 14:59:40 +11:00
Walter A. Boring IV ce5b7c74cb Change name of privsep_helper to match code
This patch updates the setup.cfg to be consistent with the
daemon's usage of the name 'privsep-helper', instead of the
setup.cfg's name of 'privesep_helper'

Closes-Bug: #1543664

Change-Id: I02a6b9bf70fb1f75c75f2dad052b3d0ad9e96967
2016-02-09 19:08:16 +00:00
Angus Lees a6e554bd49 Ignore --config-dir when value is None
Previous code incorrectly used an explicit --config-dir=None on the
privsep-helper command line when cfg.CONF.config_dir was None (the
default).  This change correctly skips the --config-dir flag entirely in
this situation.

Change-Id: I8d71b1e0c5ab702a39c3e56119611700a126a5d4
2016-02-08 18:05:52 +11:00
Eric Brown ca917939bc Add version and download badges to README
All the other oslo libraries contain such badges, so might as
well add to oslo.privsep too.

Change-Id: I3f882133c7f7fdf5fcaed988ae5b1271a3aa1d34
2016-02-03 14:47:10 -08:00
Andreas Jaeger 39f1802ad7 Update translation setup
Follow new infra setup for translations, see spec
http://specs.openstack.org/openstack-infra/infra-specs/specs/translation_setup.html
for full details.

This basically renames
oslo.privsep/locale/oslo.privsep.pot to
oslo_privsep/locale/oslo_privsep.pot. For this we need to update
setup.cfg.

Update also domain name in i18n.py.

Change-Id: I72f8be0c6562741a2f7fb4d8171ec468e20716c5
2016-01-29 11:50:10 +01:00
OpenStack Proposal Bot c97dd6d432 Updated from global requirements
Change-Id: Ic70dbecf1c90dbda471cd724731b2ccad3b86914
2016-01-26 23:28:02 +00:00
OpenStack Proposal Bot 874fd1aed3 Updated from global requirements
Change-Id: I0b43df64aca9fefbafc6d7c8da7f19560ff931cb
2016-01-23 10:34:56 +00:00
OpenStack Proposal Bot 8874899999 Updated from global requirements
Change-Id: I3637d444f7b41730ac880763834a7a0117aaedd2
2016-01-18 22:45:05 +00:00
Jenkins 545744b9f8 Merge "Imported Translations from Zanata" 2016-01-18 00:33:44 +00:00
OpenStack Proposal Bot 28b4f4cc37 Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: Ib9999bdfdf77a6c3da6b8e9c4a534f2c4e452e88
2016-01-17 06:08:06 +00:00
OpenStack Proposal Bot 6a0a42de36 Updated from global requirements
Change-Id: I57d45c101c8ba8b2975c3df5c25a541d7827cc06
2016-01-17 01:14:54 +00:00
Joshua Harlow f03da04eee Update/make better the README.rst long description
Change-Id: Ic562d008e61156cde0ead024b899b13a70b7278e
2016-01-15 15:59:30 -08:00
Jenkins 0bd8325f2b Merge "Use logging intead of oslo_log" 2016-01-14 15:36:35 +00:00
Angus Lees 525a028012 Improve `helper_command' config default
This option needs to capture the current oslo_config in some way, so it
can be reconstructed in the new privileged process (when using the
'sudo/rootwrap' method).  The previous version had a "$project"
placeholder default that didn't work in real usage (as expected).  This
new version generates a default value at run-time based on the values of
cfg.CONF.{config_file,config_dir}.

If the deployer has provided an explicit value for `helper_command' then
the new cfg.CONF logic is also ignored.

Note secure deployments will capture this command line in sudoers or
rootwrap filters, and it is up to sudo/rootwrap to verify that whatever
we generate here is secure and reasonable.

Note also that this and the surrounding code is ignored when using the
'fork' method.

Change-Id: I0d31bf24cac6c26f10b5d1eebaa8f475402f73d2
2016-01-12 15:31:53 +11:00
OpenStack Proposal Bot 4962e83a31 Updated from global requirements
Change-Id: I40607b5bca9f43ccd34760a70c2ec216865cd984
2016-01-07 06:56:30 +00:00
Jenkins 3c6f77ff3a Merge "Replace deprecated LOG.warn with LOG.warning" 2016-01-06 14:56:31 +00:00
Swapnil Kulkarni (coolsvap) 928a14934a Replace deprecated LOG.warn with LOG.warning
LOG.warn is deprecated. It still used in a few places.
Updated to non-deprecated LOG.warning.

Change-Id: Ifa7e39d513c4f51a50b7516daa57f60141bbebb2
Closes-Bug:#1508442
2016-01-05 09:21:56 +00:00
OpenStack Proposal Bot f7af9e76fc Updated from global requirements
Change-Id: If3aa807d69defa1e76ec33d6ce4e615492eee657
2016-01-04 20:14:44 +00:00
Jenkins 3b0330ee25 Merge "Remove unused file openstack-common.conf" 2016-01-04 14:47:26 +00:00
Zhihai Song 6c1a6f58b6 Use logging intead of oslo_log
We should make dependency of a oslo lib on other oslo libs as
little as possible.

Change-Id: I4ccb3d416842b06b6bd93d588f75b85fdf48204d
2016-01-04 16:05:43 +08:00