Closed Bug 1212729 Opened 9 years ago Closed 9 years ago

Bluetooth PBAP doesn’t handle illegal virtual folders path properly.

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:2.2r+, firefox44 fixed, b2g-v2.2r fixed, b2g-master fixed)

RESOLVED FIXED
FxOS-S9 (16Oct)
blocking-b2g 2.2r+
Tracking Status
firefox44 --- fixed
b2g-v2.2r --- fixed
b2g-master --- fixed

People

(Reporter: jaliu, Assigned: jaliu)

References

Details

Attachments

(2 files, 1 obsolete file)

PBAP manager should reply ObexResponseCode::NotFound if the path virtual folders path is illegal.
Assignee: nobody → 6jamin
Blocks: 1199528
Attachment #8671181 - Flags: review?(btian)
Comment on attachment 8671181 [details] [diff] [review]
Handle illegal PBAP virtual folders path properly. (v1)

Review of attachment 8671181 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with comment addressed.

::: dom/bluetooth/bluedroid/BluetoothPbapManager.cpp
@@ +403,5 @@
>        // Go back to root
>        newPath.AssignLiteral("");
>      } else {
>        // Go down 1 level
> +      if (!mCurrentPath.IsEmpty()) {

Replace |mCurrentPath| with |newPath|.

::: dom/bluetooth/bluedroid/BluetoothPbapManager.h
@@ +157,5 @@
>    InfallibleTArray<uint32_t>  PackPropertiesMask(uint8_t* aData, int aSize);
>    bool CompareHeaderTarget(const ObexHeaderSet& aHeader);
>    bool IsLegalPath(const nsAString& aPath);
> +  bool IsLegalPhonebookName(const nsAString& aName);
> +  bool GetInputStreamFromBlob(nsIDOMBlob* aBlob);

Restore |nsIDOMBlob| to |Blob|.
Attachment #8671181 - Flags: review?(btian) → review+
Comment on attachment 8671181 [details] [diff] [review]
Handle illegal PBAP virtual folders path properly. (v1)

Review of attachment 8671181 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bluetooth/bluedroid/BluetoothPbapManager.cpp
@@ +627,5 @@
> +    "SIM1/telecom/pb",
> +    "SIM1/telecom/ich",
> +    "SIM1/telecom/och",
> +    "SIM1/telecom/mch",
> +    "SIM1/telecom/cch"

To note, the reason to remove "/" is to keep internal phonebook path consistent to path carried in PullPhoneBook request (i.e., no "/" at the beginning), per PBAP spec 1.2.

5.1.2 Name 
The Name header shall contain the absolute path in the virtual folders architecture of the PSE, appended with the name of the file representation of one of the Phone Book Objects. 
Example: telecom/pb.vcf or SIM1/telecom/pb.vcf for the main phone book objects.
Set 2.2r blocker for required bluetooth feature PBAP.
blocking-b2g: --- → 2.2r+
- revise previous patch based on #comment 2.

Thank Ben for reviewing the patch.
Attachment #8671181 - Attachment is obsolete: true
The results on treeherder looks fine.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b1d44e588a86
Status: NEW → ASSIGNED
Keywords: checkin-needed
this failed to apply to 2.2r with:

patching file dom/bluetooth/bluedroid/BluetoothPbapManager.h
Hunk #1 FAILED at 151
1 out of 1 hunks FAILED -- saving rejects to file dom/bluetooth/bluedroid/BluetoothPbapManager.h.rej

could you take a look, thanks!
Flags: needinfo?(6jamin)
(In reply to Carsten Book [:Tomcat] from comment #8)
> this failed to apply to 2.2r with:
> 
> patching file dom/bluetooth/bluedroid/BluetoothPbapManager.h
> Hunk #1 FAILED at 151
> 1 out of 1 hunks FAILED -- saving rejects to file
> dom/bluetooth/bluedroid/BluetoothPbapManager.h.rej
> 
> could you take a look, thanks!

Got it.
I'll upload a patch for v2.2r.
Sorry for the inconvenience caused.
Flags: needinfo?(6jamin)
Attachment #8672469 - Attachment description: Handle illegal PBAP virtual folders path properly. (v2), r=btian → (for m-c) Handle illegal PBAP virtual folders path properly. (v2), r=btian
https://hg.mozilla.org/mozilla-central/rev/83f9e85ebee0
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S9 (16Oct)
Blocks: 1203821
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: