Commit Graph

482 Commits

Author SHA1 Message Date
Morris Jobke 655c26224b Merge pull request #5596 from nextcloud/mount-rename
Fix renaming of non-renamble mounts
2017-07-21 23:10:50 +02:00
Robin Appelman 06a4d6b5b9 Also repair storage id's when repairing invalid entries
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-07-21 14:06:13 +02:00
Lukas Reschke 3d2600b039
Add Phan plugin to check for SQL injections
This adds a phan plugin which checks for SQL injections on code using our QueryBuilder, while it isn't perfect it should already catch most potential issues.

As always, static analysis will sometimes have false positives and this is also here the case. So in some cases the analyzer just doesn't know if something is potential user input or not, thus I had to add some `@suppress SqlInjectionChecker` in front of those potential injections.

The Phan plugin hasn't the most awesome code but it works and I also added a file with test cases.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-07-20 22:48:13 +02:00
Artem Kochnev 5abeb9519e Fix for mb strlen
Error with moving files with long names in UTF-8
2017-07-20 17:29:50 +03:00
Lukas Reschke 030d85bc9c
Remove unused functions
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-07-19 10:28:12 +02:00
Lukas Reschke d8ec399454
Run phan over code base
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-07-19 10:28:11 +02:00
1 Man Projects 3e5d590f1e changed direct cast to integer to numerical value 2017-07-17 15:19:04 +02:00
Robin Appelman 0e107bc63c
non movable mounts can not be moved
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-07-17 15:09:08 +02:00
1 Man Projects 56c0384044 Removed cast to integer in getSize
Fixes - Wrong or no sizes of files/folders #5031
2017-07-15 20:18:45 +02:00
Robin Appelman 03f27b4c2c
Fix scan permissions with nested permissions masks
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-07-13 14:29:04 +02:00
Robin Appelman dfe662ad42
Fix propagating changes within jail wrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-07-11 17:55:04 +02:00
Morris Jobke b4a221f9be Merge pull request #5424 from nextcloud/moveFromCache-from-shared
fix moving folders out of a cache jail
2017-07-06 18:31:18 +02:00
Bjoern Schiessle da51ec38f4
only collect detailed access list if it is really needed
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-07-06 11:33:08 +02:00
Morris Jobke 7d58bb7db5 Merge pull request #5342 from nextcloud/userlist-used-space
show used space in user list
2017-07-05 15:15:25 +02:00
Roeland Jago Douma 4a9277d8da Merge pull request #5460 from nextcloud/objectstore-error-logging
improved logging of objectore errors
2017-06-29 11:22:17 +02:00
Robin Appelman 0a12b5d38d improved logging of objectore errors
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-06-21 17:33:26 -05:00
Robin Appelman 2e8e6f95b9
show used space in user list
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-06-15 14:06:54 +02:00
Robin Appelman fa81759917
fix moving folders out of a cache jail
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-06-15 13:59:06 +02:00
Michael Munger b8f2418248 Fixed a crash caused by Local::copyFromStorage() not conforming to Common::copyFromStorage. Issue# 5071 2017-05-23 10:29:30 -04:00
Lukas Reschke 8c624bdef9 Merge pull request #4792 from nextcloud/fix-storage-wrappers-on-scanner
Make sure we use the passed-in storage when there is one
2017-05-19 00:49:58 +02:00
Robin Appelman 1f1e1b0d00
use unmasked permissions during scanning
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-05-18 16:38:54 +02:00
Morris Jobke 91dfff5db4 Revert "fix permissions of mountpoints - take 2" 2017-05-15 12:43:25 -05:00
Morris Jobke ad0d0b0916 Merge pull request #4685 from nextcloud/fix_4683
fix permissions of mountpoints - take 2
2017-05-15 11:53:59 -05:00
Joas Schilling 00ebd5c184
Fix variable names
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-05-15 12:38:30 +02:00
Joas Schilling fd75c08238
Fix order of parameter and escaping
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-05-12 09:33:51 +02:00
Joas Schilling 65efb388e6
Actually we want to update the mimetype of all files ending with the suffix
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-05-11 10:58:21 +02:00
Rello f1ef5fc537
don´t change folders with --repair-filecache
check if folder is "httpd/unix-directory" and don´t perform here #27585
2017-05-11 10:40:48 +02:00
Joas Schilling cd2b567c21
Make sure we use the passed-in storage when there is one
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-05-10 15:45:18 +02:00
Morris Jobke f8044cbbce Proper exception for upload of .htaccess file via WebDAV
* fixes #2860

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-05-08 20:03:41 -05:00
Roeland Jago Douma e5960fe260
Revert "Revert "fix permissions of mountpoints""
This reverts commit 70a0e9c2d3.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-05-04 08:41:54 +02:00
Morris Jobke 70a0e9c2d3 Revert "fix permissions of mountpoints" 2017-05-04 00:09:09 -03:00
Robin Appelman 75b3b72d89
fix permissions of mountpoints
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-05-01 15:37:02 +02:00
Robin Appelman ab9a36e872
allow apps to set custom mount types
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-04-28 09:38:21 +02:00
Roeland Jago Douma 9da697b11a Merge pull request #4524 from nextcloud/downstream-27508
Keep file id on move
2017-04-28 09:37:40 +02:00
Vincent Petry 642b4331a6
Moved unit tests from ObjectTree::move to Directory 2017-04-26 15:42:29 +02:00
Vincent Petry 0721a7d5cc
Fix scanner after review 2017-04-26 13:26:47 +02:00
Vincent Petry e3218ddffd
OCC scanner commit in batches 2017-04-26 13:26:27 +02:00
Morris Jobke c54a59d51e
Remove unused use statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-22 19:23:31 -05:00
Roeland Jago Douma 867b3ee234 Merge pull request #4396 from nextcloud/scan-non-existing
show error when trying to scan non existing path
2017-04-21 19:47:33 +02:00
Robin Appelman 6fbe991afb
limit the user when searching for a file by id if we know the user already
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-04-21 17:11:26 +02:00
Robin Appelman a0e5107c0b
check for existence before we start the db transaction
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-04-20 13:25:49 +02:00
Morris Jobke fbedea0807
Add PHPDoc and handle exception in ScanAppData as well
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-19 17:04:16 -05:00
Robin Appelman ce2dba0796
show error when trying to scan non existing path
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-04-19 14:36:38 +02:00
Morris Jobke 31024b7700 Merge pull request #4329 from nextcloud/move-out-shared-folder
Fix moving files out of a shared folder
2017-04-12 11:44:26 -05:00
Robin Appelman 8500debe79
use unjailed path when moving files out of a shared storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-04-12 14:56:51 +02:00
Robin Appelman 2f949f4515
rename Jail::getSourcePath to getUnjailedPath to fix conflict with Local::getSourcePath
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-04-12 14:55:47 +02:00
Piotr M dc78f1251e
Optimize put - Dont try to fetch filecache for not existing filecache in encription 2017-04-12 12:54:20 +02:00
Björn Schießle 18580395d4 Merge pull request #4277 from nextcloud/permissions-mask-scanner
Dont use the permissions mask while scanning
2017-04-10 16:04:12 +02:00
Robin Appelman a7c611039d
Dont use the permissions mask while scanning
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-04-10 15:19:21 +02:00
Robin Appelman bb7e236e74
Allow searching file by fileid
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-04-05 15:22:53 +02:00
Robin Appelman d4a7cfec7c
rename fun to func
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-30 11:15:06 +02:00
Robin Appelman fee818f493
Add tests for query builder (i)like
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-30 11:15:03 +02:00
Robin Appelman 4b7bc2af0e
Move all children of a folder in a single query
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-30 11:14:48 +02:00
Roeland Jago Douma 626d03e3d4 Merge pull request #4116 from nextcloud/swift-cache-token
Cache swift authentication token in memcache
2017-03-29 11:23:13 +02:00
Lukas Reschke 49ba822fef
Remove verbose error message
There's no need to have this included in the error message.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-03-29 00:34:33 +02:00
Roeland Jago Douma 4821c00ea8 Merge pull request #4004 from nextcloud/backport-27172
Remove SharedCache::getNumericStorageId to let CacheWrapper do it
2017-03-28 21:56:44 +02:00
Robin Appelman 6991b79d40
serialize the token to json instead of using php's serialize
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-28 21:33:07 +02:00
Robin Appelman 205d5586e8
cache swift tokens in memcache
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-28 12:37:41 -06:00
Robin Appelman e26f138fc5 Merge pull request #4112 from nextcloud/swift-config
Better error messages for objectsack swift configuration
2017-03-28 17:51:18 +02:00
Robin Appelman 8dbca71a77
better error messages for invalid regions, urltypes and service names
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-28 17:00:11 +02:00
Robin Appelman 5062d0ac50
better error messages when swift authentication fails
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-28 11:02:18 +02:00
Robin Appelman 8de4209c3e
round the mtime in touch
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-27 17:07:48 +02:00
Morris Jobke b59f6dcca4 Merge pull request #3850 from nextcloud/search-order
Fix search ordering
2017-03-23 15:25:27 -06:00
Robin Appelman 2d02a4735c
Fix search ordering
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-23 15:24:50 -06:00
Morris Jobke eee7e97a6e Merge pull request #4001 from nextcloud/backport-27389
Ensure that FileInfo return values as required by its phpdoc.
2017-03-23 13:00:49 -06:00
Joas Schilling 88015bc51f
Fix type hints and doc blocks
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-03-23 17:52:47 +01:00
Vincent Petry 89c42a76c3
Remove SharedCache::getNumericStorageId to let CacheWrapper do it
The CacheWrapper will properly forward the call to the wrapped cache.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-23 00:02:48 -06:00
Piotr M 5c7079f8c6
Ensure that FileInfo return values as required by its phpdoc.
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-22 20:03:46 -06:00
Jörn Friedrich Dreyer 9eca1da1dd
allow configuring authType for DAV backend
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-22 18:13:42 -06:00
Robin Appelman 714f198a5d
mount shared mounts last
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-22 17:15:42 +01:00
Lukas Reschke ab9e3525cc
Move error message to log entry
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-03-20 11:06:08 +01:00
kdslkdsaldsal fc57d4b96c
Fix malformed logging in exception
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-19 22:56:35 -06:00
Joas Schilling 26eda9dd58 Merge pull request #3892 from nextcloud/downstream-27101
Redirect unlink to rmdir
2017-03-17 13:56:36 +01:00
Vincent Petry cbebfaaf2b
Skip FailedStorage in background scan
The background job that scans storages must skip failed storages to
avoid potential exceptions, especially when the failed storage comes
from a shared storage where the source is not accessible.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-17 00:06:48 -06:00
Vincent Petry 7256940524
Redirect unlink to rmdir (#27101)
Many API callers will call unlink even for directories and it can mess
up with some wrappers like the encryption wrapper

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-16 23:45:03 -06:00
Roeland Jago Douma 67faf7edc4 Merge pull request #3838 from Xuanwo/basename-fix
[OC/Files/Cache]: Fix wrong usage of basename
2017-03-14 21:00:24 +01:00
Roeland Jago Douma 6565533d3b Merge pull request #3600 from coletivoEITA/master
added method needsPartFile() in Storage
2017-03-14 15:14:59 +01:00
Vinicius Cubas Brand 13e50cbcd7 added method needsPartFile() in Storage
Signed-off-by: Vinicius Cubas Brand <viniciuscb@gmail.com>
2017-03-14 10:06:50 -03:00
Xuanwo 210f4106c4 [OC/Files/Cache]: Fix wrong usage of basename
Fix https://github.com/nextcloud/server/issues/3837

Signed-off-by: Xuanwo <xuanwo@yunify.com>
2017-03-14 13:27:17 +08:00
Robin Appelman 6d0c756ff9
dont allow empty wildcard search
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-13 16:06:19 +01:00
Robin Appelman e61606a767
Allow searching for favorites
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-08 16:30:55 +01:00
Robin Appelman df2063ee7b
Implement webdav SEARCH
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-01 14:06:39 +01:00
Robin Appelman 706131b394
add icewind/searchdav
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-02-28 14:24:18 +01:00
Frédéric Fortier 55a37c1db9 Refactor files' CacheEntry object creation to call cacheEntryFromData() all the time thus allowing proper casts to be done
Signed-off-by: Frédéric Fortier <frederic.fortier@oronospolytechnique.com>
2017-02-22 20:03:32 -05:00
Frédéric Fortier cc511ac7b8 Typecast filecache 'storage' as int to return it as documented, fixes #3461
Signed-off-by: Frédéric Fortier <frederic.fortier@oronospolytechnique.com>
2017-02-20 22:23:27 -05:00
Roeland Jago Douma 79a16bc2d3 Merge pull request #3495 from nextcloud/dav-protected
Make it easier to subclass DAV storage
2017-02-15 20:49:06 +01:00
Roeland Jago Douma 17c07e5caf Merge pull request #3447 from nextcloud/getmetadata-permissions-mask
also apply permissions mask in getMetaData
2017-02-15 20:22:08 +01:00
Roeland Jago Douma f60d95840e Merge pull request #3262 from nextcloud/jail-scanner-storage-id
Make sure we use the correct storage id and parent id when scanning a jailed storage
2017-02-15 20:21:03 +01:00
Robin Appelman 25dc140511
Make it easier to subclass DAV storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-02-15 14:00:00 +01:00
Lukas Reschke 257e28f46d Merge pull request #3465 from nextcloud/storage-log-locks
Add option to enable locking debug logging
2017-02-14 15:08:21 +01:00
Morris Jobke 7f73ee0764
Add missing PHPDoc and properly throw exception
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-02-13 18:03:35 -06:00
Lukas Reschke a422a59f99
Add storage to log item as well
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-02-13 22:49:44 +01:00
Robin Appelman 8c1ed7507a
Add option to enable locking debug logging
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-02-13 15:03:46 +01:00
Robin Appelman f27113a6ee
also apply permissions mask in getMetaData
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-02-10 22:36:12 +01:00
vkuimov 71a022640b bug when connect to yandex webdav server
server think that request like 
<?xml version="1.0" encoding="UTF-8"?> 
<d:propfind xmlns:d="DAV:">
<d:prop/> 
</d:propfind>

is 400: Bad Request
2017-02-10 16:31:49 +00:00
Morris Jobke 687e38c409 Merge pull request #2970 from nextcloud/notify-self-test
Add self-test for files_external:notify
2017-01-30 17:15:57 -06:00
Jörn Friedrich Dreyer 6fd7d4efd0
remove obsolete hack (#26928)
* remove obsolete hack

> // file_get_contents() has a memory leak: https://bugs.php.net/bug.php?id=61961
was closed 4 years ago. we could also use the Common implementation

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-01-27 12:20:48 -06:00
Robin Appelman 269747985e
Add a more powerful notify mechanism
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-27 10:44:33 +01:00
Lukas Reschke 29f5ab1758 Merge pull request #3238 from nextcloud/dav-test
Make DAV external storage test more reliable
2017-01-26 18:43:36 +01:00
Robin Appelman 2520a4831b
Make sure we use the correct storage id when scanning a jailed storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-25 17:03:45 +01:00
Morris Jobke 95ab46e3d2 Merge pull request #3030 from nextcloud/filesapi-renamefailcase
Fix files node API failed rename/copy
2017-01-24 21:23:59 -06:00
Robin Appelman 38ec2a35f2
Make DAV external storage test more reliable
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-24 16:56:24 +01:00
Robin Appelman d4d116503c Merge pull request #3212 from mwalbeck/mimetype-hidden-files
Mimetype detection for hidden files
2017-01-23 21:45:16 +01:00
Magnus Walbeck 3d99ec6832 Reduced code for filename trim
Signed-off-by: Magnus Walbeck <mw@mwalbeck.org>
2017-01-23 17:14:39 +01:00
Magnus Walbeck eadc1ac637 Mimetype detection for hidden files
Signed-off-by: Magnus Walbeck <mw@mwalbeck.org>
2017-01-23 13:28:35 +01:00
Vincent Petry 0aaf209c66
Prevent PHP request to get killed when using fclose callback (#26775)
* Prevent PHP request to get killed when using fclose callback

* Add ignore_user_abort everywhere where the time limit is set to 0

Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-23 12:33:20 +01:00
Vincent Petry e667b28298
Fix files node API failed rename/copy
Whenever a rename or copy operation failed on the view, we must throw
an exception instead of just ignoring.

Signed-off-by: Vincent Petry <pvince81@owncloud.com>
2017-01-12 13:52:59 +01:00
Vincent Petry eb5ea0e260
Refactor files node API for more code reuse
Signed-off-by: Vincent Petry <pvince81@owncloud.com>
2017-01-11 14:53:42 +01:00
Roeland Jago Douma 447e388ce9 Merge pull request #2744 from nextcloud/oc_26324
[downstream] Fix DAV stat cache to properly cache 404
2017-01-11 08:16:40 +01:00
Roeland Jago Douma 00b17c3af5
Only check for local shared storages
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-01-10 16:14:21 +01:00
Vincent Petry 706655ef20
Skip local shares in bkg scan and occ files:scan (#26590)
Local shares should only be scanned when doing it for the owner to
avoid repeatedly rescanning the same shared storage over and over again
for every recipient.
2017-01-10 16:11:45 +01:00
Robin Appelman 5774d3e82c
replace close:// streamwrapper with CallBackWrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-06 15:33:32 +01:00
Roeland Jago Douma 73fcb69cad Merge pull request #2934 from nextcloud/quota-stream-non-global
remove the need to register the quota streamwrapper globally
2017-01-06 15:25:20 +01:00
Vincent Petry 6d4abdab8f
Fix DAV stat cache to properly cache 404
404 errors were not properly cached due to catching the wrong
exception. Now catching ClientHttpException and checking the error
code. In case of 404, adjust the stat cache accordingly.
2017-01-05 09:39:07 +01:00
Robin Appelman 72a3ea6073
log a warning when trying to use a non basic fopen mode
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-05 08:49:04 +01:00
Robin Appelman bca91f2216
remove static:// stream wrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-04 15:57:02 +01:00
Robin Appelman 968de70bc5
remove the need to register the quota streamwrapper globally
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-04 15:15:47 +01:00
Robin Appelman 5b09565594
remove no longer used fakedir stream wrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-03 17:06:03 +01:00
Vincent Petry 4744dce4df
Nuke the legacy storage fallback from orbit
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-12-23 12:49:46 +01:00
Robin Appelman 14a561ddad
always use numeric storage id in cacheentry
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-12-13 12:53:38 +01:00
Robin Appelman 86473306f3
fix cacheentry return wrong storage id
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-12-13 12:50:17 +01:00
Robin Appelman 6f46a8bd5b
also compare storage ids when checking for changed mounts
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-12-13 12:11:10 +01:00
Morris Jobke 1253d1008a Merge pull request #2411 from nextcloud/fix-encryption-home-storage
check if the file should really be encrypted before we update the file cache
2016-12-05 15:38:12 +01:00
Lukas Reschke 1131338562 Merge pull request #2486 from nextcloud/shared-storage-mask
apply permissions mask for shared storage
2016-12-02 23:39:48 +01:00
Robin Appelman 02ee4f958c
apply permissions mask for shared storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-12-02 17:59:02 +01:00
Robin Appelman efbe26f9c3
only update the cache if the storage operation succeeds
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-12-02 16:20:49 +01:00
Lukas Reschke b7f866988e
Prevent endless loop in \OC\Files\View::createParentDirectories
\OC\Files\View::createParentDirectories was previously prone to an endless loop. If a path such as /foo/existingfile.txt/bar/foo was passed and existingfile.txt existed in foo the loop was never left and running until the PHP process timed out.

This commit changes the logic to a foreach loop over an array and additionally additional error handling using is_file.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-12-01 16:57:12 +01:00
Bjoern Schiessle 0f8fe77b3a
check if the file should really be encrypted before we update the file cache
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2016-11-29 20:34:45 +01:00
Robin Appelman ce2f9493a7
filter out oc_mounts results from non existing users
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-24 11:44:18 +01:00
Joas Schilling 558f169671
Move the validation into one place only
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-11-21 09:23:37 +01:00
Joas Schilling 4652d203e3
Make sure we don't scan files that can not be accessed
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-11-21 09:23:32 +01:00
Lukas Reschke cc500c2810 Merge pull request #2199 from nextcloud/readfile-close-handle
close the file handle after readfile
2016-11-18 14:58:03 +01:00
Robin Appelman 8b9ad46ba3 Merge pull request #768 from nextcloud/s3-objectstore
Add S3 objectstore backend
2016-11-18 14:55:07 +01:00
Robin Appelman 89d37575a3
close the file handle after readfile
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-18 12:19:49 +01:00
Robin Appelman 2f03fcab4a
let the share backend get the node cacheentry to save queries
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-17 18:48:38 +01:00
Robin Appelman 14cdeafc3e
make source cache injectable in cache wrappers
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-17 18:48:38 +01:00
Morris Jobke 02bfd91553 Merge pull request #2176 from nextcloud/share-cache-root-info
reuse the known rootinfo in the shared cache when possible
2016-11-17 18:47:39 +01:00
Morris Jobke 54ca411ff0 Merge pull request #2167 from nextcloud/mountmanager-lockdown
ensure we setup the mount manager when in lockdown
2016-11-17 16:56:55 +01:00
Robin Appelman 30e7c27d86
reuse the known rootinfo in the shared cache when possible
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-17 14:59:31 +01:00
Morris Jobke b373f52fa8
only use one kind of hack for the storage wrappers of the sharing code
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2016-11-16 19:04:47 +01:00
Vincent Petry e7b1196dd6
Hack to prevent warning for read-only wrapper in public links
Storage wrappers should normally always be registered inside a presetup
hook. However in the public link scenario this is not possible and
there is currently no good alternative with the current architecture.

Instead of logging a warning every time, this fix prevents the warning
to be shown but also adds a FIXME in the code for the future. This is
ok because this app is already using private/internal APIs at the
moment and should be reworked properly in the future.
2016-11-16 19:04:42 +01:00
Robin Appelman a7c0d99705
ensure we setup the mount manager when in lockdown
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-16 17:24:37 +01:00
Robin Appelman 3ab160dd5a
fopen s3 objects directly to work around unexplainable guzzle bug
For some reason when a text file started with a valid hex character ([0-9a-f]) it would eat the text untill the first newline
The new code does basically the same thing as guzzle/s3-sdk did only without wrapping everything in a guzzle stream

Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-16 15:30:37 +01:00
Robin Appelman 0ee958595e
Improve isMounted to handle primary storage object store
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-16 15:30:36 +01:00
Robin Appelman eefd059716
add amazon s3 objectstore backend
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-16 15:30:36 +01:00
Robin Appelman 64e896cc0d
split testing of objectstoragestorage and objectstore implementations
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-16 15:30:36 +01:00
Robin Appelman 0a246f9852
split off s3 connection logic
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-16 15:30:36 +01:00
Robin Appelman b56f2c9ed0
basic lockdown logic
Signed-off-by: Robin Appelman <icewind@owncloud.com>
2016-11-16 15:24:23 +01:00
Roeland Jago Douma b7e13b43fb Merge pull request #2114 from nextcloud/downstream-26498
make object prefix configurable
2016-11-14 17:07:00 +01:00
Jörn Friedrich Dreyer 4a9361905d
make object prefix configurable 2016-11-14 15:10:56 +01:00
Thomas Müller 506ccdbd8d
Introduce an event for first time login based on the last login time stamp
Use firstLogin event to trigger creation of default calendar and default address book

Delay login of admin user after setup so that firstLogin event can properly be processed for the admin

Fixing tests ...

Skeleton files are not copied over -> only 3 cache entries are remaining

Use updateLastLoginTimestamp to properly setup lastLogin value for a test user
2016-11-14 14:50:10 +01:00
Robin Appelman cbcdf69dc2
only query substorages to calculate the final mtime/size/etag lazily
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-10 13:59:22 +01:00
Lukas Reschke a9547a2fd7 Merge pull request #2015 from nextcloud/swift-bucket
allow using 'bucket' to set the swift container
2016-11-04 21:46:59 +01:00
Morris Jobke f42d5b6e56 Merge pull request #2007 from nextcloud/downstream-26411
[oc] Fix initMountPoints to set usersSetup earlier
2016-11-04 15:03:52 +01:00
Robin Appelman b72e5a2e4e
allow using 'bucket' to set the swift container
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-04 14:15:18 +01:00
Vincent Petry 237dab675e
Fix initMountPoints to set usersSetup earlier
This is needed because in some cases like LDAP, the user manager itself
might trigger avatar updates which would internally also call
initMountPoints with the same user. This could cause the same user to
be setup twice, and in some sharing situations could cause recursive
deduplication of shares by adding "(2)" every time.
2016-11-03 20:45:40 +01:00
Robin Appelman 7be62d083e
explicitly cast mtime to int
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-03 14:36:46 +01:00
Lukas Reschke 68cebef64c
DI for root.php
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-11-02 23:16:51 +01:00
Morris Jobke 8653d14862
Do not expose user data in exceptions & fix typo
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2016-11-02 22:21:47 +01:00
Vincent Petry f737426eca
Add using casing check/fix for initMountPoints 2016-11-02 22:21:46 +01:00
Robin Appelman 049bcae29e
Allow setting a maximun number of buckets for multibucket
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-02 21:31:24 +01:00
Morris Jobke 27ba46c40e Merge pull request #1890 from nextcloud/downstream-25428
fixing php 32 bit (arm) filemtime on large file issue (#18971) (#25428)
2016-10-25 14:44:27 +02:00
Lukas Reschke 459477e2c3
Move function to LargeFileHelper
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-10-25 12:00:57 +02:00
Boris Rybalkin cfc0d9249b
fixing php 32 bit (arm) filemtime on large file issue (#18971) (#25428)
* fixing php 32 bit (arm) filemtime on large file issue (#18971)

* cast to int
2016-10-25 11:43:17 +02:00
Lukas Reschke df3444493b
Remove not existent function call
- Removes a not existent function call
- Removes a fallback for Windows

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-10-25 11:37:16 +02:00
Roeland Jago Douma e73a11d106
Fix permision mask
If we move a file from the temp part file to the original file we don't
need update permissions.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-24 21:45:00 +02:00
Morris Jobke 169faf8c32
Remove sensible information from exception message
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2016-10-24 11:42:04 +02:00
Olivier Mehani 19ad058d06
Add message to NotSquareException thrown from Avatar
This prevents cryptic messages such as the following, from `user_ldap`:

     Could not set avatar for uid=user,ou=People,dc=example,dc=net, because:

Signed-off-by: Olivier Mehani <shtrom@ssji.net>

Add message to NotPermittedException thrown from Files\Nodes\Folder

Ditto.

Don't use translation macros here as this seems to be pretty low-level
errors that generally get caught and prettified, and I don't want to
unduly clog down the lower layers.

Signed-off-by: Olivier Mehani <shtrom@ssji.net>

fixup! Add message to NotPermittedException thrown from Files\Nodes\Folder
2016-10-24 11:27:27 +02:00
Roeland Jago Douma ab91fa2660 Merge pull request #1820 from nextcloud/4byte-filenames
Allow 4byte unicode filenames on supported platforms
2016-10-24 10:38:25 +02:00
Morris Jobke 2799b0a821 Merge pull request #1835 from nextcloud/downstream-24948
Move OC\Files\Storage\Shared to the right namespace
2016-10-20 23:48:15 +02:00
Vincent Petry 9e9fef46d9
Get rid of very old oc:// stream wrapper (#26381) 2016-10-20 20:46:30 +02:00
Joas Schilling 246bb9f33d
Move OC\Files\Storage\Shared to the right namespace 2016-10-20 20:27:44 +02:00
Robin Appelman 3a8e75a814
Allow 4byte unicode filenames on supported platforms
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-10-20 14:26:09 +02:00
Morris Jobke deb59d3d48 Merge pull request #1722 from nextcloud/hide-storage-warnings
hide storage wrapper warning for the readonly storage
2016-10-18 16:15:52 +02:00
Morris Jobke 4d2835802f
hide storage wrapper warning for the readonly storage
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2016-10-13 14:37:31 +02:00
Robin Appelman 1484d01ff6
explicitly cast to int
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-10-12 16:12:39 +02:00
Robin Appelman 0d842e0550
optimize Folder::getById to use less queries
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-10-12 16:12:28 +02:00
Roeland Jago Douma 6807cb684f
avatar to appdata
* Fix AvatarTest

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-05 11:00:16 +02:00
Roeland Jago Douma ac38a3a654
Add Tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-05 11:00:16 +02:00
Roeland Jago Douma 5d8b941fea
Initial AppData
* Introduce simpleFS
* Introduce IAppData
* Introduce AppData Factory to get your AppData folder
* Update FileDisplayResponse

* AppData implements a ISimpleRoot but lazy. So only if an apps starts
  to access data will stuff get initialized

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-05 11:00:14 +02:00
Lukas Reschke c4d263199c Merge pull request #1521 from nextcloud/fix-mimetypedetect-hiddenfolder
Fix mimetype detection inside hidden folders (#26138)
2016-09-27 18:52:48 +02:00
Vincent Petry 9b4de310bd
Fix mimetype detection inside hidden folders (#26138)
Downstreaming of https://github.com/owncloud/core/pull/26138

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-09-26 11:31:03 +02:00
Vincent Petry 1f21a132c7
Only use realpath for real directories (#26058)
In some cross-local-storage use cases, the Local storage is
instantiated with "/" as data directory. In such cases, calling
realpath() would cause PHP warnings when open_basedir is set.

This fix bypasses the realpath() call when dealing with a root storage.

Downstreaming of https://github.com/owncloud/core/pull/26058

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-09-26 11:21:47 +02:00
Semih Serhat Karakaya cfc1c7cbd2 Update CachedMountInfo for user home storage
In getMountPointNode function rootId is not inside of the userFolder for home storage. We was searching '/user' folder in '/user/files' folder. So, it was return NULL. I moved searching part to parent folder. It solves everything. Also, obviously other storage types not affect then this change.

Related owncloud commit :
https://github.com/owncloud/core/pull/26017
2016-09-09 18:07:21 +03:00
Morris Jobke 5ac26d12f0 Merge pull request #1247 from nextcloud/storage-id-global-cache
more efficient querying of numeric storage ids
2016-09-08 21:09:14 +02:00
Robin Appelman e8e950a4d2
more efficient querying of numeric storage ids 2016-09-07 17:22:40 +02:00
Joas Schilling 24d90a4bb1
Correctly remove the charset from finfo mimetype 2016-09-05 09:48:22 +02:00
Vincent Petry 669b0bc2ae
Prevent error with orphaned shares when updating user mount cache 2016-08-30 19:49:23 +02:00
Jörn Friedrich Dreyer d5518735c9
always return numeric storage id as int, also check type equality in test asserts 2016-08-29 14:20:51 +02:00
Lukas Reschke 4d85ffc27c Merge pull request #1054 from nextcloud/less-cache-hits
Reduce the number of cache operations for dav operations
2016-08-27 22:44:29 +02:00
Roeland Jago Douma f805aff67c
Always use the LazyRoot 2016-08-26 12:13:34 +02:00
Robin Appelman fb88d66857 optimize getUserFolder for the common case 2016-08-25 17:22:25 +02:00
Robin Appelman 2693ae870e cache user folders 2016-08-25 17:22:25 +02:00
Robin Appelman b2d365734a cache root id in mountpoint 2016-08-25 17:22:25 +02:00
Robin Appelman a0c2342c20 prevent infinite recursion while getting storage from mount 2016-08-23 14:52:18 +02:00
Robin Appelman e316a7ade7 Allow jail wrappers to lazily initialize the source storage 2016-08-22 12:26:27 +02:00
Robin Appelman 5e44a2d868 Allow storage wrappers to lazily initialize the source storage 2016-08-22 12:23:55 +02:00
Lukas Reschke 67d016833d Merge pull request #810 from nextcloud/shared-cachethepropagatorinstance
Store the shared propagator instance
2016-08-10 17:24:57 +02:00
Vincent Petry 412b5c5407
Store the shared propagator instance
This instead of recreating it for every call.
2016-08-10 10:57:49 +02:00
Robin Appelman a999420c75 get shared storage storage id without setting up the storage 2016-08-09 15:52:13 +02:00
Thomas Müller f1cd68d713 Adding test case for getPathById including a jailed cache where root is just empty 2016-08-05 14:06:05 +02:00
Thomas Müller d252d79059 getJailedPath expects $path to have a trailing / - fixes #25464 2016-08-05 14:06:05 +02:00
Robin Appelman 81e103074e use limit instead of since when listing recent files 2016-07-22 15:20:55 +02:00
Robin Appelman e321ecd592 add recent files to node api 2016-07-22 14:39:32 +02:00
Robin Appelman d499f68fd7 Fix storage id with storage jail 2016-07-22 14:34:59 +02:00
Joas Schilling 0215b004da
Update with robin 2016-07-21 18:13:58 +02:00
Joas Schilling ba87db3fcc
Fix others 2016-07-21 18:13:57 +02:00
Robin Appelman 29eeeb2273 Save the files external mount id in the mount cache table 2016-07-13 16:34:08 +02:00
Morris Jobke c2d88a08b7
Remove unneeded checks if it runs on a Windows machine
* the setup check is still there
2016-07-08 15:55:17 +02:00
Thomas Müller d2d99a91a0 fix swift primary object store test (#25281)
* Wait for socket to be open

* Fix call on null

* Allow DB access for MountProviderTest

Makes unit tests pass when using object store, since their FS access is
actually oc_filecache DB access. It is currently not possible to mock
or bypass the logic from "SharedMount::verifyMountPoint()" triggered by
this test.
2016-07-05 08:54:51 +02:00
Hendrik Leppelsack 11be3d6276 remove png references in core 2016-07-01 16:36:37 +02:00
Robin Appelman 2a72eff9ee Fix getting the certificate bundle for dav external storage (#25274)
* Fix getting the certificate bundle for dav external storages

* Log the original exception in dav external storage
2016-06-27 22:26:43 +02:00
Robin Appelman 88ef163276 handle unavailable fed shares while testing for availability (#25277)
* More explicit http status codes

* handle unavailable fed shares while testing for availability
2016-06-27 21:34:28 +02:00
karakayasemi c8b7a059b4
Fire hooks for mkdir for folder upload
fromTmpFile function, usual mkdir call is only working for file's parent
directory. Does not care upper parent folders. I added a recursive
function that creates parent non-existing folders with usual mkdir.
2016-06-21 17:10:52 +02:00
Vincent Petry 5de6432441 Merge pull request #25056 from owncloud/fs-usermountcache-capped
Capped cache for cache info in UserMountCache
2016-06-15 13:01:28 +02:00
Vincent Petry f163eedfa2 Merge pull request #25102 from owncloud/preview-delete-performance
Preview delete performance
2016-06-15 11:58:50 +02:00
Robin Appelman 01d9ad6b14 optimized size propagation on deletes 2016-06-14 17:17:43 +02:00
Vincent Petry 86d7241be2
Capped cache for cache info in UserMountCache 2016-06-13 15:08:12 +02:00
Robin Appelman 338cd4033a handle invalid storages in LazyStorageMountInfo 2016-06-13 13:31:45 +02:00
Vincent Petry 52a0c939ab Merge pull request #24863 from owncloud/propagator-batching
Propagator batching for the file scanner
2016-06-10 17:45:52 +02:00
Vincent Petry 0e3737ffe1 Merge pull request #25028 from owncloud/scanner-user-not-setup
skip scanning for a user when the user is not setup yet
2016-06-09 10:29:46 +02:00
Robin Appelman 808438efc0 skip scanning for a user when the user is not setup yet 2016-06-08 14:19:42 +02:00
Vincent Petry 8d0948977e Merge pull request #24899 from owncloud/local-storage-symlinks
dissalow symlinks in local storages that point outside the datadir
2016-06-08 10:19:24 +02:00
Robin Appelman 2cf7ad8c55 make sure $data['mtime'] is always a timestamp 2016-06-07 17:09:24 +02:00
Robin Appelman 6822689e38 don't update storage mtime if we can't get the modified date 2016-06-07 15:04:24 +02:00
Robin Appelman 73547f29be Ignore forbidden files while scanning 2016-06-07 14:01:55 +02:00
Robin Appelman 7b1b723e5b dissalow symlinks in local storages that point outside the datadir 2016-06-07 14:01:53 +02:00
Robin Appelman 6bc8305edd Fix warnings when trying to get mtime of non existing files 2016-06-03 13:35:27 +02:00
Robin Appelman 14f96f86e7 return success when deleting ghost files 2016-06-03 13:34:54 +02:00
Robin Appelman 63408fa6ef allow deleting "ghost files" trough the View and Node api 2016-06-03 13:30:59 +02:00
Georg Ehrke 89a10fdb2d
normalize path in getInternalPath 2016-06-02 19:11:35 +02:00
Robin Appelman fce19d22d9 fix mtime propagation on sqlite 2016-06-02 15:43:43 +02:00
Robin Appelman cc67ad4dda use propagator batching in the scanner 2016-06-02 15:07:50 +02:00
Robin Appelman 9fb44e34af add propagator batching 2016-06-02 15:07:47 +02:00
Vincent Petry 5ad8fa7675
Add keepUnicode value in the cache key of normalizedPathCache 2016-06-01 14:28:59 +02:00
Vincent Petry 5d7f37d570
Check whether remote DAV server accepted the mtime on touch
ownCloud as remote DAV always accepts the mtime on touch, but other
servers like Apache's DAV server doesn't. The latter doesn't give any
visible hint in its response to detect this case, so this fix does a
subsequent PROPFIND to check whether the mtime was actually set.

Since a touch() operation seldom happens (only on uploads), the minor
performance loss should hopefully be acceptable.
2016-05-30 16:10:30 +02:00
Vincent Petry 6f346b4b1f
Fix webdav destination header when overwriting folders
The trailing slash is needed when talking to Apache's mod_dav server
2016-05-30 16:10:30 +02:00
Robin Appelman d717b583d2 trigger size calculation after scanning (#24875) 2016-05-30 11:14:31 +02:00
Lukas Reschke aba539703c
Update license headers 2016-05-26 19:57:24 +02:00
Vincent Petry e7110c7678 Merge pull request #24760 from owncloud/objectstore_multibucket
Objectstore multibucket
2016-05-24 15:15:59 +02:00
Roeland Jago Douma abe338f433
Store user bucket in preferences 2016-05-23 21:57:41 +02:00
Vincent Petry adcf942901 Merge pull request #24750 from owncloud/lenz1111-share_download_range_requests_support
Http Range requests support in downloads
2016-05-23 21:01:26 +02:00
Roeland Jago Douma e03e4921a0
Fix Name 2016-05-23 20:42:08 +02:00
Roeland Jago Douma 5e2316d05d
Allow multibucket in objectstore 2016-05-23 20:42:08 +02:00
Vincent Petry aa56d42fa8 Merge pull request #24777 from owncloud/scanner-dont-propagate
dont needlessly triger the propgator in the scanner
2016-05-23 19:05:20 +02:00
Vincent Petry 524479fa09 Merge pull request #24699 from owncloud/background-scan-recursion
Only recurse into incomplete folders during background scans
2016-05-23 17:44:02 +02:00
Piotr Filiciak 6577bbe887 Code style and doc fix 2016-05-23 15:17:00 +02:00
Robin Appelman eca57be336 Only recurse into incomplete folders during background scans 2016-05-23 14:40:35 +02:00
Vincent Petry 21df2eb5a1 Merge pull request #24695 from owncloud/background-scan-propagate
Trigger propagation from the background scanner
2016-05-23 14:32:28 +02:00
Robin Appelman f3979e5459 dont needlessly triger the propgator in the scanner 2016-05-23 13:53:05 +02:00