`pkg-config` is a well established tool and all of our required
libraries do provide .pc files. Therefore let's declare `pkg-config` as
required and use it. In addition, remove now useless code.
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Compiling against fuse3 shows 'incompatible pointer type' warnings due
to the additional function arguments in the new API.
Therefore, adjust the declarations of zdsfs_getattr() and
zdsfs_readdir() to match.
GitHub-ID: https://github.com/ibm-s390-linux/s390-tools/pull/117
Signed-off-by: Graham Inggs <ginggs@debian.org>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
The tmp buffer is one byte too short missing space for the final \0 byte
leading to out of bound access.
Fix by increasing the buffer by one.
Reported-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Add transparent codepage conversion feature to zdsfs.
Add options to specify that codepage conversion should be done using
default codepages from 'CP1047' to 'UTF-8' or using user defined codepage
tables.
Also add a new config file allowing the user to specify codepage conversion
options on a per dataset basis.
When a dataset is opened and codepage conversion settings match this
dataset an iconv handle is created and the conversion itself is performed
by the lzds_dshandle_read() function.
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Add description for coordinated read access to man page as well as some
editorial changes after ID review.
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
For data consistency it is essential that datasets are not modified by
z/OS applications during zdsfs access. This is currently ensured by
manually setting the device offline in z/OS before mounting it in Linux.
This patch improves the usability and data security by making this manual
step obsolete.
Before opening a dataset zdsfs will obtain an ENQ to mark it as in use for
z/OS and release the ENQ when closing the dataset.
A timer is set up that pings the z/OSMF REST services with the ENQ to
prevent it from a timeout after 10 minutes.
The behavior of zdsfs can be configured in a new config file or with new
command line options.
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Add library functions that allow to communicate with z/OSMF REST services
using libcurl.
Following three functions are added:
lzds_rest_get_enq()
to obtain an ENQ that will mark a dataset as in use to z/OS until
it is released again
lzds_rest_release_enq()
to release an ENQ and mark a dataset as no longer in use to z/OS
lzds_rest_ping()
to ping a z/OSMF REST server to check if it accessible
or to refresh an ENQ and prevent it from a timeout after 10 minutes
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Reading DASD specific sysfs attributes should be collected in one
library. Move get_host_access_count() to libdasd/dasd_sys.
Remove the old implementation and update any user accordingly.
Also, fix the build order for zdsfs.
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Enable zdsfs to access datasets that were created after zdsfs was
mounted without the need to remount zdsfs.
This is done by re-reading the VTOC with every readdir system call.
To ensure a consistent VTOC state the DASD device is reserved for
every VTOC read and released afterwards.
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
By using util_strlcpy() and correctly copying strings we can get rid of
the following GCC8 compile warnings:
In function ‘path_to_ds_name.constprop’,
inlined from ‘zdsfs_readdir’ at zdsfs.c:282:2:
zdsfs.c:78:2: warning: ‘strncpy’ specified bound 45 equals destination
size [-Wstringop-truncation]
strncpy(normds, path, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘path_to_ds_name.constprop’,
inlined from ‘zdsfs_open’ at zdsfs.c:339:2:
zdsfs.c:78:2: warning: ‘strncpy’ specified bound 45 equals destination
size [-Wstringop-truncation]
strncpy(normds, path, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘path_to_member_name.constprop’,
inlined from ‘zdsfs_open’ at zdsfs.c:372:3:
zdsfs.c:94:3: warning: ‘strncpy’ specified bound 45 equals destination
size [-Wstringop-truncation]
strncpy(normds, path, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘path_to_ds_name.constprop’,
inlined from ‘zdsfs_getxattr’ at zdsfs.c:527:2:
zdsfs.c:78:2: warning: ‘strncpy’ specified bound 45 equals destination
size [-Wstringop-truncation]
strncpy(normds, path, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘path_to_member_name.constprop’,
inlined from ‘zdsfs_getxattr’ at zdsfs.c:547:4:
zdsfs.c:94:3: warning: ‘strncpy’ specified bound 45 equals destination
size [-Wstringop-truncation]
strncpy(normds, path, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘path_to_ds_name.constprop’,
inlined from ‘zdsfs_getattr.part.1’ at zdsfs.c:134:2,
inlined from ‘zdsfs_getattr’:
zdsfs.c:78:2: warning: ‘strncpy’ specified bound 45 equals destination
size [-Wstringop-truncation]
strncpy(normds, path, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘path_to_member_name.constprop’,
inlined from ‘zdsfs_getattr.part.1’ at zdsfs.c:164:3,
inlined from ‘zdsfs_getattr’:
zdsfs.c:94:3: warning: ‘strncpy’ specified bound 45 equals destination
size [-Wstringop-truncation]
strncpy(normds, path, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
zdsfs writes output for --help and --version to stderr. This is
likely because zdsfs calls into a FUSE function for additional
usage output that also writes to stderr (prior to FUSE 3.0.0).
To be consistent with other s390-tools and GNU coding guide lines,
fix this by using stdout for zdsfs generated output, and by
redirecting stderr to stdout before calling the FUSE function.
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is based on the s390-tools-1.39.0 version.
Changes on top of s390-tools-1.39.0:
- Add MIT license to all source files
- Add LICENSE file
- Transform REAMDE to README.md (markdown)
- Add AUTHORS.md file
- Add CONTRIBUTING.md file
- Move changelog from README to CHANGELOG.md file
Reviewed-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>