[cups.bugs] [LOW] STR #1815: cupsaddsmb may go an infinite loop

kmuto.debian kmuto at debian.org
Sat Jul 1 05:00:13 PDT 2006


[STR New]

Hi,

This is related with Debian Bug#376232.
cupsaddsmb command may go an infinite loop when cupsAdminExportSamba fails
by some reasons.

I investigated systemv/cupsaddsmb.c and wondered why it needs a loop back
when cupsAdminExportSamba().
If this is for reentering password, it won't work as expected. status is
already 0(error) and SAMBAPassword isn't NULL... It will just run
cupsAdminExportSamba again, fail, run again.
Resetting SAMBAPassword isn't solution.

- Samba server may be configured as empty password.
- getpass(3) [this is obsolete API...] ignores Ctrl+c signal. User can't
escape from infinite loop of password question without kill from other
terminal.

In my humble opinion, it is unnecessary to loop at here.

------------------------
  for (status = 0; !status;)
  {
   /*
    * Get the password, as needed...
    */

    if (!SAMBAPassword)
    {
      snprintf(prompt, sizeof(prompt),
               _("Password for %s required to access %s via SAMBA: "),
               SAMBAUser, SAMBAServer);

      if ((SAMBAPassword = cupsGetPassword(prompt)) == NULL)
        break;
    }

    status = cupsAdminExportSamba(dest, ppdfile, SAMBAServer,
                                  SAMBAUser, SAMBAPassword,
                                  Verbosity ? stderr : NULL);
  }
------------------------

Link: http://www.cups.org/str.php?L1815
Version: 1.2-current





More information about the cups-devel mailing list