LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-24-2014, 02:19 PM   #1
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Rep: Reputation: 21
Strange file permissions?


After extracting android-studio to my home directory, I found that the file ownership of its file hierarchy are like these.
Code:
ls -l
total 48
drwxrwxr-x  2 12275 5000  4096 May 24 10:06 bin
-rw-r--r--  1 12275 5000    14 Mar 18 16:42 build.txt
-rw-r--r--  1 12275 5000  1688 Mar 18 16:42 Install-Linux-tar.txt
drwxrwxr-x  5 12275 5000  4096 May 24 10:06 lib
drwxrwxr-x  2 12275 5000  4096 May 24 10:06 license
-rw-r--r--  1 12275 5000 11358 Mar 18 16:42 LICENSE.txt
-rw-r--r--  1 12275 5000   127 Mar 18 16:42 NOTICE.txt
drwxrwxr-x 23 12275 5000  4096 May 24 10:06 plugins
drwxrwxr-x  8 12275 5000  4096 May 24 10:06 sdk
drwxrwxr-x  8 root  root  4096 Mar 21 16:43 sdk2
What does 12275 5000 mean? I am also getting permission denied errors which obviously prevent files from being accessed by the IDE.

I was tempted to use chown to change the file permissions recursively to something more Debian-like.

Last edited by edbarx; 05-24-2014 at 02:21 PM.
 
Old 05-24-2014, 02:29 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
That means there is no corresponding user and group in your system.
 
Old 05-24-2014, 02:39 PM   #3
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
Actually, there are at least two users, myself as an unprivileged user and root.
 
Old 05-24-2014, 02:45 PM   #4
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Try cat /etc/passwd, is there an user with UID 5000?
 
Old 05-24-2014, 02:54 PM   #5
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
Code:
$ cat /etc/passwd | grep 5000
Didn't output anything.
 
Old 05-24-2014, 03:05 PM   #6
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
So that is the very reason you do not see user and see the UID instead. Same goes for GID.
 
Old 05-24-2014, 03:10 PM   #7
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
Should I use chown recursively to change the ownership of the files? I am on Debian Wheezy v7.5

Last edited by edbarx; 05-24-2014 at 03:11 PM.
 
Old 05-24-2014, 03:11 PM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Some distros start the UID at 500, some 1000

I'd just cat ( or less ) said passwd file, and look



you might want to do that in the old environment, to find the names, then get appropriate uid for new system

E.g.
Old system
Code:
cat /etc/{passwd,group} | grep -E "12275|5000"
Then switch out the numbers for names on new one
 
Old 05-24-2014, 03:15 PM   #9
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by edbarx View Post
Should I use chown recursively to change the ownership of the files? I am on Debian Wheezy v7.5
Personally I would investgate each file first,

But if they all have same pattern, then yes chown -R

See previous post to get right {u,g}id
 
Old 05-24-2014, 03:22 PM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
I would suggest checking on the Android lists.

It is possible that for the purpose of development there should be an android account used for this.

Alternatively, it is possible these files are supposed to be owned by the user doing development, and the only reason these got odd UID/GID assignments was that the files were untarred by root into the users home directory.

Normally, for files in the users account, the users account would be used to untar them - and thus get owned by the user. This is because tar uses --same-owner by default for root, which is useful for restoring from backup files produced by tar.
 
Old 05-24-2014, 03:29 PM   #11
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
The tgz pacakage archive I downloaded, is, I presume according to what I read a Slackware package. I used alien to convert it into a Debian .deb package. Then, used dpkg -i to install it. Oddly enough, the installed files were copied to /android-studio! So, I moved /android-studio to my home directory where there are less privileges.
 
Old 05-24-2014, 03:32 PM   #12
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
You know, I totaly missed the android bit.

Android uids are tracked differently

See

Code:
cat /data/system/packages.list
You need root.

becareful with chown -R

Some things in /data/data/org.package.foo/ may be symlinks to files in /data/app-lib
And must remain install:install
 
Old 05-24-2014, 03:40 PM   #13
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
I am on Debian Wheezy and there is no /data directory. I know that using chown recursively can ruin an entire installation. I know there is something wrong because, Debian does not install programs to the root directory. These headaches are because the package wasn't properly ported to Debian.

Last edited by edbarx; 05-24-2014 at 03:43 PM.
 
Old 05-24-2014, 03:48 PM   #14
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by edbarx View Post
I am on Debian Wheezy and there is no /data directory. I know that using chown recursively can ruin an entire installation.

Sorry, my fault I was reacting to Android ..

/data/ is a directory on android systems which holds all of the app configurations along with some 'system' configs etc..

Not entirely certain as to what you are doing


But as jpollard sugested you may just need to untar ( assuming a tar archive) as a standard user

In general it is a bad idea to use a root account to do anything, unless you 'have to’ and know why
 
Old 05-24-2014, 05:21 PM   #15
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
Actually, the solution was to change the file ownership recursively! After, the change I was able to create a new project and the full IDE loaded successfully. The only error that I am receiving is that libz.so.1 is not found although it exists.

EDIT:
For the benefit of anyone reading this thread, the solution for the missing libz.so.1 was to install lib32z1. Since, my computer's RAM is limited I opted out of installing the complete set of 32 bit libraries.

So, in short, the solution was to change the file ownership using chown recursively. Anyone using chown in this way, should be aware of the command's potential to destroy an entire installation, so, be aware of the danger and use with caution.


Other than that, enjoy your shiny apps using android-studio. As a last advice, don't use the device (mobile phone) emulator because it is very slow even on good hardware.

Last edited by edbarx; 05-25-2014 at 04:27 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange file permissions and ownership behavior xiztrn Linux - Newbie 6 12-22-2011 04:14 AM
strange (to me) behavior of file permissions when copying file warrob Linux - General 10 10-25-2009 05:13 AM
Strange File Permissions tuftystick Linux - Newbie 3 08-25-2009 01:00 PM
Strange file size and permissions under /usr/sbin phyrster Linux - Security 6 05-31-2006 08:26 AM
Strange file size and permissions in /usr/sbin phyrster Debian 2 05-28-2006 04:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration