helpdavfs2 - Support: sr #108145, Startup error when `mount` command...

 
 

sr #108145: Startup error when `mount` command passes options after operands on cmdline

Submitted by:  None
Submitted on:  Sat 29 Sep 2012 03:43:25 AM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 5 - BlockerStatus: Done
Privacy: PublicAssigned to: Werner Baumann <wbaumann>
Originator Email: -unavailable-Open/Closed: Closed
Operating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 03 Oct 2012 06:53:25 PM UTC, comment #4:

Thanks for the additional information.
Its the same on my Debian system.

So you are right: POSIXLY_CORRECT is a runtime environment variable. The problem is mount calling the mount helper in a non-POSIX-compliant way.

Cheers
Werner

Werner Baumann <wbaumann>
Project AdministratorIn charge of this item.
Tue 02 Oct 2012 06:53:32 PM UTC, comment #3:

On my Slackware 13.37, 32-bit, when POSIXLY_CORRECT is set I also get the "too many arguments" message from the `mount` command, which goes away when I unset the env var.

Anonymous
Mon 01 Oct 2012 11:46:48 AM UTC, comment #2:

It must be the POSIXLY_CORRECT variable, which allows me to use any other file name instead of ~/.bashrc, if I put the name in the environment variable ENV, as described in POSIX specification.

On my CentOS 6.3 at work it appears to be a run-time setting, not only compile-time. Whenever I ran the `mount` command for my davfs2 folder with POSIXLY_CORRECT set, I get the error message.

Strictly speaking I believe the system `mount` command should invoke the `mount.fstype` sub-commands with the right order of options on the command line, at least when POSIXLY_CORRECT is set, but I think it does things the way it does for historical / compatiblity reasons.

Anonymous
Sat 29 Sep 2012 08:34:16 AM UTC, comment #1:

This looks like a different problem.

davfs2 relies on some enhancements and extensions of GNU libc. The GNU version of the getopt function already rearanges the arguments.Options and non-option arguments can be given in any order without problems. This works on my system and most other GNU/Linux systems.

Possible reasons why this does not work for you:
- your system uses another libc without this enhancement
- while building davfs2 the variable POSIX_CORRECT was set which will switch off this behaviour.

To make it easier to port davfs2 to non_GNU systems I started to use Gnulib which makes the GNU enhancements available on non-GNU systems. The code is in the MAIN branch of the CVS. But this code also contains a lot of other changes to davfs2. As far as I have tested it is working. But it is not finished and not seriously tested.

Werner

Werner Baumann <wbaumann>
Project AdministratorIn charge of this item.
Sat 29 Sep 2012 03:43:25 AM UTC, original submission:

davfs2-1.4.7, including the source code repository version as of this writing, assumes option arguments precede the operands (the non-option arguments) on the command line.

However on slackware 13.37 the `mount` command invokes the davfs mount command with the "-o mountopts,.." arguments <em>after</em> the <em>device</em> and <em>mountpoint</em> arguments, like this:

/sbin/mount.davfs \
https://storage-file-eu.gmx.com/ \
./gmx-file-storage \
-o rw,nosuid,nodev,noauto,user,_netdev,exec

In this case, mount.davfs will exit with the error message "too many arguments".

To overcome this without changes on the davfs2 source code, I wrote a simple wrapper executable that re-arranges the arguments on the command line, than exec's the real mount.davfs (a script with the same purpose would not work here, `mount` command will not run it).

It is attached here if anyone else runs into the problem, but I really think webdavfs (mount.davfs) should be fixed to allow different order of arguments.

If you are interested I believe I can also provide a patch.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #26664:  mount.davfs2.zip added by None (2kB - application/zip - Wrapper executable to re-arrange arguments for the mount.davfs command line)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wbaumann (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 20 Apr 2014 07:25:38 PM UTCwbaumannStatusIn Progress=>Done
      Open/ClosedOpen=>Closed
    Sat 29 Sep 2012 08:34:16 AM UTCwbaumannStatusNone=>In Progress
      Assigned toNone=>wbaumann
    Sat 29 Sep 2012 03:43:25 AM UTCNoneAttached File-=>Added mount.davfs2.zip, #26664

    Back to the top


    Powered by Savane 3.1-cleanup