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

 
 

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

Submitter:  None
Submitted:  Sat 29 Sep 2012 03:43:25 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  5 - Blocker Status:  Done
Privacy:  Public Assigned to:  _71007
Originator Email:  -email is unavailable- Open/Closed:  Closed
Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

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

- <_71007>
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

- <_71007>
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 Files:
   
   
Comment:
   

Attached Files
file #26664:  mount.davfs2.zip added by None (2KiB - 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
  • -email is unavailable- added by _71007 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-04-20 _71007 StatusIn Progress Done
        Open/ClosedOpen Closed
    2012-09-29 _71007 StatusNone In Progress
        Assigned toNone _71007
    2012-09-29 None Attached File- Added mount.davfs2.zip, #26664

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code