1. Are you ready for the Galaxy S20? Here is everything we know so far!

[International / GSM] Advice on File Permissions for Root

Discussion in 'Android Devices' started by jlt1112, Apr 15, 2012.

  1. jlt1112

    jlt1112 Newbie
    Thread Starter

    I have a GSM SGN running stock ICS 4.04. Previously, unlocked the bootloader as verified by the bootloader screen. Used Wug
     


    scary alien likes this.

    1. Download the Forums for Android™ app!


      Download

       
  2. scary alien

    scary alien not really so scary
    VIP Member

    jlt1112,

    Welcome to the AndroidForums! (and thank you for the kind words :).

    Apologies for not seeing your thread until this morning...but I think I have a solution for you.

    It appears to me that the su binary that is located in your /sbin directory and that binary is being used (first) for trying to grant your device root access.

    /sbin/su is a non-standard location for root (ChainsDD is a little puzzled as to why folks have proliferated the su binary there for many devices).

    The good news is that you do have a good, working, properly secured su binary where it belongs--in /system/bin/su.

    As you've already discovered, an adb shell and an "su" will grant you proper root access for the adb shell.

    What I would do if I were you would be to rename or delete the /sbin/su file and then see if you start getting root / Superuser permissions properly (I don't think a reboot is necessary, but if it doesn't work, then try reboot after you've deleted or renamed /sbin/su file).

    Also, for your CWM flashing issues, try running my Android Root Toolkit app's "Make Recovery Stick" function (see the download link in my signature)--after you've verified that you properly have root, of course ;) :).

    Cheers and let me know if you have any questions.

    -SA
     
    jlt1112 likes this.
  3. jlt1112

    jlt1112 Newbie
    Thread Starter

    SA,

    Many thanks for your time. Understand exactly what you want me to do. In ADB Shell, I am able to get into the sbin directory. However, not able to delete its su file. Used "adb shell rm -r/sbin/su" (and su.app) command with no luck. Also, I could not find an adb command for listing files in the directory.

    Since I came from the era of DOS, tried to get into the "Galaxy Nexus" drive as shown on file explorer. Was hoping to get at it from there. No luck. Appreciate the time you have taken.
     
  4. scary alien

    scary alien not really so scary
    VIP Member

    Ah, no problem jlt1112 (I forgot that you'll need to remount the root filesystem as read-write).

    Here's what you'll need:

    c:\android-sdk-windows\platform-tools> adb shell
    $ su
    # cd /sbin
    # mount -o remount,rw -t rootfs rootfs /
    # mv su old-stupid-su

    After that, you should be good-to-go :).

    Oh, and the list command you are looking for is ls or ls -a -l or a derivation thereof :p.

    Lemme know!

    Thanks,
    -SA
     
  5. jlt1112

    jlt1112 Newbie
    Thread Starter

    SA,

    Did fine until the rename point ... no file existed. I tried to condense what Root Checker was telling me; as a result I may have left out important info. So here is the full text:


    System File Properties for Root Access:
    Alternative Location
    Check Command: ls -l /sbin/su:
    Result: /sbin/su: Permission denied
    Analysis: File system permissions restricted and denied access.

    Standard Location
    Check Command: ls -l /system/bin/su:
    Result: -rwsr-xr-x root root 22228 2012-04-14 18:16 su
    Analysis: Setuid attribute present and root user ownership present. Root access is correctly configured for this file! Executing this file can grant root access!

    Alternative Location
    Check Command: ls -l /system/xbin/sudo:
    Result: /system/xbin/sudo: No such file or directory
    Analysis: File /system/xbin/sudo does not exist.

    Standard Location
    Check Command: ls -l /system/xbin/su:
    Result: /system/xbin/su: No such file or directory
    Analysis: File /system/xbin/su does not exist.

    Root User ID and Group ID Status:
    SU binary not found or not operating properly

    System Environment PATH: /sbin /vendor/bin /system/sbin /system/bin /system/xbin

    ADB Shell Default User:
    ADB shell setting for standard access, stored in default.prop, is configured as: shell (non root) user - ro.secure=1

    I appreciate the time you have taken; looks like I need to study more to be effective. If you don't see anything in this, let me know. I will stop and do some studying before I trouble you anymore.
     
  6. scary alien

    scary alien not really so scary
    VIP Member

    Hmm, well, I still stand by my thought that it's /sbin/su that gumming-up the works...

    (sorry for the delay in replying...busy afternoon...)

    Did the remounting of /system work okay? (you can check with the "mount" command and see that the output for the root file system shows:

    rootfs / rootfs rw,relatime 0 0

    or something very similar.

    Then, if you type this:

    ls -a -l /sbin/su

    and

    ls -d -l /sbin

    what does the output show?

    I'm thinking that /sbin is set to not allow you to rename files in that directory.

    I'll set my phone up like yours when you tell me the permissions for the /sbin directory and see what it takes to nuke it ;) :).

    Heading home in a bit where I'll be able to help you better.

    Cheers!
     
  7. jlt1112

    jlt1112 Newbie
    Thread Starter

    SA,

    I did what you asked; found that the directory did not mount - when using a "space" between the commands and modifiers (mount -o), I got a return of usage info vice rootfs / rootfs rw,relatime 0 0. I tried not using a space before the options and got a mount not found.

    Also, I got files not found for the listing commands (assume that because the directory did not mount.

    Greatly appreciate your time; don't feel in a rush for my issue.

    Best wishes - jlt1112
     
  8. scary alien

    scary alien not really so scary
    VIP Member

    Now that I'm home, I can do a copy and paste of stuff.

    Here's what I did on my phone from my PC (don't worry about the fact that I'm already root (i.e., initial # instead of $) or the missing /sbin/su file that I don't have):

    Code (Text):
    1. C:\Users\Scary Alien>
    2. C:\Users\Scary Alien>[COLOR="Blue"][B]adb shell[/B][/COLOR]
    3. root@android:/ # [COLOR="Blue"][B]su[/B][/COLOR]
    4. su
    5. root@android:/ # [COLOR="blue"][B]ls -a -l -d /sbin[/B][/COLOR]
    6. ls -a -l -d /sbin
    7. [COLOR="Red"]drwxrwxr-x system  system   2012-04-16 19:46 sbin[/COLOR]
    8. root@android:/ # [COLOR="blue"][B]ls -a -l /sbin/su[/B][/COLOR]
    9. ls -a -l /sbin/su
    10. /sbin/su: No such file or directory
    11. 1|root@android:/ # [COLOR="blue"][B]mount[/B][/COLOR]
    12. mount
    13. [COLOR="red"]rootfs / rootfs ro,relatime 0 0[/COLOR]
    14. [COLOR="Purple"]<snip>[/COLOR]
    15. root@android:/ # [COLOR="blue"][B]mount -o remount,rw -t rootfs rootfs /[/B][/COLOR]
    16. mount -o remount,rw -t rootfs rootfs /
    17. root@android:/ # [COLOR="blue"][B]mount[/B][/COLOR]
    18. mount
    19. [COLOR="red"]rootfs / rootfs [COLOR="Blue"]rw[/COLOR],relatime 0 0[/COLOR]
    20. [COLOR="purple"]<snip>[/COLOR]
    21. root@android:/ # [COLOR="blue"][B]cd /sbin[/B][/COLOR]
    22. cd /sbin
    23. root@android:/sbin # [COLOR="blue"][B]mv su old-stupid-su[/B][/COLOR]
    24. mv su old-stupid-su
    25. failed on 'su' - No such file or directory
    26. 255|root@android:/sbin #
    27.  
    See if this helps...if not, we'll figure something else out ;) :).

    Cheers!
     
  9. jlt1112

    jlt1112 Newbie
    Thread Starter

    SA,

    I was able to successfully list the following: system/bin/su and the following directories: /sbin /vendor/bin /system/sbin /system/bin /system/xbin. I was bit able to find su in any of the other directories than one it is suppose to be in.

    I didn't go any further since I couldn't find any more "SU's".

    Should I delete that file and try to root the phone again? If so given I am on ICS 4.04, which rooting strategy should I use?

    Again many thanks for your time!
     
  10. scary alien

    scary alien not really so scary
    VIP Member

    Well, I was looking to see what the permissions were for the /sbin directory itself, since that seems to be what's keeping you from being able to delete the /sbin/su file.

    Can you repeat the commands I listed in my above post and copy/paste that output here?

    I still think that the /sbin/su binary (improperly secured) is getting invoked first before your other su binaries (which are properly secured)...the /sbin directory is listed first in your PATH variable, which would cause this and the issue you are experiencing.

    If you can delete or rename the /sbin/su file, then I think you'll have proper root functionality.

    Thanks!
     
  11. jlt1112

    jlt1112 Newbie
    Thread Starter

    SA,

    See attached:

    Sorry for the delay.
     

    Attached Files:

    scary alien likes this.
  12. scary alien

    scary alien not really so scary
    VIP Member

    Thanks! Hmm, that's a little weird...you do not have a su file in your /sbin directory, so I don't know why your root checker is telling you that...? :thinking:

    Can you try using my app (Android Root Toolkit--see my signature for the link) and do the "Display Root and Mount Status" and then something like "Identify Current Recovery" to test its access to root?

    Lemme know what that tool says...

    Thanks!

    edit: signature links appear several posts up, but here's the app link, too:

    https://play.google.com/store/apps/details?id=sa.root.toolkit
     
  13. jlt1112

    jlt1112 Newbie
    Thread Starter

    SA,

    Really appreciate your sticking with me.

    Current root and mount status: system mounted as ready only. /(roots): mounted as read-write.

    su: present/properly secured.
    Superuser.apk: present
    busybox not present
    saved root: not present

    Device appears to have root.

    When I identify current recovery, application does not respond and then asked me to close.

    Confirms what you been thinking. Your app is beautifully written; very impressive.
     
    scary alien likes this.
  14. scary alien

    scary alien not really so scary
    VIP Member

    Thank you for the kind words--I very much appreciate it :).

    Wow, I'm still a little stumped here, jlt1112.

    It almost sounds now like its because the Superuser app isn't responding to the su binary...

    Have you tried re-installing the Superuser.apk app (you can get it from the Market)?

    Can you try that?
     
  15. jlt1112

    jlt1112 Newbie
    Thread Starter

    Went to uninstall SU via Apps in Settings; could not because it was loaded via the rooting process vice a download from the app store. All I can do is to stop process and disable. Went to the app store and it shows installed - no luck for a reinstall.

    My intent sometime today is to try to rename it as you tried to have me do for \sbin. If I can't do that, then guess I should try to wipe and reload another ROM. Whether I am successful or not, I have really learned a lot and appreciate all your help!
     
  16. scary alien

    scary alien not really so scary
    VIP Member

    jlt1112,

    Yeah, you've certainly got a puzzler here...you've got root manually via adb, but not via an app.

    I know you've said that you flashed various su.zip files for root, but can you point me to the links that you've downloaded them from?

    I've read that others have had trouble with the "normal" su.zip file that we've got posted here in the GNex root guides, but I've used it on a 4.0.4 leak for my VZW Gnex and it rooted me just fine. But I'll try to find the link to the su.zip that will supposedly work on 4.0.4 (it is different, but I can't see why or how it installs the root binaries any differently).

    If I had your phone in my hands and since you still have root access via adb, I would push / install a busybox manually on to the phone, use its find command to search for all of the su and Superuser.apk files and either delete them or re-secure them properly (and then, optionally re-flash the su.zip).

    I'm happy to help guide you through that if you'd like, just let me know.

    Cheers!
     
  17. jlt1112

    jlt1112 Newbie
    Thread Starter

    SA,

    Good by me - when you have time, send me the guide.

    Best wishes!
     
  18. scary alien

    scary alien not really so scary
    VIP Member

    jlt1112,

    No problem, I'll get back with you with something after I get home from work.

    In the meantime, I found the "4.0.4 approved" su.zip that I had seen over at XDA:

    xda-developers - View Single Post - 4.0.4 OTA Officially Rolling Out Now (GSM-Yakju Only) Link Inside!

    (here's the direct link to that post in that full thread: http://forum.xda-developers.com/showpost.php?p=24194838&postcount=582)

    You might try flashing that and see if that magically makes a difference (although like I said, I certainly don't understand why it would--but others in that thread have reported that this is what is needed for 4.0.4).

    Cheers!
     
  19. jlt1112

    jlt1112 Newbie
    Thread Starter

    SA,

    Good news - your program shows I have root and I was able to check other things. It seems that I had the wrong SU .... before your program executed, SU requested permission for it to do its job.

    I can't thank you enough for all the time you have spent with me. I hope you gained something from this too. My very best wishes!

    Joe
     
    scary alien likes this.
  20. scary alien

    scary alien not really so scary
    VIP Member

    You are most welcome, Joe! :)

    It was interesting, anyway...;) [I always learn something new].

    Glad you're working now...

    Cheers!
    -SA
     
    jlt1112 likes this.
  21. StartledNinja

    StartledNinja Lurker

    Scary Alien,

    I seem to have found myself in the same boat as Jlt1112 and have yet to find my way out. I ran the same codes in terminal and they are the exact same as his. I then tried to install the new su.zip to no avail. I'm also having the same issues with busybox, and when I ran your app, it came back the exact same as his as well. Any help would be appreciated. Oh and I left my iphone for this galaxy nexus 3 days ago.... Complete Noob.

    Thanks!!!!!
     
  22. scary alien

    scary alien not really so scary
    VIP Member

    Hey StartledNinja (great name, by the way :)), welcome to the AndroidForums! :)

    So, can you reset me here a little bit...I went back and re-read jlt1112 posts and it looks like his issues were solved by re-installing the root binaries (i.e., flashing the newest version via ClockworkMod).

    You're on 4.0.4 and have ClockworkMod installed? And you downloaded and flashed this version of the su.zip?

    xda-developers - View Single Post - 4.0.4 OTA Officially Rolling Out Now (GSM-Yakju Only) Link Inside!

    Thanks!
     
    StartledNinja likes this.
  23. StartledNinja

    StartledNinja Lurker

    Thanks for the response! I am actually on 4.1.1. I tried rooting using a combination of a few out of date methods, I then found a random post about updating the su.zip. I then flashed the one you pointed to, but nothing, actually when I try and flash, it tells me on the clkmod that I may loose root, so I hit yes to apply update from sdcard. And nothing! So here I am partially rooted and no idea what to flash or if I need to start over?
     
  24. scary alien

    scary alien not really so scary
    VIP Member

    Ah, so you are on JellyBean?

    You could flash the su.zip (SuperSU.zip) that I used for rooting my Nexus 7:

    SuperSU Download

    (courtesy of this thread: [16.07.2012] SuperSU v0.94 - xda-developers)

    Try flashing that and see if it works.

    Cheers!
     
    StartledNinja likes this.
  25. StartledNinja

    StartledNinja Lurker

    Downloaded straight to nexus, moved to internal memory, then flashed and it worked like a charm! (I'm Kind of impressed with my skills) You are the man! Thanks so much for the help! Although trying to update Superuser it gets stuck? From what I read, I'm assuming it's a little buggy?
     
    scary alien likes this.

Galaxy Nexus Forum

The Galaxy Nexus release date was November 2011. Features and Specs include a 4.65" inch screen, 5MP camera, 1GB RAM, TI OMAP 4460 processor, and 1750mAh battery.

November 2011
Release Date
0
Reviews
Loading...
Similar Threads - International GSM Advice
  1. rogerbid
    Replies:
    10
    Views:
    543
  2. bbbl67
    Replies:
    12
    Views:
    680
  3. tendoboy1984
    Replies:
    8
    Views:
    461
  4. Edjekadetje
    Replies:
    2
    Views:
    558
  5. mtgsilentstorm
    Replies:
    3
    Views:
    449
  6. PrimitiveScrewhead
    Replies:
    9
    Views:
    1,357
  7. PrimitiveScrewhead
    Replies:
    15
    Views:
    975
  8. kumaranil13k
    Replies:
    4
    Views:
    634
  9. Retrodyne
    Replies:
    20
    Views:
    1,846
  10. tmyc
    Replies:
    9
    Views:
    1,465

Share This Page

Loading...