Consider the following /etc/auto.master attempting to include /etc/auto.master1 which doesn't exist. /home /etc/auto.home +/etc/auto.master1 /misc /etc/auto.misc In this case, the autofs mount /home is loaded by automount but /misc is ignored. The code path used for doing the initial read to parse /etc/auto.master is main() -> master_read_master() -> lookup_nss_read_master() -> do_read_master()-> lookup_read_master() lookup_read_master() is the function used to read the maps. It uses a while loop to go through the map file. If a patch starts with a '+', it treats it as a map file to be included and calls lookup_nss_read_master() to attempt to read this map. In this case, it encounters a problem while reading the map file. The error is returned by lookup_nss_read_master(). On receiving this error, lookup_read_master() exits with the return code NSS_STATUS_UNAVAIL. All subsequent mountpoints will not be read. int lookup_read_master(struct master *master, time_t age, void *context) { .. while(1) { entry = read_one(logopt, f, path, &path_len, ent, &ent_len); .. if (*path == '+') { .. status = lookup_nss_read_master(master, age); if (!status) { warn(logopt, MODPREFIX "failed to read included master map %s", master->name); if (!master->recurse) { master->name = save_name; master->depth--; master->recurse = 0; fclose(f); return NSS_STATUS_UNAVAIL; } } .. } The fix appears to be to simply delete the following lines in lookup_read_master() if (!master->recurse) { master->name = save_name; master->depth--; master->recurse = 0; fclose(f); return NSS_STATUS_UNAVAIL; }
(In reply to comment #0) > > The fix appears to be to simply delete the following lines in > lookup_read_master() > > if (!master->recurse) { > master->name = save_name; > master->depth--; > master->recurse = 0; > fclose(f); > return NSS_STATUS_UNAVAIL; > } Yes, that does seem approiate. I wonder what I was thinking when I did that! Let me think about it a little more. Ian
Created attachment 366380 [details] Patch to fix included map read fail handling
A test package including the above patch is available at: http://people.redhat.com/~ikent/autofs-5.0.1-0.rc2.132.bz506034.1.el5 Please test and report result.
Build autofs-5.0.1-0.rc2.133.el5 of autofs contains the changes discussed here. In addition to the reproducer above the RHTS test bz506034 within the bugzillas workflow tests detects the issue resolved by this change.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2010-0265.html