Jeffrey Altman [Thu, 20 Aug 2009 14:54:47 +0000 (10:54 -0400)]
Windows: cleanup smb polution of non-smb modules
There are a variety of functions that are declared in smb modules
that are used within non-smb modules. In order to reduce some of
the polution, several time conversion functions and the thread
priority operations are migrated to cm_utils. As part of this
migration the unused !USE_NUMERIC_TIME_CONV time implementations
are removed.
In addition, an unnecessary use of an SMB preprocessor symbols
is removed from cm_freelance.c and smb_ioctls.h is no longer
included within afsd.h.
Jeffrey Altman [Thu, 20 Aug 2009 18:30:27 +0000 (14:30 -0400)]
Windows: Init root.afs before smb_Init
It is not safe to initialize the root.afs cm_scache object
after the SMB package. Break it out of afsd_InitDaemon()
into its own afsd_InitRoot() and call from afsd_InitCM().
Russ Allbery [Wed, 19 Aug 2009 23:07:27 +0000 (16:07 -0700)]
Describe 's' PTS group permissions more accurately
PTS groups with 's' access permissions can be examined by members of the
group and the owner of the group in addition to system:administrators.
State this in the manual page.
Jeffrey Altman [Thu, 20 Aug 2009 13:21:53 +0000 (09:21 -0400)]
Windows: Ensure consistency of error code mapping
For Windows, the error mapping table used throughout the system
is located in util/errmap_nt.h. This table was incomplete and
WINNT/afsd/cm_utils.c added additional mapping locally. Move
said error mapping to util/errmap_nt.h.
When including afs/unified_afs.h it must be done after including
afs/errmap_nt.h. Otherwise, undefined errors are mapped to EIO
which should not be.
Felix Frank [Tue, 14 Jul 2009 08:57:21 +0000 (10:57 +0200)]
Move statistics keeping from afs_dcache to afs_fetchstore.
More context of the afs_CacheFetchProc() call in GetDCache is now inlined
in the afs_CacheFetchProc. Boosts readability of GetDCache and saves
stack, as counter pointers need not be passed anymore. The statistics
code is more readable due to lesser indentation.
Jeffrey Altman [Wed, 19 Aug 2009 22:10:43 +0000 (18:10 -0400)]
Windows: cm_conn_t must not be referenced after cm_Analyze is called
The 64-bit Large File Support added a reference to the cm_conn_t
object after cm_Analyze() is called and releases the hold. This
permits the object to be freed if it is appropriate to do so
which can result in an invalid memory reference.
Jeffrey Altman [Wed, 19 Aug 2009 12:04:30 +0000 (08:04 -0400)]
Windows: Permit build system to update symbol store
Microsoft Debugging Tools for Windows, Visual Studio Debugger,
and SysInternals tools can all make use of a Symbol Server.
http://msdn.microsoft.com/en-us/magazine/cc163563.aspx
The commit adds functionality to the build system to automatically
add binaries and symbols to a symbol store during the build.
This functionality is only enabled if two environment variables
are defined:
SYMSTORE_EXE - specifies the location of symstore.exe
SYMSTORE_ROOT - specifies the location of the symbol store
an optional environment variable permits an arbitrary comment
to be added to the symbol store history file.
SYMSTORE_COMMENT - arbitrary text to be added to the history
Simon Wilkinson [Tue, 18 Aug 2009 21:31:38 +0000 (22:31 +0100)]
Make MacOS installer pane permit dashes
The MacOS installer only permits characters in [0-9A-Za-z] in cellnames.
However, OpenAFS itself will also allow dashes, and they're in use by some
sites.
This trivially amends the installer pane to permit dashes.
Michael Meffie [Tue, 18 Aug 2009 18:51:57 +0000 (14:51 -0400)]
Fix stack corruption on 64 bit linux when md5inum is enabled
Fix a stack overflow on 64 bit linux which corrupts the stack
saved arguments and causes a kernel panic. This bug is seen
on platforms where ino_t is 64 bits and the md5inum sysctl
option is enabled.
Jeffrey Altman [Mon, 17 Aug 2009 16:33:09 +0000 (12:33 -0400)]
Windows: Be more conservative about checking error conditions
It has been reported that winlogon.exe is crashing on some
systems. The reports indicate that the failure is somewhere
in GetLogonDomainOptions. This commit ensures that we are
more conservative about the assumptions that are made regarding
which Lsa operations can fail.
Jeffrey Altman [Sun, 16 Aug 2009 12:43:23 +0000 (08:43 -0400)]
Windows: Prevent smb_StartedLock use before initialization
The smb_StartedLock osi_mutex can be obtained before
initialization due to a race if the IP address configuration
is in a state of flux as afsd_service is starting up.
To avoid the problem call cm_InitDaemons() after smb_Init().
This race is the cause of the periodic assertions in some
environments when lock order validation is enabled.
Jeffrey Altman [Sat, 15 Aug 2009 01:40:22 +0000 (21:40 -0400)]
Windows: Prevent cm_daemon thread from terminating during suspend
Remove the check for powerStateSuspend that caused the cm_daemon
thread to terminate when the machine enters suspend mode. When
the machine awakens there is no thread to check the down server
state, new IP address bindings, etc.
Felix Frank [Tue, 14 Jul 2009 08:51:03 +0000 (10:51 +0200)]
Move context of CacheFetchProc from afs_dcache.c to afs_fetchstore.c
GetDCache() is quite bloated. This inlinining makes code more
readable. For protocols to come besides rxfs (such as rxosd), some
initializations may need to be performed differently. Thus, much
has to be moved to the specific rxfs_fetchInit() function rather than
afs_CacheFetchProc() proper.
Simon Wilkinson [Wed, 22 Jul 2009 22:05:48 +0000 (23:05 +0100)]
Fix gtx_create calls to all share a prototype
All of the different _create calls need to share a prototype, so
function pointers can be stuffed into a structure. Use an anonymous
pointer so that we can acheive this.
Asanka Herath [Wed, 12 Aug 2009 18:56:56 +0000 (14:56 -0400)]
Handle more RPC service names
While the Windows client only implements support for WKSSVC and
SRVSVC RPC services, it should be aware of and handle requests
for other well known service names.
This patch refactors service name checks to a separate
MSRPC_IsWellKnownService() function. In addition, it separates
the tests for IPC TIDs from the test for well known service
names. An IPC TID may be used for generic pipe operations as
well as for RPC message pipe operations. Therefore the fact that
a TID was opened for IPC doesn't necessarily mean that it will
only be used for RPC.
Asanka Herath [Wed, 12 Aug 2009 17:57:11 +0000 (13:57 -0400)]
rand_s isn't supported on older Visual C compilers
We still support building on Visual Studio 2003 where rand_s() is
not available. If we are building on a Visual C compiler prior
to version 15.00, failover to srand()/rand() instead of using
rand_s().
Jeffrey Altman [Tue, 11 Aug 2009 14:37:19 +0000 (10:37 -0400)]
Windows: Dfs Referrals Processing. Not all errors are errors.
When processing a Dfs Referral request, not all lookup errors
should be treated as if the path does not exist. Servers being
down or busy, volumes offline, cell vldb servers not found, etc.
do not mean that the client should go searching elsewhere to
evaluate the path.
Jeffrey Altman [Tue, 11 Aug 2009 12:43:53 +0000 (08:43 -0400)]
Windows: Avoid unnecessary DNS lookups
Windows will attempt to open connections to a broad
range of pipe service (share) names which do not contain
a dot in them. Attempts to search for these names as
cell names in DNS result in timeouts and sluggish behavior
when browsing \\AFS in the Explorer Shell.
To avoid this problem, do not perform a DNS lookup for a
cellname that doesn't not contain a dot in it.
Jeffrey Altman [Tue, 11 Aug 2009 12:59:39 +0000 (08:59 -0400)]
Windows: Setting Server Preferences
The Windows cache manager can apply administrator specified
server preferences as specified in the registry. When these
rankings are applied the CM_SERVERFLAG_PREF_SET flag was not
set on the cm_server_t object. In addition, appropriate locking
was not being used in the places where the flag was set.
Felix Frank [Thu, 2 Jul 2009 07:14:13 +0000 (09:14 +0200)]
Unite CacheFetchProcs and add abstraction calls.
The cache type specific differencies among afs_MemCacheFetchProc
and afs_UFSCacheFetchProc are divided into two sets of "fetchOps".
Upon rxfs_fetchInit, the appropriate set is chosen.
Asanka Herath [Fri, 7 Aug 2009 02:56:42 +0000 (22:56 -0400)]
Windows: Implement SRVSVC and WKSSVC RPC interfaces
Windows uses RPC over SMB to communicate with file servers for
administrative tasks including enumeration and queries of file
server shares. This patch implements support for RPC over SMB
and partially implements the SRVSVC and WKSSVC RPC interfaces.
Andrew Deason [Mon, 10 Aug 2009 17:06:26 +0000 (12:06 -0500)]
Restore util des dependency
Commit c3c8a3e2f912855addc2c430f909bdce912e3670 removed 'des' as a
dependency of the 'util' target, but util still depends on des since
rxkstats.c includes des.h. So, put the des dep back in.
Change static max allocators to 30. Add atomic add/sub macros returning
original value, based on CASIO. Add interfaces to add and remove generic
allocator caches. Add atomic inc/dec/sub macros using MCAS primitives.
Add inline assembly for x86_64 and shim for Solaris (9+) atomic operations,
providing Solaris x86 and alternate shim for Solaris Sparc. Set interface
adapted for iteration and generalized for use with opaque key, value
pointers. File cas_skip_func.c provides kv interface, cas_skip_adt.c
provides kv interface, plus iteration on skip lists. Casual dependencies
on stdio and exit() defined out.
Jeffrey Altman [Thu, 6 Aug 2009 03:25:42 +0000 (23:25 -0400)]
Windows: Preserve GetLastError during WinTorture testing
When an error occurs during the WinTorture scripts the
actual error was not always being preserved because
subsequent Win32 calls were executed before the value
was logged.
In at least one case, the variable used to store the
last error was not initialized nor assigned in all data
paths.
Marc Dionne [Mon, 27 Jul 2009 18:24:15 +0000 (14:24 -0400)]
kauth warning reduction
Warning removal for various functions that manipulates keys and use
several data types interchangeably.
Inline helpers are introduced to convert between the types and are
used when making function calls to target the appropriate type:
des_prototypes.h
cblockptr_to_cblock: des_cblock * to des_cblock
charptr_to_cblock: char * to des_cblock
charptr_to_cblockptr: char * to des_cblock *
rxkad_prototypes.h
ktc_to_cblock: struct ktc_encryptionKey * to des_cblock
ktc_to_cblockptr: struct ktc_encryptionKey * to des_cblock *
kauth_internal.h
EncryptionKey_to_cblock: EncryptionKey * to des_cblock
EncryptionKey_to_ktc: EncryptionKey * to struct ktc_encryptionKey *
ktc_to_EncryptionKey: struct ktc_encryptionKey * to EncryptionKey *
- parameters are adjusted for tkt_DecodeTicket(5), replacing the char *
key with struct ktc_encryptionKey, to match usage
- the get_key function is changed to have a void * parameter, to match
usage
- rxkad_prototypes.h includes des.h to get the des_cblock definition.
This causes conflicts for a few files where the kerberos headers are
also included - aklog/aklog_main.c and WINNT/afsd/afskfw.c
Use NO_DES_H_INCLUDE in thoses cases to skip the new parts of
rxkad_prototypes.h
Claudio Bisegni [Mon, 3 Aug 2009 17:05:46 +0000 (19:05 +0200)]
Removed user perspectivev3 file in xcode project and update the gitconfig
gitconfig in src/platform/DARWIN/AFSPreference has been modified to ignore the perspectivev3 that is created by xcode for window layout.Has been also delete the file created for the user
Claudio Bisegni [Mon, 3 Aug 2009 14:40:05 +0000 (16:40 +0200)]
Cleaned most warning OSX OpenAFS preference and completed the AFSBackgrounder implementation
At startup the preference pane check for the presence in ~/Library/LaunchAgents of the file it.infn.lnf.network.AFSBackgrounder.plist that. The agent could be started in OpenAFS preference pane view.
AFSBackgrounder has replaced the NSMenuExtra, when it doesn't quit well launchd restart it. AFSBackgrounder can be used also for other work, for now, at login it check the user preference for get token.
Has been made some refactoring in code for remove most warning.
The unused think are been delete from project.
Start coding OSX Backgrounder Application, for OpenAFS Preference Pane, that user NSStatusItem
To prevent future compatibility with osx we must use NSStatusItem instead NSMenuExtra that is not documented api.
For this has been created a background only application that will manage all function managed by current NSMenuExtra
Restore permission documentation in bosserver man page
The original IBM HTML documentation had a table showing the permissions
that bosserver expects and sets when it creates the directory structure
for AFS. That table was accidentally dropped in the conversion to POD.
Restore it from the HTML shipped with an older version of OpenAFS.
Andrew Deason [Thu, 30 Jul 2009 17:43:27 +0000 (13:43 -0400)]
Fix UKERNEL afs_mount arguments
Change 73 (commit dc6299f5) changed the order of arguments for the
UKERNEL implementation of afs_mount, causing uafs_mount to segfault
whenever called. This changes them back to what they were before.
Andrew Deason [Mon, 20 Jul 2009 17:31:44 +0000 (12:31 -0500)]
Add additional vlprocs safety checks
This adds additional safety checks to the vlserver's implementation of
the VL_CreateEntry, VL_ReplaceEntry, and VL_UpdateEntry RPCs. Now in all
three of these, any new volume ID that would be added to the VLDB or
that would be newly referenced in a VLDB entry is checked against
duplication in other entries. Additionally, any new volume names added
to the VLDB (either by creation, or modifying an existing volume) are
checked against duplication. This should make it impossible for clients
to make a volume ID or volume name correspond to multiple volume groups
(either conceptually or literally in the vldb).
This also alters the vlserver's implementation of the VL_GetNewVolumeId
RPC such that the vlserver increments maxvolid until the range of volume
IDs [*newvolumeid, *newvolumeid+bumpcount) is unused. 'vos' is modified
to only allocate one new volume id at a time, so we don't skip over
potentially-usable vol ids.
Windows: test for and react to SMB Extended Session Timeout support
SMB Extended Session Timeout Support is available only on
Windows systems with specific versions of the mrxsmb.sys driver.
Add a test for those driver versions. If a supporting version
is present use the extended session timeout value instead of the
standard timeout value for the redirector timeout. Adjust the
rx hard, conn, and idle timeouts accordingly.
The SMB module will define the ExtendedSessTimeout registry
value if it does not exist. We rely on the fact that this is
done after the rx timeout values are calculated. The mrxsmb
driver only reads the value at boot.
Simon Wilkinson [Tue, 28 Jul 2009 10:09:30 +0000 (11:09 +0100)]
Code cleanup for vlserver
Move the cnvldb.h include so it's after vlserver.h
Don't define MAXSERVERS in cnvldb.h (it's already defined elsewhere)
Cast nvldbentry(s) to vldbentry to avoid warnings from display_entry
Volume IDs are unsigned
Use var[0]='\0' rather than sprintf(var, "");
Reviewed-on: http://gerrit.openafs.org/237 Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Tue, 28 Jul 2009 11:13:10 +0000 (12:13 +0100)]
Cleanup for the USS directory
Add additional header files for prototypes
Add additional prototypes to header files
yyerror() is internal, not external. Make it static while we're at it.
ANSIfy various function definitions
Unsigned vs signed cleanup
Reviewed-on: http://gerrit.openafs.org/239 Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Mon, 27 Jul 2009 21:32:01 +0000 (22:32 +0100)]
More warnings cleanup for vol/
Prototype a number of functions
Add additional includes as required
Make some existing prototypes match the actual declarations
Volume IDs are unsigned in most of the code, change this bit to match
Make various Procs take an anonymous pointer, so they can be type checked
Add vol_internal.h for prototypes internal to this package
Reviewed-on: http://gerrit.openafs.org/235 Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Marc Dionne [Mon, 27 Jul 2009 15:29:34 +0000 (11:29 -0400)]
Eliminate some "implicit function declaration" warnings
Include appropriate header files to eliminate some warnings for
implicit function declarations. These are simple cases that don't
generate new warnings because of the prototypes.
Use grp.h if it exists to get setgroups() definition.
Reviewed-on: http://gerrit.openafs.org/233 Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Tested-by: Jeffrey Altman <jaltman@openafs.org> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Adam Megacz [Mon, 27 Jul 2009 03:32:07 +0000 (20:32 -0700)]
In rxi_SendPacket[List], down hosts if ENETUNREACH or equivalent
This patch causes rxi_SendPacket[List] to "down" a host if
rxi_Sendmsg() returns -ENETUNREACH (or equivalent). Previous behavior
only did this check if defined(KERNEL) becauase non-defined(KERNEL)
implementations did not return meaningful error codes from
rxi_Sendmsg().
Jeff Altman <jaltman@openafs.org> supplied the logic for the
AFS_NT40_ENV case; I was not able to test this (I do not own a
Windows license) and took him on his word.
Reviewed-on: http://gerrit.openafs.org/59 Reviewed-by: Adam Megacz <megacz@gmail.com> Tested-by: Adam Megacz <megacz@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Marc Dionne [Mon, 27 Jul 2009 02:28:29 +0000 (22:28 -0400)]
Unused variable cleanup
Eliminate some warnings for unused variables. In most cases the
variables are not used at all and are removed; in a few cases the
declarations need to be ifdef'ed to follow the code that uses them.
For a typical build here this removes 24 warnings.
Reviewed-on: http://gerrit.openafs.org/232 Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Jason Edgecombe [Mon, 27 Jul 2009 01:26:59 +0000 (21:26 -0400)]
Future-proof the wording of the auditlog options in the man pages
It was suggested that the auditlog option should not say there is one
record per RPC. In the future, there might be a need for multiple records
per RPC.
Adam Megacz [Sun, 19 Jul 2009 18:00:41 +0000 (11:00 -0700)]
Use -errno or WSAGetLastError() as return value from rxi_Sendmsg()
This patch causes the pthread and lwp implementations of rxi_Sendmsg()
to use -errno or WSAGetLastError() as the return value if it is
positive. This is required in order to communicate more meaningful
error conditions to rxi_SendPacket[List], which should "down" a host
immediately when it observes ENETUNREACH.
Jeff Altman <jaltman@openafs.org> supplied the logic for the
AFS_NT40_ENV case; I was not able to test this (I do not own a
Windows license) and took him on his word.
Reviewed-on: http://gerrit.openafs.org/58 Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Adam Megacz <megacz@gmail.com> Tested-by: Adam Megacz <megacz@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Windows: Add cm_req_t parameter to buf_Get* functions
The buf_Get* functions do not currently accept a cm_req_t
parameter. As a result they allocate their own cm_req_t on
the stack even though all callers already have one that can
be used.
Portable lock-free data structures by Keir Fraser (MCAS)
The MCAS suite, previously released as lock-free library, under a
non-restrictive license.
This software includes software previously released in 2003 under a
GPL license, but released by the original copyright holder, Keir
Fraser, under a BSD license, on 5/28/2008.
Document that the quotas passed to fs setquota, vos create, and vos
setfields and the size passed to fs setcachesize may take a suffix
indicating the unit. This documents the change in behavior implemented by 54c0a3f3e6575fa5af39ddd797d5381c36b48001.
Fix a copy/paste error in the vos create -maxquota option definition.
Andrew Deason [Wed, 24 Jun 2009 21:46:27 +0000 (17:46 -0400)]
Enhance audit logs to support SysV message queues
Adds support for sysv message queues for fileserver audit logs. This
also organizes the audit log code into various 'interfaces', of which
there are two: the original 'file' interface, and the 'sysvmq' interface
that this adds. The interface is configurable at runtime with the
-audit-interface switch.
Andrew Deason [Mon, 6 Jul 2009 15:29:20 +0000 (10:29 -0500)]
Allow specifying vos create/addsite volume IDs
This adds the -id option to 'vos create', and the -roid option to 'vos
create' and 'vos addsite'. This allows the user to manually specify the
volume IDs that a new RW or RO volume will get (or explicitly specify
that an RO volume ID should be unset), instead of always relying on the
volume IDs retrieved from the vlserver.
Running bos -noauth should not require client CellServDB configuration
When setting up a new cell, the admin is instructed to use "bos -noauth"
to configure the servers and only afterwards create the client configuration.
This leads to a catch-22 since currently bos -noauth fails if there is no
client configuration even though it is not required.
This change avoids the call to afsconf_Open() which is only required
if tokens are being acquired.
Windows: Move src/NTMakefile to top-level in order to avoid copying
For some unknown reason the Windows top-level NTMakefile is stored
at src/NTMakefile and must be copied to the top-level before it can
be used. Now that git permits easy file moves, relocate src/NTMakefile
to where it belongs.
This patch completes the implementation of an install time prompeter
for information about the local AFS cell, which is then used to populate
the ThisCell file. It removes the need for manual editing of
configuration files as part of the installation.
(Build system modified by Simon Wilkinson from Toby's original patch)
Remove hand-crafted equivalents of AC_SEARCH_LIBS for socket, connect,
and gethostbyname functions. The only effective difference between
this code and AC_SEARCH_LIBS was to define the HAVE_* macros for the
functions, which are not used anywhere in the tree.
Remove AC_FUNC_SETVBUF_REVERSED. This call no longer does anything in
current versions of Autoconf since the last system with this problem
was based on SVR2 and became obsolete in 1987. Remove the one place in
the source tree where the results are used.
Windows: rename compile_et.pod to afs_compile_et.pod
Gerrit 175 renamed compile_et and compile_et.pod to afs_compile_et*.
Fix the Windows build system to process the new pod file name
and modify the WiX installer scripts to install afs_compile_et.html.
Simon Wilkinson [Tue, 21 Jul 2009 19:53:57 +0000 (20:53 +0100)]
Further code cleanup for the backup suite
Protect butm.h against multiple inclusion
Prototype more functions for internal use in bucoord
Remove some unused variables
Include additional headers as required
Prototype exported functions in budb
Make SendReturnList helper function generic, by using a void * rock