Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Failed to chmod(/data/xprivacy): libcore.io.ErrnoException: chmod failed: ENOENT (No such file or directory) #1437

Closed
nikonakoneko opened this issue Feb 23, 2014 · 12 comments
Labels

Comments

@nikonakoneko
Copy link

I installed XPrivacy on my HTC One X running KitKat / CM 11 with NOGAPPS ( http://forum.xda-developers.com/showthread.php?t=1715375 ). After activation & reboot, when I launch XPrivacy, the app shows up for a few seconds and then turns all black.

/data/xprivacy doesn't exist, and creating it manually doesn't solve the issue at all.

XPrivacy version 1.99.53.
CyanogenMod-11-20140220-NIGHTLY-endeavoru (Android 4.4.2)
logcat

@M66B
Copy link
Owner

M66B commented Feb 23, 2014

Is this with the latest XPrivacy version?

@M66B M66B added bug and removed bug labels Feb 23, 2014
@M66B
Copy link
Owner

M66B commented Feb 23, 2014

I/Xposed  (  156): -----------------
I/Xposed  (  156): 23 févr. 2014 16:33:39 UTC
I/Xposed  (  156): Loading Xposed v42 (for Zygote)...
I/Xposed  (  156): Loading modules from /data/app/biz.bokhorst.xprivacy-1.apk
I/Xposed  (  156):   Loading class biz.bokhorst.xprivacy.XPrivacy
I/XPrivacy(  156): Load /data/app/biz.bokhorst.xprivacy-1.apk
W/XPrivacy(  156): Changed permission path=/data/xprivacy mode=770 uid=1000 gid=1000
W/FileUtils(  156): Failed to chmod(/data/xprivacy): libcore.io.ErrnoException: chmod failed: ENOENT (No such file or directory)

For some reason the folder /data/xprivacy could not be created.
In any case delete any existing file/folder and retry with the latest XPrivacy version:

rm -R /data/xprivacy

@M66B
Copy link
Owner

M66B commented Feb 23, 2014

Maybe the permissions of the top folder are the problem, so please post the output of:

ls -al | grep data

Mine is like this:

drwxrwx--x system   system            2014-02-23 20:16 data

Maybe some weird SELinux rule is causing this, so you might want to try with SELinux in permissive mode (there is an app in the Play store that can change this).

@nikonakoneko
Copy link
Author

# ls /data/xprivacy                                         
/data/xprivacy: No such file or directory
# ls / -Zla | grep data                                         
drwxrwx--x system   system            u:object_r:system_data_file:s0 data
# getenforce                                                  
Permissive
# ps -Z | grep xprivacy                                       
u:r:untrusted_app:s0           u0_a122   14979 156   biz.bokhorst.xprivacy
# cat /data/misc/audit/audit.log |  grep xprivacy             
type=1400 msg=audit(1393175384.770:9): avc:  denied  { create } for  pid=156 comm="zygote" name="xprivacy" scontext=u:r:zygote:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir

M66B pushed a commit that referenced this issue Feb 23, 2014
@M66B
Copy link
Owner

M66B commented Feb 23, 2014

Thanks for the outputs!

The database (folder) is created by Zygote, so the security context of Zygote is what counts.
For me the security context is:

u:r:init:s0                    root      182   1     zygote

Could you please try this version, where I have moved the database to /data/system, which seems to be a better location anyway then a private folder: http://d-h.st/F12

@nikonakoneko
Copy link
Author

This version seems to starts and run fine

Maybe unrelated issue: in the fake data settings in the location field which defaults to "Christmas Island", I can input any location name (New York ; France ; Tokyo, Japan ; …) when I tap the search button, I get a toast saying "unknow" and logcat shows:

W/XPrivacy( 2883): java.io.IOException: unknown uid=10129
W/XPrivacy( 2883): java.io.IOException: unknown
W/XPrivacy( 2883):  at android.location.Geocoder.getFromLocationName(Geocoder.java:178)
W/XPrivacy( 2883):  at biz.bokhorst.xprivacy.SettingsDialog$15.onClick(SettingsDialog.java:361)
W/XPrivacy( 2883):  at android.view.View.performClick(View.java:4445)
W/XPrivacy( 2883):  at android.view.View$PerformClick.run(View.java:18429)
W/XPrivacy( 2883):  at android.os.Handler.handleCallback(Handler.java:733)
W/XPrivacy( 2883):  at android.os.Handler.dispatchMessage(Handler.java:95)
W/XPrivacy( 2883):  at android.os.Looper.loop(Looper.java:136)
W/XPrivacy( 2883):  at android.app.ActivityThread.main(ActivityThread.java:5081)
W/XPrivacy( 2883):  at java.lang.reflect.Method.invokeNative(Native Method)
W/XPrivacy( 2883):  at java.lang.reflect.Method.invoke(Method.java:515)
W/XPrivacy( 2883):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:781)
W/XPrivacy( 2883):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
W/XPrivacy( 2883):  at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:126)
W/XPrivacy( 2883):  at dalvik.system.NativeStart.main(Native Method)

M66B pushed a commit that referenced this issue Feb 24, 2014
@M66B
Copy link
Owner

M66B commented Feb 24, 2014

Thanks for reporting back!

The next version will have the database in a sub folder of /data/system, so you need to move the databases manually when upgrading.

The Geocoder message most probably means that there are parts of Google components are not installed / not running.

@M66B M66B closed this as completed Feb 24, 2014
@M66B
Copy link
Owner

M66B commented Feb 24, 2014

Since I think it is not very clean to put the database files in /data/system between the other system files, I like to put the database files in the folder /data/system/xprivacy. Since you had problems with creating folders, I like you to try this version: http://d-h.st/3KF, which will attempt to make the sub folder in /data/system. Please note that the old databases will not be moved, so you might want to move them after the test. Could you please test if this works?

@nikonakoneko
Copy link
Author

Doesn't work (SELinux set in permissive mode with SELinuxModeChanger)

I/Xposed  (  155): Loading Xposed v42 (for Zygote)...
I/Xposed  (  155): Loading modules from /data/app/biz.bokhorst.xprivacy-1.apk
I/Xposed  (  155):   Loading class biz.bokhorst.xprivacy.XPrivacy
I/XPrivacy(  155): Load /data/app/biz.bokhorst.xprivacy-1.apk
E/XPrivacy(  155): Does not exist folder=/data/system/xprivacy
W/XPrivacy(  155): Changed permission path=/data/system/xprivacy mode=770 uid=1000 gid=1000
W/FileUtils(  155): Failed to chmod(/data/system/xprivacy): libcore.io.ErrnoException: chmod failed: ENOENT (No such file or directory)
# ls /data -Zl | grep 'system$'                              
drwxrwxr-x system   system            u:object_r:system_data_file:s0 system
 # cat /data/misc/audit/audit.log |  grep xprivacy 
type=1400 msg=audit(1393346181.695:9): avc:  denied  { create } for  pid=156 comm="zygote" name="xprivacy" scontext=u:r:zygote:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir

@M66B M66B reopened this Feb 25, 2014
M66B pushed a commit that referenced this issue Feb 25, 2014
@M66B
Copy link
Owner

M66B commented Feb 25, 2014

Could you please try if this version can create the folder:
https://github.com/M66B/XPrivacy/releases/tag/1.99.55

It is unfortunate that I cannot reproduce this issue myself.
What has been changed is that no longer Zygote will create the folder, but the system server.

@nikonakoneko
Copy link
Author

OK, folder and db are created and the app starts fine with SELinux in enforcing mode:

W/XPrivacy(  593): Database folder=/data/system/xprivacy
W/XPrivacy(  593): Changed permission path=/data/system/xprivacy mode=770 uid=1000 gid=1000
W/XPrivacy(  593): Changed permission path=/data/system/xprivacy/xprivacy.db mode=770 uid=1000 gid=1000
W/XPrivacy(  593): Changed permission path=/data/system/xprivacy/xprivacy.db-journal mode=770 uid=1000 gid=1000
W/XPrivacy(  593): Service registered name=xprivacy288

I see some warnings in the log, but maybe it's just because I do not have the gapps:

W/PackageManager(  593): Unknown permission biz.bokhorst.xprivacy.pro.CHECK in package biz.bokhorst.xprivacy
[…]
I/dalvikvm( 2162): Failed resolving Lbiz/bokhorst/xprivacy/XPrivacy; interface 1134 'Lde/robv/android/xposed/IXposedHookLoadPackage;'
W/dalvikvm( 2162): Link of class 'Lbiz/bokhorst/xprivacy/XPrivacy;' failed
I/dalvikvm( 2162): Could not find method biz.bokhorst.xprivacy.XPrivacy.hookAll, referenced from method biz.bokhorst.xprivacy.PrivacyService.register
W/dalvikvm( 2162): VFY: unable to resolve static method 7148: Lbiz/bokhorst/xprivacy/XPrivacy;.hookAll (Ljava/util/List;Ljava/lang/String;)V
D/dalvikvm( 2162): VFY: replacing opcode 0x71 at 0x005d
W/XPrivacy( 2162): UI started

@M66B
Copy link
Owner

M66B commented Feb 25, 2014

Thanks for reporting back!
These warnings are nothing to worry about.

@M66B M66B closed this as completed Feb 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants