Add -Z option to ls and ps for displaying security contexts.
Modify id to display security context.
Add new SELinux commands: chcon, getenforce, getsebool, load_policy, restorecon, runcon, setenforce, setsebool.
Change-Id: Ia20941be4a6cd706fe392fed6e38a37d880ec5f1
When the chown program fails it prints out an error message
and is describing itself as chmod. This has been corrected.
Change-Id: I2c489975f09343bdf66acbf7df6e7183c2daff78
Signed-off-by: christian bejram <christian.bejram@stericsson.com>
hd would error out on files that were not a multiple of its read
buffer size (4096). For example:
Read error on init.rc, offset 17040 len 4096, No such file or directory
The fix is to stop reading on EOF instead of treating it as an
error.
Signed-off-by: Scott Anderson <saa@google.com>
(cherry picked from commit a9fac4155f)
Change-Id: Ib2af725fc39e96c2f81559f61979d451604d4817
This command outputs the MD5 for specified files. The output is
in the same form as the md5sum command on Linux.
Change-Id: Ie0e6faf678469ac886bba8b46d98c0e54976a1ed
Signed-off-by: Scott Anderson <saa@google.com>
Adds a field to the non-long version of ls that tells what type of file
it is (i.e., regular, directory, link, fifo, etc).
This is useful for scripts that don't have direct filesystem access.
Change-Id: I54a327390f6ed403acb13c824f62ba9594ba320d
This fixes bug http://b.android.com/18419, which complains about a bogus
error check in the mount command (it also was wrong in the umount command)
and also asks for the mount command to support more than one loopback
device, as mentioned in the FIXME comments in mount.c. This required some
corresponding changes to umount.c
Change-Id: Ib796c70926395e61557e487bad64984d3295d5f3
Fixed a bug printing the event value when using labels.
Stop trying to print the available codes for EV_SYN because
we cannot actually query them. EVIOCGBIT(0, size) is a special
case that returns the set of events that are supported, and
EV_SYN == 0.
Change-Id: Iea086ba24300ca0815e4814a3bc5ff60756612c2
Added -l argument to print labels for event types, codes and values.
Added -i argument to print all device info.
Added support for printing input properties.
Change-Id: I3cacb716dbc38f50217b9dfc24ba44d08f352603
I wrote this to test my fix to support utime(2) system calls in the
sdcard fuse filesystem for stingray, and decided to finish sprucing
it up and make it part of toolbox. In an effort to keep it small,
it doesn't accept dates a la touch, but just a time_t value.
Change-Id: I5dd011cd2e34d0cc605d6f40e46b96a8c949f194
Ext4 filesystems like to be unmounted before rebooting. The Android system
doesn't have a traditional Linux init setup, and shutting down the system
was not much more than calling sync(2) and reboot(2). This adds a new
function to libcutils called android_reboot(). By default, it calls sync()
and then remounts all writable filesystems as read-only and marks them clean.
There is a flag parameter in which the caller can ask for sync() not to be
called, or to not remount the filesystems as read-only. Then it will call
reboot(2) as directed by the other parameters. This change also updates
adb, init and toolbox to call the new android_reboot() function.
Fixes bugs 3350709 and 3495575.
Change-Id: I16d71ffce3134310d7a260f61ec6f4dd204124a7
getprop used to output a colon after the property name like:
[property.name]: [property.value]
Add back the colon that was missing, because
com.android.ddmlib.GetPropReceiver's regex expects it. Without
the colon, the GetPropReceiver doesn't parse the device's
properties causing CTS to not recognize the device.
Change-Id: I9bef5ab2b310c831c49c8c51cae7f129167c2dc5
This patch also factors out the dynarray_t/strlist_t code
from ls.c and moves it to dynarray.[hc].
Change-Id: Ifae2b364d7c2733aad5551ad3c78ae72f8ac31f4
The first field in /proc/uptime is bootbased time, not monotonic
time. If the kernel tracks bootbased time correctly, it counts
elapsed run time as well as sleep time, which is the same as the
elapsed time in the android alarm driver, and sleep time is
always returned as 0.
Use clock_gettime(CLOCK_MONOTONIC) instead, which will return
elapsed run time not counting sleep time on all platforms.
Change-Id: I28a22e8c93d78f62666ee8c877c7c6718a2b640a
Merge commit 'f1fd5eb8cca9f1096c4d0de5abbbd2b264fd1b9e'
* commit 'f1fd5eb8cca9f1096c4d0de5abbbd2b264fd1b9e':
netstat should include /proc/net/tcp6 and /proc/net/udp6 data
Merge commit '2f7b72f9e8d06c80957cdf384d23d3bf5bd5ce5c' into gingerbread-plus-aosp
* commit '2f7b72f9e8d06c80957cdf384d23d3bf5bd5ce5c':
netstat should include /proc/net/tcp6 and /proc/net/udp6 data
Merge commit '09dd3e57b920c8f65cb486313a4c0f35b8cb9f46' into gingerbread-plus-aosp
* commit '09dd3e57b920c8f65cb486313a4c0f35b8cb9f46':
make df more readable
Merge commit '53308d4cd5c4414402e979a6771f7ef3b35f5c2f' into gingerbread-plus-aosp
* commit '53308d4cd5c4414402e979a6771f7ef3b35f5c2f':
Correct copyright header for uptime and NOTICE
Basic "list open files" command.
Supports reading all processes for their "exe", "cwd", "root", and "fd"
entries.
Change-Id: I2e2f0911dd65a1993aa1ce9f51222bf264a9d68d
Merge commit '869cc685b171c5c0c1efbad5df693cfaebe0af43'
* commit '869cc685b171c5c0c1efbad5df693cfaebe0af43':
fix insmod reading more than one module parameter
File size was cast to a signed integer which displayed files over 2GB as
negative sizes on devices. Use a long long for printing instead which
matches the stat struct.
Change-Id: I0ec07f33716bb4c2e5d120633ed435f637238f46
Sorts file and directory names properly in 'ls'
+ accept group flags (e.g. '-ld' instead of '-l -d')
+ accept flags in any position on the command line (e.g. 'ls foo -l' works)
Change-Id: Idc24a69ae31fe0c13726d39892357ac89a8830db
Previous behaviour was to set route's network mask as 255.255.255.255
Setting a destination network with netmask /32 blocks the connections
just to the specified host. 0.0.0.0/32 defines the exact IPv4 address
0.0.0.0 and not the whole IPv4 hosts range.
This patch allows traffic to any network, setting a 0.0.0.0/0 route.
Change-Id: I1665f2fac52526337bb2c48e3b09564d9da448e7
it seems wrong to put '/0' after reading one argument
if we are passing more than one module parameters, they are not being propogated
to the kernel properly.
Second module parameters onwards are simply being ignored by kernel
since insmod incorrectly put '/0' after reading first module parameter
Change-Id: I54283eb30a66a83d5c619ffb1fb174ccf5fdcaf7
Prints elapsed real time since boot, as well as idle time and sleep time.
Change-Id: I97f482d6087e9f802d74e91147bf767e6b2d4f42
Signed-off-by: Mike Lockwood <lockwood@android.com>
Prints elapsed real time since boot, as well as idle time and sleep time.
Change-Id: I97f482d6087e9f802d74e91147bf767e6b2d4f42
Signed-off-by: Mike Lockwood <lockwood@android.com>
Added the "total" line, which makes it easy to answer questions like,
"how the hell much space am I wasting on /data/dalvik-cache?".
Also fixed the -s filename output, which was showing mostly-full paths
when a simple filename was called for.
This may not be useful, and may actually be misleading since yaffs2
doesn't track the blocks used for each file (it just divides the length
down by 512). I'm submitting it because yaffs2 isn't the only
filesystem we'll ever use.
I also changed some sprintf to snprintf, mostly out of paranoid habit.