[OpenAFS] Open AFS on Win32, scripting drive maps

David Bear David.Bear@asu.edu
Thu, 28 Mar 2002 12:01:37 -0700 (MST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--Boundary_(ID_Qf4nOfpdf+uJYYaLQyyzaA)
Content-type: TEXT/PLAIN; charset=US-ASCII


We use mostly winnt and windows2000 here with AFS clients.  I'm using the
afs1.2.2b dist from openafs.org.

The huge problem we have is the AFS drive maps aren't stored in a unique
user profile.  All drive maps seem to be stored in afsdsbmt.ini (correctly
me please, this is what I have observed).  Years ago with the transarc afs
code, I wrote a Rexx script that would rewrite the afsdsbmt.ini file with
the correct drive to afs path mappings.  Since that is now not working on
w2k, I thought I would rewrite the script in python.  Here's our
requirement:

1) afs home directories are built according to the following rule:
  homes rooted at /cell/users
  then the first 3 chars of the user id are used to create containing
folders: ie.  /char1/char2/char3/userid.  So, for user bgates, the home
directory would be /asu.edu/users/b/g/a/bgates.

2) win2k machines are shared.  Local logon users id's are supposed to be
the same as the global windows NT domain ids.  Ergo, they logon locally,
but are authenticated from a globaly nt domain.

3) we would LIKE to implement stored and roaming user profiles (but
haven't yet)

This is why we need to script afs drive maps.  The python script attached
is not meant to be bullet proof -- It uses command line programs to do
everython.  I considered using just windows cmd/shell but dropped the idea
because I wanted something that would be a little more 'maintainable'.

I did notice that for some reason, openafs wants to used the word "home"
for some special purpose.  As soon as I stop using that as a submount
name, my script started working.  I would apprecaite any comments.


 --
David Bear College of Public Programs/ASU
480-965-8257
...the way is like water, going where nobody wants it to go

--Boundary_(ID_Qf4nOfpdf+uJYYaLQyyzaA)
Content-id: <Pine.LNX.4.33.0203281201370.18936@moroni.pp.asu.edu>
Content-type: APPLICATION/octet-stream; name=pyscript.tgz
Content-transfer-encoding: BASE64
Content-disposition: attachment; filename=pyscript.tgz
Content-description:

H4sIAAdmozwAA+1ae1PbSBLP31TxHeZIpWTfGWNsA3Wu41IsgVtq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