Project

General

Profile

Bug #25239

Fix reset of webdav password

Added by Toni Ylenius about 1 year ago. Updated 11 months ago.

Status:
Resolved
Priority:
Nice to have
Assignee:
William Grzybowski
Category:
Middleware
Target version:
Seen in:
Sprint:
Severity:
New
Backlog Priority:
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:

Running in a VM

ChangeLog Required:
No

Description

WebDAV service configuration is not a documented feature of API 1.0 http://api.freenas.org/resources/services.html

However, I found that the API is there and could work. I also found that there is a recent bug fix to this part of code in commit 193a284ac784a891c348a8445b120bf57f5b2ed0 with commit message "fix(api): do not require second password field". The fix could resolve the bug, if it so please merge the change to release.

The report: Following request doesn't work, but returns "The two password fields didn't match."

root@laptop-freenas:~ # curl -X PUT -u root:admin12 -H 'Content-Type: application/json' -d '{ "webdav_password": "new_password" }' http://localhost/api/v1.0/services/webdav/
{"webdav_password": ["The two password fields didn't match."]}root@laptop-freenas:~ #

and it doesn't work even if you provide the password twice
oot@laptop-freenas:~ # curl -X PUT -u root:admin12 -H 'Content-Type: application/json' -d '{ "webdav_password": "new_password", "webdav_password2": "new_password" }' http://localhost/api/v1.0/services/webdav/
{"webdav_password": ["The two password fields didn't match."]}root@laptop-freenas:~ #

History

#2 Updated by Dru Lavigne about 1 year ago

  • Assignee changed from Release Council to Vaibhav Chauhan

#3 Updated by Joe Maloney about 1 year ago

  • Assignee changed from Vaibhav Chauhan to Suraj Ravichandran

Suraj,
Vaibhav told Rishabh to assign this to you. We have verified that changing the webdav password using FreeNAS API is an issue with automation tests that Rishabh worked on. Please get with Rishabh if you have further questions, or let us know if we need to reassign this to someone else.

#4 Updated by Suraj Ravichandran about 1 year ago

  • Status changed from Unscreened to 15
  • Assignee changed from Suraj Ravichandran to Joe Maloney
  • Target version set to 11.1

I showed it working to rishab on my very own machine????

I even gave him the call and everything!!!

Did something else break after that?

#5 Updated by Suraj Ravichandran about 1 year ago

I just did the following:

1. Created a webdav share called testdav.
2. Updated its password via the following command: "curl -i -X PUT -H "Content-Type: application/json" -d @data.json -u root:test http://172.16.21.132/api/v1.0/services/webdav/" where data.json contains: {"webdav_password": "pass1"}
3. Connected to this share via the web browser as well as my mac webdav share mount, created a file and such
4. Updated the password again via the command in 2 except that the password now was "pass2" 
5. Tried to do step 3 again with the old password "pass1". IT DID NOT WORK :-)
6. Did step 3 again with new pass "pass2" and everything works.

I have spoken to Rishan about this and told him that most likely the issue is in his script (i.e. the password variable in hist script must not be getting updated or some)

Just wanted to write my findings down here.

Thanks & Hope this helps!

#6 Updated by Dru Lavigne about 1 year ago

  • Status changed from 15 to 46
  • Assignee changed from Joe Maloney to Suraj Ravichandran

Suraj: is there anything to fix here or should this ticket be closed?

#7 Updated by Suraj Ravichandran about 1 year ago

  • Status changed from 46 to Closed: Cannot reproduce
  • Target version changed from 11.1 to N/A

Nothing to fix here, it all works (as shown with proof to Rishab too)

#8 Updated by Toni Ylenius about 1 year ago

Sorry for long delay. I built a new system using 11.0-U2 and I still see the same issue. Did you try to reproduce this on 11.0-U2 or on something else?

I tried Surajs example

root@laptop-freenas:~ # echo '{"webdav_password": "pass1"}' > data.json
root@laptop-freenas:~ # curl -i -X PUT -H "Content-Type: application/json" -d @data.json -u root:admin12 http://localhost/api/v1.0/services/webdav/
HTTP/1.1 409 Conflict
Server: nginx/1.10.1
Date: Wed, 30 Aug 2017 15:33:33 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Language, Cookie
Content-Language: en

{"webdav_password": ["The two password fields didn't match."]}root@laptop-freenas:~ #

And my own (with some extra if it helps)

Last login: Wed Aug 30 18:26:47 2017 from 192.168.126.1
FreeBSD 11.0-STABLE (FreeNAS.amd64) #0 r313908+d7d07647f69(freenas/11.0-stable): Thu Jul 20 19:01:05 UTC 2017

        FreeNAS (c) 2009-2017, The FreeNAS Development Team
        All rights reserved.
        FreeNAS is released under the modified BSD license.

        For more information, documentation, help or support, go here:
        http://freenas.org
Welcome to FreeNAS
root@laptop-freenas:~ # date
Wed Aug 30 18:28:55 EEST 2017
root@laptop-freenas:~ # freenas-debug -y |grep FreeNAS
+                    FreeNAS-11.0-U2 (e417d8aa5) @1504106946                     +
    root@gauntlet:/freenas-11-releng/freenas/_BE/objs/freenas-11-releng/freenas/_BE/os/sys/FreeNAS.amd64
debug finished in 0 seconds for FreeNAS-11.0-U2 (e417d8aa5)
    root@gauntlet:/freenas-11-releng/freenas/_BE/objs/freenas-11-releng/freenas/_BE/os/sys/FreeNAS.amd64

root@laptop-freenas:~ #
root@laptop-freenas:~ # curl -X PUT -u root:admin12 -H 'Content-Type: application/json' -d '{ "webdav_password": "new_password" }' http://localhost/api/v1.0/services/webdav/
{"webdav_password": ["The two password fields didn't match."]}root@laptop-freenas:~ #
root@laptop-freenas:~ #
root@laptop-freenas:~ #  curl -X PUT -u root:admin12 -H 'Content-Type: application/json' -d '{ "webdav_password": "new_password", "webdav_password2": "new_password" }' http://localhost/api/v1.0/services/webdav/
{"webdav_password": ["The two password fields didn't match."]}root@laptop-freenas:~ #

#9 Updated by Dru Lavigne about 1 year ago

  • Status changed from Closed: Cannot reproduce to Unscreened
  • Assignee changed from Suraj Ravichandran to William Grzybowski
  • Seen in changed from 11.0-U1 to 11.0-U2

William, is this something you can reproduce?

#10 Updated by William Grzybowski about 1 year ago

  • Status changed from Unscreened to Ready For Release
  • Priority changed from No priority to Nice to have
  • Target version changed from N/A to 11.1

This will be fixed in 11.1

193a284ac784a891c348a8445b120bf57f5b2ed0

#11 Updated by Dru Lavigne about 1 year ago

  • Subject changed from Can't reset webdav password using FreeNAS API v1.0 to Fix reset of webdav password

#12 Updated by Dru Lavigne about 1 year ago

  • Target version changed from 11.1 to 11.1-BETA1

#13 Updated by Dru Lavigne 12 months ago

  • Status changed from Ready For Release to Resolved

#14 Updated by Rishabh Chauhan 11 months ago

  • Needs QA changed from Yes to No
  • QA Status Test Passes FreeNAS added
  • QA Status deleted (Not Tested)

I created a file with name data.json and tested it multiple times with different passwords and according to http response the test was successful.

curl -i -X PUT -H "Content-Type: application/json" -d @data.json -u root:abcd1234 http://10.211.1.114/api/v1.0/services/webdav/
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 07 Nov 2017 01:05:10 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept, Accept-Language, Cookie
Content-Language: en

{"id": 1, "webdav_certssl": null, "webdav_htauth": "digest", "webdav_password": "xW1EjYDimn4jdbCACYqo8S9TcTPBEYxxDiRNcK3gbzBLHCnoRk0RfQ==", "webdav_protocol": "http", "webdav_tcpport": 8080, "webdav_tcpportssl": 8081}

Also available in: Atom PDF