cupDoRequest asking for administrative permissions on managed account

akbar akbarbasha at tataelxsi.co.in
Wed Feb 24 06:10:37 PST 2010


Hi

I am able to release my job using IPP_RELEASE_JOB.It is working fine with my below code from the Administrator of leopard .But From managed Account It is asking for Administrative priviliges to release the job.

My requirement is print job has to release from the queue and it has to print without asking any Administative priviliges.


How can I solve this . i saw from cups documents cupsSetPasswordCB ,

and auth-info required = none , but nothing is working .

How to solve this one.give me some suggestion.


	request = ippNew();


	/* Set up the request */
	request->request.op.operation_id =  IPP_RELEASE_JOB;
	request->request.op.request_id = 1;
	language = cupsLangDefault();

//	ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
//				 "auth-info-required", NULL," none");

	ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
				 "attributes-charset", NULL, cupsLangEncoding(language));

	ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
				 "attributes-natural-language", NULL, language->language);

	snprintf(uri, sizeof(uri), "ipp://%s", defaultPrinterName);

	//fputs("ATTR: auth-info-required=negotiate\n", stderr);



	ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
				 "printer-uri", NULL, uri);

	ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
				  jobId);

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

	//ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
//					 "auth-info-required", NULL," none");

	ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
				 "which-jobs", NULL, "completed");

	ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
				  "requested-attributes",
				  sizeof(def_attrs) / sizeof(def_attrs[0]), NULL,
				  def_attrs);






	if ((response = cupsDoRequest(http, request, "/admin/")) == NULL)
	{



I also tried with

if ((response = cupsDoRequest(http, request, "/")) == NULL)



thanks

Akbar




More information about the cups-devel mailing list