How to make file READ ONLY when exposed through WebDAV - webdav

I'm using jackrabbit implementation of WebDAV. There is a user who doesn't have write permission to a folder. That user is able to open the file in desktop applications and able to edit. When the user does save, the server is rejecting the changes but the client is still having those changes, though after the re-mount, these changes will be gone. So, I'm looking for the answers to the following questions:
Is there a way to make files/folders READ-ONLY when mounted through
a WebDAV?
Does WebDAV spec allows this? If so, how to do this
(response format/values) on MAC and windows?
Thanks for your help.
With jackrabbit server, on a windows native WebDAV client, we could got it working with property name Z:Win32FileAttributes.
Here is the PROPFIND response captured in charles:
<D:response>
<D:href>http://10.40.61.110:8080/repository/default/content/test.txt</D:href>
<D:propstat>
<D:prop>
<Z:Win32FileAttributes xmlns:Z="urn:schemas-microsoft-com:">00000021</Z:Win32FileAttributes>
<D:creationdate>2015-07-30T05:38:24Z</D:creationdate>
<D:getetag>"11-1438238197046"</D:getetag>
<D:lockdiscovery />
<D:displayname>test.txt</D:displayname>
<D:supportedlock>
<D:lockentry>
<D:lockscope>
<D:exclusive />
</D:lockscope>
<D:locktype>
<D:write />
</D:locktype>
</D:lockentry>
</D:supportedlock>
<D:getlastmodified>Thu, 30 Jul 2015 06:36:37 GMT</D:getlastmodified>
<D:iscollection>0</D:iscollection>
<D:getcontenttype>application/xml</D:getcontenttype>
<D:getcontentlength>11</D:getcontentlength>
<D:resourcetype />
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>http://10.40.61.110:8080/repository/default/content/Desert.jpg</D:href>
<D:propstat>
<D:prop>
<D:creationdate>2015-07-30T09:49:31Z</D:creationdate>
<D:getetag>"329032-1438249785205"</D:getetag>
<D:getlastmodified>Thu, 30 Jul 2015 09:49:45 GMT</D:getlastmodified>
<D:iscollection>0</D:iscollection>
<Z:Win32LastModifiedTime xmlns:Z="urn:schemas-microsoft-com:">Thu, 30 Jul 2015 09:49:45 GMT</Z:Win32LastModifiedTime>
<Z:Win32LastAccessTime xmlns:Z="urn:schemas-microsoft-com:">Thu, 30 Jul 2015 09:49:32 GMT</Z:Win32LastAccessTime>
<D:getcontentlength>329032</D:getcontentlength>
<D:resourcetype />
<Z:Win32FileAttributes xmlns:Z="urn:schemas-microsoft-com:">00000020</Z:Win32FileAttributes>
<D:lockdiscovery />
<D:displayname>Desert.jpg</D:displayname>
<D:supportedlock>
<D:lockentry>
<D:lockscope>
<D:exclusive />
</D:lockscope>
<D:locktype>
<D:write />
</D:locktype>
</D:lockentry>
</D:supportedlock>
<D:getcontenttype>image/jpeg</D:getcontenttype>
<Z:Win32CreationTime xmlns:Z="urn:schemas-microsoft-com:">Thu, 30 Jul 2015 09:49:32 GMT</Z:Win32CreationTime>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
The value: 00000020 for Z:Win32FileAttributes - Allows to read/write
The value: 00000021 for Z:Win32FileAttributes - Allows to READ-ONLY
Looking for any such properties for native MAC WebDAV client as well?

WebDAV uses RFC3744 for access control. Generally when a user tries an operation that's not allowed, a WebDAV server implementing RFC3744 will respond with a 403 Forbidden http status code.
However, most WebDAV clients ignore this and pretend that the entire server is either read-write or read-only. It's possible for some clients to emit proprietary webdav properties to indicate read-only status. Windows/Office for instance have their own specialized property, but I don't know the name or value ottomh.

Related

Getting "Remotely closed" error for HTTP POST Request In the MULE 4

I am Getting below error while calling a Mulesoft system api from mulesoft process API via DLB in the cloudHub.
The frequency of closing the remote connection error is not fixed.
Sometimes this error comes after 2 minutes and sometimes after 5 minutes.
Though, with second retry it works but still I want to avoid this error as its being happening very frequently.
HTTP POST on resource 'https://internal-nonprod-dlb.lb.anypointdns.net:443/api/sys/aws/s3/databricks/object' failed: Remotely closed.
Mule Version : 4.4
HTTP connector version: 1.7.3
DLB Timeout : 7 minutes
Payload size : ~ 30 MB System
APIs Listener Idle timeout : 5 Minutes
request configuration in process api
<http:request method="POST" doc:name="POST GZIP / aws system api" doc:id="0b490747-5069-4546-9446-8b77130ae848" config-ref="Aws_Sys_API_HTTP_Request_configuration" path="${awsSysApi.databricksPath}" responseTimeout="600000">
<reconnect />
<http:headers><![CDATA[#[output application/java
---
{
"client_secret" : p('secure::awsSysApi.client_secret'),
"Content-Type" : "application/gzip",
"client_id" : p('secure::awsSysApi.client_id')
}]]]></http:headers>
<http:query-params><![CDATA[#[output application/java
---
{
"bucketName" : p('aws.bucket.datalakeRawDeBucket'),
"key" : vars.key
}]]]></http:query-params>
<http:response-validator>
<http:success-status-code-validator values="200..499" />
</http:response-validator>
</http:request>
HTTP requests global configuration in process API
<http:request-config name="Aws_Sys_API_HTTP_Request_configuration" doc:name="HTTP Request configuration" doc:id="5a7eb30f-9850-4de5-8cca-a7d77b0c10d4" basePath="${awsSysApi.basepath}">
<http:request-connection host="${awsSysApi.host}" port="${awsSysApi.port}" protocol="HTTPS" connectionIdleTimeout="${awsSysApi.idletTimeout}">
<reconnection>
<reconnect frequency="${retry.millisecondsBetweenRetries}" count="${retry.maxRetries}" />
</reconnection>
<tls:context>
<tls:trust-store insecure="true" />
<tls:key-store type="jks" path="${tls.keyStore.path}" keyPassword="${secure::tls.keyStore.keyPassword}" password="${secure::tls.keyStore.password}" />
</tls:context>
</http:request-connection>
</http:request-config>
system APIs listener configuration:
<http:listener-connection host="${http.host}" port="${http.private.port}" readTimeout="300000" connectionIdleTimeout="360000">
<reconnection>
<reconnect frequency="30000" count="2" />
</reconnection>
</http:listener-connection> ```
Please let me know if i have missed any information.
Probably you system API is failing to process big payloads. It could be also related to concurrency, or both. Maybe insufficient resources.
You should try to reproduce locally with a similar memory configuration with different payloads to understand the issue.
The HTTP configurations alone are unlikely to be related to the issue. FYI the Connection idle timeout is not related to connection timeouts.

Email Sending Issue with CodeIgniter on nginx server

I have shifted my client management system to a new server but after that, emails notifications are not working anymore. The new server is running nginx and this is the error I'm getting in the logs. OpenSSL is updated and installed on the server.
Normal PHPMails are working but they always go to the spam/junk folder so I'm using ZohoMail for this purpose. On the previous apache server, it was running fine.
The same case is happening with WordPress installation as well. Please guide me on this issue so I can better communicate with my server vendor.
ERROR - 2022-04-08 05:12:16 --> Email: sendWithSmtp throwed fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
ERROR - 2022-04-08 05:12:16 --> Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.<br /><pre>Date: Fri, 8 Apr 2022 05:12:16 -0500
From: "Smart Portal" <noreply#email.com>
Return-Path: <noreply#email.com>
To: my#email.com
Subject: =?UTF-8?Q?Test=20message?=
Reply-To: <noreply#email.com>
User-Agent: CodeIgniter
X-Sender: noreply#email.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <62500a803c12f0.84020712#email.com>
Mime-Version: 1.0

ESP8266 SSDP - Not showing on Windows?

I've got the ESP8266SSDP library running on my NodeMCU, and have it configured like so:
SSDP.setSchemaURL("test.xml");
SSDP.setHTTPPort(80);
SSDP.setName("Addressable Strip");
SSDP.setSerialNumber("001788102201");
SSDP.setURL("index.html");
SSDP.setModelName("ESP8266");
SSDP.setModelNumber("929000226503");
SSDP.setModelURL("http://www.google.com");
SSDP.setManufacturer("Nobody");
SSDP.setManufacturerURL("http://www.google.com");
SSDP.setDeviceType("upnp:rootdevice");
if(SSDP.begin()){
Serial.println("SSDP started");
}
The above will not show up in Windows for some reason, however I download SSDPTester for my phone and I can see the following when it is searching for devices
9 Jan 2017 9:15:15 am: Packet received from 192.168.1.123:1900 :
HTTP/1.1 200 OK\r\n
EXT:\r\n
CACHE-CONTROL: max-age=1200\r\n
SERVER: Arduino/1.0 UPNP/1.1 ESP8266/929000226503\r\n
USN: uuid:38323636-4558-4dda-9188-cda0e6cd87f1\r\n
ST: upnp:rootdevice\r\n
LOCATION: http://192.168.1.123:80/description.xml\r\n
\r\n
Does anyone know why the doesn't show up in Windows?
On your NodeMCU, be sure to send a NOTIFY message on startup and periodically in order for the Windows control point to detect and list the device.

Infinispan Clustered Cache & JGroups - Servers don't see each other

I'm using Infinispan to create a distributed cache between two servers and to leverage its failover feature.
I initially tested my webservice on two local instances of tomcat, using the pre-configured JGroups configuration file provided by infinispan-core-7.0.0.Final.jar. I was able to get the distributed cache working between the two Tomcat instances since the pre-configured xml files were using the loopback ip address.
I then moved the webservice onto two separate servers and have been unable to have them join the same Group. I created my own custom JGroups tcp configuration xml because using the loopback ip in the pre-configured one was causing some issues.
I don't have much experience in setting up tcp or udp channel, so I think the problem may lie with my JGroups configuration file (I based it off the pre-configured one).
<config xmlns="urn:org:jgroups"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.4.xsd">
<!-- bind_addr="${jgroups.tcp.address:127.0.0.1}"-->
<TCP
bind_addr="GLOBAL"
bind_port="${jgroups.tcp.port:7800}"
port_range="30"
recv_buf_size="20m"
send_buf_size="640k"
max_bundle_size="31k"
use_send_queues="true"
enable_diagnostics="false"
bundler_type="sender-sends-with-timer"
thread_naming_pattern="pl"
thread_pool.enabled="true"
thread_pool.min_threads="2"
thread_pool.max_threads="30"
thread_pool.keep_alive_time="60000"
thread_pool.queue_enabled="true"
thread_pool.queue_max_size="100"
thread_pool.rejection_policy="Discard"
oob_thread_pool.enabled="true"
oob_thread_pool.min_threads="2"
oob_thread_pool.max_threads="30"
oob_thread_pool.keep_alive_time="60000"
oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="Discard"
internal_thread_pool.enabled="true"
internal_thread_pool.min_threads="2"
internal_thread_pool.max_threads="4"
internal_thread_pool.keep_alive_time="60000"
internal_thread_pool.queue_enabled="true"
internal_thread_pool.queue_max_size="100"
internal_thread_pool.rejection_policy="Discard"
/>
<!-- Ergonomics, new in JGroups 2.11, are disabled by default in TCPPING until JGRP-1253 is resolved -->
<!--
<TCPPING timeout="3000"
initial_hosts="localhost[7800],localhost[7801]"
port_range="5"
num_initial_members="3"
ergonomics="false"
/>
-->
<!-- bind_addr="${jgroups.bind_addr:127.0.0.1}" -->
<!-- ip_ttl="${jgroups.udp.ip_ttl:2}"-->
<MPING bind_addr="GLOBAL" break_on_coord_rsp="true"
mcast_addr="${jgroups.mping.mcast_addr:228.2.4.6}"
mcast_port="${jgroups.mping.mcast_port:43366}"
num_initial_members="3"/>
<MERGE3/>
<FD_SOCK/>
<FD timeout="3000" max_tries="5"/>
<VERIFY_SUSPECT timeout="1500"/>
<pbcast.NAKACK2 use_mcast_xmit="false"
xmit_interval="1000"
xmit_table_num_rows="100"
xmit_table_msgs_per_row="10000"
xmit_table_max_compaction_time="10000"
max_msg_batch_size="100"/>
<UNICAST3 xmit_interval="500"
xmit_table_num_rows="20"
xmit_table_msgs_per_row="10000"
xmit_table_max_compaction_time="10000"
max_msg_batch_size="100"
conn_expiry_timeout="0"/>
<pbcast.STABLE stability_delay="500" desired_avg_gossip="5000" max_bytes="1m"/>
<pbcast.GMS print_local_addr="false" join_timeout="3000" view_bundling="true"/>
<tom.TOA/> <!-- the TOA is only needed for total order transactions-->
<MFC max_credits="2m" min_threshold="0.40"/>
<FRAG2 frag_size="30k"/>
<RSVP timeout="60000" resend_interval="500" ack_on_delivery="false" />
</config>
My initial thought is that the problem may be with the bind_addr in the TCP and MPing elements. The two servers are on the same network and are able to ping each other. Anyone have any tips/insights on the configuration file above?
If it helps I've posted what's in the log file in regards to the Infinispan/JGroups startup below:
SERVER 1:
INFO JGroupsTransport - ISPN000078: Starting JGroups channel esrs
Nov 20, 2014 3:22:43 AM org.jgroups.logging.JDKLogImpl warn
WARNING: JGRP000014: Discovery.num_initial_members has been deprecated: will be ignored
INFO JGroupsTransport - ISPN000094: Received new cluster view for channel esrs: [udmesrs02-61057|0] (1) [udmesrs02-61057]
INFO JGroupsTransport - ISPN000079: Channel esrs local address is udmesrs02-61057
INFO GlobalComponentRegistry - ISPN000128: Infinispan version: Infinispan 'Guinness' 7.0.0.Final
SERVER 2:
INFO JGroupsTransport - ISPN000078: Starting JGroups channel esrs
Nov 20, 2014 3:20:28 AM org.jgroups.logging.JDKLogImpl warn
WARNING: JGRP000014: Discovery.num_initial_members has been deprecated: will be ignored
INFO JGroupsTransport - ISPN000094: Received new cluster view for channel esrs: [udmesrs01-16389|0] (1) [udmesrs01-16389]
INFO JGroupsTransport - ISPN000079: Channel esrs local address is udmesrs01-16389
INFO GlobalComponentRegistry - ISPN000128: Infinispan version: Infinispan 'Guinness' 7.0.0.Final
There are two possible issues: IPv4/IPv6 issues and UDP routing.
First try to set -Djava.net.preferIPv4Stack=true on both machines.
If that does not help, check your UDP firewall and routing settings.
If you don't find anything strange there, you'll have to use tcpdump on udp and port 43366 and tcp 7800 and see if there's any activity - there should be some multicast packet going from each node at least every 15 s.

Why is Web Deploy giving me an error code 0x800704CD

I'm trying to get Web Deploy to work from Web Matrix and I've searched through through all the logs and events and can't seem to find the source of the following error in the event viewer:
Log Name: Microsoft Web Deploy
Source: Web Deploy
Date: 9/4/2013 1:48:16 PM
Event ID: 1
Task Category: None
Level: Error
Keywords: Classic
User: XXX
Computer: XX
Description:
User:
Client IP:
Content-Type:
Version: 9.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 9.0.1762.0
MSDeploy.Method: GetPackage
MSDeploy.RequestId: 4cab8a9b-5c5c-4f99-8141-52e5453b88f9
MSDeploy.RequestCulture: en-US
MSDeploy.RequestUICulture: en-US
ServerVersion: 9.0.1762.0
Skip: objectName="^configProtectedData$"
Provider: iisApp, Path: xxx.xxx.xxx
A tracing deployment agent exception occurred that was propagated to the client. Request ID '4cab8a9b-5c5c-4f99-8141-52e5453b88f9'. Request Timestamp: '9/4/2013 1:48:15 PM'. Error Details:
System.Web.HttpException: The remote host closed the connection. The error code is 0x800704CD.
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush)
at System.IO.BufferedStream.FlushWrite()
at System.IO.BufferedStream.Flush()
at System.IO.BufferedStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at Microsoft.Web.Deployment.PackageSerializer.Dispose()
at Microsoft.Web.Deployment.DeploymentAgent.HandleGetPackage(DeploymentAgentWorkerRequest workerRequest)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequestWorker(DeploymentAgentAsyncData asyncData)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequest(DeploymentAgentAsyncData asyncData)
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Web Deploy" />
<EventID Qualifiers="0">1</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-09-04T17:48:16.000000000Z" />
<EventRecordID>238</EventRecordID>
<Channel>Microsoft Web Deploy</Channel>
<Computer>xxxx</Computer>
<Security UserID="S-1-5-21-3588641846-14347574-4076679054-500" />
</System>
<EventData>
<Data>User:
Client IP:
Content-Type:
Version: 9.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 9.0.1762.0
MSDeploy.Method: GetPackage
MSDeploy.RequestId: 4cab8a9b-5c5c-4f99-8141-52e5453b88f9
MSDeploy.RequestCulture: en-US
MSDeploy.RequestUICulture: en-US
ServerVersion: 9.0.1762.0
Skip: objectName="^configProtectedData$"
Provider: iisApp, Path: xxx.xxx.xxx
A tracing deployment agent exception occurred that was propagated to the client. Request ID '4cab8a9b-5c5c-4f99-8141-52e5453b88f9'. Request Timestamp: '9/4/2013 1:48:15 PM'. Error Details:
System.Web.HttpException: The remote host closed the connection. The error code is 0x800704CD.
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush)
at System.IO.BufferedStream.FlushWrite()
at System.IO.BufferedStream.Flush()
at System.IO.BufferedStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at Microsoft.Web.Deployment.PackageSerializer.Dispose()
at Microsoft.Web.Deployment.DeploymentAgent.HandleGetPackage(DeploymentAgentWorkerRequest workerRequest)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequestWorker(DeploymentAgentAsyncData asyncData)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequest(DeploymentAgentAsyncData asyncData)
</Data>
</EventData>
</Event>
I used Web Deploy on the server to create the settings file using IIS on the host. This error appears during the simple web page compatibility test. Any clues as to what may be going on?
The error is basically because the remote server, or the hosting service provider closed the request.
Sometimes it is also stated as the server is trying to deny or is try to cancel the requests. For instance, a user started to download some file or a page, and the server is off so the download would be cancelled, or the download would fail.
There are many issues for this error code.
Here is a post from another forum. forums.asp.net
The best method would be to check the settings on the server that you are having hosting from. Or contact them directly to get help regarding this issue.
Edit:
Getting LogFiles:
You can get the LogFiles here:
start --> run --> LogFiles
2011-09-20 21:25:25 xx.xxx.xxx.xxx 36482 192.168.10.32 80 HTTP/1.1 POST /orders/mail/mailorderentry - - Timer_HeaderWait –
2011-09-20 21:22:29 xx.xxx.xxx.xxx 44399 192.168.10.32 80 HTTP/1.1 POST /orders/mail/mailorderentry - - Client_Reset –
HttpRunTime:
Secondly the request closed issue can also raise if the httpRunTime is out (timeout). But that exception isn't here I am sure, however still try this too: http://msdn.microsoft.com/en-us/library/e1f13641.aspx
Antivirus (If any):
Also, please try check if Antivirus is installed, then is it allowing the server to communicate with users or not? Sometimes along with Firewall, Antivirus might also try to stop the connections.
I recently had the exact same eventLogs, after the webmatrix web deploy throwed a "can not publish" (without any apparent reasons because it worked several month so far).
After some searches (unlucky) and a lot of fumbling, I got it to work again just by using a windows user with administrator privileges instead of the IIS Manager Users configuration.

Resources