Skip to contentSkip to conversation

external mount utilities and utab

DISCUSSION Phillip Susi 2 participants 10 messages Nov 1, 2013 – Nov 14, 2013 Util-Linux package

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When mount runs mount.cifs, /run/mount/utab is not updated, so the user mount flag is lost and thus, I can't umount as the user. Running mount -i works correctly. Is this a bug in mount.cifs, or should mount be recording these options whether it runs the external helper or not?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSc/8pAAoJEJrBOlT6nu75ybMH/jtQUtC2FJ78ohCc7jsFYh6u UU+lL4K4AdUQBZ44/cW23N8KV1fNppeF4JhYeHaIiCv0DWw4pglMsMN2HhCJuY01 8rYXRo5MVvvO/TpZlomm5JPIbuTaAyCChgU7doQXCyVTzXSi+On8KOFpXachqMiq fPWL1wBQpSCS11n3+f4O7trkg8pB8pXuNYk+TcUEzRM11yEpu0Q+XvYN6po9faZc YDJKyb4Zq2+b3Xp3jbfa15wMQ01hpVG6XZBFeBkmOdvdMmHvzO0Qgj1bYAPp+WEr Ea4lDFtgedNlL0dGYmlyktywK8mkKTTMpq/dGE3ChTSZLl/DSFfx6s5nSQi5s5k= =JvkV
-----END PGP SIGNATURE-----

maintainer
#1 lore raw
Quoted 8 lines · Phillip Susi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When mount runs mount.cifs, /run/mount/utab is not updated, so the user mount flag is lost and thus, I can't umount as the user. Running mount -i works correctly. Is this a bug in mount.cifs, or should mount be recording these options whether it runs the external helper or not?

This problem is fixed in mount.nfs where we use libmount. The question is if really need to link all the helpers with libmount. I'll try to play with that and prepare a solution.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
maintainer
#2 lore raw
In reply to Phillip Susi
Quoted 8 lines · Phillip Susi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When mount runs mount.cifs, /run/mount/utab is not updated, so the user mount flag is lost and thus, I can't umount as the user. Running mount -i works correctly. Is this a bug in mount.cifs, or should mount be recording these options whether it runs the external helper or not?

Fixed, so if you have suid mount.cifs then you can use "user" mount option and libmount will (after successful external helper) update /run/mount/utab.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
maintainer
#3 lore raw
In reply to Phillip Susi
Quoted 8 lines · Phillip Susi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When mount runs mount.cifs, /run/mount/utab is not updated, so the user mount flag is lost and thus, I can't umount as the user. Running mount -i works correctly. Is this a bug in mount.cifs, or should mount be recording these options whether it runs the external helper or not?

ah.. note, that mount.cifs is not suid on Fedora, only suid mount helper is mount.nfs on my machine.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Are you saying then that all of the helpers should now be using libmount, and taking care of the utab updates themselves rather than just having mount do it?

Quoted 9 lines · Karel Zak
Quoted 7 lines · Phillip Susi

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

When mount runs mount.cifs, /run/mount/utab is not updated, so the user mount flag is lost and thus, I can't umount as the user. Running mount -i works correctly. Is this a bug in mount.cifs, or should mount be recording these options whether it runs the external helper or not?

Quoted 5 lines

ah.. note, that mount.cifs is not suid on Fedora, only suid mount helper is mount.nfs on my machine.

Karel

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSd6oMAAoJEJrBOlT6nu759zQH/ApS7k10RDvYNgByirfu97gY anSEcvn2nSBH4RXxiN2ugSlVtYPpr4HAZrxD0tYfb1BGH/0q1KI6RwlOlih9DSvf kc6+iXRBU6eBVgaGWUeNWc9TVuSN9s/Ifw63dKkwppq6smLn4K6vnn1AcR3vy23c BQw7wqdZZobsdMgiijDqKV0uT0VHEjH5lTDWkJ89fvJiC4/lvi1aL5AeKndOgusP PuTrF9inji1lTbtK7r3gVoVPwl9b+YvzcsWG91OfbR77ACtM+OwC8kJZHxjI8AAu 4/x1OHI0yiz9kkMYDZDOfGj3lYrTc2aJ+tksDu89wFERnC8SOhv0HpsoY/6ANSw= =0XY3
-----END PGP SIGNATURE-----

maintainer
#5 lore raw
Quoted 3 lines · Phillip Susi

Are you saying then that all of the helpers should now be using libmount, and taking care of the utab updates themselves rather than just having mount do it?

That would be the best solution (and not only for utab, but also for options parsing, userspace options, command line options used for helpers, etc.). It's better to have all the things in one library.

Anyway, the change I did today allows to use "user" fstab mount option also for non-libmount external helper.

It's already in my TODO list to write libmount patch for mount.cifs.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#6 lore raw
In reply to Phillip Susi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Phillip Susi

Are you saying then that all of the helpers should now be using libmount, and taking care of the utab updates themselves rather than just having mount do it?

ping... still wondering if the proper fix for this is to link mount.cifs with libmount and make it suid, or if mount needs fixed to do the utab update?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSg8TMAAoJEJrBOlT6nu75vV0H/RfDGiv5oPR+R2TsaABnd/GV HMJ8AZfS322qdYjeMMyMTCTx9y/cy6fKzfW9q/JqyvQy6JNBq8LSFEve0Z298dwf 4JNvImDO1pjnXedMEvtN9X5NwxJbYpkY+LP9owg4LWP6d0RnLu8uwxNDHDpLp2Oi PX2nbXHoUm8r8r6a3FfN1mVDqExhMbc5nJP7RCD6AqYzJ8ARz6x5/z3ei9u8UsT9 tctApV8wEvnGqdQufLXtP236pOplWnTMJ32RfIe7chM86T88MRheC5Mxq2MHjtZ4 slDJptr6dcTHAz8lY12J6mIZPpbLrb0mT9xOKmalivk8PJj0jkhj2/Fm9ejp87E= =V2jT
-----END PGP SIGNATURE-----

maintainer
#7 lore raw
Quoted 11 lines · Phillip Susi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Phillip Susi

Are you saying then that all of the helpers should now be using libmount, and taking care of the utab updates themselves rather than just having mount do it?

ping... still wondering if the proper fix for this is to link mount.cifs with libmount and make it suid, or if mount needs fixed to do the utab update?

I have improved libmount (in git tree) and now it updates utab for the helpers.

Anyway if your mount.cifs is not suid then user= does not make sense and you also don't have to care about utab at all. For example on Fedora we don't have suid mount.cifs for years.

IMHO it's better to minimize number of suid binaries. I guess that the user= functionality has been introduced to mount regular filesystems (ext2, ...) from removable devices.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#8 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · Karel Zak

I have improved libmount (in git tree) and now it updates utab for the helpers.

But does that mean that the helper has to use libmount?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJShPetAAoJEJrBOlT6nu75L6MIAMFbmidwDH1TUo7mjc5rw0d+ d3MMCkrGQ0ZW1ddv6iJvs/uAFBC/59leN2S7VrTN2wPHf5VKc1+4I4MVow/V/0eS VQ8rrWCkGlayIM0+bghI8JflV8wL4zd2E2z8bqIyOzZm3sbVkjIcpi8UC4R0iDtU BusDfS/bbVKoFARJz81GMyoq7l5WVSphuWGfpdjxi//4dWfvh2I5/I0Q9Wh/Q4ls F/jxRo35IRPoi2kriOMQb1SdYu+jv2umpf1EYgc7XgJF8txPiW2XsSc+v4j117hG 1Lz2lRgDmJjXSInD4tGgN6/zXmD8HC2ptRgps0j9Y7ZhgsddTq9Hy9WElxFG4mc= =wWrk
-----END PGP SIGNATURE-----

maintainer
#9 lore raw
Quoted 8 lines · Phillip Susi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · Karel Zak

I have improved libmount (in git tree) and now it updates utab for the helpers.

But does that mean that the helper has to use libmount?

No, after successful helper execution (helper has to return 0) the library checks utab and update the file if there is user= mount option and the mountpoint is not in the file.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com