#128 ✓hold
Riccardo Iaconelli

Can't access files in iTunes_Control/Device

Reported by Riccardo Iaconelli | April 23rd, 2010 @ 06:31 PM

I suppose this is the right component onto which file the bug, please tell me if it's not.

The problem is simple:

$ ifuse ipod/

$ ls -lah ipod/iTunes_Control/Device/
total 4.0K
drwxr-xr-x 2 ruphy users 102 Feb 26  2009 ./
drwxr-xr-x 7 ruphy users 238 Apr 21 18:50 ../
-rw-r--r-- 1 ruphy users  53 Feb 26  2009 SysInfo

$ echo "test" > ipod/iTunes_Control/Device/test
bash: ipod/iTunes_Control/Device/test: Operation not permitted

The SysInfo file comes from when I used to sync this iPod through wlan, when I still had a 2.0 firmware.

It's currenly wrong (it has an 'n' appended at the end of the FirewireGuid which seems to enable gtkpod to read but not to write a working database) and I anyways didn't manage to jailbreak it, so that I could at least try to write the file from ssh.

This effectively prevents me from using my iPod from Linux.

ifuse version 1.0.0
iPod Touch 1st generation with firmware 3.1.3

Comments and changes to this ticket

  • Riccardo Iaconelli

    Riccardo Iaconelli April 23rd, 2010 @ 06:33 PM

    • Tag set to permissions ifuse device
  • Riccardo Iaconelli

    Riccardo Iaconelli April 23rd, 2010 @ 06:33 PM

    • Tag changed from permissions ifuse device to ifuse, itunes_control, permissions
  • Martin S.

    Martin S. April 25th, 2010 @ 12:56 PM

    • State changed from “new” to “open”

    You can run "ifuse -d ipod/" in order to enable debugging. Once done, please repeat the attempt to write the "test" file and post the debugging output here.

  • Riccardo Iaconelli

    Riccardo Iaconelli April 25th, 2010 @ 05:39 PM

    here is the relevant part:

    unique: 126, opcode: LOOKUP (1), nodeid: 1, insize: 55
    LOOKUP /iTunes_Control
    getattr /iTunes_Control
       NODEID: 15
       unique: 126, success, outsize: 144
    unique: 127, opcode: LOOKUP (1), nodeid: 15, insize: 47
    LOOKUP /iTunes_Control/Device
    getattr /iTunes_Control/Device
       NODEID: 18
       unique: 127, success, outsize: 144
    unique: 128, opcode: LOOKUP (1), nodeid: 18, insize: 45
    LOOKUP /iTunes_Control/Device/test
    getattr /iTunes_Control/Device/test
       unique: 128, error: -2 (No such file or directory), outsize: 16
    unique: 129, opcode: CREATE (35), nodeid: 18, insize: 61
    create flags: 0x8241 /iTunes_Control/Device/test 0100644 umask=0022
       unique: 129, error: -1 (Operation not permitted), outsize: 16
    
  • Riccardo Iaconelli

    Riccardo Iaconelli April 25th, 2010 @ 05:47 PM

    also adding the output from:

    $ ifuse -d ipod/ 2> error.ifuse
    

    (let it mount... once done, wait some seconds, Ctrl+C)

    $ grep -a3 error error.ifuse
    unique: 23, opcode: LOOKUP (1), nodeid: 1, insize: 45
    LOOKUP /BDMV
    getattr /BDMV
       unique: 23, error: -2 (No such file or directory), outsize: 16
    unique: 24, opcode: LOOKUP (1), nodeid: 1, insize: 57
    LOOKUP /.xdg-volume-info
    getattr /.xdg-volume-info
       unique: 24, error: -2 (No such file or directory), outsize: 16
    unique: 25, opcode: LOOKUP (1), nodeid: 1, insize: 52
    LOOKUP /autorun.inf
    getattr /autorun.inf
       unique: 25, error: -2 (No such file or directory), outsize: 16
    unique: 26, opcode: READDIR (28), nodeid: 1, insize: 80
    readdir[0] from 0
       unique: 26, success, outsize: 688
    --
    unique: 97, opcode: READDIR (28), nodeid: 1, insize: 80
       unique: 97, success, outsize: 16
    unique: 98, opcode: ACCESS (34), nodeid: 3, insize: 48
       unique: 98, error: -38 (Function not implemented), outsize: 16
    unique: 99, opcode: OPENDIR (27), nodeid: 3, insize: 48
       unique: 99, success, outsize: 32
    unique: 100, opcode: READDIR (28), nodeid: 3, insize: 80
    --
    unique: 121, opcode: LOOKUP (1), nodeid: 1, insize: 52
    LOOKUP /autorun.inf
    getattr /autorun.inf
       unique: 121, error: -2 (No such file or directory), outsize: 16
    

    this is without doing any operation, so it's all the errors it spits out in the debug when mounting it.

    hope it helps =)

  • Martin S.

    Martin S. April 27th, 2010 @ 02:03 PM

    Thanks for the output. Errors are OK here. If you look at it closely, you might notice that some application is testing if a file exists and thus you see those "No such file or directory" "errors" returned to the application.

    The issue seems to be right here:

    create flags: 0x8241 /iTunes_Control/Device/test 0100644 umask=0022
       unique: 129, error: -1 (Operation not permitted), outsize: 16
    

    You have lack of permissions somewhere.

    I think it might have to do with usbmuxd.

    1. Check your /var/log/messages syslog while attempting to write for any usbmuxd errors/warnings.
    2. Check which arguments usbmuxd is started with on your system:
      # ps ax | grep -i usbmuxd
      
    3. Try to manually run usbmuxd in the foreground as root:
      # killall usbmuxd && usbmuxd -f -v
      
    4. Try ifuse again as regular user and check the output of the running usbmuxd for permission issues.

    Also please tell us which distro you running. Thanks.

  • Riccardo Iaconelli

    Riccardo Iaconelli April 27th, 2010 @ 02:23 PM

    I'm using Arch Linux, and this is my usbmuxd package: http://aur.archlinux.org/packages.php?ID=29923

    /var/log/* didn't report any error from usbmuxd. Attaching the output of

    # usbmuxd -f -vvv -u
    

    which has been runt as root.

    I mounted the ipod, typed some newlines in the output, tried to create the file, failed, typed some more newlines, unmounted and killed usbmuxd.

    If you need more info I'm here. :-)

  • Martin S.

    Martin S. May 14th, 2010 @ 02:04 PM

    Why do you add the "-u" parameter? Can you please try this without passing "-u" as I described? ;)

    Please also try if this works:

    # mkdir ~/ipod
    # ifuse ~/ipod
    

    Remember, run usbmuxd as root, everything else always as regular user.

  • Nikias Bassen

    Nikias Bassen June 2nd, 2010 @ 07:21 AM

    Hi,

    I bet the Device folder or the SysInfo file has been created by root so that they are not writable to you. Without a jailbreak this is not easy to resolve. But AFAIK the jailbreak for the iPod Touch 1st generation is not a problem at all using spirit? Try to read some tutorials on how to jailbreak it.

  • Martin S.

    Martin S. June 2nd, 2010 @ 09:09 AM

    • State changed from “open” to “hold”

    I think running usbmux without the "-u" flag is the solution here. Otherwise it drops permissions and then ifuse starts behaving as described.
    So it's probably a packaging issue for Arch Linux. Still need to be verified by Riccardo though.

  • Riccardo Iaconelli

    Riccardo Iaconelli June 4th, 2010 @ 07:35 AM

    same exact problem.
    here are the details of what I did:

    
    root@galileo:~# usbmuxd -f -v
    [09:26:21.351][3] usbmuxd v1.0.4 starting up
    [09:26:21.351][4] Creating socket
    [09:26:21.351][4] Initializing USB
    [09:26:21.353][4] 0 devices detected
    [09:26:21.353][3] Initialization complete
    

    (connect iPod)

    [09:28:56.046][4] Caught SIGUSR1/2 but we weren't started in --udev mode, ignoring
    [09:28:56.674][4] Found new device with v/p 05ac:1291 at 2-2
    [09:28:56.675][4] Using wMaxPacketSize=512 for device 2-2
    [09:28:56.675][3] Connecting to new device on location 0x20002 as ID 1
    [09:28:56.676][3] Connected to v1.0 device 1 on location 0x20002 with serial number 77591d321e9154b0b3aa858a76a2d4ef3a0d01fb
    

    probably the output it follows comes from right after I mounted the iPod, judging from the timestamps

    [09:29:32.211][4] New client on fd 9
    [09:29:33.212][4] New client on fd 10
    [09:29:33.212][4] Client 9 connection closed
    [09:29:33.212][4] Disconnecting client fd 9
    [09:29:34.041][4] New client on fd 9
    [09:29:34.069][4] Disconnecting client fd 10
    
    Okay, open a new shell, sudo -s to gain root.
    And this is what I typed there, while usbmuxd was running on the other shell.
    root@galileo:~# mkdir ifuse
    root@galileo:~# ifuse ifuse/
    root@galileo:~# echo "test" > ifuse/iTunes_Control/Device/test
    bash: ifuse/iTunes_Control/Device/test: Operation not permitted
    
  • Riccardo Iaconelli
  • Martin S.

    Martin S. June 21st, 2010 @ 09:30 AM

    • State changed from “hold” to “open”

    Once again: Remember, run usbmuxd as root, everything else always as regular user. I don't understand why you run ifuse as root.

    Also please post the "ls" of the mounted directory after mounting with ifuse so we can verify permissions.

    If this won't help you, we must verify the output of running ifuse with the "--debug" switch (not -d).

    I think this definitely is not a bug with ifuse, but with permissions on your system.

  • Riccardo Iaconelli

    Riccardo Iaconelli June 21st, 2010 @ 10:25 AM

    Sorry, I'm silly, I never actually managed to read that I had to run ifuse as a normal user. :)
    Let me try now.

  • Riccardo Iaconelli

    Riccardo Iaconelli June 21st, 2010 @ 10:35 AM

    The problem still persists.

    ruphy@galileo:~/ifuse$ echo "test" > iTunes_Control/Device/test
    bash: iTunes_Control/Device/test: Operation not permitted
    ruphy@galileo:~/ifuse$ ls -lah iTunes_Control/Device/
    total 4.0K
    drwxr-xr-x 2 ruphy users 102 Feb 26  2009 ./
    drwxr-xr-x 7 ruphy users 238 Apr 21 18:50 ../
    -rw-r--r-- 1 ruphy users  53 Feb 26  2009 SysInfo
    

    Other outputs:

    [root@galileo ~]# usbmuxd -f -v
    [12:30:33.547][3] usbmuxd v1.0.4 starting up
    [12:30:33.548][4] Creating socket
    [12:30:33.548][4] Initializing USB
    [12:30:33.551][4] Found new device with v/p 05ac:1291 at 2-8
    [12:30:33.554][4] Using wMaxPacketSize=512 for device 2-8
    [12:30:33.554][3] Connecting to new device on location 0x20008 as ID 1
    [12:30:33.554][4] 1 device detected
    [12:30:33.554][3] Initialization complete
    [12:30:33.555][3] Connected to v1.0 device 1 on location 0x20008 with serial number 77591d321e9154b0b3aa858a76a2d4ef3a0d01fb
    

    Attaching the output of ifuse --debug

  • Martin S.

    Martin S. June 21st, 2010 @ 10:54 AM

    Let's sum this up:

    • Accessing your device works
    • usbmux reports no errors and thus it's not an USB issue
    • ifuse is able to mount and you are able to browse the filesystem fine thus device communication works fine

    The places to verify now are afc communication and filesystem permissions.

    Can you please test to run "touch test" instead of the "echo" redirect?
    Can you also please try to create a file recursively down to the root of the mount? Thus in "/iTunes_Control/", then in "/" and verify if that works?

  • Riccardo Iaconelli

    Riccardo Iaconelli June 21st, 2010 @ 11:05 AM

    Done:

    ruphy@galileo:~/ifuse/iTunes_Control/Device$ touch test
    touch: setting times of `test': No such file or directory
    ruphy@galileo:~/ifuse/iTunes_Control/Device$ cd ..
    ruphy@galileo:~/ifuse/iTunes_Control$ touch test
    ruphy@galileo:~/ifuse/iTunes_Control$ cd ..
    ruphy@galileo:~/ifuse$ touch test
    ruphy@galileo:~/ifuse$ ls test iTunes_Control/test iTunes_Control/Device/
    iTunes_Control/test  test
    
    iTunes_Control/Device/:
    SysInfo
    

    So it's just the "Device" folder that doesn't work.

    Also, analyzing the log attached above, I saw an error that looks suspicious:

    12:31:44 lockdown.c:1273 lockdownd_start_session(): Session startup OK
    12:31:44 lockdown.c:1284 lockdownd_start_session(): SessionID: E45D5394-59D5-4EF8-9D6E-DE20E73F334A
    12:31:44 lockdown.c:1290 lockdownd_start_session(): Enable SSL Session: true
    12:31:44 idevice.c:548 idevice_connection_enable_ssl(): enabling SSL mode
    12:31:44 idevice.c:569 idevice_connection_enable_ssl(): GnuTLS step 1...
    12:31:44 idevice.c:571 idevice_connection_enable_ssl(): GnuTLS step 2...
    12:31:44 idevice.c:573 idevice_connection_enable_ssl(): GnuTLS step 3...
    12:31:44 idevice.c:575 idevice_connection_enable_ssl(): GnuTLS step 4 -- now handshaking...
    12:31:44 idevice.c:577 idevice_connection_enable_ssl(): WARN: errno says No such file or directory before handshake!
    
  • Martin S.

    Martin S. June 21st, 2010 @ 12:12 PM

    Well, "setting times of test" is suspicious. For some reason it might be some screwed up permissons on the device itself.

    Please remove the "Device" folder and it's contents completely, recreate it and then retry to "touch test". It's clearly not an ifuse issue but some sort of permission issue on your system or the device.

    The other error you noted is just a warning and is not related to this.

  • Riccardo Iaconelli

    Riccardo Iaconelli June 21st, 2010 @ 01:04 PM

    ruphy@galileo:~/ifuse/iTunes_Control$ rm -rf Device/
    rm: cannot remove `Device/SysInfo': Operation not permitted
    

    And I'm perfectly able to sync it from other places, besides the fact that I'm starting from a totally clean restore.

    ruphy@galileo:~/ifuse/iTunes_Control$ ls -lah
    total 0
    drwxr-xr-x  7 ruphy users  272 Jun 21 13:02 ./
    drwxr-xr-x 14 ruphy users  612 Jun 21 13:02 ../
    drwxr-xr-x  2 ruphy users  272 Apr 23 21:24 Artwork/
    drwxr-xr-x  2 ruphy users  102 Feb 26  2009 Device/
    drwxr-xr-x  3 ruphy users  884 May 27 07:37 iTunes/
    drwxr-xr-x 52 ruphy users 1.8K Jan 20  2009 Music/
    drwxr-xr-x  2 ruphy users   68 May 30  2009 Ringtones/
    
  • Riccardo Iaconelli

    Riccardo Iaconelli June 21st, 2010 @ 01:04 PM

    (from other places: i tried with iTunes on a windows PC)

  • Martin S.

    Martin S. June 21st, 2010 @ 01:31 PM

    As you see, it's a permission issue on the device itself.
    If you would have done a "clean restore", or to be exact an "erase restore", this would not be an issue.
    Mind the date of the Device folder, 26.02.2009... I assume you restored just recently, which should not result in such a date here.

    Now it could be an issue with your device. Since it's an iPod Touch first generation, I assume the device had several firmware updates and perhaps was even jailbroken inbetween.

    One last issue I can think of is a broken libgpod. Please try to kill anything running on your system which might be related to "libgpod", then retry. Especially the libgpod callouts like "iphone-set-info" and "ipod-set-info". Those might be blocking access to that folder and file and would explain the issue here.

  • Riccardo Iaconelli

    Riccardo Iaconelli June 21st, 2010 @ 01:49 PM

    Thanks, I'll make some experiments and let you know what happens. :)

  • Martin S.

    Martin S. March 13th, 2011 @ 03:54 PM

    • State changed from “open” to “hold”

    If you have any further needs please reopen, closing for now.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A project around supporting the iPhone in Linux.

See http://libimobiledevice.org

Attachments

Pages