suid位,sgid位及setuid(),setgid()函数实测情况
2015-06-24 13:21
381 查看
suid 标识位,可执行程序文件以所有者的身份被执行
1039进程sh
root@generic:/system/bin # cat /proc/1039/status
cat /proc/1039/status
Name: sh
State: S (sleeping)
Tgid: 1039
Pid: 1039
PPid: 1033
TracerPid: 0
Uid: 2000 2000 2000 2000
Gid: 2000 2000 2000 2000
755情况
root@generic:/system/bin # ls -all | grep test_while
ls -all | grep test_while
-rwxr-xr-x root root 109420 2015-06-23 22:37 test_while
root@generic:/system/bin # ps | grep test_while
ps | grep test_while
shell 1042 1039 272 68 00000000 0000823c R ./test_while
root@generic:/system/bin # cat /proc/1042/status
cat /proc/1042/status
Name: test_while
State: R (running)
Tgid: 1042
Pid: 1042
PPid: 1039
TracerPid: 0
Uid: 2000 2000 2000 2000
Gid: 2000 2000 2000 2000
4755情况
root@generic:/system/bin # ls -all | grep test_while
ls -all | grep test_while
-rwsr-xr-x root root 109420 2015-06-23 22:37 test_while
root@generic:/system/bin # ps | grep test_while
ps | grep test_while
root 1073 1039 272 68 00000000 0000823c R ./test_while
root@generic:/system/bin # cat /proc/1073/status
cat /proc/1073/status
Name: test_while
State: R (running)
Tgid: 1073
Pid: 1073
PPid: 1039
TracerPid: 0
Uid: 2000 0 0 0
Gid: 2000 2000 2000 2000
6755情况
root@generic:/system/bin # ls -all | grep test_while
ls -all | grep test_while
-rwsr-sr-x root root 109420 2015-06-23 22:37 test_while
root@generic:/system/bin # ps | grep test_while
ps | grep test_while
root 1085 1039 272 68 00000000 0000823c R ./test_while
root@generic:/system/bin # cat /proc/1085/status
cat /proc/1085/status
Name: test_while
State: R (running)
Tgid: 1085
Pid: 1085
PPid: 1039
TracerPid: 0
Uid: 2000 0 0 0
Gid: 2000 0 0 0
调用setuid(0)情况
root@generic:/system/bin # cat /proc/1229/status
cat /proc/1229/status
Name: test_while_setuid
State: R (running)
Tgid: 1229
Pid: 1229
PPid: 1039
TracerPid: 0
Uid: 0 0 0 0
Gid: 2000 0 0 0
调用setuid(0),setgid(0) 情况
root@generic:/system/bin # cat /proc/1260/status
cat /proc/1260/status
Name: test_while_setu
State: R (running)
Tgid: 1260
Pid: 1260
PPid: 1039
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
1039进程sh
root@generic:/system/bin # cat /proc/1039/status
cat /proc/1039/status
Name: sh
State: S (sleeping)
Tgid: 1039
Pid: 1039
PPid: 1033
TracerPid: 0
Uid: 2000 2000 2000 2000
Gid: 2000 2000 2000 2000
755情况
root@generic:/system/bin # ls -all | grep test_while
ls -all | grep test_while
-rwxr-xr-x root root 109420 2015-06-23 22:37 test_while
root@generic:/system/bin # ps | grep test_while
ps | grep test_while
shell 1042 1039 272 68 00000000 0000823c R ./test_while
root@generic:/system/bin # cat /proc/1042/status
cat /proc/1042/status
Name: test_while
State: R (running)
Tgid: 1042
Pid: 1042
PPid: 1039
TracerPid: 0
Uid: 2000 2000 2000 2000
Gid: 2000 2000 2000 2000
4755情况
root@generic:/system/bin # ls -all | grep test_while
ls -all | grep test_while
-rwsr-xr-x root root 109420 2015-06-23 22:37 test_while
root@generic:/system/bin # ps | grep test_while
ps | grep test_while
root 1073 1039 272 68 00000000 0000823c R ./test_while
root@generic:/system/bin # cat /proc/1073/status
cat /proc/1073/status
Name: test_while
State: R (running)
Tgid: 1073
Pid: 1073
PPid: 1039
TracerPid: 0
Uid: 2000 0 0 0
Gid: 2000 2000 2000 2000
6755情况
root@generic:/system/bin # ls -all | grep test_while
ls -all | grep test_while
-rwsr-sr-x root root 109420 2015-06-23 22:37 test_while
root@generic:/system/bin # ps | grep test_while
ps | grep test_while
root 1085 1039 272 68 00000000 0000823c R ./test_while
root@generic:/system/bin # cat /proc/1085/status
cat /proc/1085/status
Name: test_while
State: R (running)
Tgid: 1085
Pid: 1085
PPid: 1039
TracerPid: 0
Uid: 2000 0 0 0
Gid: 2000 0 0 0
调用setuid(0)情况
root@generic:/system/bin # cat /proc/1229/status
cat /proc/1229/status
Name: test_while_setuid
State: R (running)
Tgid: 1229
Pid: 1229
PPid: 1039
TracerPid: 0
Uid: 0 0 0 0
Gid: 2000 0 0 0
调用setuid(0),setgid(0) 情况
root@generic:/system/bin # cat /proc/1260/status
cat /proc/1260/status
Name: test_while_setu
State: R (running)
Tgid: 1260
Pid: 1260
PPid: 1039
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
相关文章推荐
- XCUIElementType API
- UITableView的上下滑动与自己添加的手势冲突
- poj2778 DNA Sequence(AC自动机+矩阵快速幂 )
- 比较height(),innerHeight(),outerHeight()和outerHeight(true)
- android.util.AndroidRuntimeException: requestFeature() must be called before adding content
- UIBezierPath 的理解 及使用
- Android API Guides - Activities - Fragments
- The type org.xmlpull.v1.XmlPullParser cannot be resolved. It is indirectly referenced from required
- GUI(主)线程与子线程之间的通信
- iOS-Core-Animation-Advanced-Techniques(七)
- iOS-Core-Animation-Advanced-Techniques(六)
- iOS-Core-Animation-Advanced-Techniques(三)
- iOS-Core-Animation-Advanced-Techniques(二)
- iOS-Core-Animation-Advanced-Techniques(一)
- UITableViewCell点击时背景颜色
- 单据UI界面设计开发
- UITable里的分割线
- SharePoint 2013 引发类型为“System.ArgumentException”的异常。 参数名: encodedValue
- iOS 9: UIStackView入门
- 如何让UILabel显示多行,并在结尾显示省略号