If -nomount was passed, we don't try to mount /afs. So, there is no
reason to require its existence.
Change-Id: Id426f345b94de8f2d673af62fe14f803d1c77752
Reviewed-on: http://gerrit.openafs.org/3822
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The Netbios NCBRESET command resets all of the Netbios state
associated with the LAN adapter including the name bindings.
In response to a detected LAN adapter IP address change, the
smb_LanAdapterChange() function is called to determine if any
Netbios LAN adapter bindings that were in use or should be in
use by afsd_service were altered. As part of the check,
lana_GetUncServerNameEx() is called which in turn calls
lana_FindLoopback() which in turn issued a lana_IsLoopback()
for each LAN adapter with the 'reset adapter' flag set to TRUE.
Calling lana_IsLoopback() with 'reset' equal TRUE was fine
when lana_GetUncServerNameEx() was only called from smb_Init(),
but it is not fine when called after the service is processing
calls. By resetting the adapter the binding of the netbios name
"AFS" (or "<MACHINE>-AFS") is removed and all outstanding calls
are canceled. If the SMB redirector attempts a reconnect during
the window before NCBADDNAM is called to re-bind the name, a
negative cache entry will be placed in the netbios name lookup
table that will prevent the SMB redirector from connecting to
the client for several minutes.
If the environment is one in which frequent IP address change
events are triggered, it is possible that the SMB redirector
will never be able to reconnect to the service.
This patchset adds a flag, LANA_NETBIOS_NO_RESET, to the
lana_GetUncServerEx interface which permits smb_LanAdapterChange()
to avoid the undesirable reset. This negative flag was selected
in order to avoid changing the current default behavior as the
lanahelper library is used by out of tree installers and it
is preferred that OpenAFS avoid breaking them unnecessarily.
Change-Id: I094af7b342d27c65025235888705af8af1a7d56e
Reviewed-on: http://gerrit.openafs.org/3821
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
we looked for a set character (not NULL) at cpos before, instead
of looking for a non-NULL pointer. fix it.
Change-Id: Iaa370980b6482f1c50e11f161e3208c039043a6f
Reviewed-on: http://gerrit.openafs.org/3874
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Fix the superuser tests so that they can be run on Linux. This
requires explicitly including sys/wait.h so we can use waitpid,
and changing some initialisation ordering so that we initialise
the RX library before we try and fake an rxkad token.
Change-Id: I8439ff6211a50c749ea22819e2d836409a64d2ad
Reviewed-on: http://gerrit.openafs.org/3776
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Some unconnected changes break the Linux linker when faced with this
library list. librx is included too early, and liblwp isn't included
after the second inclusion of librx. Reorder the library list to fix
this problem, and so it matches the library order in the rest of our
modules.
Change-Id: Iba19111f613c70c8a6e66539b437a99d58faf7f4
Reviewed-on: http://gerrit.openafs.org/3775
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Install the rx_atomic.h header into the build-wide header directory,
so that modules other than RX can make us of it.
Change-Id: Id3c3d0c486412942fb0772d7a8cf5d2fc1bf8876
Reviewed-on: http://gerrit.openafs.org/3774
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Move the crypto include files which are used for kernel builds into
the hcrypto directory where they logically belong.
Change-Id: Ic904e63e48d09e6a2049f4e1c4433980ecf0fa1e
Reviewed-on: http://gerrit.openafs.org/3767
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The recent refactoring of cm_CheckCBExpiration introduced
a lock ordering error between the cm_scache_t rw lock and the
cm_scacheLock. This patchset fixes the error by dropping the
cm_scacheLock as each cm_scache_t is being processed.
Change-Id: Ib9e45abc5a43ca550d4a2a7923e3b30017e9fbf9
Reviewed-on: http://gerrit.openafs.org/3773
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
The aklog Makefile was setting XCFLAGS, but then not actually using them
which meant that we never used the correct include path for the Kerberos
libraries, or defined ALLOW_REGISTER
Change-Id: Iae573bc216b42bdf9aa49e9f5f42a883e08b6265
Reviewed-on: http://gerrit.openafs.org/3766
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
FD_t is an abstract type. Invalid file decriptors are == INVALID_FD.
In most places this module does the right thing. Fix the last
stragglers where it is testing as less than zero.
Change-Id: I9ae3db8775ce69da070a4ebef5a532e1db035977
Reviewed-on: http://gerrit.openafs.org/3768
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Signal to the vfs that we don't support path RCU walk in
d_revalidate. It will call back in non-RCU mode.
Change-Id: I15d0d30131b205a38577666122b067807282a7cd
Reviewed-on: http://gerrit.openafs.org/3759
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
In 2.6.38, the super block structure has a new field to hold the
default dentry ops. The vfs will automatically set it for new
dentries in most cases.
Set s_d_op to our set of operations, and omit setting the dentry
ops where the vfs will already do it (and where new locking rules
prohibit it).
Change-Id: I9d738bdd528577d0a7ccd307246b5e935379c84d
Reviewed-on: http://gerrit.openafs.org/3758
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When we receive an RX_PACKET_TYPE_BUSY packet, we currently ignore it.
This is a problem when the server has a long-running call on that same
call channel that we don't know about, since we will then keep
retrying the call on the same channel and keep getting
RX_PACKET_TYPE_BUSY responses.
Try to avoid this by returning the RX_CALL_TIMEOUT error when we get a
BUSY packet and there are other free call channels available on the
conn. When the application gets the error and retries the call, we
avoid using the same call channel again where possible. When all of
the call channels appear busy, we revert to effectively the old
behavior of retrying the call on the same channel until we get an
RX_CALL_DEAD (or similar) error.
FIXES 128671
Change-Id: I29b84aa36dcc856528c30d26811e5d6c4b78a1ca
Reviewed-on: http://gerrit.openafs.org/3431
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit updates the code imported from heimdal to
8ce821c38744b30e226ff024f675668b991b984d (switch-from-svn-to-git-1998-g8ce821c)
Upstream changes are:
Asanka C. Herath (2):
Revert use of backslash as an escape for double quote in config strings
Condition roken's ssize_t definition for compatibility
Love Hornquist Astrand (1):
don't undefined SLIST
Change-Id: I8855e060e88008f95eb2b24b029843081702fc04
Reviewed-on: http://gerrit.openafs.org/3761
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
cm_volume_t flags was used for two categories of flags. The first
protected by the cm_volume_t->rw lock. The second protected by
the global cm_volumeLock. Separate the flags field into two
afs_uint16 fields and break the flag space into FLAG and QFLAG.
Add assertions to the volume LRU functions to ensure that they
are always called with cm_volumeLock write-locked.
Correct two locations where cm_AdjustVolumeLRU() was called
read-locked instead of write-locked.
Change-Id: I7991b995a3c981cd5d08d9cbba09badc81518a5a
Reviewed-on: http://gerrit.openafs.org/3760
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
In SalvageIndex, if check is true, we're only supposed to check for
consistency and not actually change anything (this is enforced by an
assert later on). The check for vnode magic consistency breaks this
assumption, and just always fixes the vnode.
Change this so we just error out if check is set, and the vnode magic
is wrong.
Change-Id: I9e2d3bd5e9e340a9b2ac66d70d52aa110b512561
Reviewed-on: http://gerrit.openafs.org/3756
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
somehow this got corrupted earlier. fix it to use the right arg.
Change-Id: Ic597412819a9186d7b4b0b0c7e93e7c75b9a979a
Reviewed-on: http://gerrit.openafs.org/3755
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Implement a multi_RXAFS_GiveUpAllCallBacks version of
cm_GiveUpAllCallBacksAllServers() and use it in place of
the non-multi version.
Change-Id: I6d630ab7a5cf3a3434d088a9e8cde046b541cd3f
Reviewed-on: http://gerrit.openafs.org/3648
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
SetFilePointerEx takes specific values
(FILE_BEGIN/FILE_CURRENT/FILE_END) whilse fseek requires SEEK_SET,
SEK_END, SEEK_CUR. It turns out that these overlap, but we should
not let that pass unchallenged.
SetFilePointerEx returns nonzero for success zero for failure. fseek
returns the other way around.
Neither of these changes currently matter, but we should fix them.
Change-Id: Ib31cf6265fa1e714232ff0d2e099c657e41f17e9
Reviewed-on: http://gerrit.openafs.org/3746
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
nt_read and nt_write were defined to take a char* buffer which was
then cast to a void *. Meantime every call of OS_READ and
OS_WRITE were casting to a char*.
Equally every call of OS_OPEN was passing down a const char*,
causing warnings.
This checkin fixes this:
nt_read : char* to void*
nt_write: char* to const void*
nt_open char* to const char*
Change-Id: Id4e138b9d347e1a9f35241e162a105d5f462b168
Reviewed-on: http://gerrit.openafs.org/3744
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
With OpenBSD 4.8, OpenBSD now uses gcc 4. With its new
defaults, the OpenAFS compile of the kernel module now
complains incessantly about the conflict between the
built-in malloc versus the kernel version (which has
extra parameters). Therefore, set -fno-builtin-malloc
when compiling the kernel module to remove the noise
since the differences can't be reconciled otherwise.
Change-Id: I7e28e6275ca90f73a8d1f65d82f1ccf2cc3a0ead
Reviewed-on: http://gerrit.openafs.org/3751
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
OpenBSD 4.8 no longer needs to include h/user.h in dir.c
and it's presence now gets in the way of the compile so
remove it.
Change-Id: Ie270f94db69f344c5c1a3942db395dbe3a47d5e9
Reviewed-on: http://gerrit.openafs.org/3750
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
With OpenBSD 4.8, curproc has moved from h/proc.h to
h/systm.h. Fix rx_event.c to reflect this change.
Change-Id: I38d4676d445bfafa47f2ae973d789d0b9f6a687a
Reviewed-on: http://gerrit.openafs.org/3749
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The label 'retry' in nt_open is not used and was causing a warning. Remove it.
Change-Id: I964d954e4f9cdb672c689a6e757a5f62bea8f65c
Reviewed-on: http://gerrit.openafs.org/3747
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The implementation has an assumption that all disk volumes have an
object name of \Device\HarddiskXXX (where XXX is a number). This is
wrong since the name is purely a convention and since about WXP they
have been called \Device\HarddiskVolumeXXX.
Either way it is spurious to assume the format and then try to compare
the XXX. This change just compares the strings. This is done in a
case insenstive manner which is the safer option. It is quite
feasible, but very unlikely that someone will uses 'case sensitively
different' object names.
Change-Id: Ifa91c88f2b17f747f30541b8833b722cf5993e48
Reviewed-on: http://gerrit.openafs.org/3745
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
If when parsing a directory page in cm_ApplyDir the consistency
checks fail, log a message and invalidate the page in case
it was a transient failure.
Change-Id: Iab690cd876a717fbdef30fb78e4ed559fa7e0a5a
Reviewed-on: http://gerrit.openafs.org/3742
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
OpenBSD follows the policy of using a separate common
param file (post 1.4.x). However, when introducing support
for i386 OpenBSD 4.7, this was not done and a single param
config header file was created instead. This patch changes
the param files for OpenBSD 4.7 so that they are
consistent with the other OpenBSD versions by using a
separate common param header file.
Change-Id: I9d828d2447a2d018eeea0fbe9f4c047ac819d209
Reviewed-on: http://gerrit.openafs.org/3725
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
nt_unlink: when opening a file handle to assign delete on close
status the caller must request DELETE permission.
nt_open: make sure that DELETE permission along with FILE_SHARE_DELETE
is requested if we wish to permit another CreateFile call in the future
to assign delete on close.
Change-Id: Ib971ecc098dbc5eb64dcbfed93c334397c9d8ac9
Reviewed-on: http://gerrit.openafs.org/3711
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
use NAMEI_SPECDIRC, NAMEI_INODESPECIAL, INVALID_FD and other
preprocessor symbols in place of numeric constants.
namei_create() on Windows must call namei_CreateDataDirectories()
and retry if the afs_open() call fails with either ENOTDIR or
ENOENT.
modify namei_HandleToName() on Windows to make its decision
process clearer.
Change-Id: Ib1dfbaa3afe81f57685c95cdcae749c67cc95598
Reviewed-on: http://gerrit.openafs.org/3712
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
On Windows, files opened via the CRT fopen or open
POSIX compatibility functions cannot be marked for delete
on close. Add a comment until such time as the use of
fopen and open on Windows can be replaced.
Change-Id: I9cec46bef332c981b2f64ba85e310783e3c71bc9
Reviewed-on: http://gerrit.openafs.org/3707
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
afs_sfsize_t is not always the same size as 'int'.
Avoid warnings by using afs_sfsize_t in the appropriate locations.
Change-Id: I88f7458421c3a9c2081597e5481d352bd5a2927a
Reviewed-on: http://gerrit.openafs.org/3706
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Inconsistent use of temporary file name bases resulted in
the temporary files never being deleted.
Change-Id: I0be59282488bb2db0f1b7b5200df5bd6ac285711
Reviewed-on: http://gerrit.openafs.org/3705
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Use OS_UNLINK in order to ensure that platform specific
unlink functions are called. OS_UNLINK is unlink on Unix.
Change-Id: Idcfc18345abe5532e9ebe97fc757d6f435c2af52
Reviewed-on: http://gerrit.openafs.org/3704
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The directory level represented by 'dirp2' does not exist on
Windows. Do not attempt to close the DIR object that was
never opened.
Remove unnecessary function prototypes.
Change-Id: Ib6b27e52f0120115173cb04893092ba6f2da32fe
Reviewed-on: http://gerrit.openafs.org/3703
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
For consistency use OS_DIRSEP and OS_DIRSEPC throughout the
package.
Change-Id: I7bb93b4fe7324492e71a6d303e2b74723aaefc5a
Reviewed-on: http://gerrit.openafs.org/3702
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
replace 'i' with 'dirl' and assign the new variable a value
before using it.
Change-Id: Ia93b6c75154b6f2a9238f0e9c2881d6c79c36540
Reviewed-on: http://gerrit.openafs.org/3701
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Separate the SetOGM function into two implementations to
match the other OGM functions. Implement the Windows version
as returning -1 always.
In the future, the OGM functions could be renamed to express
their purpose: saving and restoring the volume id and tag
associated with a file. Windows currently encodes this
information using the CreationDate and the file name but
in the future this information might be stored in an alternate
data stream.
Change-Id: I7e60cceb4548b7ad3a1e045f390e7052fece4926
Reviewed-on: http://gerrit.openafs.org/3700
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The manner in which addtoname() is used can often result
in double dir separators in path names. Check for it and
avoid doubling the separator in addtoname()
Change-Id: Ie33459bec3bcc93f81f13020cd35ed8c473b6ca5
Reviewed-on: http://gerrit.openafs.org/3699
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
in ih_reallyclose() clear ihP->ih_synced before dropped
the IH_LOCK. ih_reallyclose() is already committed to
performing the OS_SYNC() call. Failing to clear the ih_synced
flag before dropping the lock permits another thread, the ih_sync_all()
thread for example, to also conclude that it must sync the
file.
Change-Id: Icb928f7d2ec2342a57ed21b440ae0580c980e9d2
Reviewed-on: http://gerrit.openafs.org/3696
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
if AD is being used to verify authentication (e.g. via builtin)
don't allow get krb5 at login to succeed. since a helper does this we can't
grey the option, but we can decline to act on it.
Change-Id: I1f2bb891377c3ed9765f9e58141c77ec54d3ae22
Reviewed-on: http://gerrit.openafs.org/3690
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Revert the prior change that added directory creation
to nt_open(). nt_open() should fail and the caller should
create the directories. Failure to do so results in an
incomplete tree which confuses the salvager.
Change-Id: Ieb2a05baada2531dad1869e95823fe2006bdc2c6
Reviewed-on: http://gerrit.openafs.org/3709
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
namei_ogm_t is not used on Windows. There is no equivalent
to owner/group mode.
Change-Id: Ib0675f106bf5e77b006ebe5eae5d67ee232313e0
Reviewed-on: http://gerrit.openafs.org/3698
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Cast to DWORD since the results of the mask and shift
are guaranteed to be 32-bit. This avoids sixteen warnings.
Change-Id: Ifdb9356e207b4b8791b5923985a70efeb457edb1
Reviewed-on: http://gerrit.openafs.org/3695
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The executables built in src/vol are pthreaded. Therefore, they
require a pthread safe version of the src/dir objects. Instead
of building the dir object files in yet another directory, create
a mtafsdir.lib in src/dir and use it in src/vol, src/tviced and
src/tsalvaged.
Change-Id: I50017bd56ec741af1ff3fc1dd39208e610369088
Reviewed-on: http://gerrit.openafs.org/3693
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
afs_osi_Wakeup() was not being called with the proper argument,
causing afs_osi_Sleep() to fail forever while waiting for rxk_Listener
to wake up.
Change-Id: I1b650c57ae507987359d0cb230400d3d23984cfa
Reviewed-on: http://gerrit.openafs.org/3692
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>