Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • aports aports
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare
  • Issues 739
    • Issues 739
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 324
    • Merge requests 324
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • alpinealpine
  • aportsaports
  • Issues
  • #4802
Closed
Open
Issue created Oct 28, 2015 by David Laube@dlaube

open-iscsi iscsiadm throws unrecognized character errors

We are seeing strange behavior while attempting to execute basic functions of the iscsiadm utility under Alpine linux 3.2.3. This seems to impact all iscsi initiator features under Alpine linux.

Steps to reproduce:

apk add open-iscsi
apk add open-iscsi-doc
[See command output after man page examples below]


Man page for iscsiadm

EXAMPLES
Discover targets at a given IP address:

iscsiadm —mode discoverydb —type sendtargets —portal 192.168.1.10 —discover
…
List node records:

iscsiadm —mode node


Command output:

localhost:~# iscsiadm —mode discoverydb —type sendtargets —portal 10.144.0.14 —discover
iscsiadm: unrecognized character ‘D’
localhost:~# iscsiadm —debug 8 —mode discoverydb —type sendtargets —portal 10.144.0.14 —discover
iscsiadm: ip 10.144.0.14, port –1, tgpt –1
iscsiadm: unrecognized character ‘D’
localhost:~# iscsiadm —mode node
iscsiadm: unrecognized character ‘m’

(from redmine: issue id 4802, created on 2015-10-28, closed on 2016-08-12)

  • Changesets:
    • Revision 3d5e7f06 by Jann - Ove Risvik on 2016-08-11T20:12:14Z:
main/open-iscsi: musl fix for error handling. (bug #4802)

fixes #4802

Seems like iscsiadm relies on checking optopt for checking if there's an
error, instead of checking whether opterr is set or if getopt returns
'?' and then using optopt to retrieve the option that it didn't
recognize.

For some reason musl sets optopt to the last option parsed even if it
was valid. Is musl supposed to do that? glibc doesn't behave this way.
The posix standard for getopt also reads like optopt is only supposed to
be set when there's an error.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking