* Administration utility API definitions for the Common UNIX Printing
* System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
if (have_drivers == 0)
{
_cupsSetError(IPP_NOT_FOUND, message);
+
+ unlink(authfile);
+
return (0);
}
in_admin_location = 0;
in_location = 0;
}
- else if (!strcasecmp(line, "Allow") && in_admin_location &&
+ else if (!strcasecmp(line, "Allow") &&
strcasecmp(value, "localhost") && strcasecmp(value, "127.0.0.1")
#ifdef AF_LOCAL
&& *value != '/'
#endif /* AF_INET6 */
)
{
- remote_admin = 1;
-
- if (!strcasecmp(value, "all"))
+ if (in_admin_location)
+ remote_admin = 1;
+ else if (!strcasecmp(value, "all"))
remote_any = 1;
}
else if (line[0] != '<' && !in_location && !in_policy)
if (remote_admin)
cupsFilePrintf(temp, " Allow %s\n",
remote_any > 0 ? "all" : "@LOCAL");
- else
- cupsFilePuts(temp, " Allow localhost\n");
}
else if (in_conf_location && remote_admin >= 0)
{
if (remote_admin)
cupsFilePrintf(temp, " Allow %s\n",
remote_any > 0 ? "all" : "@LOCAL");
- else
- cupsFilePuts(temp, " Allow localhost\n");
}
else if (in_root_location && (remote_admin >= 0 || share_printers >= 0))
{
if (remote_admin > 0 || share_printers > 0)
cupsFilePrintf(temp, " Allow %s\n",
remote_any > 0 ? "all" : "@LOCAL");
- else
- cupsFilePuts(temp, " Allow localhost\n");
}
in_admin_location = 0;
if (remote_admin > 0 || share_printers > 0)
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
- else
- cupsFilePuts(temp, " Allow localhost\n");
cupsFilePuts(temp, "</Location>\n");
}
if (remote_admin)
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
- else
- cupsFilePuts(temp, " Allow localhost\n");
cupsFilePuts(temp, "</Location>\n");
}
if (remote_admin)
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
- else
- cupsFilePuts(temp, " Allow localhost\n");
cupsFilePuts(temp, "</Location>\n");
}