Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler segfaults when missing value in configuration file #3861

Closed
michaelrsweet opened this issue Jun 14, 2011 · 3 comments
Closed

scheduler segfaults when missing value in configuration file #3861

michaelrsweet opened this issue Jun 14, 2011 · 3 comments

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.4.6
CUPS.org User: jpopelka

Scheduler crashes with segfault on start when there's for example no value in Listen directive.

For the original report see
https://bugzilla.redhat.com/show_bug.cgi?id=706673

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

Updated patch attached.

@michaelrsweet
Copy link
Collaborator Author

"cups-1.4.6-conf-segfault.patch":

diff -up cups-1.4.6/scheduler/conf.c.conf_segfault cups-1.4.6/scheduler/conf.c
--- cups-1.4.6/scheduler/conf.c.conf_segfault 2010-08-31 06:18:38.000000000 +0200
+++ cups-1.4.6/scheduler/conf.c 2011-06-14 15:07:20.538275499 +0200
@@ -2498,11 +2498,11 @@ read_configuration(cups_file_t fp) / I
"FaxRetryLimit is deprecated; use "
"JobRetryLimit on line %d.", linenum);
}

  • else if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")
  • else if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")
    #ifdef HAVE_SSL
    || !strcasecmp(line, "SSLPort") || !strcasecmp(line, "SSLListen")
    #endif /* HAVE_SSL */
  •    )
    
  •    ) && value)
    
    {
    /*
    • Add listening address(es) to the list...
      @@ -3632,7 +3632,7 @@ read_location(cups_file_t fp, / I - C
      else if (!strcasecmp(line, "") ||
      !strcasecmp(line, ""))
      loc = parent;
  • else if (!parse_aaa(loc, line, value, linenum))
  • else if (value && !parse_aaa(loc, line, value, linenum))
    {
    cupsdLogMessage(CUPSD_LOG_ERROR,
    "Unknown Location directive %s on line %d.",
    @@ -3828,7 +3828,7 @@ read_policy(cups_file_t fp, / I - Con
    if (FatalErrors & CUPSD_FATAL_CONFIG)
    return (0);
    }
  • else if (!parse_aaa(op, line, value, linenum))
  • else if (value && !parse_aaa(op, line, value, linenum))
    {
    if (op)
    cupsdLogMessage(CUPSD_LOG_ERROR,

@michaelrsweet
Copy link
Collaborator Author

"str3861.patch":

Index: scheduler/conf.c

--- scheduler/conf.c (revision 9828)
+++ scheduler/conf.c (working copy)
@@ -2593,11 +2593,11 @@
"FaxRetryLimit is deprecated; use "
"JobRetryLimit on line %d.", linenum);
}

  • else if (!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")

  • else if ((!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")
    #ifdef HAVE_SSL
    || !_cups_strcasecmp(line, "SSLPort") || !_cups_strcasecmp(line, "SSLListen")
    #endif /* HAVE_SSL */

  •    )
    
  •    ) && value)
    

    {
    /*

    • Add listening address(es) to the list...
      @@ -3740,6 +3740,12 @@
      else if (!_cups_strcasecmp(line, "") ||
      !_cups_strcasecmp(line, ""))
      loc = parent;
  • else if (!value)

  • {

  •  cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value on line %d.", linenum);
    
  •  if (FatalErrors & CUPSD_FATAL_CONFIG)
    
  • return (0);

  • }
    else if (!parse_aaa(loc, line, value, linenum))
    {
    cupsdLogMessage(CUPSD_LOG_ERROR,
    @@ -3889,6 +3895,12 @@

    op = NULL;
    }

  • else if (!value)

  • {

  •  cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value on line %d.", linenum);
    
  •  if (FatalErrors & CUPSD_FATAL_CONFIG)
    
  • return (0);

  • }
    else if (!_cups_strcasecmp(line, "JobPrivateAccess") ||
    !_cups_strcasecmp(line, "JobPrivateValues") ||
    !_cups_strcasecmp(line, "SubscriptionPrivateAccess") ||

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant