/*
- * "$Id: adminutil.c 6262 2007-02-11 16:59:33Z mike $"
+ * "$Id: adminutil.c 6270 2007-02-12 14:27:47Z mike $"
*
* Administration utility API definitions for the Common UNIX Printing
* System (CUPS).
int remote_access = 0, /* Remote access allowed? */
remote_admin = 0, /* Remote administration allowed? */
+ remote_any = 0, /* Remote access from anywhere allowed? */
browsing = 1, /* Browsing enabled? */
browse_allow = 1, /* Browse address set? */
browse_address = 0, /* Browse address set? */
)
{
remote_admin = 1;
+
+ if (!strcasecmp(value, "all"))
+ remote_any = 1;
}
else if (line[0] != '<' && !in_location && !in_policy)
cg->cupsd_num_settings = cupsAddOption(line, value,
cg->cupsd_num_settings,
&(cg->cupsd_settings));
+ cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY,
+ remote_any ? "1" : "0",
+ cg->cupsd_num_settings,
+ &(cg->cupsd_settings));
+
cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
(browsing && browse_allow) ?
"1" : "0",
int remote_printers, /* Show remote printers */
share_printers, /* Share local printers */
remote_admin, /* Remote administration allowed? */
+ remote_any, /* Remote access from anywhere? */
user_cancel_any, /* Cancel-job policy set? */
debug_logging; /* LogLevel debug set? */
int wrote_port_listen, /* Wrote the port/listen lines? */
else
old_remote_admin = 0;
+ if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, cupsd_num_settings,
+ cupsd_settings)) != NULL)
+ remote_any = atoi(val);
+ else
+ remote_any = 0;
+
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, cupsd_num_settings,
cupsd_settings)) != NULL)
old_remote_printers = atoi(val);
else
debug_logging = -1;
+ if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, num_settings,
+ settings)) != NULL)
+ remote_any = atoi(val);
+
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings,
settings)) != NULL)
{
remote_admin = atoi(val);
- if (remote_admin == old_remote_admin)
+ if (remote_admin == old_remote_admin && remote_any < 0)
{
/*
* No change to this setting...
{
share_printers = atoi(val);
- if (share_printers == old_share_printers)
+ if (share_printers == old_share_printers && remote_any < 0)
{
/*
* No change to this setting...
cupsFilePuts(temp, "BrowseOrder allow,deny\n");
if (remote_printers > 0)
- cupsFilePuts(temp, "BrowseAllow @LOCAL\n");
+ cupsFilePuts(temp, "BrowseAllow all\n");
if (share_printers > 0)
cupsFilePuts(temp, "BrowseAddress @LOCAL\n");
cupsFilePuts(temp, " Order allow,deny\n");
if (remote_admin)
- cupsFilePuts(temp, " Allow @LOCAL\n");
+ cupsFilePrintf(temp, " Allow %s\n",
+ remote_any > 0 ? "all" : "@LOCAL");
else
cupsFilePuts(temp, " Allow localhost\n");
}
cupsFilePuts(temp, " Order allow,deny\n");
if (remote_admin)
- cupsFilePuts(temp, " Allow @LOCAL\n");
+ cupsFilePrintf(temp, " Allow %s\n",
+ remote_any > 0 ? "all" : "@LOCAL");
else
cupsFilePuts(temp, " Allow localhost\n");
}
cupsFilePuts(temp, " Order allow,deny\n");
if (remote_admin > 0 || share_printers > 0)
- cupsFilePuts(temp, " Allow @LOCAL\n");
+ cupsFilePrintf(temp, " Allow %s\n",
+ remote_any > 0 ? "all" : "@LOCAL");
else
cupsFilePuts(temp, " Allow localhost\n");
}
cupsFilePuts(temp, "BrowseOrder allow,deny\n");
if (remote_printers > 0)
- cupsFilePuts(temp, "BrowseAllow @LOCAL\n");
+ cupsFilePuts(temp, "BrowseAllow all\n");
if (share_printers > 0)
cupsFilePuts(temp, "BrowseAddress @LOCAL\n");
" Order allow,deny\n");
if (remote_admin > 0 || share_printers > 0)
- cupsFilePuts(temp, " Allow @LOCAL\n");
+ cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
else
cupsFilePuts(temp, " Allow localhost\n");
" Order allow,deny\n");
if (remote_admin)
- cupsFilePuts(temp, " Allow @LOCAL\n");
+ cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
else
cupsFilePuts(temp, " Allow localhost\n");
" Order allow,deny\n");
if (remote_admin)
- cupsFilePuts(temp, " Allow @LOCAL\n");
+ cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
else
cupsFilePuts(temp, " Allow localhost\n");
old_remote_admin ? "1" : "0",
cupsd_num_settings, &cupsd_settings);
+ cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY,
+ remote_any ? "1" : "0",
+ cupsd_num_settings, &cupsd_settings);
+
if (remote_printers >= 0)
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
remote_printers ? "1" : "0",
/*
- * End of "$Id: adminutil.c 6262 2007-02-11 16:59:33Z mike $".
+ * End of "$Id: adminutil.c 6270 2007-02-12 14:27:47Z mike $".
*/