diff options
44 files changed, 621 insertions, 165 deletions
diff --git a/.travis.yml b/.travis.yml index 5affab673..16ce8e5c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,9 +14,7 @@ env: # a helper shell script. before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew uninstall libtool; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install $(sh .travis-translate-pkgs $EXTRALIBS); fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install libtool; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y $(sh .travis-translate-pkgs $EXTRALIBS); fi diff --git a/Makefile.am b/Makefile.am index 37e500570..31257ff7a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ bin_SCRIPTS = gphoto2-config EXTRA_DIST = MAINTAINERS TESTERS installcheck.mk -EXTRA_DIST += HACKING.md +EXTRA_DIST += HACKING.md SECURITY.md # Note: @subdirs@ lists all the directories from AC_CONFIG_SUBDIRS() SUBDIRS = @subdirs@ libgphoto2 camlibs tests examples po packaging doc gphoto-m4 @@ -76,7 +76,32 @@ source-code-check: # Usage: make CAMLIBS="canon.la ptp2.la" install-camlibs install-camlibs: - cd camlibs && $(MAKE) CAMLIBS="$(CAMLIBS)" install-camlibs + cd camlibs && $(MAKE) $(AM_MAKEFLAGS) CAMLIBS="$(CAMLIBS)" install-camlibs + + +######################################################################## +# Convenience shortcuts to update the *.po translation files in both +# po/ subdirs at once and to reset the *.po translation files to "git +# HEAD" in both po/ subdirs at once. + +PO_SUBDIRS = +PO_SUBDIRS += libgphoto2_port/po +PO_SUBDIRS += po + +# Run "git checkout *.po" in all po/ subdirs +# which is quite useful after "make dist" to clean up "git status". +.PHONY: git-checkout-po +git-checkout-po: + set -e; cd "$(top_srcdir)" && if test -d .git; then \ + for d in $(PO_SUBDIRS); do \ + (cd "$$d" && git checkout *.po); \ + done; \ + fi + +# Run "make update-po" in all po/ subdirs +.PHONY: update-po +update-po: + @for d in $(PO_SUBDIRS); do (cd "$$d" && $(MAKE) $(AM_MAKEFLAGS) update-po) || exit 1; done ######################################################################## @@ -95,8 +120,8 @@ if ENABLE_RPM # create RPM packages rpm: Makefile - $(MAKE) dist - $(MAKE) -C packaging/rpm rpm + $(MAKE) $(AM_MAKEFLAGS) dist + cd packaging/rpm && $(MAKE) $(AM_MAKEFLAGS) rpm @echo "The RPM packages should now be found in packaging/rpm/RPMS" else @@ -2,16 +2,30 @@ libgphoto2 2.5.23.1 development lumix: -* New WIFI Lumix camera driver, using curl and libxml2. +* New WIFI Lumix camera driver was added, using curl and libxml2. - Lots of abilities supported already, just capture is not working :/ + Lots of abilities supported already, also capture preview. + However capture itself is not yet working :/ + This driver needs libxml2 and libcurl to be built. ptp2: - +* Canon EOS: lock/unlock ui before more operations +* Canon Powershot SX / EOS M: some setup adjustments to make powershot sx work better +* Nikon Keymission 170: try override opcodes to allow capture +* Nikon DSLR: fixed a regression where 5 seconds was longer image capture shutterspeed +* Sony: adjusted manualfocusing not to autofocus +* bugfixes +* New ids added: + * Sony Alpha RX100V, A7s, RX0 II, + * Nikon Coolpix L810, KeyMission 170 + * Canon PowerShot SX530HS, SX 620HS, + * Canon EOS 2000D, 1500D, R2, M6 Mark 2, 250D, + * Fuji X-A5, X-E3, GFX100 + * GoPro Hero 7 White, 7 Black, 8 Black all: -* fixed some fuzzer issues +* fixed some issues found by AFL fuzzing, mostly in "outdated" drivers. ------------------------------------------------------------------------------ libgphoto2 2.5.23 release diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..66d512feb --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,68 @@ +# Security overview + +## General + +libgphoto2 is a software library to allow accessing USB devices (cameras, +media players), allowing file system operations (list, download, +upload, delete), and control operations (get and set settings, and +remote control). + +It consists of a core library, and drivers for both "port" protocols +like USB, serial, IP and devices (camera drivers). + +libgphoto2 only processes images to provide standard formats. For JPEG +images the libexif library is used for extraction of EXIF data. + +Callers of the library can be assumed trusted, also input coming into +the library via API calls is considered trusted. + +Data coming from port drivers (USB, serial, IP, etc) is considered untrusted. + +Historically the primary development goals was "make it work", without +security in mind. + +## Attack Surface + +The primary attack scenario is a kiosk style photo access computer, where people +can plug in USB devices in an unattended fashion. + +Attack impacts are achieving control over this computer, or blocking its use. + +## Bugs considered security issues + +(Mostly for CVE assigments rules.) + +In scope of a security attack are the autodetecting protocols support, +like USB. + +Also IP (TCP and UDP) based drivers are considered in scope, with +malicious target devices or man in the middle attacks. + +Current day camera drivers are in scope (e.g. all drivers not marked as "outdated"). + +Triggering memory corruption is considered in scope. +Triggering endless loops is considered in scope. (would block kiosk style operation) + +## Bugs not considered security issues + +Serial cameras are not in scope, as they cannot be autodetected and need +special configuration which makes other attack vectors likely. + +Outdated drivers... We have classified a number of older drivers as +"outdated", and do not recommend to build them by default anymore. + +Denial of service attacks of class "crash" or "resource consumption +(disk)" are not in scope. + +- Frontends should auto-recover (restart) after crashes. +- Resource consumption in terms of diskspace is not in scope, as the + library is meant to download large amounts of data (Gigabytes) in + regular operation. + +Information disclosure is not a relevant attack scenario. + +## Bugreports + +Bugreports can be filed as github issues. + +If you want to report an embargoed security bug report, reach out to marcus@jet.franken.de diff --git a/camlibs/Makefile.am b/camlibs/Makefile.am index 53f210d85..c6a6e257a 100644 --- a/camlibs/Makefile.am +++ b/camlibs/Makefile.am @@ -19,7 +19,7 @@ # # Building the camlibs itself is defined in the Makefile-files # included below. -SUBDIRS = . canon/doc konica/localization +SUBDIRS = . ######################################################################## @@ -156,7 +156,7 @@ all-local: Makefile # Usage: make CAMLIBS="canon.la ptp2.la" install-camlibs install-camlibs: - $(MAKE) BUILD_THESE_CAMLIBS="$(CAMLIBS)" install-camlibLTLIBRARIES + $(MAKE) $(AM_MAKEFLAGS) BUILD_THESE_CAMLIBS="$(CAMLIBS)" install-camlibLTLIBRARIES ######################################################################## diff --git a/camlibs/canon/Makefile-files b/camlibs/canon/Makefile-files index 08c002e8b..fe02b85d0 100644 --- a/camlibs/canon/Makefile-files +++ b/camlibs/canon/Makefile-files @@ -1,5 +1,7 @@ # -*- Makefile -*- +SUBDIRS += canon/doc + EXTRA_LTLIBRARIES += canon.la camlibdoc_DATA += canon/README.canon diff --git a/camlibs/clicksmart310/clicksmart.c b/camlibs/clicksmart310/clicksmart.c index 9184c6cb4..a867284c8 100644 --- a/camlibs/clicksmart310/clicksmart.c +++ b/camlibs/clicksmart310/clicksmart.c @@ -53,8 +53,7 @@ CLICKSMART_READ (GPPort *port, int index, char *data) static int CLICKSMART_READ_STATUS (GPPort *port, char *data) { - gp_port_usb_msg_interface_read(port, 0, 0, CS_CH_READY, data, 1); - return GP_OK; + return gp_port_usb_msg_interface_read(port, 0, 0, CS_CH_READY, data, 1); } int clicksmart_init (GPPort *port, CameraPrivateLibrary *priv) @@ -86,8 +85,11 @@ int clicksmart_init (GPPort *port, CameraPrivateLibrary *priv) CLICKSMART_READ_STATUS (port, &c); gp_port_usb_msg_interface_write(port, 6, 0, 9, NULL, 0); - while (c != 1) - CLICKSMART_READ_STATUS (port, &c); + while (c != 1) { + int r; + if ((r = CLICKSMART_READ_STATUS (port, &c)) < GP_OK) + return r; + } buffer = malloc(0x200); if (!buffer) { free (temp_catalog); @@ -131,7 +133,7 @@ int clicksmart_get_res_setting (CameraPrivateLibrary *priv, int n) int clicksmart_read_pic_data (CameraPrivateLibrary *priv, GPPort *port, - unsigned char *data, int n) + unsigned char **data, int n) { int offset=0; char c; @@ -147,7 +149,9 @@ clicksmart_read_pic_data (CameraPrivateLibrary *priv, GPPort *port, gp_port_usb_msg_interface_write(port, 6, 0x1fff - n, 1, NULL, 0); c = 0; while (c != 1){ - CLICKSMART_READ_STATUS (port, &c); + int r; + if ((r = CLICKSMART_READ_STATUS (port, &c)) < GP_OK) + return r; } /* Get the size of the data and calculate the size to download, which * is the next multiple of 0x100. Only for the hi-res photos is the @@ -161,17 +165,20 @@ clicksmart_read_pic_data (CameraPrivateLibrary *priv, GPPort *port, remainder = size%0x200; GP_DEBUG("size: %x, remainder: %x\n", size, remainder); + *data = calloc(size + 0x100,1); + if (!*data) return GP_ERROR; /* Download the data */ while (offset < size-remainder) { GP_DEBUG("offset: %x\n", offset); - gp_port_read(port, (char *)data + offset, 0x200); + if (gp_port_read(port, (char *)*data + offset, 0x200) < GP_OK) + break; offset = offset + 0x200; } remainder=((remainder+0xff)/0x100)*0x100; GP_DEBUG("Second remainder: %x\n", remainder); if (remainder) - gp_port_read(port, (char *)data + offset, remainder); + gp_port_read(port, (char *)*data + offset, remainder); gp_port_usb_msg_interface_read(port, 0, 0, CS_READCLOSE, &c, 1); gp_port_usb_msg_interface_write(port, 0, 2, CS_CH_READY, NULL, 0); @@ -183,7 +190,7 @@ clicksmart_read_pic_data (CameraPrivateLibrary *priv, GPPort *port, */ if (priv->catalog[16*n]) { - while ( data[size-1] == 0) + while ( (*data)[size-1] == 0) size--; } return size; diff --git a/camlibs/clicksmart310/clicksmart.h b/camlibs/clicksmart310/clicksmart.h index 35435d1cb..5982ef99c 100644 --- a/camlibs/clicksmart310/clicksmart.h +++ b/camlibs/clicksmart310/clicksmart.h @@ -35,7 +35,7 @@ struct _CameraPrivateLibrary { int clicksmart_init (GPPort *port, CameraPrivateLibrary *priv); int clicksmart_get_res_setting (CameraPrivateLibrary *priv, int n); int clicksmart_read_pic_data (CameraPrivateLibrary *priv, - GPPort *port, unsigned char *data, + GPPort *port, unsigned char **data, int n); int clicksmart_delete_all_pics (GPPort *port); diff --git a/camlibs/clicksmart310/library.c b/camlibs/clicksmart310/library.c index 53853cc58..674c9ec25 100644 --- a/camlibs/clicksmart310/library.c +++ b/camlibs/clicksmart310/library.c @@ -195,12 +195,10 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, return GP_ERROR; } - data = malloc (w*h); - if(!data) - return GP_ERROR_NO_MEMORY; + data = NULL; GP_DEBUG("Fetch entry %i\n", k); - b = clicksmart_read_pic_data (camera->pl, camera->port, data, k); + b = clicksmart_read_pic_data (camera->pl, camera->port, &data, k); if (GP_FILE_TYPE_RAW == type) { /* type is GP_FILE_TYPE_RAW */ gp_file_set_mime_type (file, GP_MIME_RAW); diff --git a/camlibs/jl2005a/library.c b/camlibs/jl2005a/library.c index 4db8749b3..80a2e3e7a 100644 --- a/camlibs/jl2005a/library.c +++ b/camlibs/jl2005a/library.c @@ -164,8 +164,8 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, { Camera *camera = user_data; int status = GP_OK; - int w, h = 0, k; - int i,j; + unsigned int w, h = 0; + int i,j,k; int b = 0; int compressed = 0; unsigned char header[5] = "\xff\xff\xff\xff\x55"; @@ -192,7 +192,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, GP_DEBUG ("height is %i\n", h); /* sanity check against bad usb devices */ - if ((w ==0) || (w > 1024) || (h == 0) || (h > 1024)) return GP_ERROR; + if ((w ==0) || (w > 1024) || (h == 0) || (h > 1024)) return GP_ERROR_CORRUPTED_DATA; /* Image data to be downloaded contains header and footer bytes */ data = malloc (b+14); @@ -231,7 +231,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, /* sanity check the sizes, as the ahd bayer algorithm does not like very small height / width */ if ((h < 72) || (w < 176)) { - status = GP_ERROR; + status = GP_ERROR_CORRUPTED_DATA; goto end; } p_data = malloc( w*h ); @@ -239,10 +239,22 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, status = GP_ERROR_NO_MEMORY; goto end; } - if (compressed) + if (compressed) { + /* compressed seems to mean half the lines */ + if (w/2*h > b+14) { + free(p_data); + status = GP_ERROR_CORRUPTED_DATA; + goto end; + } jl2005a_decompress (image_start, p_data, w, h); - else + } else { + if (w*h > b+14) { + free(p_data); + status = GP_ERROR_CORRUPTED_DATA; + goto end; + } memcpy(p_data, image_start, w*h); + } ppm = malloc (w * h * 3 + 256); /* room for data and header */ if (!ppm) { free(p_data); @@ -265,7 +277,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, gp_gamma_correct_single (gtable, ptr, w * h); gp_file_set_mime_type (file, GP_MIME_PPM); gp_file_set_data_and_size (file, (char *)ppm, size); - end: +end: free(data); return status; } diff --git a/camlibs/jl2005c/jl2005c.c b/camlibs/jl2005c/jl2005c.c index 2380e9c20..62abf0c01 100644 --- a/camlibs/jl2005c/jl2005c.c +++ b/camlibs/jl2005c/jl2005c.c @@ -36,6 +36,11 @@ #define GP_MODULE "jl2005c" +/* do not sleep during fuzzing */ +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +# define usleep(x) +#endif + int jl2005c_init (Camera *camera, GPPort *port, CameraPrivateLibrary *priv) { diff --git a/camlibs/kodak/dc240/library.c b/camlibs/kodak/dc240/library.c index 5352e9db2..a77d0999c 100644 --- a/camlibs/kodak/dc240/library.c +++ b/camlibs/kodak/dc240/library.c @@ -60,6 +60,10 @@ #define GP_MODULE "dc240" +/* do not sleep during fuzzing */ +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +# define usleep(x) +#endif /* legacy from dc240.h */ /* @@ -165,10 +169,13 @@ write_again: /* Read in the response from the camera if requested */ while (read_response) { - if (gp_port_read(camera->port, in, 1) >= GP_OK) { + int ret; + if ((ret=gp_port_read(camera->port, in, 1)) >= GP_OK) { /* On error, read again */ read_response = 0; + break; } + if (ret == GP_ERROR_IO_READ) return ret; /* e.g. device detached? */ } return GP_OK; @@ -458,7 +465,10 @@ static int dc240_get_file_size (Camera *camera, const char *folder, const char * if (dc240_packet_exchange(camera, f, p1, p2, &size, 256, context) < 0) size = 0; else { - gp_file_get_data_and_size (f, (const char**)&fdata, &fsize); + int ret; + ret = gp_file_get_data_and_size (f, (const char**)&fdata, &fsize); + if (ret < GP_OK) return ret; + if (!fdata || (fsize < 4)) return GP_ERROR; size = (fdata[offset] << 24) | (fdata[offset+1] << 16) | (fdata[offset+2] << 8 ) | @@ -753,6 +763,11 @@ int dc240_get_directory_list (Camera *camera, CameraList *list, const char *fold num_of_entries = be16atoh(&fdata [0]) + 1; total_size = 2 + (num_of_entries * 20); GP_DEBUG ("number of file entries : %d, size = %ld", num_of_entries, fsize); + if (total_size > fsize) { + GP_DEBUG ("total_size %d > fsize %ld", total_size, fsize); + gp_file_free (file); + return GP_ERROR; + } for (x = 2; x < total_size; x += 20) { if ((fdata[x] != '.') && (attrib == (unsigned char)fdata[x+11])) { /* Files have attrib 0x00, Folders have attrib 0x10 */ @@ -793,7 +808,7 @@ int dc240_file_action (Camera *camera, int action, CameraFile *file, thumb = 1; /* no break on purpose */ case DC240_ACTION_IMAGE: - if ((size = dc240_get_file_size(camera, folder, filename, thumb, context)) < 0) { + if ((size = dc240_get_file_size(camera, folder, filename, thumb, context)) < GP_OK) { retval = GP_ERROR; break; } diff --git a/camlibs/konica/Makefile-files b/camlibs/konica/Makefile-files index 324c0c15b..5d20d348f 100644 --- a/camlibs/konica/Makefile-files +++ b/camlibs/konica/Makefile-files @@ -1,5 +1,7 @@ # -*- Makefile -*- +SUBDIRS += konica/localization + EXTRA_DIST += konica/EXPERTS konica/qm150.txt konica/README.konica konica/ChangeLog konica/COPYING konica/TODO camlibdoc_DATA += konica/README.konica diff --git a/camlibs/lg_gsm/lg_gsm.c b/camlibs/lg_gsm/lg_gsm.c index 89ab2b472..b6266fbe2 100644 --- a/camlibs/lg_gsm/lg_gsm.c +++ b/camlibs/lg_gsm/lg_gsm.c @@ -116,7 +116,7 @@ unsigned int lg_gsm_get_picture_size (GPPort *port, int pic) return size; } -int lg_gsm_read_picture_data (GPPort *port, char *data, int size, int n) +int lg_gsm_read_picture_data (GPPort *port, char *data, unsigned int datasize, unsigned int n) { char listphotos[] = "\x04\x0\x08\x0\x0\x0\x40\x0\x0\x0\x0\x0\x0\x0"; @@ -127,6 +127,7 @@ int lg_gsm_read_picture_data (GPPort *port, char *data, int size, int n) char block[50000]; char oknok[6]; + unsigned int size; int pos=0; int block_size=50000; int header_size=8; @@ -158,11 +159,15 @@ int lg_gsm_read_picture_data (GPPort *port, char *data, int size, int n) /* then read 142 */ READ(port, photodesc, 142); size = (int)photodesc[138] + (int)photodesc[139]*0x100 + (int)photodesc[140]*0x10000+(int)photodesc[141]*0x1000000; - GP_DEBUG(" size of picture %i is 0x%x\n", n, size); + GP_DEBUG(" size of picture %i is 0x%x", n, size); /* max. 1280x960x24bits ? */ if ( (size >= 0x384000 ) ) { return GP_ERROR; } + if (datasize < size) { + GP_DEBUG("size of picture %u, previous read %u", datasize, size); + return GP_ERROR_CORRUPTED_DATA; + } memcpy(getphoto, &get_photo_cmd[0], 10); memcpy(getphoto +10, &n, 1); /*TODO: fix this*/ @@ -180,6 +185,7 @@ int lg_gsm_read_picture_data (GPPort *port, char *data, int size, int n) for (i = 1 ; i <= nb_blocks ; i++) { remain = size - pos; + GP_DEBUG ("size %d, pos %d, remain %d, block_size %d, header_size %d", size, pos, remain, block_size, header_size); if (remain >= block_size - header_size) { READ(port, block, block_size); diff --git a/camlibs/lg_gsm/lg_gsm.h b/camlibs/lg_gsm/lg_gsm.h index 893dcd44a..bcbb2372a 100644 --- a/camlibs/lg_gsm/lg_gsm.h +++ b/camlibs/lg_gsm/lg_gsm.h @@ -31,7 +31,7 @@ typedef enum { int lg_gsm_init (GPPort *port, Model *model, Info *info); unsigned int lg_gsm_get_picture_size (GPPort *port, int pic); -int lg_gsm_read_picture_data (GPPort *port, char *data, int size, int n); +int lg_gsm_read_picture_data (GPPort *port, char *data, unsigned int size, unsigned int n); int lg_gsm_list_files (GPPort *port, CameraList *list); #endif diff --git a/camlibs/lg_gsm/library.c b/camlibs/lg_gsm/library.c index f1333fbf7..6ecb26ccf 100644 --- a/camlibs/lg_gsm/library.c +++ b/camlibs/lg_gsm/library.c @@ -139,7 +139,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, int k; char *data; - int len; + unsigned int len; k = gp_filesystem_number(camera->fs, "/", filename, context); diff --git a/camlibs/lumix/Makefile-files b/camlibs/lumix/Makefile-files index d8d151ff8..1670b332b 100644 --- a/camlibs/lumix/Makefile-files +++ b/camlibs/lumix/Makefile-files @@ -1,13 +1,9 @@ # -*- Makefile -*- EXTRA_DIST += lumix/README.lumix - noinst_DATA += lumix/README.lumix -if BUILD_LUMIX + EXTRA_LTLIBRARIES += lumix.la -else -EXTRA_DIST += lumix/lumix.c -endif lumix_la_SOURCES = lumix/lumix.c lumix_la_CFLAGS = $(AM_CFLAGS) $(NO_UNUSED_CFLAGS) $(CFLAGS) $(LIBXML2_CFLAGS) $(LIBCURL_CFLAGS) diff --git a/camlibs/lumix/lumix.c b/camlibs/lumix/lumix.c index eeb0a0b54..3115b0648 100644 --- a/camlibs/lumix/lumix.c +++ b/camlibs/lumix/lumix.c @@ -24,15 +24,20 @@ */ #include "config.h" + #include <string.h> #include <errno.h> -#include <curl/curl.h> +#ifdef HAVE_LIBCURL +# include <curl/curl.h> +#endif #include <stdio.h> -#include <libxml/parser.h> -#include <libxml/tree.h> #include <stdlib.h> -#include <libxml/xmlmemory.h> -#include <libxml/xmlreader.h> +#ifdef HAVE_LIBXML2 +# include <libxml/parser.h> +# include <libxml/tree.h> +# include <libxml/xmlmemory.h> +# include <libxml/xmlreader.h> +#endif #include <sys/socket.h> @@ -82,6 +87,8 @@ # define N_(String) (String) #endif +#if defined(HAVE_LIBCURL) && defined(HAVE_LIBXML2) + char* CDS_Control = ":60606/Server0/CDS_control"; int ReadoutMode = 2; // this should be picked up from the settings.... 0-> JPG; 1->RAW; 2 -> Thumbnails char* cameraShutterSpeed = "B"; // //placeholder to store the value of the shutterspeed set in camera; "B" is for bulb. @@ -370,14 +377,6 @@ storage_info_func (CameraFilesystem *fs, /**********************************************************************/ -int -camera_id (CameraText *id) -{ - strcpy(id->text, "Lumix Wifi"); - - return GP_OK; -} - static size_t write_callback(char *contents, size_t size, size_t nmemb, void *userp) { @@ -1919,3 +1918,25 @@ camera_init (Camera *camera, GPContext *context) } else return GP_ERROR_IO; } + +#else +/* no XML2 or no CURL -> no camera here */ +int +camera_init (Camera *camera, GPContext *context) +{ + return GP_OK; +} + +int camera_abilities (CameraAbilitiesList *list) +{ + return GP_OK; +} +#endif + +int +camera_id (CameraText *id) +{ + strcpy(id->text, "Lumix Wifi"); + + return GP_OK; +} diff --git a/camlibs/pentax/exiftool_pentax_lens.txt b/camlibs/pentax/exiftool_pentax_lens.txt index f9bbf1baf..9d8d6bef7 100644 --- a/camlibs/pentax/exiftool_pentax_lens.txt +++ b/camlibs/pentax/exiftool_pentax_lens.txt @@ -168,6 +168,7 @@ {8, 0, "Sigma 50-150mm F2.8 II APO EX DC HSM"}, {8, 3, "Sigma 18-125mm F3.8-5.6 DC HSM"}, {8, 4, "Sigma 50mm F1.4 EX DG HSM"}, +{8, 6, "Sigma 4.5mm F2.8 EX DC Fisheye"}, {8, 7, "Sigma 24-70mm F2.8 IF EX DG HSM"}, {8, 8, "Sigma 18-250mm F3.5-6.3 DC OS HSM"}, {8, 11, "Sigma 10-20mm F3.5 EX DC HSM"}, @@ -178,6 +179,7 @@ {8, 16, "Sigma 70-200mm F2.8 EX DG Macro HSM II"}, {8, 17, "Sigma 50-500mm F4.5-6.3 DG OS HSM"}, {8, 18, "Sigma 8-16mm F4.5-5.6 DC HSM"}, +{8, 20, "Sigma 18-50mm F2.8-4.5 DC HSM"}, {8, 21, "Sigma 17-50mm F2.8 EX DC OS HSM"}, {8, 22, "Sigma 85mm F1.4 EX DG HSM"}, {8, 23, "Sigma 70-200mm F2.8 APO EX DG OS HSM"}, diff --git a/camlibs/pentax/pslr.h b/camlibs/pentax/pslr.h index 8ab06dfe3..df9c196f8 100644 --- a/camlibs/pentax/pslr.h +++ b/camlibs/pentax/pslr.h @@ -72,7 +72,7 @@ user_file_format_t *get_file_format_t( user_file_format uff ); // OFF-AUTO: Off-Auto-Aperture typedef enum { - PSLR_EXPOSURE_MODE_P = 0 , + PSLR_EXPOSURE_MODE_P = 0, PSLR_EXPOSURE_MODE_GREEN = 1, // PSLR_EXPOSURE_MODE_HYP = 2, // PSLR_EXPOSURE_MODE_AUTO_PICT = 1, diff --git a/camlibs/pentax/pslr_model.c b/camlibs/pentax/pslr_model.c index 10476600d..5d3068df6 100644 --- a/camlibs/pentax/pslr_model.c +++ b/camlibs/pentax/pslr_model.c @@ -968,7 +968,7 @@ ipslr_model_info_t camera_models[] = { { 0x1309c, "K-3II", false, false, true, true, false, true, 452, 4, {24, 14, 6, 2}, 9, 8000, 100, 51200, 100, 51200, PSLR_JPEG_IMAGE_TONE_BLEACH_BYPASS, true, 27, ipslr_status_parse_k3}, { 0x12fca, "K-500", false, true, true, false, false, false, 452, 3, {16, 12, 8, 5}, 9, 6000, 100, 51200, 100, 51200, PSLR_JPEG_IMAGE_TONE_CROSS_PROCESSING, true, 11, ipslr_status_parse_k500}, // only limited support from here - { 0x12994, "*ist D", true, true, true, false, false, false, 0, 3, {6, 4, 2}, 3, 4000, 200, 3200, 200, 3200, PSLR_JPEG_IMAGE_TONE_NONE , false, 11, NULL}, // buffersize: 264 + { 0x12994, "*ist D", true, true, true, false, false, false, 0, 3, {6, 4, 2}, 3, 4000, 200, 3200, 200, 3200, PSLR_JPEG_IMAGE_TONE_NONE, false, 11, NULL}, // buffersize: 264 { 0x12b60, "*ist DS2", true, true, true, false, false, false, 0, 3, {6, 4, 2}, 5, 4000, 200, 3200, 200, 3200, PSLR_JPEG_IMAGE_TONE_BRIGHT, false, 11, NULL}, { 0x12b1a, "*ist DL", true, true, true, false, false, false, 0, 3, {6, 4, 2}, 5, 4000, 200, 3200, 200, 3200, PSLR_JPEG_IMAGE_TONE_BRIGHT, false, 11, NULL}, { 0x12b80, "GX-1L", true, true, true, false, false, false, 0, 3, {6, 4, 2}, 5, 4000, 200, 3200, 200, 3200, PSLR_JPEG_IMAGE_TONE_BRIGHT, false, 11, NULL}, diff --git a/camlibs/polaroid/pdc640.c b/camlibs/polaroid/pdc640.c index 2476494f3..146f4779a 100644 --- a/camlibs/polaroid/pdc640.c +++ b/camlibs/polaroid/pdc640.c @@ -568,6 +568,7 @@ pdc640_deltadecode (int width, int height, unsigned char **rawdata, int *rawsize GP_DEBUG ("pdc640_deltacode ()"); + if (width < 2) return GP_ERROR_CORRUPTED_DATA; /* invalid, we implicitly assume it to be 2 or higher in the decoder */ /* Create a buffer to store RGB data in */ size = width * height; data = malloc (size * sizeof (char)); @@ -697,7 +698,7 @@ pdc640_getpic (Camera *camera, int n, int thumbnail, int justraw, CHECK_RESULT (pdc640_transmit_pic (camera->port, cmd, width, thumbnail, *data, *size)); - if (thumbnail || (compression_type == 0 )) { + if (thumbnail || ((compression_type & 3) == 0 )) { /* Process uncompressed data */ CHECK_RESULT (pdc640_processtn (width, height, data, *size)); diff --git a/camlibs/ptp2/cameras/gopro-hero7white.txt b/camlibs/ptp2/cameras/gopro-hero7white.txt new file mode 100644 index 000000000..4103dbbcd --- /dev/null +++ b/camlibs/ptp2/cameras/gopro-hero7white.txt @@ -0,0 +1,155 @@ +Camera summary: +Manufacturer: GoPro +Model: HERO7 WHITE + Version: H18.02.02.10.00 + Serial Number: Cnnnnnnnnnnnnn +Vendor Extension ID: 0x6 (1.0) +Vendor Extension Description: microsoft.com: 1.0; android.com: 1.0; + +Capture Formats: Association/Directory PNG +Display Formats: Undefined Type, Association/Directory, Text, HTML, Unknown(4000), Defined Type, JPEG, Unknown(4001), TIFF EP, BMP, GIF, JFIF, PNG, TIFF, TIFF_IT, JP2, JPX, OGG, MP3, MS Wave, WMA, AAC, FLAC, Abstract Audio Album, Abstract Audio Video Playlist +Supported MTP Object Properties: + Undefined Type/3000: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + Association/Directory/3001: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + Text/3004: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + HTML/3005: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + Unknown(4000)/4000: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + Defined Type/3800: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + JPEG/3801: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + Unknown(4001)/4001: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + TIFF EP/3802: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + BMP/3804: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + GIF/3807: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + JFIF/3808: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + PNG/380b: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + TIFF/380d: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + TIFF_IT/380e: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + JP2/380f: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + JPX/3810: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + OGG/b902: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + MP3/3009: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + MS Wave/3008: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + WMA/b901: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + AAC/b903: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + FLAC/b906: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + Abstract Audio Album/ba03: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + Abstract Audio Video Playlist/ba05: dc01/StorageID dc0b/ParentObject dc02/ObjectFormat dc04/ObjectSize dc07/ObjectFileName dc87/Width dc88/Height dce0/DisplayName dc41/PersistantUniqueObjectIdentifier dc05/AssociationType dc06/AssociationDesc dc03/ProtectionStatus dc08/DateCreated dc09/DateModified dc0d/Hidden dc4f/NonConsumable + +Device Capabilities: + File Download, File Deletion, File Upload + No Image Capture, No Open Capture, No vendor specific capture + +Storage Devices Summary: +store_00000004: + StorageDescription: GoPro MTP Client Disk Volume + VolumeLabel: None + Storage Type: Removable RAM (memory card) + Filesystemtype: Generic Hierarchical + Access Capability: Read-Write + Maximum Capability: 63831015424 (60874 MB) + Free Space (Bytes): 58212745216 (55516 MB) + Free Space (Images): 1073741824 + +Device Property Summary: +Friendly Device Name(0xd402):(read only) (type=0xffff) (null) ('(null)') +Synchronization Partner(0xd401):(read only) (type=0xffff) (null) ('(null)') + +/main/actions/opcode +Label: PTP Opcode +Readonly: 0 +Type: TEXT +Current: 0x1001,0xparam1,0xparam2 +END +/main/status/serialnumber +Label: Serial Number +Readonly: 0 +Type: TEXT +Current: Cnnnnnnnnnnnnn +END +/main/status/manufacturer +Label: Camera Manufacturer +Readonly: 0 +Type: TEXT +Current: GoPro +END +/main/status/cameramodel +Label: Camera Model +Readonly: 0 +Type: TEXT +Current: HERO7 WHITE +END +/main/status/deviceversion +Label: Device Version +Readonly: 0 +Type: TEXT +Current: H18.02.02.10.00 +END +/main/status/vendorextension +Label: Vendor Extension +Readonly: 0 +Type: TEXT +Current: microsoft.com: 1.0; android.com: 1.0; +END +/main/other/d402 +Label: Friendly Device Name +Readonly: 1 +Type: TEXT +Current: (null) +END +/main/other/d401 +Label: Synchronization Partner +Readonly: 1 +Type: TEXT +Current: (null) +END + +Device info: +Manufacturer: GoPro + Model: HERO7 WHITE + device version: H18.02.02.10.00 + serial number: 'Cnnnnnnnnnnnnn' +Vendor extension ID: 0x00000006 +Vendor extension version: 100 +Vendor extension description: microsoft.com: 1.0; android.com: 1.0; +Functional Mode: 0x0000 +PTP Standard Version: 100 +Supported operations: + 0x1001 (Get device info) + 0x1002 (Open session) + 0x1003 (Close session) + 0x1004 (Get storage IDs) + 0x1005 (Get storage info) + 0x1006 (Get number of objects) + 0x1007 (Get object handles) + 0x1008 (Get object info) + 0x1009 (Get object) + 0x100a (Get thumbnail) + 0x100b (Delete object) + 0x100c (Send object info) + 0x100d (Send object) + 0x100f (Format storage) + 0x1014 (Get device property description) + 0x1015 (Get device property value) + 0x1017 (Reset device property value) + 0x1019 (Move object) + 0x101b (Get partial object) + 0x9801 (Get object properties supported) + 0x9802 (Get object property description) + 0x9803 (Get object property value) + 0x9805 (Get object property list) + 0x9810 (Get object references) + 0x95c1 (Get Partial Object (64bit Offset)) + 0x95c2 (Send Partial Object) + 0x95c3 (Truncate Object) + 0x95c4 (Begin Edit Object) + 0x95c5 (End Edit Object) +Events Supported: + 0x4002 (ObjectAdded) + 0x4003 (ObjectRemoved) + 0x4004 (StoreAdded) + 0x4005 (StoreRemoved) + 0x4007 (ObjectInfoChanged) + 0xc801 (ObjectPropChanged) +Device Properties Supported: + 0xd402 (Friendly Device Name) + 0xd401 (Synchronization Partner) diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index bbef0e814..f24489218 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -455,7 +455,10 @@ camera_prepare_canon_eos_capture(Camera *camera, GPContext *context) { C_PTP (ptp_check_eos_events (params)); params->eos_captureenabled = 1; - if (is_canon_eos_m (params) && 0) { + /* run this only on EOS M, not on PowerShot SX */ + /* FIXME: needs more testing :/ */ + if (is_canon_eos_m (params) && strstr(params->deviceinfo.Model,"EOS")) { + /* This code is needed on EOS m3 at least. might not be needed on others ... mess :/ */ PTPPropertyValue ct_val; GP_LOG_D ("EOS M detected"); @@ -5299,6 +5302,23 @@ static struct deviceproptableu8 nikon_d850_compression[] = { }; GENERIC8TABLE(Nikon_D850_Compression,nikon_d850_compression) +static struct deviceproptableu8 nikon_d7500_compression[] = { + { N_("JPEG Basic"), 0x00, PTP_VENDOR_NIKON }, + { N_("JPEG Basic*"), 0x01, PTP_VENDOR_NIKON }, + { N_("JPEG Normal"), 0x02, PTP_VENDOR_NIKON }, + { N_("JPEG Normal*"), 0x03, PTP_VENDOR_NIKON }, + { N_("JPEG Fine"), 0x04, PTP_VENDOR_NIKON }, + { N_("JPEG Fine*"), 0x05, PTP_VENDOR_NIKON }, + { N_("NEF (Raw)"), 0x07, PTP_VENDOR_NIKON }, + { N_("NEF+Basic"), 0x08, PTP_VENDOR_NIKON }, + { N_("NEF+Basic*"), 0x09, PTP_VENDOR_NIKON }, + { N_("NEF+Normal"), 0x0A, PTP_VENDOR_NIKON }, + { N_("NEF+Normal*"), 0x0B, PTP_VENDOR_NIKON }, + { N_("NEF+Fine"), 0x0C, PTP_VENDOR_NIKON }, + { N_("NEF+Fine*"), 0x0D, PTP_VENDOR_NIKON }, +}; +GENERIC8TABLE(Nikon_D7500_Compression,nikon_d7500_compression) + static struct deviceproptableu8 compressionsetting[] = { { N_("JPEG Basic"), 0x00, PTP_VENDOR_NIKON }, { N_("JPEG Normal"), 0x01, PTP_VENDOR_NIKON }, @@ -5307,7 +5327,6 @@ static struct deviceproptableu8 compressionsetting[] = { { N_("NEF+Basic"), 0x05, PTP_VENDOR_NIKON }, { N_("NEF+Normal"), 0x06, PTP_VENDOR_NIKON }, { N_("NEF+Fine"), 0x07, PTP_VENDOR_NIKON }, - { N_("Standard"), 0x02, PTP_VENDOR_SONY }, { N_("Fine"), 0x03, PTP_VENDOR_SONY }, { N_("Extra Fine"), 0x04, PTP_VENDOR_SONY }, @@ -8541,6 +8560,11 @@ static struct submenu nikon_d850_capture_settings[] = { { 0,0,0,0,0,0,0 }, }; +static struct submenu nikon_d7500_capture_settings[] = { + { N_("Image Quality"), "imagequality", PTP_DPC_CompressionSetting, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_D7500_Compression, _put_Nikon_D7500_Compression }, + { 0,0,0,0,0,0,0 }, +}; + static struct submenu nikon_z6_capture_settings[] = { { N_("Image Quality"), "imagequality", PTP_DPC_CompressionSetting, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_D850_Compression, _put_Nikon_D850_Compression }, { N_("Focus Metering Mode"), "focusmetermode", PTP_DPC_FocusMeteringMode, PTP_VENDOR_NIKON, PTP_DTC_UINT16, _get_Nikon_D850_FocusMetering, _put_Nikon_D850_FocusMetering }, @@ -8645,8 +8669,9 @@ static struct menu menus[] = { { N_("Capture Settings"), "capturesettings", 0x4b0, 0x0426, nikon_d3s_capture_settings, NULL, NULL }, { N_("Capture Settings"), "capturesettings", 0x4b0, 0x0429, nikon_d5100_capture_settings, NULL, NULL }, { N_("Capture Settings"), "capturesettings", 0x4b0, 0x0430, nikon_d7100_capture_settings, NULL, NULL }, + { N_("Capture Settings"), "capturesettings", 0x4b0, 0x0440, nikon_d7500_capture_settings, NULL, NULL }, { N_("Capture Settings"), "capturesettings", 0x4b0, 0x0414, nikon_d40_capture_settings, NULL, NULL }, - { N_("Capture Settings"), "capturesettings", 0x4b0, 0x0441, nikon_d850_capture_settings, NULL, NULL }, + { N_("Capture Settings"), "capturesettings", 0x4b0, 0x0441, nikon_d850_capture_settings, NULL, NULL }, { N_("Capture Settings"), "capturesettings", 0x4b0, 0x0442, nikon_z6_capture_settings, NULL, NULL }, /* Z7 */ { N_("Capture Settings"), "capturesettings", 0x4b0, 0x0443, nikon_z6_capture_settings, NULL, NULL }, /* Z6 */ { N_("Capture Settings"), "capturesettings", 0x4b0, 0, nikon_generic_capture_settings, NULL, NULL }, diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 415cdfcef..5ac54edc4 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -999,26 +999,31 @@ static struct { /* https://github.com/gphoto/libgphoto2/issues/190 */ {"Sony:Alpha-A6500", 0x054c, 0x0784, 0}, - /* hanes442@icloud.com */ - {"Sony:DSC-RX100M5 (Control)",0x054c, 0x07a3, PTP_CAP}, - - /* https://github.com/gphoto/libgphoto2/issues/190 */ - {"Sony:Alpha-A6500 (Control)",0x054c, 0x07a4, PTP_CAP|PTP_CAP_PREVIEW}, - - /* https://sourceforge.net/p/gphoto/support-requests/127/ */ - {"Sony:Alpha-A5000 (Control)",0x054c, 0x07c6, PTP_CAP}, - /* bertrand.chambon@free.fr */ {"Sony:Alpha-A68 (Control)", 0x054c, 0x079b, PTP_CAP|PTP_CAP_PREVIEW}, /* https://github.com/gphoto/libgphoto2/issues/70 */ {"Sony:Alpha-A6300 (Control)",0x054c, 0x079c, PTP_CAP|PTP_CAP_PREVIEW}, + /* Anja Stock at SUSE */ + {"Sony:DSC-RX10M3 (Control)", 0x054c, 0x079d, PTP_CAP|PTP_CAP_PREVIEW}, + /* Elijah Parker <mail@timelapseplus.com> */ {"Sony:Alpha-A99 M2 (Control)", 0x054c, 0x079e, PTP_CAP|PTP_CAP_PREVIEW}, - /* Anja Stock at SUSE */ - {"Sony:DSC-RX10M3 (Control)", 0x054c, 0x079d, PTP_CAP|PTP_CAP_PREVIEW}, + /* Elijah Parker <mail@timelapseplus.com> */ + {"Sony:DSC-RX100V (Control)", 0x054c, 0x07a3, PTP_CAP}, + /* hanes442@icloud.com */ + {"Sony:DSC-RX100M5 (Control)",0x054c, 0x07a3, PTP_CAP}, + + + /* Elijah Parker <mail@timelapseplus.com> */ + /* https://github.com/gphoto/libgphoto2/issues/190 */ + {"Sony:Alpha-A6500 (Control)", 0x054c, 0x07a4, PTP_CAP|PTP_CAP_PREVIEW}, + + /* Elijah Parker <mail@timelapseplus.com> */ + /* https://sourceforge.net/p/gphoto/support-requests/127/ */ + {"Sony:Alpha-A5000 (Control)", 0x054c, 0x07c6, PTP_CAP}, /* jackden@gmail.com */ {"Sony:DSC-RX100M6 (MTP)", 0x054c, 0x0830, 0}, @@ -1057,6 +1062,9 @@ static struct { /* Nick Clarke <nick.clarke@gmail.com> */ {"Sony:Alpha-A77 M2 (Control)", 0x054c, 0x0953, PTP_CAP|PTP_CAP_PREVIEW}, + /* Elijah Parker <mail@timelapseplus.com> */ + {"Sony:Alpha-A7s (Control)", 0x054c, 0x0954, PTP_CAP}, + /* Markus Oertel */ /* Preview confirmed by Adrian Schroeter, preview might need the firmware getting updated */ {"Sony:Alpha-A5100 (Control)", 0x054c, 0x0957, PTP_CAP|PTP_CAP_PREVIEW}, @@ -1105,6 +1113,7 @@ static struct { {"Sony:DSC-RX0 (PC Control)", 0x054c, 0x0c32, PTP_CAP|PTP_CAP_PREVIEW}, /* Elijah Parker, mail@timelapseplus.com */ + /* https://github.com/gphoto/libgphoto2/issues/230 */ {"Sony:Alpha-A7r III (PC Control)", 0x054c, 0x0c33, PTP_CAP|PTP_CAP_PREVIEW}, /* FIXME: crosscheck */ {"Sony:Alpha-A7 III (PC Control)", 0x054c, 0x0c34, PTP_CAP|PTP_CAP_PREVIEW}, /* FIXME: crosscheck */ @@ -1119,9 +1128,9 @@ static struct { {"Sony:DSC-RX100M5A (MTP)", 0x054c, 0x0cb1, 0}, {"Sony:DSC-RX100M5A (PC Control)", 0x054c, 0x0cb2, PTP_CAP|PTP_CAP_PREVIEW}, - /* https://github.com/gphoto/libgphoto2/issues/230 */ /* Elijah Parker, mail@timelapseplus.com */ - {"Sony:Alpha-A7R III (Control)", 0x054c,0x0c33, PTP_CAP|PTP_CAP_PREVIEW}, + {"Sony:DSC-A7r IV (Control)", 0x054c, 0x0ccc, PTP_CAP|PTP_CAP_PREVIEW}, + /* Nikon Coolpix 2500: M. Meissner, 05 Oct 2003 */ {"Nikon:Coolpix 2500 (PTP mode)", 0x04b0, 0x0109, 0}, @@ -1334,7 +1343,7 @@ static struct { /* Mdasoh Kyaeppd at IRC */ {"Nikon:Coolpix S6300 (PTP mode)",0x04b0, 0x032c, PTP_CAP}, /* sakax <sakamotox@gmail.com> */ - {"Nikon:Coolpix S2600 (PTP mode)",0x04b0, 0x032d, PTP_CAP}, + {"Nikon:Coolpix S2600 (PTP mode)",0x04b0, 0x032d, PTP_CAP|PTP_NIKON_BROKEN_CAP}, /* dougvj@gmail.com */ {"Nikon:Coolpix L810 (PTP mode)",0x04b0, 0x032f, PTP_CAP}, @@ -2089,6 +2098,9 @@ static struct { /* sparkycoladev@gmail.com */ {"Canon:PowerShot G7 X", 0x04a9, 0x329d, PTP_CAP|PTP_CAP_PREVIEW|PTP_DONT_CLOSE_SESSION}, + /* Sascha Wolff <sascha.wolff1@gmail.com> */ + {"Canon:PowerShot SX530 HS", 0x04a9, 0x329f, PTP_CAP|PTP_CAP_PREVIEW|PTP_DONT_CLOSE_SESSION}, + /* Marcus Meissner <marcus@jet.franken.de> */ {"Canon:EOS M10", 0x04a9, 0x32a0, PTP_CAP|PTP_CAP_PREVIEW}, @@ -2425,8 +2437,12 @@ static struct { /* https://sourceforge.net/p/libmtp/feature-requests/239/ */ {"GoPro:HERO6 Black", 0x2672, 0x0037, 0}, + /* Rasmus Larsson <larsson.rasmus@gmail.com> */ + {"GoPro:HERO7 White", 0x2672, 0x0042, 0}, /* https://sourceforge.net/p/libmtp/feature-requests/284/ */ {"GoPro:HERO7 Black", 0x2672, 0x0047, 0}, + /* https://sourceforge.net/p/libmtp/bugs/1858/ */ + {"GoPro:HERO8 Black", 0x2672, 0x0049, 0}, #endif }; @@ -2846,7 +2862,7 @@ camera_about (Camera *camera, CameraText *text, GPContext *context) "This driver supports cameras that support PTP or PictBridge(tm), and\n" "Media Players that support the Media Transfer Protocol (MTP).\n" "\n" - "Enjoy!"), 2019); + "Enjoy!"), 2020); return (GP_OK); } @@ -3568,7 +3584,7 @@ capturetriggered: CR (gp_port_set_timeout (camera->port, capture_timeout)); - C_PTP_REP (nikon_wait_busy (params, 100, 20000)); /* lets wait 20 seconds */ + C_PTP_REP (nikon_wait_busy (params, 100, 200*1000)); /* lets wait 200 seconds */ newobject = 0xffff0001; done = 0; tries = 100; @@ -4235,7 +4251,7 @@ camera_sony_capture (Camera *camera, CameraCaptureType type, CameraFilePath *pat /* Check if we are in manual focus to skip the wait for focus */ C_PTP (ptp_generic_getdevicepropdesc (params, PTP_DPC_FocusMode, &dpd)); - if (dpd.CurrentValue.u8 == 2) { + if (dpd.CurrentValue.u16 != 1) { /* 1 is Manual .. no need to wait there for focusing */ /* Now hold down the shutter button for a bit. We probably need to hold it as long as it takes to * get focus, indicated by the 0xD213 property. But hold it for at most 1 second. @@ -5300,7 +5316,8 @@ camera_trigger_capture (Camera *camera, GPContext *context) /* sleep a bit perhaps ? or check events? */ } while (tries--); - C_PTP_REP (nikon_wait_busy (params, 100, 20000)); /* lets wait 20 second */ + /* busyness will be reported during the whole of the exposure time. */ + C_PTP_REP (nikon_wait_busy (params, 100, 200*1000)); /* lets wait 200 seconds */ return GP_OK; } @@ -5334,7 +5351,7 @@ camera_trigger_capture (Camera *camera, GPContext *context) return translate_ptp_result (ret); } while (ret == PTP_RC_DeviceBusy); - C_PTP_REP (nikon_wait_busy (params, 100, 20000)); /* lets wait 20 seconds */ + C_PTP_REP (nikon_wait_busy (params, 100, 200*000)); /* lets wait 200 seconds */ return GP_OK; } @@ -5439,8 +5456,7 @@ camera_trigger_capture (Camera *camera, GPContext *context) /* Wait for focus only in automatic focus mode */ C_PTP (ptp_generic_getdevicepropdesc (params, PTP_DPC_FocusMode, &dpd)); - if (dpd.CurrentValue.u8 == 2) { - + if (dpd.CurrentValue.u16 != 1) { /* 1 is Manual .. no need to wait there for focusing */ /* Now hold down the shutter button for a bit. We probably need to hold it as long as it takes to * get focus, indicated by the 0xD213 property. But hold it for at most 1 second. */ diff --git a/camlibs/ptp2/music-players.h b/camlibs/ptp2/music-players.h index 875878c54..6953318a8 100644 --- a/camlibs/ptp2/music-players.h +++ b/camlibs/ptp2/music-players.h @@ -1061,6 +1061,8 @@ { "Archos", 0x0e79, "50d neon", 0x5371, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1660/ */ { "Archos", 0x0e79, "70b neon", 0x5395, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/support-requests/290/ */ + { "Archos", 0x0e79, "50 power", 0x53a7, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1637/ */ { "Archos", 0x0e79, "101b Oxygen", 0x542f, DEVICE_FLAGS_ANDROID_BUGS }, @@ -1266,6 +1268,8 @@ { "Nokia", 0x2e04, "6", 0xc025, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1783/ */ { "Nokia", 0x2e04, "6.1", 0xc026, DEVICE_FLAGS_ANDROID_BUGS }, + /* ndim from gphoto */ + { "Nokia", 0x2e04, "6.2", 0xc02a, DEVICE_FLAGS_ANDROID_BUGS }, /* * Qualcomm @@ -1556,6 +1560,9 @@ /* https://sourceforge.net/p/libmtp/bugs/1701/ */ { "LG Electronics Inc.", 0x1004, "Transpyre", 0x628a, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/feature-requests/290/ */ + { "LG Electronics Inc.", 0x1004, "LG G6 Phone", 0x62c9, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/feature-requests/222/ */ { "LG Electronics Inc.", 0x1004, "LG G5 Phone", 0x62ce, DEVICE_FLAGS_ANDROID_BUGS }, @@ -1968,6 +1975,18 @@ /* https://sourceforge.net/p/libmtp/bugs/1775/ */ { "SONY", 0x0fce, "Xperia XZ2 (H8266)", 0x01fa, DEVICE_FLAG_NONE }, + /* https://sourceforge.net/p/libmtp/bugs/1854/ */ + { "SONY", 0x0fce, "Xperia XZ2 Premium", 0x01fb, + DEVICE_FLAG_NONE }, + /* https://sourceforge.net/p/libmtp/bugs/1853/ */ + { "SONY", 0x0fce, "Xperia 10 (I4113)", 0x0201, + DEVICE_FLAG_NONE }, + /* https://sourceforge.net/p/libmtp/bugs/1859/ */ + { "SONY", 0x0fce, "Xperia 1 (J9110)", 0x0205, + DEVICE_FLAG_NONE }, + /* https://sourceforge.net/p/libmtp/bugs/1849/ */ + { "SONY", 0x0fce, "Xperia I4312", 0x0207, + DEVICE_FLAG_NONE }, /* https://bugs.kde.org/show_bug.cgi?id=387454 ... probably not in the ADB/CDROM method? */ { "SONY", 0x0fce, "Xperia XA2 (Jolla Sailfish)", 0x0a07, @@ -2110,6 +2129,14 @@ DEVICE_FLAG_NONE }, { "SONY", 0x0fce, "Xperia XZ2 (H8266) MTP+CDROM", 0x41fa, DEVICE_FLAG_NONE }, + { "SONY", 0x0fce, "Xperia XZ2 Premium MTP+CDROM", 0x41fb, + DEVICE_FLAG_NONE }, + { "SONY", 0x0fce, "Xperia 10 (I4113) MTP+CDROM", 0x4201, + DEVICE_FLAG_NONE }, + { "SONY", 0x0fce, "Xperia 1 (J9110) MTP+CDROM", 0x4205, + DEVICE_FLAG_NONE }, + { "SONY", 0x0fce, "Xperia I4312 MTP+CDROM", 0x4207, + DEVICE_FLAG_NONE }, /* * MTP+ADB personalities of MTP devices (see above) @@ -2272,6 +2299,14 @@ DEVICE_FLAG_NONE }, { "SONY", 0x0fce, "Xperia XZ2 (H8266) MTP+ADB", 0x51fa, DEVICE_FLAG_NONE }, + { "SONY", 0x0fce, "Xperia XZ2 Premium MTP+ADB", 0x51fb, + DEVICE_FLAG_NONE }, + { "SONY", 0x0fce, "Xperia 10 (I4113) MTP+ADB", 0x5201, + DEVICE_FLAG_NONE }, + { "SONY", 0x0fce, "Xperia 1 (J9110) MTP+ADB", 0x5205, + DEVICE_FLAG_NONE }, + { "SONY", 0x0fce, "Xperia I4312 MTP+ADB", 0x5207, + DEVICE_FLAG_NONE }, /* * MTP+UMS modes @@ -2931,6 +2966,9 @@ /* https://sourceforge.net/p/libmtp/support-requests/272/ */ { "Lenovo", 0x17ef, "A7-30HC", 0x7852, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1861/ */ + { "Lenovo", 0x17ef, "A7-30GC", 0x7853, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/feature-requests/253/ */ { "Lenovo", 0x17ef, "A7000-A Smartphone", 0x7882, DEVICE_FLAGS_ANDROID_BUGS }, @@ -2989,6 +3027,9 @@ DEVICE_FLAGS_ANDROID_BUGS }, { "Lenovo", 0x17ef, "Vibe K5 Note", 0x7999, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/feature-requests/293/ */ + { "Lenovo", 0x17ef, "TB3-710F", 0x79a2, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1820/ */ { "Lenovo", 0x17ef, "YB1-X90F", 0x79af, DEVICE_FLAGS_ANDROID_BUGS }, @@ -3411,11 +3452,14 @@ /* https://sourceforge.net/p/libmtp/bugs/1845/ */ { "Amazon", 0x1949, "Kindle Fire Kids", 0x0272, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/feature-requests/279/ */ + { "Amazon", 0x1949, "Kindle Fire Tablet 10 HD", 0x0281, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://github.com/libmtp/libmtp/issues/21 */ { "Amazon", 0x1949, "Kindle Fire 8 HD (2nd ID)", 0x0331, DEVICE_FLAGS_ANDROID_BUGS }, - /* https://sourceforge.net/p/libmtp/feature-requests/279/ */ - { "Amazon", 0x1949, "Kindle Fire Tablet 10 HD", 0x0281, + /* https://sourceforge.net/p/libmtp/support-requests/293/ */ + { "Amazon", 0x1949, "Kindle Fire Tablet 10 HD (2nd ID)", 0x03f1, DEVICE_FLAGS_ANDROID_BUGS }, { "Amazon", 0x1949, "Fire Phone", 0x0800, DEVICE_FLAGS_ANDROID_BUGS }, @@ -3451,6 +3495,9 @@ /* https://sourceforge.net/p/libmtp/bugs/1354/ */ { "Various", 0x2207, "Viewpia DR/bq Kepler Debugging", 0x0011, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/support-requests/291/ */ + { "Onyx", 0x2207, "Boox Nova", 0x0014, + DEVICE_FLAGS_ANDROID_BUGS }, /* * Kobo @@ -3658,6 +3705,8 @@ /* https://sourceforge.net/p/libmtp/bugs/1717/ */ { "MediaTek Inc", 0x0e8d, "Wiko Sunny", 0x4001, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1855/ */ + { "Vivo", 0x0e8d, "Y21", 0xff00, DEVICE_FLAGS_ANDROID_BUGS }, /* * Jolla @@ -3691,6 +3740,11 @@ { "Garmin", 0x091e, "Fenix 5/5S/5X Plus", 0x4b54, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/feature-requests/271/ */ { "Garmin", 0x091e, "Vivoactive 3", 0x4bac, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1864/ */ + { "Garmin", 0x091e, "Venu", 0x4c9a, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1852/ */ + { "Garmin", 0x091e, "Fenix 6", 0x4cda, DEVICE_FLAGS_ANDROID_BUGS }, + { "Garmin", 0x091e, "Fenix 6 Sapphire", 0x4cdb, DEVICE_FLAGS_ANDROID_BUGS }, /* * Wacom @@ -3794,6 +3848,8 @@ { "Caterpillar", 0x04b7, "Cat S30", 0x88b9, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/feature-requests/176/ */ { "Caterpillar", 0x04b7, "Cat S60", 0x88c0, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1850/ */ + { "Caterpillar", 0x04b7, "Cat S60 (2nd ID)", 0x88c1, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1757/ */ { "Caterpillar", 0x04b7, "Cat S41", 0x88c6, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/feature-requests/260/ */ @@ -3889,6 +3945,7 @@ { "GoPro" , 0x2672, "FUSION (front)", 0x0035, DEVICE_FLAG_NONE }, { "GoPro" , 0x2672, "HERO6 Black", 0x0037, DEVICE_FLAG_NONE }, { "GoPro" , 0x2672, "HERO7 Black", 0x0047, DEVICE_FLAG_NONE }, + { "GoPro" , 0x2672, "HERO8 Black", 0x0049, DEVICE_FLAG_NONE }, #endif /* https://sourceforge.net/p/libmtp/bugs/1490/ */ diff --git a/camlibs/ricoh/g3.c b/camlibs/ricoh/g3.c index af37467d8..9c1a74074 100644 --- a/camlibs/ricoh/g3.c +++ b/camlibs/ricoh/g3.c @@ -69,10 +69,12 @@ g3_channel_read(GPPort *port, int *channel, char **buffer, unsigned int *len) *channel = xbuf[1]; *len = xbuf[4] + (xbuf[5]<<8) + (xbuf[6]<<16) + (xbuf[7]<<24); + if (*len >= 0xffffffff-0x800-1) return GP_ERROR_CORRUPTED_DATA; /* Safety buffer of 0x800 ... we can only read in 0x800 chunks, * otherwise the communication gets hickups. However *len might be * less. */ + gp_log(GP_LOG_DEBUG, "g3" ,"length %u\n", *len); if (!*buffer) *buffer = malloc(*len + 1 + 0x800); else diff --git a/camlibs/smal/ultrapocket.c b/camlibs/smal/ultrapocket.c index 3854f07c3..9212dae92 100644 --- a/camlibs/smal/ultrapocket.c +++ b/camlibs/smal/ultrapocket.c @@ -169,7 +169,7 @@ getpicture_logitech_pd(Camera *camera, GPContext *context, unsigned char **rd, c unsigned char *rawdata; int ptc,pc,id; - memcpy(command+3, filename, 11); /* the id of the image to transfer */ + strncpy(command+3, filename, 11); /* the id of the image to transfer */ CHECK_RESULT(ultrapocket_command(port, 1, command, 0x10)); diff --git a/camlibs/sonix/library.c b/camlibs/sonix/library.c index 2d7546cd2..444eb6a0a 100644 --- a/camlibs/sonix/library.c +++ b/camlibs/sonix/library.c @@ -114,6 +114,7 @@ camera_summary (Camera *camera, CameraText *summary, GPContext *context) ret = sonix_init(camera->port, camera->pl); if ( ret != GP_OK) { free(camera->pl); + camera->pl = NULL; return ret; } if (!camera->pl->num_pics) @@ -168,6 +169,7 @@ file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list, ret = sonix_init(camera->port, camera->pl); if ( ret != GP_OK) { free(camera->pl); + camera->pl = NULL; return ret; } if(!camera->pl->num_pics) { @@ -211,6 +213,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, ret = sonix_init(camera->port, camera->pl); if ( ret != GP_OK) { free(camera->pl); + camera->pl = NULL; return ret; } if(!camera->pl->num_pics) { @@ -463,6 +466,7 @@ delete_all_func (CameraFilesystem *fs, const char *folder, void *data, ret = sonix_init(camera->port, camera->pl); if ( ret != GP_OK) { free(camera->pl); + camera->pl = NULL; return ret; } sonix_delete_all_pics (camera->port); @@ -480,6 +484,7 @@ delete_file_func (CameraFilesystem *fs, const char *folder, ret = sonix_init(camera->port, camera->pl); if ( ret != GP_OK) { free(camera->pl); + camera->pl = NULL; return ret; } if (camera->pl->fwversion[1] == 0x0a) @@ -505,6 +510,7 @@ camera_capture (Camera *camera, CameraCaptureType type, CameraFilePath *path, ret = sonix_init(camera->port, camera->pl); if ( ret != GP_OK) { free(camera->pl); + camera->pl = NULL; return ret; } if (!(camera->pl->can_do_capture)) { diff --git a/camlibs/sonix/sonix.c b/camlibs/sonix/sonix.c index e0164761d..22b2d73f5 100644 --- a/camlibs/sonix/sonix.c +++ b/camlibs/sonix/sonix.c @@ -44,24 +44,21 @@ static int SONIX_READ (GPPort *port, char *data) { - gp_port_usb_msg_interface_read(port, 0, 1, 0, data, 1); - return GP_OK; + return gp_port_usb_msg_interface_read(port, 0, 1, 0, data, 1); } /* This reads a 4-byte response to a command */ static int SONIX_READ4 (GPPort *port, char *data) { - gp_port_usb_msg_interface_read(port, 0, 4, 0, data, 4); - return GP_OK; + return gp_port_usb_msg_interface_read(port, 0, 4, 0, data, 4); } /* A command to the camera is a 6-byte string, and this sends it. */ static int SONIX_COMMAND (GPPort *port, char *command) { - gp_port_usb_msg_interface_write(port, 8, 2, 0, command ,6); - return GP_OK; + return gp_port_usb_msg_interface_write(port, 8, 2, 0, command ,6); } @@ -88,7 +85,8 @@ int sonix_init (GPPort *port, CameraPrivateLibrary *priv) i = 0; while ((unsigned)status > 0) { - SONIX_READ(port, &status); + if (SONIX_READ(port, &status) < GP_OK) + break; i++; if (i==1000) break; } @@ -97,8 +95,10 @@ int sonix_init (GPPort *port, CameraPrivateLibrary *priv) SONIX_COMMAND ( port, c); - while (status !=2) - SONIX_READ(port, &status); + while (status !=2) { + if (SONIX_READ(port, &status) < GP_OK) + break; + } /* FIXME(Marcus): was indented at above level, unclear if it is needed this way ... */ SONIX_READ(port, &status); @@ -117,7 +117,8 @@ int sonix_init (GPPort *port, CameraPrivateLibrary *priv) while (!reading[1]&&!reading[2]&&!reading[3]) { c[0]=0x16; - SONIX_COMMAND ( port, c ); + if (SONIX_COMMAND ( port, c ) < GP_OK) + break; /* * For the Vivicam 3350b this always gives * 96 0a 76 07. This is apparently the firmware version. @@ -129,7 +130,8 @@ int sonix_init (GPPort *port, CameraPrivateLibrary *priv) * Spy Camera 70137 it is 96 01 31 09. Since the cameras * have different abilities, we ought to distinguish. */ - SONIX_READ4 (port, (char *)reading); + if (SONIX_READ4 (port, (char *)reading) < GP_OK) + break; } GP_DEBUG("%02x %02x %02x %02x\n", reading[0], reading[1], reading[2], reading[3]); diff --git a/camlibs/soundvision/agfa_cl18.c b/camlibs/soundvision/agfa_cl18.c index d97bb331b..d8cfdb9e1 100644 --- a/camlibs/soundvision/agfa_cl18.c +++ b/camlibs/soundvision/agfa_cl18.c @@ -216,6 +216,10 @@ int agfa_get_file_list(CameraPrivateLibrary *dev) { free(buffer); return ret; } + if (ret < buflen) { + free (buffer); + return GP_ERROR_CORRUPTED_DATA; + } if (dev->file_list) free(dev->file_list); diff --git a/camlibs/spca50x/spca50x-flash.c b/camlibs/spca50x/spca50x-flash.c index 86ed02b77..efb73efd8 100644 --- a/camlibs/spca50x/spca50x-flash.c +++ b/camlibs/spca50x/spca50x-flash.c @@ -196,7 +196,7 @@ spca50x_flash_get_TOC(CameraPrivateLibrary *pl, int *filecount) /* Now, create the files info buffer */ free_files(pl); /* NOTE: using calloc to ensure new block is "empty" */ - pl->files = calloc (1, *filecount * sizeof (struct SPCA50xFile)); + pl->files = calloc (*filecount , sizeof (struct SPCA50xFile)); if (!pl->files) return GP_ERROR_NO_MEMORY; } else { /* all other cams with flash... */ @@ -580,7 +580,7 @@ spca50x_process_thumbnail (CameraPrivateLibrary *lib, /* context */ yuv_p = buf; rgb_p = tmp + hdrlen; - while (yuv_p < buf + file_size) { + while ((yuv_p < buf + file_size) && (rgb_p < tmp + hdrlen + w*h*3)) { uint32_t u, v, y, y2; uint32_t r, g, b; diff --git a/camlibs/spca50x/spca50x-sdram.c b/camlibs/spca50x/spca50x-sdram.c index 2e0b19bd0..f11cc8a32 100644 --- a/camlibs/spca50x/spca50x-sdram.c +++ b/camlibs/spca50x/spca50x-sdram.c @@ -443,6 +443,11 @@ spca50x_get_avi (CameraPrivateLibrary * lib, uint8_t ** buf, start_of_frame = avi; /* jpeg starts here */ + if ((data - mybuf) + frame_size > size) { + free (mybuf); + GP_DEBUG("BAD: accessing more than we read (%d vs total %d)", (data-mybuf)+frame_size , size); + return GP_ERROR_CORRUPTED_DATA; + } create_jpeg_from_data (avi, data, qIndex, frame_width, frame_height, 0x22, frame_size, &length, 1, 0); @@ -867,8 +872,8 @@ spca50x_get_FATs (CameraPrivateLibrary * lib, int dramtype) lib->files = NULL; } - lib->fats = malloc (lib->num_fats * SPCA50X_FAT_PAGE_SIZE); - lib->files = malloc (lib->num_files_on_sdram * sizeof (struct SPCA50xFile)); + lib->fats = calloc (lib->num_fats , SPCA50X_FAT_PAGE_SIZE); + lib->files = calloc (lib->num_files_on_sdram , sizeof (struct SPCA50xFile)); p = lib->fats; if (lib->bridge == BRIDGE_SPCA504) { @@ -926,6 +931,9 @@ spca50x_get_FATs (CameraPrivateLibrary * lib, int dramtype) ++lib->num_movies); lib->files[file_index].mime_type = SPCA50X_FILE_TYPE_AVI; + } else { + gp_log(GP_LOG_ERROR, "spca50x", "type %d unhandled - error", type); + return GP_ERROR; } lib->files[file_index].fat = p; lib->files[file_index].fat_start = index; diff --git a/camlibs/stv0674/stv0674.c b/camlibs/stv0674/stv0674.c index fe832c63d..398ed5afa 100644 --- a/camlibs/stv0674/stv0674.c +++ b/camlibs/stv0674/stv0674.c @@ -107,6 +107,10 @@ static int file_list_func (CameraFilesystem *fs, const char *folder, GP_DEBUG("file count returned %d\n",result); return result; } + if (count > 10000) { /* arbitrary limit to avoid resource exhaustion by malicious USB */ + GP_DEBUG("count %d is over 10000 arbitrary limit. Increase if needed.\n", count); + return GP_ERROR_CORRUPTED_DATA; + } GP_DEBUG("count is %x\n",count); diff --git a/camlibs/template/Makefile-files b/camlibs/template/Makefile-files index c71f28fc0..3ba9028d3 100644 --- a/camlibs/template/Makefile-files +++ b/camlibs/template/Makefile-files @@ -13,9 +13,11 @@ # And as the last step, you need to add it to configure.ac: # * GP_CAMLIB([foobar])dnl -EXTRA_DIST += template/README.template template/ChangeLog +EXTRA_DIST += template/ChangeLog +EXTRA_DIST += template/README.template noinst_DATA += template/README.template + noinst_LTLIBRARIES += template.la template_la_SOURCES = template/template.c diff --git a/coverity-model.c b/coverity-model.c index 7ffb45567..9874ed3f4 100644 --- a/coverity-model.c +++ b/coverity-model.c @@ -6,6 +6,7 @@ typedef unsigned int uint32_t; typedef unsigned long long uint64_t; typedef void *PTPParams; +typedef void *PTPContainer; uint16_t htod16p (PTPParams *params, uint16_t var) { __coverity_tainted_data_return__(); } uint16_t dtoh16p (PTPParams *params, uint16_t var) { __coverity_tainted_data_return__(); } diff --git a/examples/sample-afl.c b/examples/sample-afl.c index c01414bbc..d3520c5f2 100644 --- a/examples/sample-afl.c +++ b/examples/sample-afl.c @@ -95,7 +95,7 @@ recursive_directory(Camera *camera, const char *folder, GPContext *context, int printf ("Could not get file.\n"); return ret; } - gp_file_free (file); + gp_file_unref (file); /* get preview */ gp_file_new (&file); ret = gp_camera_file_get (camera, folder, newfile, GP_FILE_TYPE_PREVIEW, file, context); @@ -104,7 +104,7 @@ recursive_directory(Camera *camera, const char *folder, GPContext *context, int printf ("Could not get file preview.\n"); return ret; } - gp_file_free (file); + gp_file_unref (file); /* get exif */ gp_file_new (&file); ret = gp_camera_file_get (camera, folder, newfile, GP_FILE_TYPE_EXIF, file, context); @@ -113,7 +113,7 @@ recursive_directory(Camera *camera, const char *folder, GPContext *context, int printf ("Could not get file preview.\n"); return ret; } - gp_file_free (file); + gp_file_unref (file); /* Trigger the ptp things */ gp_file_new (&file); ret = gp_camera_file_get (camera, folder, newfile, GP_FILE_TYPE_METADATA, file, context); @@ -122,7 +122,7 @@ recursive_directory(Camera *camera, const char *folder, GPContext *context, int printf ("Could not get file metadata.\n"); return ret; } - gp_file_free (file); + gp_file_unref (file); if (foundfile) *foundfile = 1; gp_list_free (list); return GP_OK; diff --git a/libgphoto2/ahd_bayer.c b/libgphoto2/ahd_bayer.c index efedfd5ff..5254d28dc 100644 --- a/libgphoto2/ahd_bayer.c +++ b/libgphoto2/ahd_bayer.c @@ -581,8 +581,10 @@ int gp_ahd_interpolate (unsigned char *image, int w, int h, BayerTile tile) for (i=-1; i < 2;i++) { for (k=0; k < 3;k++) { j=i+x+w*k; - homo_ch[x]+=homo_h[j]; - homo_cv[x]+=homo_v[j]; + if ((j >= 0) && ( j < w*3)) { + homo_ch[x]+=homo_h[j]; + homo_cv[x]+=homo_v[j]; + } } } for (color=0; color < 3; color++) { diff --git a/libgphoto2_port/libgphoto2_port/Makefile.am b/libgphoto2_port/libgphoto2_port/Makefile.am index 862aa7e10..70fd0fdf5 100644 --- a/libgphoto2_port/libgphoto2_port/Makefile.am +++ b/libgphoto2_port/libgphoto2_port/Makefile.am @@ -59,5 +59,5 @@ EXTRA_DIST = \ libgphoto2_port.ver ../libltdl/libltdlc.la: - cd ../libltdl && $(MAKE) libltdlc.la + cd ../libltdl && $(MAKE) $(AM_MAKEFLAGS) libltdlc.la diff --git a/libgphoto2_port/po/pt_BR.po b/libgphoto2_port/po/pt_BR.po index b0056fcba..ae761b7d0 100644 --- a/libgphoto2_port/po/pt_BR.po +++ b/libgphoto2_port/po/pt_BR.po @@ -1,15 +1,15 @@ # Brazilian Portuguese translation of libgphoto2. -# Copyright (C) 2002-2016 Free Software Foundation, Inc. +# Copyright (C) 2002-2019 Free Software Foundation, Inc. # This file is distributed under the same license as the libgphoto2 package. # Evandro Gardenali <evandro@fasternet.com.br>, 2002. -# Fabrício Godoy <skarllot@gmail.com>, 2010, 2016. +# Fabrício Godoy <skarllot@gmail.com>, 2010, 2016, 2019. # msgid "" msgstr "" -"Project-Id-Version: libgphoto2_port 2.5.10\n" +"Project-Id-Version: libgphoto2_port 2.5.23\n" "Report-Msgid-Bugs-To: gphoto-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2016-02-22 21:02+0100\n" -"PO-Revision-Date: 2016-05-06 18:36-0300\n" +"POT-Creation-Date: 2019-05-04 15:58+0200\n" +"PO-Revision-Date: 2019-12-24 20:20-0300\n" "Last-Translator: Fabrício Godoy <skarllot@gmail.com>\n" "Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge.net>\n" "Language: pt_BR\n" @@ -19,7 +19,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: libgphoto2_port/gphoto2-port-info-list.c:409 +#: libgphoto2_port/gphoto2-port-info-list.c:411 msgid "Generic Port" msgstr "Porta genérica" @@ -124,108 +124,108 @@ msgstr "Não há suporte a operação \"%s\" por esse dispositivo" msgid "The port has not yet been initialized" msgstr "A porta ainda não foi inicializada" -#: libgphoto2_port/gphoto2-port.c:682 +#: libgphoto2_port/gphoto2-port.c:686 msgid "low" msgstr "baixo" -#: libgphoto2_port/gphoto2-port.c:683 +#: libgphoto2_port/gphoto2-port.c:687 msgid "high" msgstr "alto" -#: libgphoto2_port/gphoto2-port.c:1211 +#: libgphoto2_port/gphoto2-port.c:1215 msgid "No error description available" msgstr "Descrição do erro não disponível" -#: disk/disk.c:147 disk/disk.c:148 disk/disk.c:224 disk/disk.c:225 -#: disk/disk.c:265 disk/disk.c:288 +#: disk/disk.c:149 disk/disk.c:150 disk/disk.c:228 disk/disk.c:229 +#: disk/disk.c:269 disk/disk.c:292 #, c-format msgid "Media '%s'" msgstr "Mídia \"%s\"" -#: serial/unix.c:223 +#: serial/unix.c:230 #, c-format msgid "Could not lock device '%s'" msgstr "Não foi possível travar o dispositivo \"%s\"" -#: serial/unix.c:233 usbdiskdirect/linux.c:95 +#: serial/unix.c:240 usbdiskdirect/linux.c:95 #, c-format msgid "Device '%s' is locked by pid %d" msgstr "O dispositivo \"%s\" está travado pelo PID %d" -#: serial/unix.c:236 usbdiskdirect/linux.c:98 +#: serial/unix.c:243 usbdiskdirect/linux.c:98 #, c-format msgid "Device '%s' could not be locked (dev_lock returned %d)" msgstr "O dispositivo \"%s\" não pôde ser travado (dev_lock retornou %d)" -#: serial/unix.c:265 +#: serial/unix.c:272 #, c-format msgid "Device '%s' could not be unlocked." msgstr "O dispositivo \"%s\" não pôde ser destravado." -#: serial/unix.c:277 usbdiskdirect/linux.c:127 +#: serial/unix.c:284 usbdiskdirect/linux.c:127 #, c-format msgid "Device '%s' could not be unlocked as it is locked by pid %d." msgstr "O dispositivo \"%s\" não pôde ser destravado pois está travado pelo PID %d." -#: serial/unix.c:281 usbdiskdirect/linux.c:131 +#: serial/unix.c:288 usbdiskdirect/linux.c:131 #, c-format msgid "Device '%s' could not be unlocked (dev_unlock returned %d)" msgstr "O dispositivo \"%s\" não pôde ser destravado (dev_unlock retornou %d)" -#: serial/unix.c:339 +#: serial/unix.c:346 #, c-format msgid "Serial Port %i" msgstr "Porta serial %i" -#: serial/unix.c:352 +#: serial/unix.c:359 msgid "Serial Port Device" msgstr "Dispositivo de porta serial" -#: serial/unix.c:434 +#: serial/unix.c:441 #, c-format msgid "Failed to open '%s' (%s)." msgstr "Falha ao abrir \"%s\" (%s)." -#: serial/unix.c:454 +#: serial/unix.c:461 #, c-format msgid "Could not close '%s' (%s)." msgstr "Não foi possível fechar \"%s\" (%s)." -#: serial/unix.c:510 +#: serial/unix.c:517 #, c-format msgid "Could not write to port (%s)" msgstr "Não foi possível gravar na porta (%s)" -#: serial/unix.c:587 +#: serial/unix.c:594 msgid "Parity error." msgstr "Erro de paridade." -#: serial/unix.c:591 +#: serial/unix.c:598 #, c-format msgid "Unexpected parity response sequence 0xff 0x%02x." msgstr "Sequência de resposta de paridade inesperada 0xff 0x%02x." -#: serial/unix.c:634 +#: serial/unix.c:641 #, c-format msgid "Unknown pin %i." msgstr "Pino desconhecido %i." -#: serial/unix.c:656 +#: serial/unix.c:663 #, c-format msgid "Could not get level of pin %i (%s)." msgstr "Não foi possível obter o nível do pino %i (%s)." -#: serial/unix.c:692 +#: serial/unix.c:699 #, c-format msgid "Could not set level of pin %i to %i (%s)." msgstr "Não foi possível ajustar o nível do pino %i para %i (%s)." -#: serial/unix.c:719 +#: serial/unix.c:726 #, c-format msgid "Could not flush '%s' (%s)." msgstr "Não foi possível descarregar \"%s\" (%s)." -#: serial/unix.c:831 +#: serial/unix.c:838 #, c-format msgid "Could not set the baudrate to %d" msgstr "Não foi possível ajustar a taxa de baud para %d" @@ -259,83 +259,83 @@ msgstr "Não foi possível escrever para \"%s\" (%m)." msgid "Could not read from '%s' (%m)." msgstr "Não foi possível ler de \"%s\" (%m)." -#: usb/libusb.c:260 libusb1/libusb1.c:373 +#: usb/libusb.c:264 libusb1/libusb1.c:401 #, c-format msgid "Could not open USB device (%s)." msgstr "Não foi possível abrir o dispositivo USB (%s)." -#: usb/libusb.c:273 libusb1/libusb1.c:382 +#: usb/libusb.c:277 libusb1/libusb1.c:410 msgid "Camera is already in use." msgstr "A câmera já está em uso." -#: usb/libusb.c:281 +#: usb/libusb.c:285 #, c-format msgid "Could not detach kernel driver '%s' of camera device." msgstr "Não foi possível desanexar o driver de kernel \"%s\" do dispositivo de câmera." -#: usb/libusb.c:286 libusb1/libusb1.c:397 +#: usb/libusb.c:290 libusb1/libusb1.c:425 msgid "Could not query kernel driver of device." msgstr "Não foi possível examinar o driver de kernel do dispositivo." -#: usb/libusb.c:295 libusb1/libusb1.c:404 +#: usb/libusb.c:299 libusb1/libusb1.c:432 #, c-format msgid "Could not claim interface %d (%s). Make sure no other program (%s) or kernel module (such as %s) is using the device and you have read/write access to the device." msgstr "Não foi possível chamar a interface %d (%s). Tenha certeza de que nenhum outro programa (%s) ou módulo do kernel (como %s) está usando o dispositivo, e que você tem acesso de leitura e escrita para o dispositivo." -#: usb/libusb.c:307 libusb1/libusb1.c:415 +#: usb/libusb.c:311 libusb1/libusb1.c:443 msgid "MacOS PTPCamera service" msgstr "Serviço PTPCamera MacOS" -#: usb/libusb.c:309 libusb1/libusb1.c:417 +#: usb/libusb.c:313 libusb1/libusb1.c:445 msgid "unknown libgphoto2 using program" msgstr "O programa está usando uma libgphoto2 desconhecida" -#: usb/libusb.c:326 libusb1/libusb1.c:484 +#: usb/libusb.c:330 libusb1/libusb1.c:514 #, c-format msgid "Could not release interface %d (%s)." msgstr "Não foi possível liberar a interface %d (%s)." -#: usb/libusb.c:341 libusb1/libusb1.c:498 +#: usb/libusb.c:345 libusb1/libusb1.c:528 #, c-format msgid "Could not reset USB port (%s)." msgstr "Não foi possível reiniciar a porta USB (%s)." -#: usb/libusb.c:371 +#: usb/libusb.c:375 #, c-format msgid "Could not close USB port (%s)." msgstr "Não foi possível fechar a porta USB (%s)." -#: usb/libusb.c:632 libusb1/libusb1.c:839 +#: usb/libusb.c:637 libusb1/libusb1.c:971 #, c-format msgid "Could not set config %d/%d (%s)" msgstr "Não foi possível definir a configuração %d/%d (%s)" -#: usb/libusb.c:663 libusb1/libusb1.c:868 +#: usb/libusb.c:668 libusb1/libusb1.c:1000 #, c-format msgid "Could not set altsetting from %d to %d (%s)" msgstr "Não foi possível definir a configuração alternativa de %d para %d (%s)" -#: usb/libusb.c:752 libusb1/libusb1.c:1033 +#: usb/libusb.c:757 libusb1/libusb1.c:1165 #, c-format msgid "The supplied vendor or product id (0x%x,0x%x) is not valid." msgstr "O fabricante ou o ID do produto (0x%x,0x%x) não é válido." -#: usb/libusb.c:823 usb/libusb.c:909 libusb1/libusb1.c:1002 -#: libusb1/libusb1.c:1094 +#: usb/libusb.c:828 usb/libusb.c:914 libusb1/libusb1.c:1134 +#: libusb1/libusb1.c:1226 #, c-format msgid "Could not find USB device (vendor 0x%x, product 0x%x). Make sure this device is connected to the computer." msgstr "Não foi possível localizar o dispositivo USB (fabricante 0x%x, produto 0x%x). Tenha certeza de que esse dispositivo está conectado ao computador." -#: usb/libusb.c:1202 libusb1/libusb1.c:1383 +#: usb/libusb.c:1207 libusb1/libusb1.c:1515 #, c-format msgid "Could not find USB device (class 0x%x, subclass 0x%x, protocol 0x%x). Make sure this device is connected to the computer." msgstr "Não foi possível localizar o dispositivo USB (classe 0x%x, subclasse 0x%x, protocolo 0x%x). Tenha certeza de que esse dispositivo está conectado ao computador." -#: libusb1/libusb1.c:391 +#: libusb1/libusb1.c:419 msgid "Could not detach kernel driver of camera device." msgstr "Não foi possível desanexar o driver de kernel do dispositivo de câmera." -#: libusb1/libusb1.c:507 +#: libusb1/libusb1.c:537 msgid "Could not reattach kernel driver of camera device." msgstr "Não foi possível reanexar o driver de kernel do dispositivo de câmera." diff --git a/libgphoto2_port/vusb/vusb.c b/libgphoto2_port/vusb/vusb.c index b810910bf..87e8c541c 100644 --- a/libgphoto2_port/vusb/vusb.c +++ b/libgphoto2_port/vusb/vusb.c @@ -223,8 +223,8 @@ static int gp_port_vusb_msg_interface_read_lib(GPPort *port, int request, int value, int index, char *bytes, int size) { - gp_log(GP_LOG_DEBUG,__FUNCTION__,"()"); - return GP_OK; /* or bytes */ + gp_log(GP_LOG_DEBUG,__FUNCTION__,"(req=%x, value=%x, index=%d, size=%d)", request, value, index, size); + return port->pl->vcamera->read(port->pl->vcamera, 0x81, (unsigned char*)bytes, size); } diff --git a/packaging/rpm/Makefile.am b/packaging/rpm/Makefile.am index 9838dc025..76756c4ab 100644 --- a/packaging/rpm/Makefile.am +++ b/packaging/rpm/Makefile.am @@ -15,15 +15,15 @@ clean-local: cp $< $@ rpm: Makefile package.spec - $(MAKE) clean + $(MAKE) $(AM_MAKEFLAGS) clean mkdir -p BUILD SPECS SOURCES SRPMS for arch in i386 i486 i586 i686 alpha noarch; do \ mkdir -p "RPMS/$${arch}"; \ done - $(MAKE) SOURCES/@PACKAGE@-@VERSION@.tar.gz SPECS/@PACKAGE@-@VERSION@.spec + $(MAKE) $(AM_MAKEFLAGS) SOURCES/@PACKAGE@-@VERSION@.tar.gz SPECS/@PACKAGE@-@VERSION@.spec @RPMBUILD@ --define "_topdir $$(pwd)" -ba SPECS/@PACKAGE@-@VERSION@.spec -SOURCES/@PACKAGE@-@VERSION@.tar.gz: $(top_srcdir)/@PACKAGE@-@VERSION@.tar.gz +SOURCES/@PACKAGE@-@VERSION@.tar.gz: $(top_builddir)/@PACKAGE@-@VERSION@.tar.gz ln -f $< $@ SPECS/@PACKAGE@-@VERSION@.spec: package.spec diff --git a/packaging/rpm/package.spec.in b/packaging/rpm/package.spec.in index 65767fd98..1017574c8 100644 --- a/packaging/rpm/package.spec.in +++ b/packaging/rpm/package.spec.in @@ -75,7 +75,7 @@ frontends, which are available seperately. ######################################################################## -# Building and installing the beast into %{buildroot} +# Building and installing the beast into %%{buildroot} ######################################################################## #################################### diff --git a/tests/ddb/Makefile.am b/tests/ddb/Makefile.am index e1031654c..52e07ea42 100644 --- a/tests/ddb/Makefile.am +++ b/tests/ddb/Makefile.am @@ -45,7 +45,7 @@ clean-local: rm -f *.s *.i $(top_builddir)/packaging/generic/print-camera-list: - cd $(top_builddir)/packaging/generic && $(MAKE) print-camera-list + cd $(top_builddir)/packaging/generic && $(MAKE) $(AM_MAKEFLAGS) print-camera-list include $(top_srcdir)/installcheck.mk |