Repository navigation
Conversation
There was a problem hiding this comment.
Also log the full exception: \OCP\Util::logException('user_ldap', $e);... sometimes an exception only is a special class without a message ;)
There was a problem hiding this comment.
Also or rather instead? It would mostly duplicate it (given the IAvatar PHPdoc is correct, only \Exception for a invalid format is to be expected, others that are thrown are ruled out before by biz logic - of course it may change over time), only with more details about the exception.
|
Can those integration tests be executed on jenkins? |
Not at the moment, but it would be desirable. For now, how you run them is documented here: https://github.com/owncloud/core/blob/master/apps/user_ldap/tests/integration/readme.md Also it might make more sense to have something more general that we can use ownCloud wide. |
|
👍 |
|
@davitol @SergioBertolinSG Can you help test this? |
;) |
|
+1 for backporting and please let us know which version will have this fix included. |
|
A new inspection was created. |
|
rebased @hostingnuggets is this a "I tested it and it works +1" or just an "i like it +1"? |
|
@karlitschek backport request is pending |
|
backport is fine :-) |
|
thank you :) |
|
@SergioBertolinSG @davitol @rperezb Can someone test this please? Thanks :) |
|
@MorrisJobke thanks for the ping, we have added this to the QA queue |
|
@PVince81 Can you test this to get it in? :) |
|
@MorrisJobke I have no idea how to test this, especially how to put an avatar in LDAP. |
#!/usr/bin/php
<?php
$dn = 'uid=zombie29579,ou=zombies,dc=example,dc=com';
$adn = 'uid=owncloudagent,ou=Users,dc=example,dc=com';
$apwd = '123456';
$jpeg = file_get_contents('/tmp/ava.jpg');
$host = 'localhost';
$port = 389;
$jp = array('jpegPhoto' => $jpeg);
$cr = ldap_connect($host, $port);
ldap_set_option($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_bind($cr, $adn, $apwd);
ldap_mod_add($cr, $dn, $jp); |
|
I've reproduced the 500 internal error in stable8.1. And I've tested it on stable8.1+this PR using a gif animated picture. Now there is no crash and the picture isn't shown (default picture with a character is shown instead). It says that the avatar is given by original account, but nothing about the format, perhaps not worthy to warn about it, just to have it clear. 👍 Working without problems using jpg and png. |
|
@owncloud-bot retest this please |
fix uncaught exception on not permitted file types when setting avatar, fixes #17232
…s when setting avatar refactor integration tests to make it easier to add new ones add integration tests for avatar update fix uncaught exception on not permitted file types when setting avatar, fixes #17232 fix test after rebasing
|
Backport to stable8.1: #17951 |
@blizzz Are you also preparing the other two PRs? Thanks :) |
|
@MorrisJobke yes, yes, right at it |
[stable8.1] Backport of #17464, fix uncaught exception on not permitted file type…
[stable8] backport of #17464: fix uncaught exception on not permitted file types when setting avata…

And refactors integration tests, because it adds one as well and we don't like to have code duplication, do we. The actual fix is just the third commit, which just adds a try-catch block and does some logging.
Please test and review @11mariom @hostingnuggets @MorrisJobke @tkaufm or others, thx.
@karlitschek also, request to backport to stable8.1 (complete), stable8 and stable7 (both fix only)
Fixes #17232