• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Permission denied copying file?

Claghorn

Android Enthusiast
Feb 3, 2012
340
45
home.comcast.net
Is there some new mysterious security BS in android 4.3?

I've been setting up my new 2013 Nexus 7, and I'm trying to get rsync to work to backup the files Titanium Backup stashed on the sdcard, but it says "permission denied" when I try to copy them. I can't find any problems with any permissions:

Here I am in /storage/emulated/legacy/TitaniumBackup

and an ls -l looks like:

-rw-rw-r-- root sdcard_rw 8271 2013-07-28 19:48 xcxin.filexpert-20130728-234815.properties
-rw-rw-r-- root sdcard_rw 4029 2013-07-28 19:48 xcxin.filexpert-20130728-234815.tar.gz
-rw-rw-r-- root sdcard_rw 8308712 2013-07-28 19:48 xcxin.filexpert-9349ab6bc87f0af18def492f0576caba.apk.gz

It saves the .properties file OK, but can't save the .tar.gz file which has the exact same permissions.

Anyone know what is going on?

Am I going to have to make the rsync binary setuid root?
 
Where are you trying to copy the files to? Do you have permission to write there?

When I tried copying manually, I did indeed pick a directory where I could write, but rsync is just trying to read them and write them across the network, and it can read the .properties files, but gets permission denied on the .tar.gz files, so there is something magic about the .tar.gz files that doesn't show up in ls -l.
 
Upvote 0
Just to be clear - do you get the same failure copying the file manually with cp (whatever) or is it just rsync that's reporting the error?

I'm getting a bit concerned about all these "minor" glitches with 4.3. I also use rsync to backup both my Nexus 7 and 4 to a NAS and (as yet) haven't updated them from 4.2; until we get to the bottom of this (and a lot of other glitches) I don't think I'll be in a rush to do so :-(
 
Upvote 0
Bizarre. I've never had any issues with confused permissions on any *nix-based system including Android - until now. I do hope Google aren't fscking around with the underlying system to the point of sacrificing consistency and reliability on the altar of "security".

They can and do make the top-level Java-based more and more secure (but restrictive) with every build, but I'm not sure it's such a good idea to be too heavy handed with the already pretty solid Linux it sits on.
 
Upvote 0
Ok, and what happens if you do 'tar tzvf xcxin.filexpert-20130728-234815.tar.gz', do you get a file listing from the tarball?

I'm just trying to figure out if the permissions is on writing the file or reading it.

Also, what happens if you do something like 'touch /the/destination/directory/test.txt'

Just to see that you have write permissions there as you believe you do.
 
Upvote 0
There just ain't any read permission at all (even when I'm root, apparently). I did get mail from the titanium track folks saying they are aware of the problem and working on a fix, but I still don't know what the actual issue is. I guess there is some new ACL mechanism (or new use of existing mechanism) in android 4.3.

Actually in the latest titanium backup update, I can read the tar.gz files now, but I still can't read the apk.gz files.
 
Upvote 0
Ah, so it's something TB is doing when it writes the compressed file? This is even stranger, because I let my Nexus 4 update (wish I hadn't though!) and half expected a similar problem, but no.

Instead I found other broken things including the script manager I normally use to run things like rsync to save typing; I've used it since 1.5 on a variety of devices and it's never given a hint of trouble - until 4.3.

However when I ran the script manually it worked fine, no problem at all with the newly created TB backups, of which there were quite a few. The exact command line I use to backup the Nexus 4 to one of my NAS devices is "rsync -rtOvz --size-only /sdcard/ 192.168.1.21::backup/Nexus4/" but I doubt it makes any difference for the purpose of this discussion. The one on the Nexus 7 is identical apart from the destination directory.
 
Upvote 0
It isn't the only weird error I've seen. I tried to rsync some files from my computer to my Nexus, and rsync complains that it can't set the time on the file after it copies it (it did at least complete the copy, but couldn't reset the time to the original time from the host machine).

I'm sure there must be something "new and improved" going on in 4.3, I just wish I could find a hint about what it was :). I'll be interested to see if my old Nexus 7 starts getting the same problems when I finally get the 4.3 update.
 
Upvote 0
I've had various time synchronisation issues when using rsync on Android even back in the 2.1 days; I never did get to the erm... root... of the problem.

My quick and dirty work-around is the "--size-only" option to prevent the same unchanged files from being copied over and over again because of failures to match timestamps.

I never have the problem with real Linux systems, only Android.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones