Skip to content

cmus: unrecognized option `--passwd' #971

Closed

Description

@gotbletu

think you guys are missing an extra dash for the passwd flag

$ man cmus
--passwd PASSWD
Set the password for TCP/IP connections. Must be set if you are listening from host[:port]. Used in conjunction with --listen.

NOT WORKING

$ cmus --listen localhost:3050 --passwd abc123
cmus: unrecognized option `--passwd'

WORKING

$ cmus --listen localhost:3050 -passwd abc123


  1. uname -a:
Linux heOyeA-ant 5.5.6-arch1-1 #1 SMP PREEMPT Mon, 24 Feb 2020 12:20:16 +0000 x86_64 GNU/Linux

  1. cmus --version:
cmus v2.8.0
Copyright 2004-2006 Timo Hirvonen
Copyright 2008-2016 Various Authors

  1. cmus --plugins:
Input Plugins: /usr/lib/cmus/ip
  mad:
    Priority: 55
    File Types: mp3 mp2
    MIME Types: audio/mpeg audio/x-mp3 audio/x-mpeg
  wavpack:
    Priority: 50
    File Types: wv
    MIME Types: audio/x-wavpack
  mp4:
    Priority: 50
    File Types: mp4 m4a m4b
    MIME Types:
  vorbis:
    Priority: 50
    File Types: ogg oga ogx
    MIME Types: application/ogg audio/x-ogg
  cue:
    Priority: 50
    File Types:
    MIME Types: application/x-cue
  wav:
    Priority: 50
    File Types: wav
    MIME Types:
  cdio:
    Priority: 50
    File Types:
    MIME Types: x-content/audio-cdda
  opus:
    Priority: 50
    File Types: opus
    MIME Types:
  aac:
    Priority: 50
    File Types: aac
    MIME Types: audio/aac audio/aacp
  mpc:
    Priority: 50
    File Types: mpc mpp mp+
    MIME Types: audio/x-musepack
  flac:
    Priority: 50
    File Types: flac fla
    MIME Types:
  modplug:
    Priority: 50
    File Types: mod s3m xm it 669 amf ams dbm dmf dsm far mdl med mtm okt ptm stm ult umx mt2 psm
    MIME Types:
  ffmpeg:
    Priority: 30
    File Types: aa aac ac3 aif aifc aiff ape au fla flac m4a m4b mka mkv mp+ mp2 mp3 mp4 mpc mpp ogg shn tak tta wav webm wma wv
    MIME Types:

Output Plugins: /usr/lib/cmus/op
  pulse
  alsa
  oss
  jack
  ao

Activity

  1. dirdi commented on May 23, 2020

    @dirdi

    I can confirm this bug. The passwd option is missing in this struct:

    cmus/ui_curses.c

    Line 2472 in d1290d5

    static struct option options[NR_FLAGS + 1] = {

    Therefore the long_option function will raise the observed error:

    cmus/prog.c

    Line 91 in 17bf542

    static int long_option(const char *opt, const struct option *options)

  2. eshrh commented on Jun 3, 2020

    @eshrh
    Contributor

    Strange how this hasn't been caught earlier...

  3. mokulus commented on Jun 10, 2020

    @mokulus

    passwd is only implemented in main.c, which is cmus-remote. cmus doesn't have this flag. Check cmus --help and cmus-remote --help

  4. mokulus commented on Jun 10, 2020

    @mokulus

    @gotbletu I don't think using one dash makes it work. It just ignores the flag.

    cmus/prog.c

    Lines 126 to 134 in 17bf542

    if (opt[1] == '-') {
    if (opt[2] == 0) {
    /* '--' => no more options */
    *argvp = argv + 1;
    return -1;
    }
    i = long_option(opt + 2, options);
    } else if (opt[2]) {
    return -1;

    It will return -1 if opt is like -[not dash][not null], and will be silently ignored.

  5. dirdi commented on Jun 10, 2020

    @dirdi

    @mokulus AFAIK both cmus and cmus-remote (should) have a --passwd option. According to cmus' man page its --passwd option is there to set the password to control cmus via TCP/IP socket, whereas cmus-remote's --passwd option is there to provide this password in order to connect to cmus' socket.

    cmus' --passwd option has not been documented at its usage message, though. I would recommend to open up another bug report regarding this.

  6. mokulus commented on Jun 10, 2020

    @mokulus

    @dirdi AFAIK there are two main functions:

    For cmus-remote:

    cmus/main.c

    Line 271 in 17bf542

    int main(int argc, char *argv[])

    For cmus:

    cmus/ui_curses.c

    Line 2472 in 17bf542

    int main(int argc, char *argv[])

    And if you look at the code in ui_curses.c there is no passwd here, and it's not checked for in the arguments.

  7. pgaskin commented on Jun 4, 2021

    @pgaskin
    Member

    The server password should be set in the options rather than the CLI options. I'll update the documentation.

  8. self-assigned this
    on Jun 4, 2021
  9. added a commit that references this issue on Jun 4, 2021
    a3c8677
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions