Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 292389 Details for
Bug 380591
CUPS requires UTF-8 IPP requests
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
samba-cups-utf8.patch
samba-cups-utf8.patch (text/plain), 21.76 KB, created by
Tim Waugh
on 2008-01-21 17:35:40 UTC
(
hide
)
Description:
samba-cups-utf8.patch
Filename:
MIME Type:
Creator:
Tim Waugh
Created:
2008-01-21 17:35:40 UTC
Size:
21.76 KB
patch
obsolete
>diff -up source/printing/print_cups.c.cups-utf8 source/printing/print_cups.c >--- source/printing/print_cups.c.cups-utf8 2008-01-21 14:49:43.000000000 +0000 >+++ source/printing/print_cups.c 2008-01-21 17:33:54.000000000 +0000 >@@ -22,7 +22,6 @@ > > #ifdef HAVE_CUPS > #include <cups/cups.h> >-#include <cups/language.h> > > extern userdom_struct current_user_info; > >@@ -80,9 +79,10 @@ bool cups_cache_reload(void) > ipp_t *request = NULL, /* IPP Request */ > *response = NULL; /* IPP Response */ > ipp_attribute_t *attr; /* Current attribute */ >- cups_lang_t *language = NULL; /* Default language */ >- char *name, /* printer-name attribute */ >- *info; /* printer-info attribute */ >+ char *name_utf8, /* printer-name attribute (UTF-8) */ >+ *name, /* printer-name attribute (unix) */ >+ *info_utf8, /* printer-info attribute (UTF-8) */ >+ *info; /* printer-info attribute (unix) */ > static const char *requested[] =/* Requested attributes */ > { > "printer-name", >@@ -115,18 +115,7 @@ bool cups_cache_reload(void) > * requested-attributes > */ > >- request = ippNew(); >- >- request->request.op.operation_id = CUPS_GET_PRINTERS; >- request->request.op.request_id = 1; >- >- language = cupsLangDefault(); >- >- 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); >+ request = ippNewRequest(CUPS_GET_PRINTERS); > > ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME, > "requested-attributes", >@@ -164,11 +153,11 @@ bool cups_cache_reload(void) > while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) { > if (strcmp(attr->name, "printer-name") == 0 && > attr->value_tag == IPP_TAG_NAME) >- name = attr->values[0].string.text; >+ name_utf8 = attr->values[0].string.text; > > if (strcmp(attr->name, "printer-info") == 0 && > attr->value_tag == IPP_TAG_TEXT) >- info = attr->values[0].string.text; >+ info_utf8 = attr->values[0].string.text; > > attr = attr->next; > } >@@ -177,12 +166,24 @@ bool cups_cache_reload(void) > * See if we have everything needed... > */ > >- if (name == NULL) >+ if (name_utf8 == NULL) >+ break; >+ >+ if (pull_utf8_allocate(&info, info_utf8) == (size_t)-1) > break; > >+ if (pull_utf8_allocate(&name, name_utf8) == (size_t)-1){ >+ SAFE_FREE(info); >+ goto out; >+ } >+ > if (!pcap_cache_add(name, info)) { >+ SAFE_FREE(name); >+ SAFE_FREE(info); > goto out; > } >+ SAFE_FREE(name); >+ SAFE_FREE(info); > } > > ippDelete(response); >@@ -197,16 +198,7 @@ bool cups_cache_reload(void) > * requested-attributes > */ > >- request = ippNew(); >- >- request->request.op.operation_id = CUPS_GET_CLASSES; >- request->request.op.request_id = 1; >- >- 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); >+ request = ippNewRequest(CUPS_GET_CLASSES); > > ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME, > "requested-attributes", >@@ -238,17 +230,17 @@ bool cups_cache_reload(void) > * Pull the needed attributes from this printer... > */ > >- name = NULL; >- info = NULL; >+ name_utf8 = NULL; >+ info_utf8 = NULL; > > while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) { > if (strcmp(attr->name, "printer-name") == 0 && > attr->value_tag == IPP_TAG_NAME) >- name = attr->values[0].string.text; >+ name_utf8 = attr->values[0].string.text; > > if (strcmp(attr->name, "printer-info") == 0 && > attr->value_tag == IPP_TAG_TEXT) >- info = attr->values[0].string.text; >+ info_utf8 = attr->values[0].string.text; > > attr = attr->next; > } >@@ -257,12 +249,24 @@ bool cups_cache_reload(void) > * See if we have everything needed... > */ > >- if (name == NULL) >+ if (name_utf8 == NULL) > break; > >+ if (pull_utf8_allocate(&info, info_utf8) == (size_t)-1) >+ break; >+ >+ if (pull_utf8_allocate(&name, name_utf8) == (size_t)-1){ >+ SAFE_FREE(info); >+ goto out; >+ } >+ > if (!pcap_cache_add(name, info)) { >+ SAFE_FREE(name); >+ SAFE_FREE(info); > goto out; > } >+ SAFE_FREE(name); >+ SAFE_FREE(info); > } > > ret = True; >@@ -271,9 +275,6 @@ bool cups_cache_reload(void) > if (response) > ippDelete(response); > >- if (language) >- cupsLangFree(language); >- > if (http) > httpClose(http); > >@@ -291,7 +292,6 @@ static int cups_job_delete(const char *s > http_t *http = NULL; /* HTTP connection to server */ > ipp_t *request = NULL, /* IPP Request */ > *response = NULL; /* IPP Response */ >- cups_lang_t *language = NULL; /* Default language */ > char uri[HTTP_MAX_URI]; /* printer-uri attribute */ > > >@@ -321,18 +321,7 @@ static int cups_job_delete(const char *s > * requesting-user-name > */ > >- request = ippNew(); >- >- request->request.op.operation_id = IPP_CANCEL_JOB; >- request->request.op.request_id = 1; >- >- language = cupsLangDefault(); >- >- 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); >+ request = ippNewRequest(IPP_CANCEL_JOB); > > slprintf(uri, sizeof(uri) - 1, "ipp://localhost/jobs/%d", pjob->sysjob); > >@@ -361,9 +350,6 @@ static int cups_job_delete(const char *s > if (response) > ippDelete(response); > >- if (language) >- cupsLangFree(language); >- > if (http) > httpClose(http); > >@@ -381,7 +367,6 @@ static int cups_job_pause(int snum, stru > http_t *http = NULL; /* HTTP connection to server */ > ipp_t *request = NULL, /* IPP Request */ > *response = NULL; /* IPP Response */ >- cups_lang_t *language = NULL; /* Default language */ > char uri[HTTP_MAX_URI]; /* printer-uri attribute */ > > >@@ -411,18 +396,7 @@ static int cups_job_pause(int snum, stru > * requesting-user-name > */ > >- request = ippNew(); >- >- request->request.op.operation_id = IPP_HOLD_JOB; >- request->request.op.request_id = 1; >- >- language = cupsLangDefault(); >- >- 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); >+ request = ippNewRequest(IPP_HOLD_JOB); > > slprintf(uri, sizeof(uri) - 1, "ipp://localhost/jobs/%d", pjob->sysjob); > >@@ -451,9 +425,6 @@ static int cups_job_pause(int snum, stru > if (response) > ippDelete(response); > >- if (language) >- cupsLangFree(language); >- > if (http) > httpClose(http); > >@@ -471,7 +442,6 @@ static int cups_job_resume(int snum, str > http_t *http = NULL; /* HTTP connection to server */ > ipp_t *request = NULL, /* IPP Request */ > *response = NULL; /* IPP Response */ >- cups_lang_t *language = NULL; /* Default language */ > char uri[HTTP_MAX_URI]; /* printer-uri attribute */ > > >@@ -501,18 +471,7 @@ static int cups_job_resume(int snum, str > * requesting-user-name > */ > >- request = ippNew(); >- >- request->request.op.operation_id = IPP_RELEASE_JOB; >- request->request.op.request_id = 1; >- >- language = cupsLangDefault(); >- >- 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); >+ request = ippNewRequest(IPP_RELEASE_JOB); > > slprintf(uri, sizeof(uri) - 1, "ipp://localhost/jobs/%d", pjob->sysjob); > >@@ -541,9 +500,6 @@ static int cups_job_resume(int snum, str > if (response) > ippDelete(response); > >- if (language) >- cupsLangFree(language); >- > if (http) > httpClose(http); > >@@ -561,10 +517,12 @@ static int cups_job_submit(int snum, str > http_t *http = NULL; /* HTTP connection to server */ > ipp_t *request = NULL, /* IPP Request */ > *response = NULL; /* IPP Response */ >- cups_lang_t *language = NULL; /* Default language */ > char uri[HTTP_MAX_URI]; /* printer-uri attribute */ >+ char *uri_utf8, /* printer-uri (UTF-8) */ >+ *user_utf8; /* requesting-user-name (UTF-8) */ > const char *clientname = NULL; /* hostname of client for job-originating-host attribute */ >- char *new_jobname = NULL; >+ char *new_jobname = NULL, >+ *new_jobname_utf8; > int num_options = 0; > cups_option_t *options = NULL; > char addr[INET6_ADDRSTRLEN]; >@@ -596,27 +554,20 @@ static int cups_job_submit(int snum, str > * [document-data] > */ > >- request = ippNew(); >- >- request->request.op.operation_id = IPP_PRINT_JOB; >- request->request.op.request_id = 1; >- >- language = cupsLangDefault(); >- >- 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); >+ request = ippNewRequest(IPP_PRINT_JOB); > > slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s", > PRINTERNAME(snum)); > >+ push_utf8_allocate(&uri_utf8, uri); > ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, >- "printer-uri", NULL, uri); >+ "printer-uri", NULL, uri_utf8); >+ SAFE_FREE(uri_utf8); > >+ push_utf8_allocate(&user_utf8, pjob->user); > ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", >- NULL, pjob->user); >+ NULL, user_utf8); >+ SAFE_FREE(user_utf8); > > clientname = client_name(get_client_fd()); > if (strcmp(clientname, "UNKNOWN") == 0) { >@@ -632,8 +583,10 @@ static int cups_job_submit(int snum, str > goto out; > } > >+ push_utf8_allocate(&new_jobname_utf8, new_jobname); > ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL, >- new_jobname); >+ new_jobname_utf8); >+ SAFE_FREE(new_jobname_utf8); > > /* > * add any options defined in smb.conf >@@ -672,9 +625,6 @@ static int cups_job_submit(int snum, str > if (response) > ippDelete(response); > >- if (language) >- cupsLangFree(language); >- > if (http) > httpClose(http); > >@@ -698,14 +648,14 @@ static int cups_queue_get(const char *sh > ipp_t *request = NULL, /* IPP Request */ > *response = NULL; /* IPP Response */ > ipp_attribute_t *attr = NULL; /* Current attribute */ >- cups_lang_t *language = NULL; /* Default language */ >- char uri[HTTP_MAX_URI]; /* printer-uri attribute */ >+ char uri[HTTP_MAX_URI], /* printer-uri attribute (unix) */ >+ *uri_utf8; /* printer-uri (UTF-8) */ > int qcount = 0, /* Number of active queue entries */ > qalloc = 0; /* Number of queue entries allocated */ > print_queue_struct *queue = NULL, /* Queue entries */ > *temp; /* Temporary pointer for queue */ >- const char *user_name, /* job-originating-user-name attribute */ >- *job_name; /* job-name attribute */ >+ const char *user_name_utf8, /* job-originating-user-name attribute (UTF-8) */ >+ *job_name_utf8; /* job-name attribute (UTF-8) */ > int job_id; /* job-id attribute */ > int job_k_octets; /* job-k-octets attribute */ > time_t job_time; /* time-at-creation attribute */ >@@ -769,26 +719,17 @@ static int cups_queue_get(const char *sh > * printer-uri > */ > >- request = ippNew(); >- >- request->request.op.operation_id = IPP_GET_JOBS; >- request->request.op.request_id = 1; >- >- language = cupsLangDefault(); >- >- 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); >+ request = ippNewRequest(IPP_GET_JOBS); > > ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME, > "requested-attributes", > (sizeof(jattrs) / sizeof(jattrs[0])), > NULL, jattrs); > >+ push_utf8_allocate(&uri_utf8, uri); > ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, >- "printer-uri", NULL, uri); >+ "printer-uri", NULL, uri_utf8); >+ SAFE_FREE(uri_utf8); > > /* > * Do the request and get back a response... >@@ -852,8 +793,8 @@ static int cups_queue_get(const char *sh > job_status = IPP_JOB_PENDING; > job_time = 0; > job_k_octets = 0; >- user_name = NULL; >- job_name = NULL; >+ user_name_utf8 = NULL; >+ job_name_utf8 = NULL; > > while (attr != NULL && attr->group_tag == IPP_TAG_JOB) { > if (attr->name == NULL) { >@@ -883,11 +824,11 @@ static int cups_queue_get(const char *sh > > if (strcmp(attr->name, "job-name") == 0 && > attr->value_tag == IPP_TAG_NAME) >- job_name = attr->values[0].string.text; >+ job_name_utf8 = attr->values[0].string.text; > > if (strcmp(attr->name, "job-originating-user-name") == 0 && > attr->value_tag == IPP_TAG_NAME) >- user_name = attr->values[0].string.text; >+ user_name_utf8 = attr->values[0].string.text; > > attr = attr->next; > } >@@ -896,7 +837,8 @@ static int cups_queue_get(const char *sh > * See if we have everything needed... > */ > >- if (user_name == NULL || job_name == NULL || job_id == 0) { >+ if (user_name_utf8 == NULL || job_name_utf8 == NULL || >+ job_id == 0) { > if (attr == NULL) > break; > else >@@ -911,8 +853,10 @@ static int cups_queue_get(const char *sh > LPQ_PRINTING; > temp->priority = job_priority; > temp->time = job_time; >- strncpy(temp->fs_user, user_name, sizeof(temp->fs_user) - 1); >- strncpy(temp->fs_file, job_name, sizeof(temp->fs_file) - 1); >+ convert_string(CH_UTF8, CH_UNIX, user_name_utf8, -1, >+ temp->fs_user, sizeof(temp->fs_user) - 1, True); >+ convert_string(CH_UTF8, CH_UNIX, job_name_utf8, -1, >+ temp->fs_file, sizeof(temp->fs_file) - 1, True); > > qcount ++; > >@@ -933,24 +877,17 @@ static int cups_queue_get(const char *sh > * printer-uri > */ > >- request = ippNew(); >- >- request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; >- request->request.op.request_id = 1; >- >- 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); >+ request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); > > ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME, > "requested-attributes", > (sizeof(pattrs) / sizeof(pattrs[0])), > NULL, pattrs); > >+ push_utf8_allocate(&uri_utf8, uri); > ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, >- "printer-uri", NULL, uri); >+ "printer-uri", NULL, uri_utf8); >+ SAFE_FREE(uri_utf8); > > /* > * Do the request and get back a response... >@@ -983,7 +920,9 @@ static int cups_queue_get(const char *sh > > if ((attr = ippFindAttribute(response, "printer-state-message", > IPP_TAG_TEXT)) != NULL) >- fstrcpy(status->message, attr->values[0].string.text); >+ convert_string(CH_UTF8, CH_UNIX, >+ attr->values[0].string.text, -1, >+ status->message, sizeof(fstring), True); > > /* > * Return the job queue... >@@ -995,9 +934,6 @@ static int cups_queue_get(const char *sh > if (response) > ippDelete(response); > >- if (language) >- cupsLangFree(language); >- > if (http) > httpClose(http); > >@@ -1015,8 +951,9 @@ static int cups_queue_pause(int snum) > http_t *http = NULL; /* HTTP connection to server */ > ipp_t *request = NULL, /* IPP Request */ > *response = NULL; /* IPP Response */ >- cups_lang_t *language = NULL; /* Default language */ >- char uri[HTTP_MAX_URI]; /* printer-uri attribute */ >+ char uri[HTTP_MAX_URI], /* printer-uri attribute */ >+ *uri_utf8, /* printer-uri (UTF-8) */ >+ *user_utf8; /* username (UTF-8) */ > > > DEBUG(5,("cups_queue_pause(%d)\n", snum)); >@@ -1045,26 +982,19 @@ static int cups_queue_pause(int snum) > * requesting-user-name > */ > >- request = ippNew(); >- >- request->request.op.operation_id = IPP_PAUSE_PRINTER; >- request->request.op.request_id = 1; >- >- language = cupsLangDefault(); >- >- 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); >+ request = ippNewRequest(IPP_PAUSE_PRINTER); > > slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s", > PRINTERNAME(snum)); > >- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); >+ push_utf8_allocate(&uri_utf8, uri); >+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri_utf8); >+ SAFE_FREE(uri_utf8); > >+ push_utf8_allocate(&user_utf8, current_user_info.unix_name); > ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", >- NULL, current_user_info.unix_name); >+ NULL, user_utf8); >+ SAFE_FREE(user_utf8); > > /* > * Do the request and get back a response... >@@ -1086,9 +1016,6 @@ static int cups_queue_pause(int snum) > if (response) > ippDelete(response); > >- if (language) >- cupsLangFree(language); >- > if (http) > httpClose(http); > >@@ -1106,8 +1033,9 @@ static int cups_queue_resume(int snum) > http_t *http = NULL; /* HTTP connection to server */ > ipp_t *request = NULL, /* IPP Request */ > *response = NULL; /* IPP Response */ >- cups_lang_t *language = NULL; /* Default language */ >- char uri[HTTP_MAX_URI]; /* printer-uri attribute */ >+ char uri[HTTP_MAX_URI], /* printer-uri attribute */ >+ *uri_utf8, /* printer-uri (UTF-8) */ >+ *user_utf8; /* username (UTF-8) */ > > > DEBUG(5,("cups_queue_resume(%d)\n", snum)); >@@ -1136,26 +1064,19 @@ static int cups_queue_resume(int snum) > * requesting-user-name > */ > >- request = ippNew(); >- >- request->request.op.operation_id = IPP_RESUME_PRINTER; >- request->request.op.request_id = 1; >- >- language = cupsLangDefault(); >- >- 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); >+ request = ippNewRequest(IPP_RESUME_PRINTER); > > slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s", > PRINTERNAME(snum)); > >- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); >+ push_utf8_allocate(&uri_utf8, uri); >+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri_utf8); >+ SAFE_FREE(uri_utf8); > >+ push_utf8_allocate(&user_utf8, current_user_info.unix_name); > ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", >- NULL, current_user_info.unix_name); >+ NULL, user_utf8); >+ SAFE_FREE(user_utf8); > > /* > * Do the request and get back a response... >@@ -1177,9 +1098,6 @@ static int cups_queue_resume(int snum) > if (response) > ippDelete(response); > >- if (language) >- cupsLangFree(language); >- > if (http) > httpClose(http); > >@@ -1208,11 +1126,11 @@ bool cups_pull_comment_location(NT_PRINT > ipp_t *request = NULL, /* IPP Request */ > *response = NULL; /* IPP Response */ > ipp_attribute_t *attr; /* Current attribute */ >- cups_lang_t *language = NULL; /* Default language */ > char *name, /* printer-name attribute */ > *info, /* printer-info attribute */ > *location; /* printer-location attribute */ >- char uri[HTTP_MAX_URI]; >+ char uri[HTTP_MAX_URI], >+ *uri_utf8; > static const char *requested[] =/* Requested attributes */ > { > "printer-name", >@@ -1237,24 +1155,15 @@ bool cups_pull_comment_location(NT_PRINT > goto out; > } > >- request = ippNew(); >- >- request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; >- request->request.op.request_id = 1; >- >- language = cupsLangDefault(); >- >- 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); >+ request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); > > slprintf(uri, sizeof(uri) - 1, "ipp://%s/printers/%s", > lp_cups_server(), printer->sharename); > >+ push_utf8_allocate(&uri_utf8, uri); > ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, >- "printer-uri", NULL, uri); >+ "printer-uri", NULL, uri_utf8); >+ SAFE_FREE(uri_utf8); > > ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME, > "requested-attributes", >@@ -1298,9 +1207,10 @@ bool cups_pull_comment_location(NT_PRINT > { > DEBUG(5,("cups_pull_comment_location: Using cups comment: %s\n", > attr->values[0].string.text)); >- strlcpy(printer->comment, >- attr->values[0].string.text, >- sizeof(printer->comment)); >+ convert_string(CH_UTF8, CH_UNIX, >+ attr->values[0].string.text, -1, >+ printer->comment, >+ sizeof(printer->comment), True); > } > > /* Grab the location if we don't have one */ >@@ -1310,7 +1220,10 @@ bool cups_pull_comment_location(NT_PRINT > { > DEBUG(5,("cups_pull_comment_location: Using cups location: %s\n", > attr->values[0].string.text)); >- fstrcpy(printer->location,attr->values[0].string.text); >+ convert_string(CH_UTF8, CH_UNIX, >+ attr->values[0].string.text, -1, >+ printer->location, >+ sizeof(fstring), True); > } > > attr = attr->next; >@@ -1331,9 +1244,6 @@ bool cups_pull_comment_location(NT_PRINT > if (response) > ippDelete(response); > >- if (language) >- cupsLangFree(language); >- > if (http) > httpClose(http); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 380591
:
257131
| 292389