1
0
mirror of https://github.com/openSUSE/osc.git synced 2026-01-30 09:28:59 +01:00
Commit Graph

3186 Commits

Author SHA1 Message Date
Tomáš Čech
13df397b07 remove osc_hotshot.py
osc_hotshot.py is long time untouched and broken thus I assume it is
safe to be removed

fixes issue #400
2018-10-16 20:57:28 +02:00
lethliel
2b778f555d fix getbinaries with DOD binaries
getbinaries of dod binaries do not have a size or mtime.
This will break. So just set to None and print unkown instead.
2018-10-16 20:54:53 +02:00
lethliel
e7f979d4ea change output when creating binaries directory
was:
Creating binaries

is now:
Creating directory "binaries"
2018-10-16 20:53:41 +02:00
Marco Strigl
0c93ce26a3 Merge pull request #442 from z3ntu/py3.7
Fix Python 3.7 support
2018-10-10 20:54:27 +02:00
Luca Weiss
fa58c8a260 Fix Python 3.7 support
See PEP 479
2018-10-09 17:02:23 +02:00
lethliel
70279c60d8 fix creation of cpio archives
Problem was that the length of the cpio archive was calculated wrong,
because the content was not binary
2018-09-26 14:45:29 +02:00
lethliel
16bcfd65a9 fix crash on empty input list / meta files 2018-08-28 15:31:06 +02:00
Marco Strigl
50256bb860 fix for issue #433
This fixes https://github.com/openSUSE/osc/issues/433
and syncs oscssl.py with master
2018-07-23 14:03:23 +02:00
lethliel
1e15ff66e3 Merge branch 'python3' of github.com:openSUSE/osc into python3 2018-07-12 08:55:51 +02:00
Marcus Huewe
ca942c46aa Disable ssl session resumption
The old code could potentially yield to a use-after-free situation,
which results in UB. For this, consider the following scenario, where
osc performs several HTTPS requests (assumption: the server supports
ssl session resumption):

- HTTPS Request 1:
  * a new SSL *s connection is established, which also creates a new
    SSL_SESSION *ss => ss->references == 1
  * once the handshake is done, the ss is put into the session cache
    (see ssl_update_cache) => ss->references == 2
  - osc saves the session ss in a class variable
  - s is SSL_free()d, which calls SSL_SESSION_free => ss->references == 1

- HTTPS Request 2:
  * setup a new SSL *s connection that reuses the saved session ss
    => ss->references == 2
  * once the handshake is done, ssl_update_cache is called, which is a
    NOP, because s->hit == 1 (that is, the session was resumed)
  * osc saves the session ss in a class variable
  * s is SSL_free()d, which calls SSL_SESSION_free => ss->references == 1

...

> 2 hours later (see tls1_default_timeout)

...

- HTTPS Request 256:
  * setup a new SSL *s connection that reuses the saved session ss
    => ss->references == 2
  * once the handshake is done, ssl_update_cache is called, but is
    _no_ NOP anymore
  * ssl_update_cache flushes the session cache (this is done every
    255/256 (depending on the way we count) connections) => ss is
    SSL_SESSION_free()d => ss->references == 1
  * osc saves the session ss in a class variable
  * s is SSL_free()d, which calls SSL_SESSION_free:
    since ss->references == 1, ss is eventually free()d

- HTTPS Request 257:
  * setup a new SSL *s connection that reuses the saved session ss

Since ss does not exist anymore, the remaining program execution is UB.

(Note: SSL_free(...) is _NOT_ called, if M2Crypto 0.29 is used.
M2Crypto 0.30 calls SSL_free(...) again.)

Due to a bug in OpenSSL_1_1_0h (see openssl commit 8e405776858) the
scenario from above can be triggered with exactly 2 HTTPS requests (the
SSL_SESSION is not cached, because we configured SSL_VERIFY_PEER, but
no sid_ctx was set). This is fixed in openssl commit c4fa1f7fc01.

In order to reliably reuse a session, we probably need to listen to the
session cache changes. Such callbacks could be registered via
SSL_CTX_sess_set_new_cb and/or SSL_CTX_sess_set_remove_cb, but both
functions are not provided by M2Crypto. Another idea is to directly utilize
the session cache, but this also has to be implemented in M2Crypto first.
Yet another approach is to retrieve the session via SSL_get1_session, which
increases the session's refcnt, but this also needs to be implemented in
M2Crypto first (if we choose to use this approach, we also have to make
sure that we eventually free the session manually...).

Fixes: #398 ("SIGSEGV on \"osc commit\"")
2018-07-12 08:55:16 +02:00
Marco Strigl
89a79fe761 Merge pull request #422 from mcepl/setuptools
LGTM
2018-07-04 15:28:26 +02:00
lethliel
6d0b20782e fix slice error (division now returns float) when working with long packagelists. 2018-06-07 14:02:37 +02:00
lethliel
d8751be732 decode diff in osc rq show -d before printing it 2018-06-05 14:48:41 +02:00
72953c772d Add osc*.egg-info to .gitignore 2018-05-25 16:45:48 +02:00
351a86a0b2 Attempt for setuptools 2018-05-25 16:43:15 +02:00
lethliel
a455fd8e39 remove debug print 2018-04-27 14:03:01 +02:00
lethliel
a6627de8d3 fixed osc less <path> 2018-04-26 15:49:09 +02:00
Marco Strigl
e309a073d3 Merge pull request #407 from z3ntu/python3
python3: Fix osc add
2018-04-23 16:21:47 +02:00
lethliel
89a181264c fixed osc branch with different srcprj or srcpkg 2018-04-23 12:40:57 +02:00
Luca Weiss
f8e0e2a7e0 Fix osc add
hashlib wants bytes, ET.tostring produces a string and not bytes
2018-04-20 08:34:39 +02:00
lethliel
a30ac8f29c prevent progressbar to get double printed 2018-04-16 16:19:53 +02:00
lethliel
b38af807fc fix osc log (request is shown as bytes string)
b'rqxxxxxx' -> rqxxxxxx
2018-04-16 13:47:20 +02:00
lethliel
8a48813d8d fixed IncompleteRead(0) error on long builds.
sstatus object is introduced, which holds the state
of the stream. If an incompleteRead is thrown the stream
is restarted as long as retry_count is not reached (3)
2018-04-16 13:36:59 +02:00
lethliel
4ee2e34d5f fix commit with editors != vim 2018-04-09 12:26:11 +02:00
lethliel
03da251ee5 rename all paths for man pages 2018-04-04 15:15:09 +02:00
lethliel
577837e256 rename man page to osc-py3.1 2018-04-04 15:12:56 +02:00
lethliel
038344f0ab install parallel 2018-04-03 10:20:43 +02:00
lethliel
6e146a6643 added osc-py3-wrapper.py for parallel installation with osc 2018-04-03 10:13:42 +02:00
lethliel
3760a07b50 fixed osc ls with _link file 2018-03-26 15:06:02 +02:00
lethliel
e07332ac7f fix osc lb -s and osc lbl -s 2018-03-26 14:42:23 +02:00
lethliel
73fa448528 fixed osc bl -s 2018-03-26 13:41:50 +02:00
lethliel
ba93c3fbc6 better fix for r.readinto bug 2018-03-26 13:36:50 +02:00
lethliel
8203e3eb8e Merge branch 'python3' of github.com:openSUSE/osc into python3 2018-03-26 11:52:18 +02:00
lethliel
3e22705fda workaround bug in http/client.py that breaks if
the given buffer is 0.
2018-03-26 11:51:06 +02:00
Marco Strigl
d0a966b7e3 fix oscerr.py OutdatedWorkingCopy to use self.args
instead of self
2018-03-22 16:07:48 +01:00
lethliel
d438091ea2 fix osc diff -r1:2. Decode diff on output
remove debug print statement
2018-03-22 12:48:10 +01:00
lethliel
8f12e5b3ef add decode_list helper function to decode a list
with unknown elems. If a elem is not of type str
it gets decoded (we assume it is bytes then)
2018-03-21 15:09:03 +01:00
lethliel
3deb147555 fix build of osc package. open the gzip file in text mode 2018-03-19 13:13:16 +01:00
lethliel
d07d6b9b22 fix osc sr using message from changes file 2018-03-13 15:42:00 +01:00
lethliel
03097bdded delete commented sslcertck=False setting 2018-03-12 16:31:09 +01:00
Marcus Huewe
8566d64ffd Fix and simplify util.safewriter.SafeWriter
Storing the error encoding in an "encoding" attribute "breaks" the
python3 "input" function: In essence, builtin_input_impl does a
getattr(sys.stdout, 'encoding'), which returns our error encoding
instead of the "real" stdout encoding. In order to avoid this, we
store the error encoding in an "_encoding" attribute.

Making SafeWriter a new-style class simplifies the code a lot.
2018-03-12 16:22:16 +01:00
lethliel
6a1f5f78fe real fix for chunked encoding 2018-03-12 16:19:32 +01:00
lethliel
ef2b5dd71e temporary fix for M2Crypto chunked transfer encoding bug 2018-03-12 16:12:35 +01:00
lethliel
df6ec8d81d adapted oscssl to new m2crypto module 2018-03-12 11:54:10 +01:00
lethliel
1c36790323 fix package listing at the end of build 2018-03-09 14:56:32 +01:00
lethliel
86e236e1cd fix osc log with requests 2018-03-09 14:41:36 +01:00
lethliel
59584f0c00 fix edit_meta() again 2018-03-09 14:38:41 +01:00
lethliel
e1cb2dcc22 fix osc ci (creating package from working copy fails) 2018-03-09 13:58:21 +01:00
lethliel
132d04f146 fix osc metafromspec 2018-03-09 13:34:34 +01:00
lethliel
3da603bf49 fix request-uri-too-long error on large updates
fix osc pull
fix osc ci with orgproj
2018-03-09 11:52:56 +01:00