summaryrefslogtreecommitdiffstats
path: root/adb/file_sync_service.c
Commit message (Collapse)AuthorAgeFilesLines
* adb: set O_CLOEXEC on lots of file descriptorsNick Kralevich2014-07-181-4/+4
| | | | | | | | | Too many leaking FDs. Fixes bug: https://code.google.com/p/android/issues/detail?id=65857 (and more) Change-Id: I67d8683244e54288a8105f6f65ee40abe2378d7e
* Added support for vendor partition to adbDaniel Rosenberg2014-07-021-2/+7
| | | | | | | | | Remount will now remount the vendor partition as well, if it exists. Sync will also allow you to sync vendor, and will include it by default if it exists. Change-Id: Iea1e8212f445e96233438a8d8a9d3266bf3d6557 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* adb: Don't unlink special files on sync failure.JP Abgrall2014-03-071-5/+8
| | | | | | | | adb push some_disk_image /dev/block/mmcblk0p9 should not unlink the dev just because adb was ctrl-c'd. Change-Id: I1b6669e8dba1f80fc1438b8deb618180b7e9a1b2 Signed-off-by: JP Abgrall <jpa@google.com>
* adb: Don't clobber block devices during pushJP Abgrall2014-03-071-3/+6
| | | | | | | | | | | | | In the past, an adb push would ALWAYS unlink the target path. Now, we only links and regular files (and links). This allows the following to work: adb shell ls -l /dev/block/mmcblk0p8 # brw------- root root 179, 8 2013-11-28 07:43 mmcblk0p8 adb push n7.jpa.mda.post_jb_encryption.raw /dev/block/mmcblk0p8 Bug: 11984121 Change-Id: I982c7a1cd87986621f2bebdcb41c4e281f67f772
* Convert all selinux_android_restorecon and _setfilecon calls to new API.Stephen Smalley2014-02-071-2/+2
| | | | | | | | | | | libselinux selinux_android_restorecon API is changing to the more general interface with flags and dropping the older variants. Also get rid of the old, no longer used selinux_android_setfilecon API and rename selinux_android_setfilecon2 to it as it is the only API in use. Change-Id: I1e71ec398ccdc24cac4ec76f1b858d0f680f4925 Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* Fix "adb push /sdcard/filename"Nick Kralevich2014-01-171-13/+13
| | | | | | | | | | | | | | | Don't assume that calling chown(filename, getuid(), getgid()) will always succeed. In the case of /sdcard, a file you create will be owned by root, so the chown call will fail. Instead, use uid=gid=-1 so that the chown call is truly a no-op. Ignore the results of calling chmod. Again, for /sdcard, the chmod call will never succeed, because the file isn't owned by the shell user. Bug: 12441485 Change-Id: I11eaf1d6f6049c1158afc29754fbb7af2baf2c78
* adb: configure /system file permission with fs_configLiang Cheng2014-01-021-9/+64
| | | | | | | | | | | | | | | | | adbd changes the permissions of files uploaded by copying owner's permission to group and other. This causes kernel load failure if any changes are made to kernel modules followed by ``adb push'' or ``adb sync'' because file mode 644 would become 666. The change uses fs_config to get the target mode of files. In addition, the SELinux file label is set incorrectly on synced files. Set the label properly. Change-Id: I354db848f39adfbf189d7e8d3b028e8d763c772f Signed-off-by: Liang Cheng <licheng@nvidia.com> Bug: 12264775
* Fix a bunch of small system/core bugs.Elliott Hughes2013-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | | Missing frees in: adb/file_sync_client.c fastboot/fastboot.c libsparse/output_file.c Missing closedirs in: adb/file_sync_service.c cpio/mkbootfs.c libcutils/dir_hash.c Potential buffer overrun in: gpttool/gpttool.c Incorrect NULL check in: libsparse/backed_block.c Bug: https://code.google.com/p/android/issues/detail?id=61564 Change-Id: If97838a9e73a77aef7f416c31c237ce1fca4ce21
* adb: fix subprocess exit handling, oom adjust fixes, extra debugging.JP Abgrall2011-03-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add support for correctly handling subprocess termination in shell service (b/3400254 b/3482112 b/2249397) - have a waitpid() track the subprocess, then notify the fdevent via a socket - force an eof on the pty master in fdevent's new subproc handler. - modify fdevent to force-read the pty after an exit. * Migrate the "shell:blabla" handling to "#if !ADB_HOST" sections, where it belongs. * Fix the race around OOM adjusting. - Do it in the child before exec() instead of the in the parent as the child could already have started or not (no /proc/pid/... yet). * Allow for multi-threaded D() invocations to not clobber each other. - Allow locks across object files. - Add lock within D() - Make sure sysdesp init (mutex init also) is called early. * Add some missing close(fd) calls - Match similar existing practices near dup2() * Add extra D() invocations related to FD handling. * Warn about using debugging as stderr/stdout is used for protocol. * Fix some errno handling and make D() correctly handle it. * Add new adb trace_mask: services. * Make fdevent_loop's handle BADFDs more gracefully (could occur some subproc closed its pts explicitely). * Remove obsolete commandline args reported in help. (b/3509092) Change-Id: I928287fdf4f1a86777e22ce105f9581685f46e35
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+412
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-412/+0
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-3/+3
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+412