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

Subscription web interface incorrectly uses guest account #2774

Closed
michaelrsweet opened this issue Mar 27, 2008 · 2 comments

Comments

@michaelrsweet
Copy link
Collaborator

commented Mar 27, 2008

Version: 1.3-current
CUPS.org User: mike

Currently the "add" and "cancel" subscription functions on the web interface pass "guest" as the requesting-user-name when no user is logged on. We should not pass a username at all if we are not authenticated so that the policy can be configured.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 9, 2008

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 9, 2008

"str2774.patch":

Index: cgi-bin/admin.c

--- cgi-bin/admin.c (revision 7434)
+++ cgi-bin/admin.c (working copy)
@@ -309,6 +309,16 @@
}

/*

  • * Make sure we have a username...
  • */
  • if ((user = getenv("REMOTE_USER")) == NULL)
  • {
  • puts("Status: 401\n");
  • exit(0);
  • }
  • /*
    • Validate the subscription name...
      */

@@ -352,9 +362,6 @@
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, printer_uri);

  • if ((user = getenv("REMOTE_USER")) == NULL)

- user = "guest";

ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, user);

@@ -1306,6 +1313,16 @@
}

/*

  • * Require a username...
  • */
  • if ((user = getenv("REMOTE_USER")) == NULL)
  • {
  • puts("Status: 401\n");
  • exit(0);
  • }
  • /*
    • Cancel the subscription...
      */

@@ -1316,9 +1333,6 @@
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER,
"notify-subscription-id", id);

  • if ((user = getenv("REMOTE_USER")) == NULL)

- user = "guest";

ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, user);

@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.