This patch covers bugs found by running flexelint on
the CVS code on Windows NT.
- incorrect enum used in al_creds.cpp and various other files
- use of local after it goes out of scope in al_wizard.cpp
- uninitialized class members in afsclass/*
- cm_config.c looks like it has code commented out accidentally
- useless statement in alert.cpp
- no default case handling in problems.cpp
- strange use of & on booleans in set_clone.cpp
- fgets() and fclose() on closed stream in cellconfig.c
- memory leak in cellconfig.c
- *scanf into variables of unknown length in cellconfig.c
- incorrect pointer passed to getAFSServer() in cellconfig.c
- possible buffer overflows in userok.c
- address of array in bos.c
- too many arguments for printf() in commands.c
- return code not saved in bucoord/main.c
- bad types for argv arrays in bucoord/main.c
- probably incorrect initializer list in ol_verify.c
- extra argument to TLog() in lwps.c
- memory leak in cmd/cmd.c
- lack of typecast on malloc() in a couple files
- lower-case L for long constant in touch.c (is it a 1 or an l...)
- parentheses nesting error in util_cr.c
- apparently invalid case fall-through in util_cr.c
- various memory leaks in util_cr.c
- macro missing parens in crypt.c
- macro missing parens in quad_cksum.c
- null pointer deref in kpasswd.c (CVS work in progress?)
- Print_bos_ProcessState_p() code does not look correct
- extra argument to printf() in kas.c
- typo in vsprocs.c
- macro missing parens in iomgr.c
- address of array in threadname.c
- storing result of getch() in char type in waitkey.c (may not match EOF constant)
- storing pointer to local car in global in ptserver.c (benign -- it is in main())
- address of array in rx_lwp.c
- macro missing parens in rx_packet.h
- impossible == (signed vs. unsigned?) in rxdebug.c
- bogus constants in xdr.c and xdr_array.c (possible security implications?)
- incorrect test of fd for open file in update/server.c
- dangerous unparenthesized macro in get_krbrlm.c
- buffer overrun in regex.c
- missing comma causes string concat and bad array init in vlclient.c
- comparison of string < 0 in ntops.c
- default case has no code in vos.c
--
Joe Buehler
>>>>
Comments: Several comments for FIXME left in the code - unaddressed
This patch addresses a number of problems with printf-like functions.
Most of them are %x formats applied to pointers (which could be a
problem depending on the architecture I would assume). There is a
%p format for pointers on many machines but I don't know if it
applies to all supported OpenAFS platforms so I didn't go that route.
There is a buffer overflow fix to ktime.c
There are a couple places where incorrect format characters were used.
One call had two arguments swapped.
Other fixes include the use of PrintInode() and %s formats for
printing inode numbers. The code was inconsistent in this regard -- sometimes
PrintInode() was used, sometimes it was side-stepped.
There is one place where a local shadowed another variable, so I renamed
the local.
The last segment points out that an fdset need not be anything printable
with an integer format.
--
Joe Buehler
Comments - The fdset comment relates to a WinSock only file on which
the size is a pointer to int. Modified the source to use a %p instead
of %x as it is supported on Windows.
Added an assert(p != NULL) to src/rx/rx_packet.c
This patch mainly makes explicit some initializations that were implicit.
There are several places where it looks like the missing initialization
may be a bug, and I have inserted comments to that effect in the
relevant patches. Someone needs to look at them and supply
whatever is missing (if anything is).
In make_keyperm.c, an array was sized too large.
--
Joe Buehler
the $< macro support in solaris make is different from every other make
due to POSIX not being fully specific. a perl script cleans up the mess,
and gives us a different mess.
* Change handling of CM_ERROR_NOIPC to return an Access Denied
error instead of a Bad Network Name error. The reason is that
Bad Network Name results in a subsequent query by many apps
to find a good network name which cannot be accomplished.
Access Denied is more appropriate and results in an immediate
error return.
* Disable the Loopback Adapter hack for operating systems prior
to Windows XP because the Loopback adapter on previous versions
does not perform loopback operations on Broadcast messages
which are necessary for the proper registration of the
NETBIOS name for the AFS Service.
* Many minor corrections to uninitialized variables; spelling
errors; formatting errors; etc.
#undef REALLOC before importing drivemap.h to prevent the use of the
wrong memory allocation routines.
Remove extraneous code which computed strings which are no longer used
and worse produced misleading debug information
Improved consistency of drive mapping when HIGHSECURITY is in use
Changes to afscreds to place the obtain tokens dialog into a separate
thread to prevent blocking of the Windows Message queue. Requires
utilization of mutex semaphores to protect credential data structures.
Previous versions of afscreds would set/unset the timer event every
time the program received an event indicating user activity including
dragging the mouse across the systemtray icon. This resulted in
extremely unpredictable behavior. Now the timer event is only turned
off when it must be turned off; and turned on when it must be turned on.
The result is a credential expiration check once a minute.
Remove another file which was included in the bkbox patch but is really
autogenerated.
Add a command to dolastcmp.bat to conditionally delete golast.bat if
it exists. Otherwise, the initial CD command which is meant to be
written to the file is lost.
This massive patch contains changes in several significant areas for Windows:
- the ability to specify the mount point to be something other than /afs
- functionality to assist debugging of the NT Services
- support for languages other than English (NTLang.bat)
- revisions to the Build system to support separate trees for src, obj,
dest and free or checked; allow any MS compiler to be used
- updates to NSIS installer build
- mutex locking added to critical locations
- updates to IS5 directory tree creation
- update to afswsNetscape_config.sh
FIXES 2521
The issue: when you restore an incremental dump to an existing volume,
the creation timestamp of the target volume gets reset to the current timestamp
(literally the timestamp of when the 'vos restore' command is being executed).
That messes things up for any subsequent 'vos release' operation, because such
operation then needs to do a full release rather than an incremental one. For
large volumes that can be quite an issue.
FIXES 2498
CheckHost() sets the HOSTDELETED flag on a host, does its
touch, calls H_UNLOCK at the end of its function;
AddCallBCal1 in a different thread grabs the lock, does its
thing. Gets to GetSomeSpace_r(), which calls
h_Enumerate_r; the host in question isn't held, so
h_Enumerate_r calls h_Hold_r and h_Release_r on the host
that CheckHost() set the HOSTDELETED flag on; h_Release_r
sees the HOSTDELETED flag and calls h_TossStuff_r, poof, we
have our broken host entry for ClearHostCallbacks_r to trip
FIXES 2518
namei_dec now logs if you have open ihandles when you unlink a file
====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
FIXES 2518
flush all dir buffers we have cached when rewriting a volume from a restore
avoids holding an ihandle which has an open fdhandle for an unlinked file
====================
FIXES 2518
remove logging code for now. it appears to trigger on some possibly legitimate operations.
use multi Rx to GetTime all servers we wish to talk to in parallel. This
should have the effect of compressing the amount of time to time out all
fileservers to (1 times full set of Rx transmit intervals) instead of (n times
same). VLservers get handled out of band and so aren't in scope for this
change.
without this, if you're in a directory that the second or later entry in a
sysname list resolved to, pwd returns ESTALE. force the true path to have its
dentry cached.