Pnd_Run.sh Sometimes Seems To Ask For A Password


lomaxx

Active Member
Joined
Sep 22, 2008
Messages
747
I have been investigating this issue for several hours now and i am quite frustrated.

I am trying to use /usr/pandora/scripts/pnd_run.sh in a script for mounting/unmounting. Examples:
For mounting i am using: /usr/pandora/scripts/pnd_run.sh -p /media/trans8/pandora/menu/scummvm-openpandora-2010-05-26.pnd -b scummvm -m
For unmounting i am using: /usr/pandora/scripts/pnd_run.sh -p /media/trans8/pandora/menu/scummvm-openpandora-2010-05-26.pnd -b scummvm -u

Mounting works nice, but when unmounting, the script sometimes gets stuck. While experimenting i noticed that i sometimes am asked for a password. I think it's when "losetup -d" tries to detach the loop-devices. However this doesn't seem to happen always.

Has anyone got a clue how i can prevent this from happening or what i might be doing wrong?
 
The full line is "sudo /sbin/losetup -d $LOOP". sudo means "run as super user" and requires a password (unless it's been configured to not require it, which is usually considered dangerous and bad form). After it's been used once, it remembers for a little while so you can run sudo multiple times in a row without needing to re-enter the password. That's why it only seems to ask sometimes: it asks once, you enter the password, and then for a few minutes (or however long it is) it remembers that you've already entered the password and doesn't ask again. When the right length of time expires, it asks for your password again.
 
Calling umount in pnd_run for an umounted PND haven't been protected (yet) and does indeed ask you for a password in this case.
Ohh, and to umount a Filesystem no process should access it.
 
I am not sure anymore if the problem is only (or at all) related to the password. I think i by now found out WHEN i am asked for a password: It happens when i am using the unmount-option when i haven't mounted before. But that only happens the first time. I am not sure, but it's what seemed like a pattern during the last confusing results i had.

However there seems to be another issue: The pnd-run-script greps the output of "losetup -a" at some point. But if you have a very long pathname and filename for the pnd (like "/media/trans8/gamedata/scummvm/Secret_of_Monkey_Islands_Amiga_EN.pnd" then the endpart is cut off in the output, grep can't find the right part and the script get's confused.

The outut of losetup looks like this in such a case: "/dev/loop7: [b309]:157081 (/media/trans8/gamedata/scummvm/Secret_of_Monkey_Islands_Amiga_*)"

I am too tired and demotivated at the moment to validate all this, but it seems to be a bug. I hope i will remember to file it tomorrow.
 
Lomaxx said:
I am too tired and demotivated at the moment to validate all this, but it seems to be a bug. I hope i will remember to file it tomorrow.
EDIT : open your bug...
 
Last edited by a moderator:
Back
Top