fix read offset bug based a patch Bradford Powell submitted to the iRODS-Chat

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5566 ea137bd6-aa86-47b6-b90d-b101d9f19a90
more changes based on Bradford Powell's suggestions on iRODS-Chat

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5567 ea137bd6-aa86-47b6-b90d-b101d9f19a90
more fixes

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5568 ea137bd6-aa86-47b6-b90d-b101d9f19a90
Fix fuse client offset synchronization problems

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5569 ea137bd6-aa86-47b6-b90d-b101d9f19a90
A python test for seeking function of fuse client

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5570 ea137bd6-aa86-47b6-b90d-b101d9f19a90
Fix a double-free agent segfault when the user tries to replicate a
data-object to a resource that already has a valid copy.

This was found and reported by the RENCI EiRODS folks and is tracker item
1704 in their system:
https://code.renci.org/gf/project/e-irods/tracker/?action=TrackerItemEdit&tracker_item_id=1704&tracker_id=1704
There is also an item 1705 with some related test updates.

The tracker 1704 fix is to modify an input link-list of dataObjInfo
structures in chkCopyInResc but I decided to try a different approach
and added a new function to avoid the problem more directly, by
avoiding a free of the structure a second time.  This seems like the
safer approach to me as it is more specific to the error.  It looks
like existing code, chkCopyInResc, is just checking whether this would
be a duplicate so I didn't want to possibly adversely affect any of
that, particularly since I'm not familiar with the overall logic using
that, it's somewhat involved, and seems to work OK except for the free
at the end.

The problem can be reproduced by doing a second irepl to the same
resource, at least on the platform used at DICE-UCSD using iRODS
(tracker 1704 indicates that it takes 3 copies of the data-object
there).  So for us here, it's just (assuming resc2 is not the default
resource):
  iput file1 
  irepl -R resc2 file1
  irepl -R resc2 file1

I've also added a test like the above in icatTest.pl (part of
'irodsctl devtest' and so Tinderbox).  Before the code fixes in this
commit, that test would fail as the second irepl would fail as the
agent aborted.


git-svn-id: svn://irodssvn.ucsd.edu/trunk@5571 ea137bd6-aa86-47b6-b90d-b101d9f19a90
An update for the test for the previous commit, seems we need to do a
collection irepl to reproduce the error, at least in some cases.

But with this, I believe it does reproduce the problem that r5571
commit fixes.  I discovered this via some re-testing with the svn
version and removing the fix.



git-svn-id: svn://irodssvn.ucsd.edu/trunk@5572 ea137bd6-aa86-47b6-b90d-b101d9f19a90
When creating a resource, check that the resource name isn't blank.

This can be done via 'iadmin mkresc' if the user enters "" as the
resource name.  Once created, it's difficult to deal with.  We have a
number of basic checks on user input like this, but we (I) had missed
this one (probably since day one).

This was discovered via some testing done at a collaborating site and
reported to me in email.


git-svn-id: svn://irodssvn.ucsd.edu/trunk@5573 ea137bd6-aa86-47b6-b90d-b101d9f19a90
Added: variables or expressions as keys for the dot operator; loop over keys of key value pairs; loading new rule engine microservices defined in modules. New rule engine microservices are defined in microservice table by setting its number of arguments to 0xff. And they can access info provided by the new rule engine.

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5574 ea137bd6-aa86-47b6-b90d-b101d9f19a90
Add policy enforcement point for pre and post file transfer using server portal, currently support tcp connections.

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5575 ea137bd6-aa86-47b6-b90d-b101d9f19a90
Add temporary storage (key value pairs) for storage data within the same irodsAgent process.

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5576 ea137bd6-aa86-47b6-b90d-b101d9f19a90
new json microservice

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5577 ea137bd6-aa86-47b6-b90d-b101d9f19a90
fix some errors in the previous checkin

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5578 ea137bd6-aa86-47b6-b90d-b101d9f19a90
Log the commands (command and arguments) executed via the execCmd
function, including commands run via iexecmd.

This can be useful in certain situations and like, login events,
should be logged as a notice-type message (for sites logging
LOG_NOTICE events, which is recommended).


git-svn-id: svn://irodssvn.ucsd.edu/trunk@5579 ea137bd6-aa86-47b6-b90d-b101d9f19a90
When creating a postgres database, temporarily set PGPASSWORD as it
seems to be needed in some cases; follow-on to r5562 a few days ago.

This is a continuation of commit r5562 when I removed the set up of
the PGPASSWORD environment variable.  It did seem to work overnight in
tinderbox, successfully creating the datbase, but I noticed in some
testing today that in some cases createdb now prompts for the password
and fails if not entered.  The script attempts to pass it in via a
redirected file, but that no longer seems to work, and least when I
tried the irodssetup script by hand or via Tinderbox.  I'm not sure
why the same operation works in Tinderbox overnight; I tested in via
Tinderbox today too; it may be something to do with the new Postgres
build that is done at night (it might set the password somewhere
else).  But to be safer, I've added this setting and clearing of the
environment variable and it seems to work now.



git-svn-id: svn://irodssvn.ucsd.edu/trunk@5580 ea137bd6-aa86-47b6-b90d-b101d9f19a90
If PAM or GSI is enabled and iinit is creating some missing .irodsEnv
info (perhaps the whole file), also prompt for & set irodsAuthScheme.

Since password is default, I made it not-prompt if the auth scheme is
the only one missing, but otherwise, if GSI and/or PAM is enabled it
will prompt for the ones available and set the authentication scheme
in the user's .irodsEnv file for them.

I did some limited testing of this in PAM mode and it seems to work
fine and should work properly in the various modes.

This was requested by Andreas Lindqvist and Giacomo on irods-chat on
the thread:'iinit not saving .irodsEnv if using other authentication
scheme than irods password'



git-svn-id: svn://irodssvn.ucsd.edu/trunk@5581 ea137bd6-aa86-47b6-b90d-b101d9f19a90
Avoid a valgrind memcheck error. This wasn't really a valid problem as
the variable is set via a previous function call.

Valgrind was giving the error:
Conditional jump or move depends on uninitialised value(s)
for line 800:
     if (displaysize > ((int)strlen((char *) colName))) {

But at line 782/783 it is set via this:
      stat = SQLDescribeCol(hstmt, i+1, colName, sizeof(colName),
			    &colNameLen, &colType, &precision, &scale, NULL);

But to avoid this false positive warning from valgrind, I changed it
to set an initial value.



git-svn-id: svn://irodssvn.ucsd.edu/trunk@5582 ea137bd6-aa86-47b6-b90d-b101d9f19a90
BitCurator Rules written by Sunitha Misra

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5583 ea137bd6-aa86-47b6-b90d-b101d9f19a90
For Macs, when GSI is enabled, use 'lib' as the Globus directory even
on 64-bit hosts.  For other OSes, continue to use lib or lib64.

This was suggested by Petr Danecek on irods-chat.


git-svn-id: svn://irodssvn.ucsd.edu/trunk@5584 ea137bd6-aa86-47b6-b90d-b101d9f19a90
Change rsModAccessControl to call acPostProcForModifyAccessControl
only if the chlModAccessControl call succeeds.  This was recommended
by Tony Edgin of iPlant on irods-chat.

Also reformatted/adjusted a little and removed some comments.  In this
case, I think it was fine to have some comments in the source
explaining a change made by a particular developer for a while, but
long term, I think it's easier to read the code if we use svn for
maintaining such information.



git-svn-id: svn://irodssvn.ucsd.edu/trunk@5585 ea137bd6-aa86-47b6-b90d-b101d9f19a90