Commit graph

12 commits

Author SHA1 Message Date
Eric Biggers
adba2fcc36 vold: remove unused stop() methods
NetlinkManager::stop() and VolumeManager::stop() are never called, so
remove them.

Change-Id: I868aa2ad24066d2830816984afcc10000cbabad1
2020-09-23 10:02:25 -07:00
Paul Crowley
14c8c0765a clang-format many files.
Test: Format-only changes; treehugger suffices.
Change-Id: I23cde3f0bbcac13bef555d13514e922c79d5ad48
2018-09-18 15:41:22 -07:00
Jeff Sharkey
3472e52fc2 Move to modern utility methods from android::base.
Moves away from crufty char* operations to std::string utility
methods, including android::base methods for splitting/parsing.

Rewrite of how Process handles scanning procfs for filesystem
references; now uses fts(3) for more sane traversal.

Replace sscanf() with new FindValue() method, also has unit tests.

Remove some unused methods.  Switch almost everyone over to using
modern logging library.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest
Test: cts-tradefed run commandAndExit cts-dev --abi armeabi-v7a -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 67041047
Change-Id: I70dc512f21459d1e25b187f24289002b2c7bc7af
2017-10-17 12:40:51 -06:00
Luis Hector Chavez
d1b00de2c1 Invert the order of SO_RCVBUFFORCE and SO_RCVBUFF
This change swaps the order of SO_RCVBUFFORCE and SO_RCVBUFF, because
the latter is silently capped to sysctl_rmem_max. So, just try
SO_RCVBUFF if the former failed.

Bug: 62417946
Test: Run android in a new user and network namespace, vold does not
      abort here.

Change-Id: Iac2ddae6fbb80ba84afe5414eade978cd795ef3c
2017-08-29 10:29:48 -07:00
Junichi Uekawa
c865adaa3b Try SO_RCVBUF before SO_RCVBUFFORCE.
When running in a container, the process might be in a user/net
namespace, which would cause setting the SO_RCVBUFFORCE socket option to
fail with EPERM. But rmem_max is set to a high enough value which allows
SO_RCVBUF to succeed.

Bug: 62417946
Test: Run android in a new user and network namespace, vold does not
      abort here.

Change-Id: I2b678ddd886a406a3394d9fdd33f9c8800ef78a3
Signed-off-by: Junichi Uekawa <uekawa@google.com>
(cherry picked from commit b41155d4af0e00fc6f65d7d67b80e7b866f847d6)
2017-07-11 15:51:54 -07:00
Jeff Sharkey
36801cccf2 Progress towards dynamic storage support.
Wire up new Disk and VolumeBase objects and events to start replacing
older DirectVolume code.  Use filesystem UUID as visible PublicVolume
name to be more deterministic.

When starting, create DiskSource instances based on fstab, and watch
for kernel devices to appear.  Turn matching devices into Disk
objects, scan for partitions, and create any relevant VolumeBase
objects.  Broadcast all of these events towards userspace so the
framework can decide what to mount.

Keep track of the primary VolumeBase, and update the new per-user
/storage/self/primary symlink for all started users.

Provide a reset command that framework uses to start from a known
state when runtime is restarted.  When vold is unexpectedly killed,
try recovering by unmounting everything under /mnt and /storage
before moving forward.

Remove UMS sharing support for now, since no current devices support
it; MTP is the recommended solution going forward because it offers
better multi-user support.

Switch killProcessesWithOpenFiles() to directly take signal.  Fix
one SOCK_CLOEXEC bug, but SELinux says there are more lurking.

Bug: 19993667
Change-Id: I2dad1303aa4667ec14c52f774e2a28b3c1c1ff6d
2015-03-30 19:46:31 -07:00
Elliott Hughes
38a73c6a20 Add missing <string.h> include.
Change-Id: I31f5cd6fb4ff55d7cfe213f66955e3dbcbdff101
2015-01-28 11:47:21 -08:00
Kaspter Ju
15bd71f82f vold: fix potential socket leak
Change-Id: Icdb4500fc1e055b058974087e1e518c878dc6b22
Signed-off-by: Kaspter Ju <kaspter@gmail.com>
2013-07-02 12:04:09 -07:00
Nick Kralevich
3b20c39c90 Fix spelling.
Change-Id: I81debc5063716d7cbea060a0abb34c646d7cda93
2013-06-28 19:08:35 -07:00
Nick Kralevich
c51920c824 vold: Enable the SO_PASSCRED socket option
Ensure that sender credentials are available when we
receive a netlink message.

Change-Id: I48411205a8fbc1ebd29834f64028662d80f15995
2011-04-18 15:51:19 -07:00
San Mehat
97ac40e4e6 vold: Switch from LOG -> SLOG
Change-Id: I48ee8bd90b47f5845f069cdf4d1b8ba6ecdb1b39
Signed-off-by: San Mehat <san@google.com>
2010-03-25 08:02:28 -07:00
San Mehat
f1b736bc56 system: vold2: Initial skeleton for vold2.
Let there be light.

Signed-off-by: San Mehat <san@android.com>
2009-10-10 17:57:51 -07:00