We have moved to a new Sailfish OS Forum. Please start new discussions there.
0

noexec mount of sdcard [not relevant]

asked 2014-07-17 00:43:22 +0200

marsch gravatar image

I have a btrfs formatted sdcard in my handset, which I realized is mounted noexec. I'd like to execute some scripts there, so I need exec.

I would expect that removing the mount-option "users" (which boils down to noexec,nosuid,nodev) in /usr/sbin/mount-sd.sh would remedy the problem.

This is however not the case, the sdcard is still mounted noexec after a reboot. As the script is the singulary spot where the sdcard-mounting is done, I have no idea where this restriction comes from. Is it some kind of btrfs subvolume inheritance issue? Any other hints?

Thanks in advance.

edit retag flag offensive reopen delete

The question has been closed for the following reason "question is not relevant or outdated" by chemist
close date 2014-12-18 14:50:07.904369

Comments

for scripts you technically don't need exec. You just can't use the "./script" syntax and have to use "sh script.sh" or "python script.py"

slaveriq ( 2014-07-17 09:22:07 +0200 )edit

You're mixing apples with peas here. You first example is wrong. Your just giving a relative path instead of an absolute one (maybe also implicitely specified by the PATH environment). The binary must still be 700 for this to work.

Your second suggestion is true, as it calls the interpreter directly instead of determining by the shebang syntax.

Nevertheless, the question is rather where the noexec stems from, as it's not explicitely specified anywhere for this mountpoint.

marsch ( 2014-07-17 11:45:30 +0200 )edit

Well that was the point. You can't run binaries from it but you can execute your scripts with the help of the interpreter in question. I added it as a comment since it might help you getting your stuff done. It is in no way an answer to where the noexec flag comes from ;)

So no i was not mixing apples and peas ;)

slaveriq ( 2014-07-17 13:34:21 +0200 )edit

You can't run a binary on a noexec mount by just calling it with a relative path, as you're still calling the interpreter implicitely. It's never been different.

marsch ( 2014-07-17 22:43:49 +0200 )edit

Yes that is why i said that you CAN'T run it with "./script" please re read my initial comment.

slaveriq ( 2014-07-17 23:10:23 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2014-07-17 22:52:39 +0200

marsch gravatar image

Turns out that the SD is mounted as intended at the moment, though it wasn't for at least the first 3 reboots after changing /usr/sbin/mount-sd.sh.

Never seen such behaviour before, there's no explanation on the OS' part for this.

I'd be extremely interested in how such a thing can happen at all. Maybe somebody from the Jolla devs can comment on this. Thank you.

edit flag offensive delete publish link more

Comments

adding exec to the list of mount options in the script worked first time for me. (might also be a better option than removing users) it could be though that systemd is trying to mount the sdcard as well.

slaveriq ( 2014-07-18 01:04:22 +0200 )edit

Question tools

Follow
2 followers

Stats

Asked: 2014-07-17 00:43:22 +0200

Seen: 656 times

Last updated: Jul 17 '14