Index: branches/eam_branches/20090522/Nebulous/Changes
===================================================================
--- branches/eam_branches/20090522/Nebulous/Changes	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/Changes	(revision 24557)
@@ -1,3 +1,9 @@
 Revision history for Nebulous
+
+0.17
+    - add chmod() API
+    - change neb-ls to always output in --long format
+    - add neb-rm --force flag
+    - change neb-locate's output seperator to \n
 
 0.10
@@ -9,4 +15,5 @@
     - add neb-swap
     - add nebclient:nebSetXattr()
+    - add neb-rm --move flag
 
 0.09 Wed Jul  9 16:36:27 HST 2008
Index: branches/eam_branches/20090522/Nebulous/MANIFEST
===================================================================
--- branches/eam_branches/20090522/Nebulous/MANIFEST	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/MANIFEST	(revision 24557)
@@ -79,6 +79,6 @@
 t/00_distribution.t 
 t/01_load.t
-t/50_client_new.t
-t/51_client_create.t
+t/49_client_new.t
+t/50_client_create.t
 t/51_client_open_create.t
 t/52_client_replicate.t
@@ -98,4 +98,5 @@
 t/66_client_xattr.t
 t/67_client_swap.t
+t/68_client_chmod.t
 t/70_neb-ls.t
 t/90_nebclient.t
Index: branches/eam_branches/20090522/Nebulous/bin/neb-locate
===================================================================
--- branches/eam_branches/20090522/Nebulous/bin/neb-locate	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/bin/neb-locate	(revision 24557)
@@ -41,4 +41,6 @@
     unless defined $neb;
 
+$volume = 'any' if defined $all;
+
 my $uris;
 if (defined $volume) {
@@ -70,5 +72,5 @@
 }
 
-print join(" ", @files), "\n";
+print join("\n", @files), "\n";
 
 __END__
Index: branches/eam_branches/20090522/Nebulous/bin/neb-ls
===================================================================
--- branches/eam_branches/20090522/Nebulous/bin/neb-ls	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/bin/neb-ls	(revision 24557)
@@ -21,4 +21,7 @@
 
 $server = $ENV{'NEB_SERVER'} unless $server;
+
+# make --long the default
+$long = 1;
 
 GetOptions(
Index: branches/eam_branches/20090522/Nebulous/bin/neb-replicate
===================================================================
--- branches/eam_branches/20090522/Nebulous/bin/neb-replicate	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/bin/neb-replicate	(revision 24557)
@@ -16,5 +16,5 @@
 use Pod::Usage qw( pod2usage );
 
-my ($server, $volume, $copies);
+my ($server, $volume, $copies, $set_copies);
 $copies = 1;  # default to making just one copy
 
Index: branches/eam_branches/20090522/Nebulous/bin/neb-rm
===================================================================
--- branches/eam_branches/20090522/Nebulous/bin/neb-rm	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/bin/neb-rm	(revision 24557)
@@ -16,9 +16,15 @@
 use Pod::Usage qw( pod2usage );
 
-my ($server);
+my (
+    $force,
+    $move,
+    $server,
+);
 
 $server = $ENV{'NEB_SERVER'} unless $server;
 
 GetOptions(
+    'force|f'       => \$force,
+    'move|m'        => \$move,
     'server|s=s'    => \$server,
 ) || pod2usage( 2 );
@@ -35,5 +41,9 @@
 
 foreach my $key (@ARGV) {
-    $neb->delete($key) or warn "failed to delete key: $key";
+    unless (defined $move) {
+        $neb->delete($key) or warn "failed to delete key: $key";
+    } else {
+        $neb->move($key, "${key}.rm") or warn "failed to move key: $key";
+    }
 }
 
@@ -48,5 +58,5 @@
 =head1 SYNOPSIS
 
-    neb-rm [--server <URL>] <key...>
+    neb-rm [--server <URL>] [--force] [--move] <key...>
 
 =head1 DESCRIPTION
@@ -58,4 +68,18 @@
 
 =over 4
+
+=item * --force|-f
+
+When set, C<<key>> will be removed from the nebulous database even if the on
+disk file(s) are missing.
+
+Optional.
+
+=item * --move|-m
+
+When set, this flag causes C<<key>> to be renamed to C<<key>.rm> instead of
+being deleted.
+
+Optional.
 
 =item * --server|-s <URL>
Index: branches/eam_branches/20090522/Nebulous/bin/neb-stat
===================================================================
--- branches/eam_branches/20090522/Nebulous/bin/neb-stat	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/bin/neb-stat	(revision 24557)
@@ -41,5 +41,5 @@
 my $stat = $neb->stat($key);
 die "nebulous key: $key not found" unless $stat;   
-my $instances = $neb->find_instances($key, ':any');
+my $instances = $neb->find_instances($key, 'any');
 die "no instances found" unless $instances;   
 
Index: branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pm
===================================================================
--- branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pm	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pm	(revision 24557)
@@ -9,5 +9,5 @@
 no warnings qw( uninitialized );
 
-our $VERSION = '0.09';
+our $VERSION = '0.17';
 
 use Digest::MD5;
@@ -16,5 +16,5 @@
 use Nebulous::Client::Log;
 use Nebulous::Util qw( :standard );
-use Params::Validate qw( validate validate_pos SCALAR UNDEF );
+use Params::Validate qw( validate validate_pos SCALAR UNDEF BOOLEAN );
 #use SOAP::Lite +trace => [qw( debug )];
 use SOAP::Lite;
@@ -329,4 +329,11 @@
     my $uri = $self->delete_instance($key, @$locations[0]);
 
+    eval {
+        _nuke_file(_get_file_path(@$locations[0]));
+    };
+    if ($@) {
+        $log->logdie($@);
+    }
+
     $log->debug("leaving");
 
@@ -803,7 +810,17 @@
     my $self = shift;
 
-    my ( $key ) = validate_pos( @_,
-        {
-            type => SCALAR,
+    my ($key, $force) = validate_pos( @_,
+        {
+            type        => SCALAR,
+        },
+        {
+            type        => BOOLEAN,
+            optional    => 1,
+            default     => undef,
+            callbacks   => {
+                'is boolean' => sub {
+                    $_[0] == 0 or $_[0] == 1 or $_[0] == undef;
+                },
+            },
         },
     );
@@ -817,5 +834,32 @@
     # a lock is implicitly removed when the last storage object is deleted
     foreach my $uri ( @$locations ) {
+        # it is being assumed here that it is better to have files on disk and
+        # not in the database then the inverse.
+        my $path;
+        eval {
+            $path = _get_file_path( $uri );
+        };
+        if ($@) {
+            if ($force) {
+                $log->warn($@);
+                $log->warn("exception ignored because force is in effect");
+            } else {
+                $log->logdie($@);
+            }
+        }
+
         $self->delete_instance($key, $uri) or return undef;
+
+        eval {
+            _nuke_file( $path );
+        };
+        if ($@) {
+            if ($force) {
+                $log->warn($@);
+                $log->warn("exception ignored because force is in effect");
+            } else {
+                $log->logdie($@);
+            }
+        }
     }
 
@@ -959,13 +1003,4 @@
     $log->debug( "entered - @_" );
 
-    # it is being assumed here that it is better to have files on disk and not in
-    # the database then the inverse.
-
-    my $path;
-    eval {
-        $path = _get_file_path( $uri );
-    };
-    $log->logdie( $@ ) if $@;
-
     my $response = $self->{ 'server' }->delete_instance($key, $uri);
     if ( $response->fault ) {
@@ -982,9 +1017,4 @@
     $log->debug( "server deleted instance" );
 
-    eval {
-        _nuke_file( $path );
-    };
-    $log->logdie( $@ ) if $@;
-
     $log->debug( "leaving" );
 
@@ -1045,4 +1075,43 @@
 
     return $stats;
+}
+
+
+sub chmod
+{
+    my $self = shift;
+
+    my ($key, $mode) = validate_pos( @_,
+        {
+            type => SCALAR,
+        },
+        {
+            type => SCALAR,
+            regex       => qr/\d{3,4}/,
+        },
+    );
+
+    $log->debug( "entered - @_" );
+
+    my $response = $self->{ 'server' }->chmod_object($key, $mode);
+    if ( $response->fault ) {
+        $self->set_err($response->faultstring);
+        if ($response->faultstring =~ /is valid object key/) {
+            $log->debug( "leaving" );
+            return;
+        }
+        if ($response->faultstring =~ /is allowable mode/) {
+            $log->debug( "leaving" );
+            return;
+        }
+
+        $log->logdie("unhandled fault - ", $self->err);
+    }
+
+    my $response_mode = $response->result;
+
+    $log->debug( "leaving" );
+
+    return $response_mode;
 }
 
Index: branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pod
===================================================================
--- branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pod	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pod	(revision 24557)
@@ -13,10 +13,10 @@
     );
 
-    my $uri = $neb->create( "key", "node01" );
-    my $fh = $neb->open_create( "key", "node01" );
-    $neb->replicate( "key", "node01" );
-    $neb->cull( "key", "node01" );
-    $neb->lock( "key", 'write' );
-    $neb->unlock( "key", 'write' );
+    my $uri = $neb->create( $key, $vol );
+    my $fh = $neb->open_create( $key, $vol );
+    $neb->replicate( $key, $vol );
+    $neb->cull( $key, $vol );
+    $neb->lock( $key, 'write' );
+    $neb->unlock( $key, 'write' );
     $neb->setxattr( $key, $name, $value, $flags );
     $neb->getxattr( $key, $name );
@@ -24,14 +24,15 @@
     $neb->removexattr( $key, $name );
     my $uris = $neb->find_objects( $pattern );
-    my $uris = $neb->find_instances( "key", "node01" );
-    my $path = $neb->find( "key" );
-    my $fh = $neb->open( "key", 'read' );
-    $neb->delete( "key" );
-    $neb->copy( "key", "new_key", "node01" );
-    $neb->move( "key", "new_key" );
-    $neb->swap( "key1", "key2" );
+    my $uris = $neb->find_instances( $key, $vol );
+    my $path = $neb->find( $key );
+    my $fh = $neb->open( $key, 'read' );
+    $neb->delete( $key );
+    $neb->copy( $key, $new_key, $vol );
+    $neb->move( $key, $new_key );
+    $neb->swap( $key1, $key2 );
     $neb->delete_instance( $uri );
-    my $stats = $neb->stat( "key" );
+    my $stats = $neb->stat( $key );
     my $mounts = $neb->mounts();
+    my $mode = $neb->chmod( $key, $mode );
 
 =head1 DESCRIPTION
@@ -425,4 +426,11 @@
     ]
 
+=item * chmod( $key, $mode );
+
+Accepts 2 parameters, both mandatory.  C<$key> is the nebulous key to operate
+on and C<$mode> are the POSIX like file permissions to set on all instances of
+C<$key>.  C<$mode> must be specified in oct.  Returns C<$mode> or sucess or an
+exception on failure.
+
 =back
 
Index: branches/eam_branches/20090522/Nebulous/nebclient/nebulous.wsdl
===================================================================
--- branches/eam_branches/20090522/Nebulous/nebclient/nebulous.wsdl	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/nebclient/nebulous.wsdl	(revision 24557)
@@ -140,4 +140,13 @@
     </message>
 
+    <message name="chmod_objectRequest">
+        <part name="key" type="xsd:string" />
+        <part name="mode" type="xsd:int" />
+    </message>
+    <message name="chmod_objectResponse">
+        <!-- fixme -->
+        <part name="result" type="xsd:int" />
+    </message>
+
 
     <portType name="Nebulous/Server/SOAPPort">
@@ -240,4 +249,11 @@
             -->
         </operation>
+        <operation name="chmod_object">
+            <input  message="tns:chmod_objectRequest" />
+            <output message="tns:chmod_objectResponse" />
+            <!--
+                <fault name="" message="" />
+            -->
+        </operation>
     </portType>
 
@@ -390,4 +406,15 @@
         <operation name="stat_object">
             <soap:operation soapAction="urn:Nebulous/Server/SOAP#stat_object" />
+            <input>
+                <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP"
+                    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+            </input>
+            <output>
+                <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP"
+                    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+            </output>
+        </operation>
+        <operation name="chmod_object">
+            <soap:operation soapAction="urn:Nebulous/Server/SOAP#chmod_object" />
             <input>
                 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP"
Index: branches/eam_branches/20090522/Nebulous/nebclient/src/nebclient.c
===================================================================
--- branches/eam_branches/20090522/Nebulous/nebclient/src/nebclient.c	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/nebclient/src/nebclient.c	(revision 24557)
@@ -832,4 +832,30 @@
 }
 
+
+int nebChmod(nebServer *server, const char *key, mode_t mode)
+{
+    int response;
+
+    REQUIRE_SERVER;
+
+    if (!key) {
+        nebSetErr(server, "parameter 'key' may not be NULL");
+
+        return -1;
+    }
+
+    // FIXME is this leaking memory when response goes out of scope?  the gsoap
+    // manual seems to 'suggest' that this is temporary data that gets cleaed
+    // up on the next soap function call
+    if (soap_call_ns1__chmod_USCOREobject(server->soap, server->endpoint,
+            NULL, (char *)key, mode, &response) != SOAP_OK) {
+        nebSetServerErr(server);
+        return -1;
+    }
+
+    return 0;
+}
+
+
 char *nebErr(nebServer *server)
 {
Index: branches/eam_branches/20090522/Nebulous/nebclient/src/nebclient.h
===================================================================
--- branches/eam_branches/20090522/Nebulous/nebclient/src/nebclient.h	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/nebclient/src/nebclient.h	(revision 24557)
@@ -11,4 +11,6 @@
 #ifndef NEBCLIENT_H
 #define NEBCLIENT_H 1
+
+// #include <sys/stat.h>
 
 #ifdef __cplusplus
@@ -296,4 +298,18 @@
 );
 
+/** Change permissions of a storage objects
+ *
+ * This function will change the file permissions of all currently on disk
+ * instances of a storage object.
+ *
+ * @return the new mode or NULL on failure.
+ */
+
+int nebChmod(
+    nebServer *server,                  ///< nebServer object
+    const char *key,                    /// storage object key (name)
+    mode_t mode                         /// chmod(2) compatible mode (mode_t)
+);
+
 /** Returns the error message from the last nebclient function that failed.
  *
Index: branches/eam_branches/20090522/Nebulous/nebclient/src/nebulous.h
===================================================================
--- branches/eam_branches/20090522/Nebulous/nebclient/src/nebulous.h	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/nebclient/src/nebulous.h	(revision 24557)
@@ -1,5 +1,5 @@
 /* src/nebulous.h
    Generated by wsdl2h 1.2.12 from nebulous.wsdl and typemap.dat
-   2009-04-20 22:15:21 GMT
+   2009-06-01 23:55:50 GMT
    Copyright (C) 2001-2008 Robert van Engelen, Genivia Inc. All Rights Reserved.
    This part of the software is released under one of the following licenses:
@@ -119,4 +119,5 @@
   - @ref ns1__delete_USCOREinstance
   - @ref ns1__stat_USCOREobject
+  - @ref ns1__chmod_USCOREobject
 
 @section SOAP_ports Endpoints of Binding  "SOAP"
@@ -893,3 +894,56 @@
 );
 
+/******************************************************************************\
+ *                                                                            *
+ * ns1__chmod_USCOREobject                                                    *
+ *                                                                            *
+\******************************************************************************/
+
+
+/// Operation "ns1__chmod_USCOREobject" of service binding "SOAP"
+
+/**
+
+Operation details:
+
+  - SOAP RPC encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+  - SOAP action="urn:Nebulous/Server/SOAP#chmod_object"
+
+C stub function (defined in soapClient.c[pp] generated by soapcpp2):
+@code
+  int soap_call_ns1__chmod_USCOREobject(
+    struct soap *soap,
+    NULL, // char *endpoint = NULL selects default endpoint for this operation
+    NULL, // char *action = NULL selects default action for this operation
+    // request parameters:
+    char*                               key,
+    int                                 mode,
+    // response parameters:
+    int                                *result
+  );
+@endcode
+
+C server function (called from the service dispatcher defined in soapServer.c[pp]):
+@code
+  int ns1__chmod_USCOREobject(
+    struct soap *soap,
+    // request parameters:
+    char*                               key,
+    int                                 mode,
+    // response parameters:
+    int                                *result
+  );
+@endcode
+
+*/
+
+//gsoap ns1  service method-style:	chmod_USCOREobject rpc
+//gsoap ns1  service method-encoding:	chmod_USCOREobject http://schemas.xmlsoap.org/soap/encoding/
+//gsoap ns1  service method-action:	chmod_USCOREobject urn:Nebulous/Server/SOAP#chmod_object
+int ns1__chmod_USCOREobject(
+    char*                               key,	///< Request parameter
+    int                                 mode,	///< Request parameter
+    int                                *result	///< Response parameter
+);
+
 /* End of src/nebulous.h */
Index: branches/eam_branches/20090522/Nebulous/nebclient/src/soapC.c
===================================================================
--- branches/eam_branches/20090522/Nebulous/nebclient/src/soapC.c	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/nebclient/src/soapC.c	(revision 24557)
@@ -12,5 +12,5 @@
 #endif
 
-SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-04-20 22:15:22 GMT")
+SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-06-01 23:55:50 GMT")
 
 
@@ -161,4 +161,8 @@
 	case SOAP_TYPE_int:
 		return soap_in_int(soap, NULL, NULL, "xsd:int");
+	case SOAP_TYPE_ns1__chmod_USCOREobject:
+		return soap_in_ns1__chmod_USCOREobject(soap, NULL, NULL, "ns1:chmod_object");
+	case SOAP_TYPE_ns1__chmod_USCOREobjectResponse:
+		return soap_in_ns1__chmod_USCOREobjectResponse(soap, NULL, NULL, "ns1:chmod_objectResponse");
 	case SOAP_TYPE_ns1__stat_USCOREobject:
 		return soap_in_ns1__stat_USCOREobject(soap, NULL, NULL, "ns1:stat_object");
@@ -250,4 +254,12 @@
 			return soap_in_int(soap, NULL, NULL, NULL);
 		}
+		if (!soap_match_tag(soap, t, "ns1:chmod_object"))
+		{	*type = SOAP_TYPE_ns1__chmod_USCOREobject;
+			return soap_in_ns1__chmod_USCOREobject(soap, NULL, NULL, NULL);
+		}
+		if (!soap_match_tag(soap, t, "ns1:chmod_objectResponse"))
+		{	*type = SOAP_TYPE_ns1__chmod_USCOREobjectResponse;
+			return soap_in_ns1__chmod_USCOREobjectResponse(soap, NULL, NULL, NULL);
+		}
 		if (!soap_match_tag(soap, t, "ns1:stat_object"))
 		{	*type = SOAP_TYPE_ns1__stat_USCOREobject;
@@ -440,4 +452,8 @@
 	case SOAP_TYPE_int:
 		return soap_out_int(soap, tag, id, (const int *)ptr, "xsd:int");
+	case SOAP_TYPE_ns1__chmod_USCOREobject:
+		return soap_out_ns1__chmod_USCOREobject(soap, tag, id, (const struct ns1__chmod_USCOREobject *)ptr, "ns1:chmod_object");
+	case SOAP_TYPE_ns1__chmod_USCOREobjectResponse:
+		return soap_out_ns1__chmod_USCOREobjectResponse(soap, tag, id, (const struct ns1__chmod_USCOREobjectResponse *)ptr, "ns1:chmod_objectResponse");
 	case SOAP_TYPE_ns1__stat_USCOREobject:
 		return soap_out_ns1__stat_USCOREobject(soap, tag, id, (const struct ns1__stat_USCOREobject *)ptr, "ns1:stat_object");
@@ -527,4 +543,10 @@
 	switch (type)
 	{
+	case SOAP_TYPE_ns1__chmod_USCOREobject:
+		soap_serialize_ns1__chmod_USCOREobject(soap, (const struct ns1__chmod_USCOREobject *)ptr);
+		break;
+	case SOAP_TYPE_ns1__chmod_USCOREobjectResponse:
+		soap_serialize_ns1__chmod_USCOREobjectResponse(soap, (const struct ns1__chmod_USCOREobjectResponse *)ptr);
+		break;
 	case SOAP_TYPE_ns1__stat_USCOREobject:
 		soap_serialize_ns1__stat_USCOREobject(soap, (const struct ns1__stat_USCOREobject *)ptr);
@@ -1195,4 +1217,164 @@
 #endif
 
+SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobject(struct soap *soap, struct ns1__chmod_USCOREobject *a)
+{
+	(void)soap; (void)a; /* appease -Wall -Werror */
+	soap_default_string(soap, &a->key);
+	soap_default_int(soap, &a->mode);
+}
+
+SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobject(struct soap *soap, const struct ns1__chmod_USCOREobject *a)
+{
+	(void)soap; (void)a; /* appease -Wall -Werror */
+	soap_serialize_string(soap, &a->key);
+	soap_embedded(soap, &a->mode, SOAP_TYPE_int);
+}
+
+SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobject(struct soap *soap, const struct ns1__chmod_USCOREobject *a, const char *tag, const char *type)
+{
+	register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns1__chmod_USCOREobject);
+	if (soap_out_ns1__chmod_USCOREobject(soap, tag, id, a, type))
+		return soap->error;
+	return soap_putindependent(soap);
+}
+
+SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobject(struct soap *soap, const char *tag, int id, const struct ns1__chmod_USCOREobject *a, const char *type)
+{
+	if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__chmod_USCOREobject), type))
+		return soap->error;
+	if (soap_out_string(soap, "key", -1, &a->key, ""))
+		return soap->error;
+	if (soap_out_int(soap, "mode", -1, &a->mode, ""))
+		return soap->error;
+	return soap_element_end_out(soap, tag);
+}
+
+SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobject(struct soap *soap, struct ns1__chmod_USCOREobject *p, const char *tag, const char *type)
+{
+	if ((p = soap_in_ns1__chmod_USCOREobject(soap, tag, p, type)))
+		if (soap_getindependent(soap))
+			return NULL;
+	return p;
+}
+
+SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobject(struct soap *soap, const char *tag, struct ns1__chmod_USCOREobject *a, const char *type)
+{
+	size_t soap_flag_key = 1;
+	size_t soap_flag_mode = 1;
+	if (soap_element_begin_in(soap, tag, 0, type))
+		return NULL;
+	a = (struct ns1__chmod_USCOREobject *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__chmod_USCOREobject, sizeof(struct ns1__chmod_USCOREobject), 0, NULL, NULL, NULL);
+	if (!a)
+		return NULL;
+	soap_default_ns1__chmod_USCOREobject(soap, a);
+	if (soap->body && !*soap->href)
+	{
+		for (;;)
+		{	soap->error = SOAP_TAG_MISMATCH;
+			if (soap_flag_key && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
+				if (soap_in_string(soap, "key", &a->key, "xsd:string"))
+				{	soap_flag_key--;
+					continue;
+				}
+			if (soap_flag_mode && soap->error == SOAP_TAG_MISMATCH)
+				if (soap_in_int(soap, "mode", &a->mode, "xsd:int"))
+				{	soap_flag_mode--;
+					continue;
+				}
+			if (soap->error == SOAP_TAG_MISMATCH)
+				soap->error = soap_ignore_element(soap);
+			if (soap->error == SOAP_NO_TAG)
+				break;
+			if (soap->error)
+				return NULL;
+		}
+		if (soap_element_end_in(soap, tag))
+			return NULL;
+	}
+	else
+	{	a = (struct ns1__chmod_USCOREobject *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__chmod_USCOREobject, 0, sizeof(struct ns1__chmod_USCOREobject), 0, NULL);
+		if (soap->body && soap_element_end_in(soap, tag))
+			return NULL;
+	}
+	if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_mode > 0))
+	{	soap->error = SOAP_OCCURS;
+		return NULL;
+	}
+	return a;
+}
+
+SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobjectResponse(struct soap *soap, struct ns1__chmod_USCOREobjectResponse *a)
+{
+	(void)soap; (void)a; /* appease -Wall -Werror */
+	a->result = NULL;
+}
+
+SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobjectResponse(struct soap *soap, const struct ns1__chmod_USCOREobjectResponse *a)
+{
+	(void)soap; (void)a; /* appease -Wall -Werror */
+	soap_serialize_PointerToint(soap, &a->result);
+}
+
+SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobjectResponse(struct soap *soap, const struct ns1__chmod_USCOREobjectResponse *a, const char *tag, const char *type)
+{
+	register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns1__chmod_USCOREobjectResponse);
+	if (soap_out_ns1__chmod_USCOREobjectResponse(soap, tag, id, a, type))
+		return soap->error;
+	return soap_putindependent(soap);
+}
+
+SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobjectResponse(struct soap *soap, const char *tag, int id, const struct ns1__chmod_USCOREobjectResponse *a, const char *type)
+{
+	if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__chmod_USCOREobjectResponse), type))
+		return soap->error;
+	if (soap_out_PointerToint(soap, "result", -1, &a->result, ""))
+		return soap->error;
+	return soap_element_end_out(soap, tag);
+}
+
+SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobjectResponse(struct soap *soap, struct ns1__chmod_USCOREobjectResponse *p, const char *tag, const char *type)
+{
+	if ((p = soap_in_ns1__chmod_USCOREobjectResponse(soap, tag, p, type)))
+		if (soap_getindependent(soap))
+			return NULL;
+	return p;
+}
+
+SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobjectResponse(struct soap *soap, const char *tag, struct ns1__chmod_USCOREobjectResponse *a, const char *type)
+{
+	size_t soap_flag_result = 1;
+	if (soap_element_begin_in(soap, tag, 0, type))
+		return NULL;
+	a = (struct ns1__chmod_USCOREobjectResponse *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__chmod_USCOREobjectResponse, sizeof(struct ns1__chmod_USCOREobjectResponse), 0, NULL, NULL, NULL);
+	if (!a)
+		return NULL;
+	soap_default_ns1__chmod_USCOREobjectResponse(soap, a);
+	if (soap->body && !*soap->href)
+	{
+		for (;;)
+		{	soap->error = SOAP_TAG_MISMATCH;
+			if (soap_flag_result && soap->error == SOAP_TAG_MISMATCH)
+				if (soap_in_PointerToint(soap, "result", &a->result, "xsd:int"))
+				{	soap_flag_result--;
+					continue;
+				}
+			if (soap->error == SOAP_TAG_MISMATCH)
+				soap->error = soap_ignore_element(soap);
+			if (soap->error == SOAP_NO_TAG)
+				break;
+			if (soap->error)
+				return NULL;
+		}
+		if (soap_element_end_in(soap, tag))
+			return NULL;
+	}
+	else
+	{	a = (struct ns1__chmod_USCOREobjectResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__chmod_USCOREobjectResponse, 0, sizeof(struct ns1__chmod_USCOREobjectResponse), 0, NULL);
+		if (soap->body && soap_element_end_in(soap, tag))
+			return NULL;
+	}
+	return a;
+}
+
 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__stat_USCOREobject(struct soap *soap, struct ns1__stat_USCOREobject *a)
 {
Index: branches/eam_branches/20090522/Nebulous/nebclient/src/soapClient.c
===================================================================
--- branches/eam_branches/20090522/Nebulous/nebclient/src/soapClient.c	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/nebclient/src/soapClient.c	(revision 24557)
@@ -10,5 +10,5 @@
 #endif
 
-SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-04-20 22:15:21 GMT")
+SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-06-01 23:55:50 GMT")
 
 
@@ -812,4 +812,62 @@
 }
 
+SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__chmod_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, int mode, int *result)
+{	struct ns1__chmod_USCOREobject soap_tmp_ns1__chmod_USCOREobject;
+	struct ns1__chmod_USCOREobjectResponse *soap_tmp_ns1__chmod_USCOREobjectResponse;
+	if (!soap_endpoint)
+		soap_endpoint = "http://localhost:80/nebulous";
+	if (!soap_action)
+		soap_action = "urn:Nebulous/Server/SOAP#chmod_object";
+	soap->encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/";
+	soap_tmp_ns1__chmod_USCOREobject.key = key;
+	soap_tmp_ns1__chmod_USCOREobject.mode = mode;
+	soap_begin(soap);
+	soap_serializeheader(soap);
+	soap_serialize_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject);
+	if (soap_begin_count(soap))
+		return soap->error;
+	if (soap->mode & SOAP_IO_LENGTH)
+	{	if (soap_envelope_begin_out(soap)
+		 || soap_putheader(soap)
+		 || soap_body_begin_out(soap)
+		 || soap_put_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject, "ns1:chmod_object", "")
+		 || soap_body_end_out(soap)
+		 || soap_envelope_end_out(soap))
+			 return soap->error;
+	}
+	if (soap_end_count(soap))
+		return soap->error;
+	if (soap_connect(soap, soap_endpoint, soap_action)
+	 || soap_envelope_begin_out(soap)
+	 || soap_putheader(soap)
+	 || soap_body_begin_out(soap)
+	 || soap_put_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject, "ns1:chmod_object", "")
+	 || soap_body_end_out(soap)
+	 || soap_envelope_end_out(soap)
+	 || soap_end_send(soap))
+		return soap_closesock(soap);
+	if (!result)
+		return soap_closesock(soap);
+	soap_default_int(soap, result);
+	if (soap_begin_recv(soap)
+	 || soap_envelope_begin_in(soap)
+	 || soap_recv_header(soap)
+	 || soap_body_begin_in(soap))
+		return soap_closesock(soap);
+	soap_tmp_ns1__chmod_USCOREobjectResponse = soap_get_ns1__chmod_USCOREobjectResponse(soap, NULL, "ns1:chmod_objectResponse", "");
+	if (soap->error)
+	{	if (soap->error == SOAP_TAG_MISMATCH && soap->level == 2)
+			return soap_recv_fault(soap);
+		return soap_closesock(soap);
+	}
+	if (soap_body_end_in(soap)
+	 || soap_envelope_end_in(soap)
+	 || soap_end_recv(soap))
+		return soap_closesock(soap);
+	if (result && soap_tmp_ns1__chmod_USCOREobjectResponse->result)
+		*result = *soap_tmp_ns1__chmod_USCOREobjectResponse->result;
+	return soap_closesock(soap);
+}
+
 #ifdef __cplusplus
 }
Index: branches/eam_branches/20090522/Nebulous/nebclient/src/soapH.h
===================================================================
--- branches/eam_branches/20090522/Nebulous/nebclient/src/soapH.h	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/nebclient/src/soapH.h	(revision 24557)
@@ -42,5 +42,5 @@
 
 #ifndef SOAP_TYPE_SOAP_ENV__Fault
-#define SOAP_TYPE_SOAP_ENV__Fault (64)
+#define SOAP_TYPE_SOAP_ENV__Fault (67)
 #endif
 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *);
@@ -56,5 +56,5 @@
 
 #ifndef SOAP_TYPE_SOAP_ENV__Reason
-#define SOAP_TYPE_SOAP_ENV__Reason (63)
+#define SOAP_TYPE_SOAP_ENV__Reason (66)
 #endif
 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *);
@@ -70,5 +70,5 @@
 
 #ifndef SOAP_TYPE_SOAP_ENV__Detail
-#define SOAP_TYPE_SOAP_ENV__Detail (60)
+#define SOAP_TYPE_SOAP_ENV__Detail (63)
 #endif
 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *);
@@ -84,5 +84,5 @@
 
 #ifndef SOAP_TYPE_SOAP_ENV__Code
-#define SOAP_TYPE_SOAP_ENV__Code (58)
+#define SOAP_TYPE_SOAP_ENV__Code (61)
 #endif
 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *);
@@ -98,5 +98,5 @@
 
 #ifndef SOAP_TYPE_SOAP_ENV__Header
-#define SOAP_TYPE_SOAP_ENV__Header (57)
+#define SOAP_TYPE_SOAP_ENV__Header (60)
 #endif
 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *);
@@ -109,4 +109,24 @@
 #endif
 
+#ifndef SOAP_TYPE_ns1__chmod_USCOREobject
+#define SOAP_TYPE_ns1__chmod_USCOREobject (59)
+#endif
+SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobject(struct soap*, struct ns1__chmod_USCOREobject *);
+SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobject(struct soap*, const struct ns1__chmod_USCOREobject *);
+SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobject(struct soap*, const struct ns1__chmod_USCOREobject *, const char*, const char*);
+SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobject(struct soap*, const char*, int, const struct ns1__chmod_USCOREobject *, const char*);
+SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobject(struct soap*, struct ns1__chmod_USCOREobject *, const char*, const char*);
+SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobject(struct soap*, const char*, struct ns1__chmod_USCOREobject *, const char*);
+
+#ifndef SOAP_TYPE_ns1__chmod_USCOREobjectResponse
+#define SOAP_TYPE_ns1__chmod_USCOREobjectResponse (58)
+#endif
+SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobjectResponse(struct soap*, struct ns1__chmod_USCOREobjectResponse *);
+SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobjectResponse(struct soap*, const struct ns1__chmod_USCOREobjectResponse *);
+SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobjectResponse(struct soap*, const struct ns1__chmod_USCOREobjectResponse *, const char*, const char*);
+SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobjectResponse(struct soap*, const char*, int, const struct ns1__chmod_USCOREobjectResponse *, const char*);
+SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobjectResponse(struct soap*, struct ns1__chmod_USCOREobjectResponse *, const char*, const char*);
+SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobjectResponse(struct soap*, const char*, struct ns1__chmod_USCOREobjectResponse *, const char*);
+
 #ifndef SOAP_TYPE_ns1__stat_USCOREobject
 #define SOAP_TYPE_ns1__stat_USCOREobject (56)
@@ -402,5 +422,5 @@
 
 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason
-#define SOAP_TYPE_PointerToSOAP_ENV__Reason (66)
+#define SOAP_TYPE_PointerToSOAP_ENV__Reason (69)
 #endif
 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*);
@@ -415,5 +435,5 @@
 
 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail
-#define SOAP_TYPE_PointerToSOAP_ENV__Detail (65)
+#define SOAP_TYPE_PointerToSOAP_ENV__Detail (68)
 #endif
 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*);
@@ -428,5 +448,5 @@
 
 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Code
-#define SOAP_TYPE_PointerToSOAP_ENV__Code (59)
+#define SOAP_TYPE_PointerToSOAP_ENV__Code (62)
 #endif
 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*);
Index: branches/eam_branches/20090522/Nebulous/nebclient/src/soapServer.c
===================================================================
--- branches/eam_branches/20090522/Nebulous/nebclient/src/soapServer.c	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/nebclient/src/soapServer.c	(revision 24557)
@@ -10,5 +10,5 @@
 #endif
 
-SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-04-20 22:15:21 GMT")
+SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-06-01 23:55:50 GMT")
 
 
@@ -105,4 +105,6 @@
 	if (!soap_match_tag(soap, soap->tag, "ns1:stat_object"))
 		return soap_serve_ns1__stat_USCOREobject(soap);
+	if (!soap_match_tag(soap, soap->tag, "ns1:chmod_object"))
+		return soap_serve_ns1__chmod_USCOREobject(soap);
 	return soap->error = SOAP_NO_METHOD;
 }
@@ -713,4 +715,48 @@
 }
 
+SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__chmod_USCOREobject(struct soap *soap)
+{	struct ns1__chmod_USCOREobject soap_tmp_ns1__chmod_USCOREobject;
+	struct ns1__chmod_USCOREobjectResponse soap_tmp_ns1__chmod_USCOREobjectResponse;
+	int soap_tmp_int;
+	soap_default_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse);
+	soap_default_int(soap, &soap_tmp_int);
+	soap_tmp_ns1__chmod_USCOREobjectResponse.result = &soap_tmp_int;
+	soap_default_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject);
+	soap->encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/";
+	if (!soap_get_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject, "ns1:chmod_object", NULL))
+		return soap->error;
+	if (soap_body_end_in(soap)
+	 || soap_envelope_end_in(soap)
+	 || soap_end_recv(soap))
+		return soap->error;
+	soap->error = ns1__chmod_USCOREobject(soap, soap_tmp_ns1__chmod_USCOREobject.key, soap_tmp_ns1__chmod_USCOREobject.mode, &soap_tmp_int);
+	if (soap->error)
+		return soap->error;
+	soap_serializeheader(soap);
+	soap_serialize_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse);
+	if (soap_begin_count(soap))
+		return soap->error;
+	if (soap->mode & SOAP_IO_LENGTH)
+	{	if (soap_envelope_begin_out(soap)
+		 || soap_putheader(soap)
+		 || soap_body_begin_out(soap)
+		 || soap_put_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse, "ns1:chmod_objectResponse", "")
+		 || soap_body_end_out(soap)
+		 || soap_envelope_end_out(soap))
+			 return soap->error;
+	};
+	if (soap_end_count(soap)
+	 || soap_response(soap, SOAP_OK)
+	 || soap_envelope_begin_out(soap)
+	 || soap_putheader(soap)
+	 || soap_body_begin_out(soap)
+	 || soap_put_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse, "ns1:chmod_objectResponse", "")
+	 || soap_body_end_out(soap)
+	 || soap_envelope_end_out(soap)
+	 || soap_end_send(soap))
+		return soap->error;
+	return soap_closesock(soap);
+}
+
 #ifdef __cplusplus
 }
Index: branches/eam_branches/20090522/Nebulous/nebclient/src/soapStub.h
===================================================================
--- branches/eam_branches/20090522/Nebulous/nebclient/src/soapStub.h	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/nebclient/src/soapStub.h	(revision 24557)
@@ -306,6 +306,25 @@
 #endif
 
+#ifndef SOAP_TYPE_ns1__chmod_USCOREobjectResponse
+#define SOAP_TYPE_ns1__chmod_USCOREobjectResponse (58)
+/* ns1:chmod_objectResponse */
+struct ns1__chmod_USCOREobjectResponse
+{
+	int *result;	/* SOAP 1.2 RPC return element (when namespace qualified) */	/* optional element of type xsd:int */
+};
+#endif
+
+#ifndef SOAP_TYPE_ns1__chmod_USCOREobject
+#define SOAP_TYPE_ns1__chmod_USCOREobject (59)
+/* ns1:chmod_object */
+struct ns1__chmod_USCOREobject
+{
+	char *key;	/* optional element of type xsd:string */
+	int mode;	/* required element of type xsd:int */
+};
+#endif
+
 #ifndef SOAP_TYPE_SOAP_ENV__Header
-#define SOAP_TYPE_SOAP_ENV__Header (57)
+#define SOAP_TYPE_SOAP_ENV__Header (60)
 /* SOAP Header: */
 struct SOAP_ENV__Header
@@ -318,5 +337,5 @@
 
 #ifndef SOAP_TYPE_SOAP_ENV__Code
-#define SOAP_TYPE_SOAP_ENV__Code (58)
+#define SOAP_TYPE_SOAP_ENV__Code (61)
 /* SOAP Fault Code: */
 struct SOAP_ENV__Code
@@ -328,5 +347,5 @@
 
 #ifndef SOAP_TYPE_SOAP_ENV__Detail
-#define SOAP_TYPE_SOAP_ENV__Detail (60)
+#define SOAP_TYPE_SOAP_ENV__Detail (63)
 /* SOAP-ENV:Detail */
 struct SOAP_ENV__Detail
@@ -339,5 +358,5 @@
 
 #ifndef SOAP_TYPE_SOAP_ENV__Reason
-#define SOAP_TYPE_SOAP_ENV__Reason (63)
+#define SOAP_TYPE_SOAP_ENV__Reason (66)
 /* SOAP-ENV:Reason */
 struct SOAP_ENV__Reason
@@ -348,5 +367,5 @@
 
 #ifndef SOAP_TYPE_SOAP_ENV__Fault
-#define SOAP_TYPE_SOAP_ENV__Fault (64)
+#define SOAP_TYPE_SOAP_ENV__Fault (67)
 /* SOAP Fault: */
 struct SOAP_ENV__Fault
@@ -437,4 +456,6 @@
 SOAP_FMAC5 int SOAP_FMAC6 ns1__stat_USCOREobject(struct soap*, char *key, struct ns1__stat_USCOREobjectResponse *_param_4);
 
+SOAP_FMAC5 int SOAP_FMAC6 ns1__chmod_USCOREobject(struct soap*, char *key, int mode, int *result);
+
 /******************************************************************************\
  *                                                                            *
@@ -472,4 +493,6 @@
 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__stat_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, struct ns1__stat_USCOREobjectResponse *_param_4);
 
+SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__chmod_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, int mode, int *result);
+
 /******************************************************************************\
  *                                                                            *
@@ -509,4 +532,6 @@
 
 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__stat_USCOREobject(struct soap*);
+
+SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__chmod_USCOREobject(struct soap*);
 
 #ifdef __cplusplus
Index: branches/eam_branches/20090522/Nebulous/nebclient/tests/tests.c
===================================================================
--- branches/eam_branches/20090522/Nebulous/nebclient/tests/tests.c	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/nebclient/tests/tests.c	(revision 24557)
@@ -20,5 +20,5 @@
     char            *key = "foobarbaz";
 
-    plan_tests(28);
+    plan_tests(29);
 
     if (getenv("NEB_SERVER")) {
@@ -136,4 +136,6 @@
     neb_ok(server, nebMove(server, "copyiedfile", "movedfile"), "move object");
 
+    neb_ok(server, nebChmod(server, "movedfile", 0440) == 0, "chmod object");
+
     if (!nebDelete(server, "movedfile")) {
         diag( "cleanup failed %s\n", nebErr(server));
Index: branches/eam_branches/20090522/Nebulous/t/49_client_new.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/49_client_new.t	(revision 24557)
+++ branches/eam_branches/20090522/Nebulous/t/49_client_new.t	(revision 24557)
@@ -0,0 +1,60 @@
+#!/usr/bin/perl
+
+# Copryight (C) 2004-2005  Joshua Hoblitt
+#
+# $Id: 50_client_new.t,v 1.1 2005-12-03 02:52:31 jhoblitt Exp $
+
+use strict;
+use warnings FATAL => qw( all );
+
+use Apache::Test qw( -withtestmore );
+
+plan tests => 4;
+
+use lib qw( ./t ./lib );
+
+use Nebulous::Client;
+use Nebulous::Util qw( :standard );
+use Test::Nebulous;
+
+my $hostport = Apache::Test->config->{ 'hostport' };
+
+Test::Nebulous->setup;
+
+{
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    isa_ok( $neb, "Nebulous::Client" );
+}
+
+Test::Nebulous->setup;
+
+{
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+        uri   => "http://example.com/PS/IPP/Nebulous/Client",
+    );
+
+    isa_ok( $neb, "Nebulous::Client" );
+}
+
+Test::Nebulous->setup;
+
+eval {
+    Nebulous::Client->new;
+};
+like( $@, qr/Mandatory parameter/, "no proxy" );
+
+Test::Nebulous->setup;
+
+eval {
+    Nebulous::Client->new(
+        proxy => "foo",
+        dog => "do"
+    );
+};
+like( $@, qr/not listed in the validation options/, "bad param" );
+
+Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/50_client_create.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/50_client_create.t	(revision 24557)
+++ branches/eam_branches/20090522/Nebulous/t/50_client_create.t	(revision 24557)
@@ -0,0 +1,100 @@
+#!/usr/bin/perl
+
+# Copryight (C) 2004-2005  Joshua Hoblitt
+#
+# $Id: 51_client_create.t,v 1.6 2008-05-15 03:24:58 jhoblitt Exp $
+
+use strict;
+use warnings FATAL => qw( all );
+
+use Apache::Test qw( -withtestmore );
+
+plan tests => 9;
+
+use lib qw( ./t ./lib );
+
+use Nebulous::Client;
+use Test::Nebulous;
+use Test::URI;
+use URI::Split qw( uri_split );
+
+my $hostport = Apache::Test->config->{ 'hostport' };
+
+Test::Nebulous->setup;
+
+{
+    # key
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    my $uri = $neb->create("foo");
+    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
+    ok(-e $path, "good filename");
+    uri_scheme_ok($uri, 'file');
+}
+
+Test::Nebulous->setup;
+
+{
+    # key, volume
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    my $uri = $neb->create("foo", "node01");
+
+    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
+    ok(-e $path, "good filename");
+    uri_scheme_ok($uri, 'file');
+}
+
+Test::Nebulous->setup;
+
+{
+    # key, volume == undef
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    my $uri = $neb->create("foo", undef);
+
+    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
+    ok(-e $path, "good filename");
+    uri_scheme_ok($uri, 'file');
+}
+
+Test::Nebulous->setup;
+
+{
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    $neb->create("foo");
+    is($neb->create("foo"), undef, "object already exists");
+}
+
+Test::Nebulous->setup;
+
+eval {
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    $neb->create();
+};
+like($@, qr/1 - 2 were expected/, "no params");
+
+Test::Nebulous->setup;
+
+eval {
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    $neb->create(1, 2, 3);
+};
+like($@, qr/1 - 2 were expected/, "too many params");
+
+Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/50_client_new.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/50_client_new.t	(revision 24238)
+++ 	(revision )
@@ -1,60 +1,0 @@
-#!/usr/bin/perl
-
-# Copryight (C) 2004-2005  Joshua Hoblitt
-#
-# $Id: 50_client_new.t,v 1.1 2005-12-03 02:52:31 jhoblitt Exp $
-
-use strict;
-use warnings FATAL => qw( all );
-
-use Apache::Test qw( -withtestmore );
-
-plan tests => 4;
-
-use lib qw( ./t ./lib );
-
-use Nebulous::Client;
-use Nebulous::Util qw( :standard );
-use Test::Nebulous;
-
-my $hostport = Apache::Test->config->{ 'hostport' };
-
-Test::Nebulous->setup;
-
-{
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    isa_ok( $neb, "Nebulous::Client" );
-}
-
-Test::Nebulous->setup;
-
-{
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-        uri   => "http://example.com/PS/IPP/Nebulous/Client",
-    );
-
-    isa_ok( $neb, "Nebulous::Client" );
-}
-
-Test::Nebulous->setup;
-
-eval {
-    Nebulous::Client->new;
-};
-like( $@, qr/Mandatory parameter/, "no proxy" );
-
-Test::Nebulous->setup;
-
-eval {
-    Nebulous::Client->new(
-        proxy => "foo",
-        dog => "do"
-    );
-};
-like( $@, qr/not listed in the validation options/, "bad param" );
-
-Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/51_client_create.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/51_client_create.t	(revision 24238)
+++ 	(revision )
@@ -1,100 +1,0 @@
-#!/usr/bin/perl
-
-# Copryight (C) 2004-2005  Joshua Hoblitt
-#
-# $Id: 51_client_create.t,v 1.6 2008-05-15 03:24:58 jhoblitt Exp $
-
-use strict;
-use warnings FATAL => qw( all );
-
-use Apache::Test qw( -withtestmore );
-
-plan tests => 9;
-
-use lib qw( ./t ./lib );
-
-use Nebulous::Client;
-use Test::Nebulous;
-use Test::URI;
-use URI::Split qw( uri_split );
-
-my $hostport = Apache::Test->config->{ 'hostport' };
-
-Test::Nebulous->setup;
-
-{
-    # key
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    my $uri = $neb->create("foo");
-    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
-    ok(-e $path, "good filename");
-    uri_scheme_ok($uri, 'file');
-}
-
-Test::Nebulous->setup;
-
-{
-    # key, volume
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    my $uri = $neb->create("foo", "node01");
-
-    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
-    ok(-e $path, "good filename");
-    uri_scheme_ok($uri, 'file');
-}
-
-Test::Nebulous->setup;
-
-{
-    # key, volume == undef
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    my $uri = $neb->create("foo", undef);
-
-    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
-    ok(-e $path, "good filename");
-    uri_scheme_ok($uri, 'file');
-}
-
-Test::Nebulous->setup;
-
-{
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create("foo");
-    is($neb->create("foo"), undef, "object already exists");
-}
-
-Test::Nebulous->setup;
-
-eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create();
-};
-like($@, qr/1 - 2 were expected/, "no params");
-
-Test::Nebulous->setup;
-
-eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create(1, 2, 3);
-};
-like($@, qr/1 - 2 were expected/, "too many params");
-
-Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/59_client_delete.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/59_client_delete.t	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/t/59_client_delete.t	(revision 24557)
@@ -10,5 +10,5 @@
 use Apache::Test qw( -withtestmore );
 
-plan tests => 9;
+plan tests => 13;
 
 use lib qw( ./t ./lib );
@@ -26,7 +26,9 @@
         proxy => "http://$hostport/nebulous",
     );
-    $neb->create( "foo" );
+    my $uri = $neb->create( "foo" );
 
     ok( $neb->delete( "foo" ), "delete object" );
+
+    ok( ! -e _get_file_path($uri), "deleted file" );
 
     my $locations = $neb->find_instances( "foo" );
@@ -76,4 +78,27 @@
 }
 
+# force flag
+Test::Nebulous->setup;
+
+{
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->create( "foo" );
+
+    is( $neb->delete("foo", undef), 1, "force flag false" );
+}
+
+Test::Nebulous->setup;
+
+{
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->create( "foo" );
+
+    is( $neb->delete("foo", 1), 1, "force flag false" );
+}
+
 Test::Nebulous->setup;
 
@@ -84,5 +109,5 @@
     $neb->delete();
 };
-like( $@, qr/1 was expected/, "no params" );
+like( $@, qr/1 - 2 were expected/, "no params" );
 
 Test::Nebulous->setup;
@@ -92,7 +117,17 @@
         proxy => "http://$hostport/nebulous",
     );
-    $neb->delete( "foo", 2 );
+    $neb->delete( "foo", 3);
 };
-like( $@, qr/1 was expected/, "too many params" );
+like( $@, qr/is boolean/, "force flag not boolean" );
+
+Test::Nebulous->setup;
+
+eval {
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->delete( "foo", 0, 2 );
+};
+like( $@, qr/1 - 2 were expected/, "too many params" );
 
 Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/62_client_delete_instance.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/62_client_delete_instance.t	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/t/62_client_delete_instance.t	(revision 24557)
@@ -10,5 +10,5 @@
 use Apache::Test qw( -withtestmore );
 
-plan tests => 11;
+plan tests => 10;
 
 use lib qw( ./t ./lib );
@@ -35,6 +35,4 @@
 
     is( $uri, @$locations[0], "delete instance" );
-
-    ok( ! -e _get_file_path( @$locations[0] ), "deleted file" );
 }
 
Index: branches/eam_branches/20090522/Nebulous/t/66_client_xattr.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/66_client_xattr.t	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/t/66_client_xattr.t	(revision 24557)
@@ -1,7 +1,5 @@
 #!/usr/bin/perl
 
-# Copryight (C) 2007-2008  Joshua Hoblitt
-#
-# $Id: 66_client_xattr.t,v 1.1 2008-05-20 00:54:30 jhoblitt Exp $
+# Copryight (C) 2007-2009  Joshua Hoblitt
 
 use strict;
@@ -9,6 +7,5 @@
 
 use Apache::Test qw( -withtestmore );
-plan tests => 32;
-
+plan tests => 44;
 
 use lib qw( ./t ./lib );
@@ -20,4 +17,8 @@
 my $hostport = Apache::Test->config->{ 'hostport' };
 
+my $neb = Nebulous::Client->new(
+    proxy => "http://$hostport/nebulous",
+);
+
 # 1 key / xattr
 
@@ -25,21 +26,17 @@
 
 {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
     my $uri = $neb->create('foo');
 
-    ok($neb->setxattr('foo', 'bar', 'baz', 'create'), 'set object xattr');
+    ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr');
     {
         my $xattrs = $neb->listxattr('foo');
         is(scalar @$xattrs, 1, 'number of xattrs');
-        is(@$xattrs[0], 'bar', 'xattr name');
-    }
-
-    my $value = $neb->getxattr('foo', 'bar');
+        is(@$xattrs[0], 'user.bar', 'xattr name');
+    }
+
+    my $value = $neb->getxattr('foo', 'user.bar');
     is($value, 'baz', 'xattr value');
 
-    ok($neb->removexattr('foo', 'bar'), "remove object xattr");
+    ok($neb->removexattr('foo', 'user.bar'), "remove object xattr");
     {
         my $xattrs = $neb->listxattr('foo');
@@ -53,27 +50,23 @@
 
 {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
     my $uri = $neb->create('foo');
 
-    ok($neb->setxattr('foo', 'bar', 'baz', 'create'), 'set object xattr');
-    ok($neb->setxattr('foo', 'bonk', 'quix', 'create'), 'set object xattr');
+    ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr');
+    ok($neb->setxattr('foo', 'user.bonk', 'quix', 'create'), 'set object xattr');
     
     {
         my $xattrs = $neb->listxattr('foo');
         is(scalar @$xattrs, 2, 'number of xattrs');
-        is(@$xattrs[0], 'bar', 'xattr name');
-        is(@$xattrs[1], 'bonk', 'xattr name');
-    }
-
-    my $value = $neb->getxattr('foo', 'bar');
+        is(@$xattrs[0], 'user.bar', 'xattr name');
+        is(@$xattrs[1], 'user.bonk', 'xattr name');
+    }
+
+    my $value = $neb->getxattr('foo', 'user.bar');
     is($value, 'baz', 'xattr value');
-    $value = $neb->getxattr('foo', 'bonk');
+    $value = $neb->getxattr('foo', 'user.bonk');
     is($value, 'quix', 'xattr value');
 
-    ok($neb->removexattr('foo', 'bar'), "remove object xattr");
-    ok($neb->removexattr('foo', 'bonk'), "remove object xattr");
+    ok($neb->removexattr('foo', 'user.bar'), "remove object xattr");
+    ok($neb->removexattr('foo', 'user.bonk'), "remove object xattr");
     {
         my $xattrs = $neb->listxattr('foo');
@@ -87,23 +80,19 @@
 
 {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
     my $uri = $neb->create('foo');
 
-    ok($neb->setxattr('foo', 'bar', 'baz', 'create'), 'set object xattr');
-    ok($neb->setxattr('foo', 'bar', 'quix', 'replace'), 're-set object xattr');
+    ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr');
+    ok($neb->setxattr('foo', 'user.bar', 'quix', 'replace'), 're-set object xattr');
     
     {
         my $xattrs = $neb->listxattr('foo');
         is(scalar @$xattrs, 1, 'number of xattrs');
-        is(@$xattrs[0], 'bar', 'xattr name');
-    }
-
-    my $value = $neb->getxattr('foo', 'bar');
+        is(@$xattrs[0], 'user.bar', 'xattr name');
+    }
+
+    my $value = $neb->getxattr('foo', 'user.bar');
     is($value, 'quix', 'xattr value');
 
-    ok($neb->removexattr('foo', 'bar'), "remove object xattr");
+    ok($neb->removexattr('foo', 'user.bar'), "remove object xattr");
     {
         my $xattrs = $neb->listxattr('foo');
@@ -117,8 +106,27 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
+    $neb->setxattr('foo', 'user.bar', 'baz', 'create');
+};
+like($@, qr/is valid object key/, "create xattr on non-existant key");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+
+    $neb->setxattr('foo', 'luser.bar', 'baz', 'create');
+};
+like($@, qr/xattr is in user. namespace/, "user. namspace");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->setxattr('foo', 'user.bar', 'baz', 'replace');
+};
+like($@, qr/is valid object key/, "replace xattr on non-existant key");
+
+Test::Nebulous->setup;
+
+eval {
     $neb->setxattr();
 };
@@ -128,11 +136,7 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create('foo');
-
-    $neb->setxattr('foo', 'bar');
+    $neb->create('foo');
+
+    $neb->setxattr('foo', 'user.bar');
 };
 like($@, qr/4 were expected/, "too few params");
@@ -141,11 +145,7 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create('foo');
-
-    $neb->setxattr('foo', 'bar', 'baz');
+    $neb->create('foo');
+
+    $neb->setxattr('foo', 'user.bar', 'baz');
 };
 like($@, qr/4 were expected/, "too few params");
@@ -154,14 +154,62 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create('foo');
-
-    $neb->setxattr('foo', 'bar', 'baz', 'create', 'quix');
+    $neb->create('foo');
+
+    $neb->setxattr('foo', 'user.bar', 'baz', 'create', 'quix');
 };
 like($@, qr/4 were expected/, "too many params");
 
+# getxattr
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->getxattr('foo', 'bar');
+};
+like($@, qr/is valid object key/, "get xattr from non-existant nebulous key");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+
+    $neb->getxattr('foo', 'luser.bar');
+};
+like($@, qr/xattr is in user. namespace/, "user. namespace");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+    $neb->getxattr('foo', 'user.bar');
+};
+like($@, qr|xattr neb:///foo:user.bar does not exist|,
+    "get xattr from non-existant xattr key");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->getxattr();
+};
+like($@, qr/2 were expected/, "no params");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+
+    $neb->getxattr('foo');
+};
+like($@, qr/2 were expected/, "too few params");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+
+    $neb->getxattr('foo', 'user.bar', 'baz');
+};
+like($@, qr/2 were expected/, "too many params");
+
 # listxattr
 
@@ -169,8 +217,4 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
     $neb->create('foo');
 
@@ -182,8 +226,4 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
     $neb->create('foo');
 
@@ -192,14 +232,35 @@
 like($@, qr/1 was expected/, "too many params");
 
-# getxattr
-
-Test::Nebulous->setup;
-
-eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->getxattr();
+# removexattr
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->removexattr('foo', 'user.bar');
+};
+like($@, qr/is valid object key/, "remove xattr from non-existant nebulous key");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+
+    $neb->getxattr('foo', 'luser.bar');
+};
+like($@, qr/xattr is in user. namespace/, "user. namespace");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+    $neb->removexattr('foo', 'user.bar');
+};
+like($@, qr|xattr neb:///foo:user.bar does not exist|,
+    "remove xattr from non-existant xattr key");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->removexattr();
 };
 like($@, qr/2 were expected/, "no params");
@@ -208,11 +269,7 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create('foo');
-
-    $neb->getxattr('foo');
+    $neb->create('foo');
+
+    $neb->removexattr('foo');
 };
 like($@, qr/2 were expected/, "too few params");
@@ -221,11 +278,7 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create('foo');
-
-    $neb->getxattr('foo', 'bar', 'baz');
+    $neb->create('foo');
+
+    $neb->removexattr('foo', 'user.bar', 'baz');
 };
 like($@, qr/2 were expected/, "too many params");
Index: branches/eam_branches/20090522/Nebulous/t/68_client_chmod.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/68_client_chmod.t	(revision 24557)
+++ branches/eam_branches/20090522/Nebulous/t/68_client_chmod.t	(revision 24557)
@@ -0,0 +1,117 @@
+#!/usr/bin/perl
+
+# Copryight (C) 2009  Joshua Hoblitt
+
+use strict;
+use warnings FATAL => qw( all );
+
+use Apache::Test qw( -withtestmore );
+
+plan tests => 13;
+
+use lib qw( ./t ./lib );
+
+use Nebulous::Client;
+use Nebulous::Util qw( :standard );
+use Test::URI;
+use Test::Nebulous;
+use URI;
+use File::stat;
+
+my $hostport = Apache::Test->config->{ 'hostport' };
+
+my $neb = Nebulous::Client->new(
+    proxy => "http://$hostport/nebulous",
+);
+
+Test::Nebulous->setup;
+
+# object with one instance
+{
+    my $key = "foo";
+    my $uri = $neb->create($key);
+
+    my $path = URI->new($uri)->path;
+    my $st1 = stat($path);
+
+    my $mode = $neb->chmod($key, 0440);
+    my $st2 = stat($path);
+
+    is($st2->mode &07777, 0440, "chmod() single instance");
+    is($mode, 0440, "returned mode");
+    is($neb->getxattr($key, 'user.mode'), 0440, "xattr user.mode");
+}
+
+Test::Nebulous->setup;
+
+# object with two instances
+{
+    my $key = "foo";
+    my $uri1 = $neb->create($key);
+    my $uri2 = $neb->replicate($key);
+
+    my $mode = $neb->chmod($key, 0440);
+
+    my $st1 = stat(URI->new($uri1)->path);
+    my $st2 = stat(URI->new($uri2)->path);
+
+    is($st1->mode &07777, 0440, "chmod() first instance");
+    is($st2->mode &07777, 0440, "chmod() second instance");
+    is($mode, 0440, "returned mode");
+    is($neb->getxattr($key, 'user.mode'), 0440, "xattr user.mode");
+}
+
+Test::Nebulous->setup;
+
+{
+    my $mode = $neb->chmod("foo", 0644);
+
+    is($mode, undef, "object does not exist");
+}
+
+Test::Nebulous->setup;
+
+{
+    $neb->create("foo");
+
+    my $mode = $neb->chmod("foo", 0640);
+
+    is($mode, undef, "mode is not 0440");
+}
+
+Test::Nebulous->setup;
+
+{
+    $neb->create("foo");
+
+    my $mode = $neb->chmod("foo", 999);
+
+    is($mode, undef, "bad mode");
+}
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->chmod();
+};
+like($@, qr/2 were expected/, "no params");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create("foo");
+
+    $neb->chmod("foo");
+};
+like($@, qr/2 were expected/, "one param");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create("foo");
+
+    $neb->chmod("foo", 0440, 2);
+};
+like($@, qr/2 were expected/, "three params");
+
+Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/70_neb-ls.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/70_neb-ls.t	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/t/70_neb-ls.t	(revision 24557)
@@ -38,4 +38,5 @@
 
 # NEB_SERVER env var not set
+undef $ENV{'NEB_SERVER'} if defined $ENV{'NEB_SERVER'};
 Test::Nebulous->setup;
 
@@ -82,5 +83,5 @@
 
     is($? >> 8, 0, "exit code");
-    like($test->stdout, qr/^foo bar$/,  "stdout");
+    like($test->stdout, qr/^foo\nbar$/,  "stdout");
     like($test->stderr, qr/^$/,         "stderr");
 }
@@ -160,5 +161,5 @@
 
     is($? >> 8, 0, "exit code");
-    like($test->stdout, qr|^a/foo a/bar$|,  "stdout");
+    like($test->stdout, qr|^a/foo\na/bar$|,  "stdout");
     like($test->stderr, qr/^$/,             "stderr");
 }
Index: branches/eam_branches/20090522/Nebulous/t/conf/startup.pl.in
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/conf/startup.pl.in	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/t/conf/startup.pl.in	(revision 24557)
@@ -18,4 +18,5 @@
 my $config = Nebulous::Server::Config->new(
     trace       => 'all',
+    memcached_servers => ['127.0.0.1:11211'],
 );
 $config->add_db(
