Re: [PATCH] Make colon mandatory after map type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 26, 2012 at 11:58 PM, Ian Kent <raven@xxxxxxxxxx> wrote:
> On Fri, 2012-08-24 at 13:27 -0300, Leonardo Chiquitto wrote:
>> Hello,
>>
>> [This bug was found and fixed by Werner Fink <werner@xxxxxxx>, I'm just the
>> messenger.]
>>
>> When the extension of the map file name is equal to the map type name,
>> the automounter will fail to parse the master map.
>>
>> How to reproduce:
>>
>> # cat /etc/auto.master
>> /media/autofs file:/etc/autofs.file --timeout=5 --ghost
>> # cat /etc/auto.file
>> test  server:/nfs
>
> I can't reproduce this with the current source and I can't see any
> relevant patches in the last couple of versions that might have changed
> it.

Strange. I tried some variations here and discovered that you must use
a mount point with a long name:

/a-long-directory-name/autofs file:/etc/auto.file --timeout=5 --ghost

Aug 27 08:42:39 lotus automount[23185]: lookup_nss_read_map: reading
map file /etc/auto.rect
Aug 27 08:42:39 lotus automount[23185]: lookup(file): file map
/etc/auto.rect missing or not readable
Aug 27 08:42:39 lotus automount[23185]: do_read_map: lookup module file failed

Makes any difference in your setup?

>> // start the daemon and check the logs:
>> Aug 24 13:13:43 lotus automount[9719]: ghosting enabled
>> Aug 24 13:13:43 lotus automount[9719]: master_do_mount: mounting /media/autofs
>> Aug 24 13:13:43 lotus automount[9719]: automount_path_to_fifo: fifo
>> name /run/autofs.fifo-media-autofs
>> Aug 24 13:13:43 lotus automount[9719]: lookup_nss_read_map: reading
>> map file /etc/autofs.sfil
>> Aug 24 13:13:43 lotus automount[9719]: lookup(file): file map
>> /etc/autofs.sfil missing or not readable
>> Aug 24 13:13:43 lotus automount[9719]: do_read_map: lookup module file failed
>> Aug 24 13:13:43 lotus automount[9719]: mount_autofs_indirect: failed
>> to read map for /media/autofs
>> Aug 24 13:13:43 lotus automount[9719]: handle_mounts: mount of
>> /media/autofs failed!
>> Aug 24 13:13:43 lotus automount[9719]: master_do_mount: failed to startup mount
>>
>> To fix the problem we can make the colon after the map-type non-optional,
>> here's the patch:
>>
>> From: Werner Fink <werner@xxxxxxx>
>>
>> When the map file has the same extension as the used map type the
>> token parser should be able to handle this.  Therefore make the
>> colon as described in the manual page not optional if a map type
>> is specified.
>>
>> Additionally, fix a redefinition warning in the 'min' macro.
>>
>> Index: autofs-5.0.7/lib/master_tok.l
>> ===================================================================
>> --- autofs-5.0.7.orig/lib/master_tok.l
>> +++ autofs-5.0.7/lib/master_tok.l
>> @@ -116,9 +116,9 @@ DNNAMESTR1        ([[:alnum:]_.\- ]+)
>>  DNNAMESTR2   ([[:alnum:]_.\-]+)
>>
>>  INTMAP               (-hosts|-null)
>> -MULTI                ((multi)(,(sun|hesiod))?(:{OPTWS}|{WS}))
>> +MULTI                ((multi)(,(sun|hesiod))?(:{OPTWS}))
>>  MULTISEP     ([\-]{2}[[:blank:]]+)
>> -MTYPE                ((file|program|sss|yp|nis|nisplus|ldap|ldaps|hesiod|userdir)(,(sun|hesiod))?(:{OPTWS}|{WS}))
>> +MTYPE                ((file|program|sss|yp|nis|nisplus|ldap|ldaps|hesiod|userdir)(,(sun|hesiod))?(:{OPTWS}))
>>
>>
>>  OPTTOUT              (-t{OPTWS}|-t{OPTWS}={OPTWS}|--timeout{OPTWS}|--timeout{OPTWS}={OPTWS})
>> @@ -431,7 +431,9 @@ void master_set_scan_buffer(const char *
>>       line_lim = line + strlen(buffer) + 1;
>>  }
>>
>> -#define min(a,b) (((a) < (b)) ? (a) : (b))
>> +#ifndef min
>> +# define min(a,b) (((a) < (b)) ? (a) : (b))
>> +#endif
>>
>>  int my_yyinput(char *buffer, int max_size)
>>  {
--
To unsubscribe from this list: send the line "unsubscribe autofs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux