https://bugs.kde.org/show_bug.cgi?id=493151

--- Comment #2 from [email protected] ---
Git commit 08bb2d89b7b20d2f76180fea300487ae9c89445f by Gilles Caulier.
Committed on 19/11/2026 at 01:25.
Pushed by cgilles into branch 'master'.

Strip the display padding from the camera network address

The camera address field is masked "000.000.000.000" when it is edited,
so a network camera is stored as "ptpip:192.168.000.010". libgphoto2
passes that string through unchanged and ptp2 parses it with inet_aton(),
which reads a leading zero as an octal prefix, so the connection goes to
the wrong host or is rejected outright. Where inet_aton() is unavailable,
ptpip.c uses inet_pton(), which rejects the padded form outright.

The ptpip: case was already handled by the bug 493151 fix, but the ip:
prefix introduced later still reached libgphoto2 with the padded form.

Replace the fixed-offset implementation of DKCamera::port(), which was
hard-coded to one exact string shape and could distort stored values of
a different length, with a generic static DKCamera::normalizedPortPath()
extending the cleanup to "ip:", covering paths with explicit ports,
hostnames and non-network port paths, and add a unit test for it.

Based on work by Andrei Buneyeu in MR !441. Finalized by the maintainers
to ship in 9.2.0.

Author: Andrei Buneyeu <yankeppey at gmail dot com>

M  +1    -0    core/tests/CMakeLists.txt
A  +40   -0    core/tests/import/CMakeLists.txt
A  +86   -0    core/tests/import/dkcameraport_utest.cpp     [License:
GPL(v2.0+)]
A  +36   -0    core/tests/import/dkcameraport_utest.h     [License: GPL(v2.0+)]
M  +44   -8    core/utilities/import/backend/dkcamera.cpp
M  +5    -0    core/utilities/import/backend/dkcamera.h

https://invent.kde.org/graphics/digikam/-/commit/08bb2d89b7b20d2f76180fea300487ae9c89445f

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to