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

Bug#2497: Fixes for amd-upl102



Package: amd
Version: upl102-1

Hi,

I've prepared some fixes for amd. The fixes come in three patchfiles from
which only the first and the second are essential. The first patch is from
Tonny Madsen <Tonny.Madsen@netman.dk> and fixes a really nasty bug (ever
tried find /net or cd /net/<some_prefix><TAB> ?).

The second patch enhances mount_linux.c for newer kernels and multihomed
hosts (this mimicks the fix to mount, see Bug#2482) and fixes some other
bugs I found.

The third patch is the largest and contains mostly cosmetic fixes to
reduce the amount of compiler warnings (add prototypes to most functions,
add typecasts for xdrproc_t and a lot of changes like the following:

-       if (fs = mf->mf_server)
+       fs = mf->mf_server;
+       if (fs)

).

I hope these patches will be included into the next Debian-release of amd
(at least 1 and 2).

Greetings, Swen

From Tonny.Madsen@netman.dkWed Mar  6 10:40:40 1996
Date: Thu, 1 Jun 1995 08:24:13 +0200
From: Tonny Madsen <Tonny.Madsen@netman.dk>
To: AMD Mailing List <amd-workers@acl.lanl.gov>
Subject: A number of changes and patches to amd-upd102

Hello world of automounter managers,

I have been playing a great deal with amd (upd 102) lately in order to
make it better for our local environment. Basicaly I've made the
following changes (included below in a single patch file):

- I have made NEW_TOPLVL_READDIR work! I found a nasty error in
  make_entry_chain, that ment a bogus pointer was returned if no
  entries was found in the map -- which of cause normally only can
  happen if the cache:=all assignment is missing for the map.
  [changes to amd/mapc.c]

- I have made NEW_TOPLVL_READDIR work for type:=auto too. This
  basically means make_entry_chain now understands about prefix
  strings as specified with pref:=something. 
  [changes to amd/afs_ops.c and amd/mapc.c]

- I have done some cleanup around the mixed use of M_NEWTYPE and
  MTYPE_TYPE.
  [changes to amd/cdfs_ops.c, amd/lofs_ops.c, amd/pcfs_ops.c
   and config/os-linux.h]

- I have done some cleanup around the mixed use of HAS_CDFS and
  MTAB_TYPE_CDFS.
  [changes to amd/restart.c, config/os-sos4.h, config/os-sos5.h,
   amd/cdfs_ops.c, config/os-defaults.h, config/os-osf1.h]

- I made OSF/1 understand cdfs.
  [changes to config/os-osf1.h]

- I have enhanced the passwd map to reduce the number of performed NFS
  mounts. This change is described further below.
  [changes to amd/info_passwd.c]

I also have some changes that have not made into this patch:

- I have a new part for amd (upd 102) that will make a shared
  library for OSF/1 that implements a new set of pwd functions (getcwd
  and getwd), which knows about automount points and can handle these
  correctly. I would like to find a way to include this functionality
  in the system version of libc.so before I release anything.

- I have started on some general clean up of the code. Maybe 1/3 of
  all the preprocessor symbols can be eliminated if some work is done
  about it.

- I have a first cut for NFS V3 mount functionality. I still have a
  couple of things I need to figure out, but it is comming along nicely.

All of the changes in this patch has been working here for 3-4 weeks
now and seem to be pretty stable apart from one annoying little
problem. The '.' entry of all amd managed directories now seem to be
stale when ever it is stat'ed. It isn't a major problem here, but I
hope to get the time to look into it later this week. [It seemed to
work allright with the old version of afs_readdir, so there must be a
significant difference between this function and new_afs_readdir...]

The extension to the passwd map allow one to specify the location that
should be returned by passwd_search within some limitations. The new
format for the passwd map name is

   /etc/passwd[:<location>]

If no :<location> part is specified, a default is used that make the
passwd map behave as before. The location has access to four variables
that are constructed from the home directory of the referenced user.

A home directory, /anydir/dom1/dom2/dom3/user, is choped up as follows:

   var0:=anydir
   var1:=dom3.dom2.dom1
   var2:=user
   var3:=/anydir/dom1/dom2/dom3/user

These variables are then concatenated and prepended to the location
from the map name, before the resulting string is returned from
passwd_search.

You can now use these variables in your location in order to customize
the way user directories are handled. Note that the location string
can not be a location-list, but only a single location -- this is due
to the way varx variable are handled in opts.c.

The default value for the location is

   type:=nfs;rfs:=/${var0}/${var1};rhost:=${var1};sublink:=${var2};fs:=${autodir}${var3}

I always use the location

   type:=link;fs:=${var3}

(e.g the map name is "/etc/passwd:type:=link;fs:=$$$${var3}") as all
home directories are already mounted on all machines and I don't want
(or need) yet another NFS mount the remote disk! [All my home
directories are found as /homes/<machine>/<user> (yes, you are likely
to have seen this before!), and I use the above map for the amd
managed directory /usr/users for historical reasons.]

Note that all $'s in the location has to be quaddupled in the
passwd map name, as the map name is evaluated twice before the
location part is used in the passwd_search function.

Btw, maybe it is time to convert the current configuration of amd to
GNU autoconf. As it is, it's very, very difficult to chance anything
in the configuration part of amd and still believe it works for
machine to which one don't have access...

If you find any problems with the above, you should be more than
welcome to mail me :-> 

-- tonny

Attachment: amd.patch1.gz
Description: Tonnys patch

Attachment: amd.patch2.gz
Description: Fix for multihomed hosts and assorted bugfixes

Attachment: amd.patch3.gz
Description: Fixes for compiler warnings and cosmetic changes


Reply to: