CHANGES IN CUPS V1.3.4
+ - Documentation updates (STR #2560, STR #2563)
+ - Multiple AuthTypes in cupsd.conf did not work (STR
+ #2545)
+ - The snmp.conf file referenced the wrong man page (STR
+ #2564)
+ - The cupsaddsmb program didn't handle domain sockets
+ properly (STR #2556)
+ - The scheduler now validates device URIs when adding
+ printers.
+ - Updated httpSeparateURI() to support hostnames with
+ the backslash character.
- Updated the Japanese localization (STR #2546)
- The parallel backend now gets the current IEEE-1284
device ID string on Linux (STR #2553)
ARCHFLAGS = @ARCHFLAGS@
ARFLAGS = @ARFLAGS@
BACKLIBS = @BACKLIBS@
-CFLAGS = -I.. @CPPFLAGS@ @CFLAGS@ \
+CFLAGS = -I.. -D_CUPS_SOURCE @CPPFLAGS@ @CFLAGS@ \
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
COMMONLIBS = @LIBS@
CUPSDLIBS = @CUPSDLIBS@
-CXXFLAGS = -I.. $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
+CXXFLAGS = -I.. -D_CUPS_SOURCE $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
CXXLIBS = @CXXLIBS@
DSOFLAGS = @DSOFLAGS@
#
# "$Id$"
#
-# Sample SNMP configuration file for CUPS. See "man smnp.conf" for a
+# Sample SNMP configuration file for CUPS. See "man cups-smnp.conf" for a
# complete description of this file.
#
const char *samba_server,
const char *samba_user,
const char *samba_password,
- FILE *logfile);
+ FILE *logfile) _CUPS_API_1_2;
extern char *cupsAdminCreateWindowsPPD(http_t *http, const char *dest,
- char *buffer, int bufsize);
+ char *buffer, int bufsize) _CUPS_API_1_2;
extern int cupsAdminGetServerSettings(http_t *http,
int *num_settings,
- cups_option_t **settings);
+ cups_option_t **settings) _CUPS_API_1_3;
extern int cupsAdminSetServerSettings(http_t *http,
int num_settings,
- cups_option_t *settings);
+ cups_option_t *settings) _CUPS_API_1_3;
# ifdef __cplusplus
* Include necessary headers...
*/
+# include "versioning.h"
# include <stdlib.h>
* Functions...
*/
-extern int cupsArrayAdd(cups_array_t *a, void *e);
-extern void cupsArrayClear(cups_array_t *a);
-extern int cupsArrayCount(cups_array_t *a);
-extern void *cupsArrayCurrent(cups_array_t *a);
-extern void cupsArrayDelete(cups_array_t *a);
-extern cups_array_t *cupsArrayDup(cups_array_t *a);
-extern void *cupsArrayFind(cups_array_t *a, void *e);
-extern void *cupsArrayFirst(cups_array_t *a);
-extern int cupsArrayGetIndex(cups_array_t *a);
-extern int cupsArrayGetInsert(cups_array_t *a);
-extern void *cupsArrayIndex(cups_array_t *a, int n);
-extern int cupsArrayInsert(cups_array_t *a, void *e);
-extern void *cupsArrayLast(cups_array_t *a);
-extern cups_array_t *cupsArrayNew(cups_array_func_t f, void *d);
+extern int cupsArrayAdd(cups_array_t *a, void *e) _CUPS_API_1_2;
+extern void cupsArrayClear(cups_array_t *a) _CUPS_API_1_2;
+extern int cupsArrayCount(cups_array_t *a) _CUPS_API_1_2;
+extern void *cupsArrayCurrent(cups_array_t *a) _CUPS_API_1_2;
+extern void cupsArrayDelete(cups_array_t *a) _CUPS_API_1_2;
+extern cups_array_t *cupsArrayDup(cups_array_t *a) _CUPS_API_1_2;
+extern void *cupsArrayFind(cups_array_t *a, void *e) _CUPS_API_1_2;
+extern void *cupsArrayFirst(cups_array_t *a) _CUPS_API_1_2;
+extern int cupsArrayGetIndex(cups_array_t *a) _CUPS_API_1_3;
+extern int cupsArrayGetInsert(cups_array_t *a) _CUPS_API_1_3;
+extern void *cupsArrayIndex(cups_array_t *a, int n) _CUPS_API_1_2;
+extern int cupsArrayInsert(cups_array_t *a, void *e) _CUPS_API_1_2;
+extern void *cupsArrayLast(cups_array_t *a) _CUPS_API_1_2;
+extern cups_array_t *cupsArrayNew(cups_array_func_t f, void *d) _CUPS_API_1_2;
extern cups_array_t *cupsArrayNew2(cups_array_func_t f, void *d,
- cups_ahash_func_t h, int hsize);
-extern void *cupsArrayNext(cups_array_t *a);
-extern void *cupsArrayPrev(cups_array_t *a);
-extern int cupsArrayRemove(cups_array_t *a, void *e);
-extern void *cupsArrayRestore(cups_array_t *a);
-extern int cupsArraySave(cups_array_t *a);
-extern void *cupsArrayUserData(cups_array_t *a);
+ cups_ahash_func_t h, int hsize) _CUPS_API_1_3;
+extern void *cupsArrayNext(cups_array_t *a) _CUPS_API_1_2;
+extern void *cupsArrayPrev(cups_array_t *a) _CUPS_API_1_2;
+extern int cupsArrayRemove(cups_array_t *a, void *e) _CUPS_API_1_2;
+extern void *cupsArrayRestore(cups_array_t *a) _CUPS_API_1_2;
+extern int cupsArraySave(cups_array_t *a) _CUPS_API_1_2;
+extern void *cupsArrayUserData(cups_array_t *a) _CUPS_API_1_2;
# ifdef __cplusplus
}
# define _CUPS_BACKEND_H_
+/*
+ * Include necessary headers...
+ */
+
+# include "versioning.h"
+
+
/*
* Constants...
*/
* Prototypes...
*/
-extern const char *cupsBackendDeviceURI(char **argv);
+extern const char *cupsBackendDeviceURI(char **argv) _CUPS_API_1_2;
#endif /* !_CUPS_BACKEND_H_ */
/**** New in CUPS 1.1.20 ****/
extern int cupsDoAuthentication(http_t *http, const char *method,
- const char *resource);
+ const char *resource) _CUPS_API_1_1_20;
extern http_status_t cupsGetFile(http_t *http, const char *resource,
- const char *filename);
+ const char *filename) _CUPS_API_1_1_20;
extern http_status_t cupsGetFd(http_t *http, const char *resource, int fd);
extern http_status_t cupsPutFile(http_t *http, const char *resource,
- const char *filename);
-extern http_status_t cupsPutFd(http_t *http, const char *resource, int fd);
+ const char *filename) _CUPS_API_1_1_20;
+extern http_status_t cupsPutFd(http_t *http, const char *resource, int fd) _CUPS_API_1_1_20;
/**** New in CUPS 1.1.21 ****/
-extern const char *cupsGetDefault2(http_t *http);
-extern int cupsGetDests2(http_t *http, cups_dest_t **dests);
+extern const char *cupsGetDefault2(http_t *http) _CUPS_API_1_1_21;
+extern int cupsGetDests2(http_t *http, cups_dest_t **dests) _CUPS_API_1_1_21;
extern int cupsGetJobs2(http_t *http, cups_job_t **jobs,
const char *dest, int myjobs,
- int completed);
-extern const char *cupsGetPPD2(http_t *http, const char *printer);
+ int completed) _CUPS_API_1_1_21;
+extern const char *cupsGetPPD2(http_t *http, const char *printer) _CUPS_API_1_1_21;
extern int cupsPrintFile2(http_t *http, const char *printer,
const char *filename,
const char *title, int num_options,
- cups_option_t *options);
+ cups_option_t *options) _CUPS_API_1_1_21;
extern int cupsPrintFiles2(http_t *http, const char *printer,
int num_files, const char **files,
const char *title, int num_options,
- cups_option_t *options);
+ cups_option_t *options) _CUPS_API_1_1_21;
extern int cupsSetDests2(http_t *http, int num_dests,
- cups_dest_t *dests);
+ cups_dest_t *dests) _CUPS_API_1_1_21;
/**** New in CUPS 1.2 ****/
extern ssize_t cupsBackChannelRead(char *buffer, size_t bytes,
- double timeout);
+ double timeout) _CUPS_API_1_2;
extern ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes,
- double timeout);
+ double timeout) _CUPS_API_1_2;
extern void cupsEncodeOptions2(ipp_t *ipp, int num_options,
cups_option_t *options,
- ipp_tag_t group_tag);
-extern const char *cupsLastErrorString(void);
-extern char *cupsNotifySubject(cups_lang_t *lang, ipp_t *event);
-extern char *cupsNotifyText(cups_lang_t *lang, ipp_t *event);
+ ipp_tag_t group_tag) _CUPS_API_1_2;
+extern const char *cupsLastErrorString(void) _CUPS_API_1_2;
+extern char *cupsNotifySubject(cups_lang_t *lang, ipp_t *event) _CUPS_API_1_2;
+extern char *cupsNotifyText(cups_lang_t *lang, ipp_t *event) _CUPS_API_1_2;
extern int cupsRemoveOption(const char *name, int num_options,
- cups_option_t **options);
-extern cups_file_t *cupsTempFile2(char *filename, int len);
+ cups_option_t **options) _CUPS_API_1_2;
+extern cups_file_t *cupsTempFile2(char *filename, int len) _CUPS_API_1_2;
/**** New in CUPS 1.3 ****/
extern ipp_t *cupsDoIORequest(http_t *http, ipp_t *request,
const char *resource, int infile,
- int outfile);
-extern char *cupsGetServerPPD(http_t *http, const char *name);
+ int outfile) _CUPS_API_1_3;
+extern char *cupsGetServerPPD(http_t *http, const char *name) _CUPS_API_1_3;
extern int cupsRemoveDest(const char *name,
const char *instance,
- int num_dests, cups_dest_t **dests);
+ int num_dests, cups_dest_t **dests) _CUPS_API_1_3;
extern void cupsSetDefaultDest(const char *name,
const char *instance,
int num_dests,
- cups_dest_t *dests);
+ cups_dest_t *dests) _CUPS_API_1_3;
/**** New in CUPS 1.4 ****/
extern http_status_t cupsGetPPD3(http_t *http, const char *name,
time_t *modtime, char *buffer,
- size_t bufsize);
+ size_t bufsize) _CUPS_API_1_4;
# ifdef __cplusplus
}
* Include necessary headers...
*/
+# include "versioning.h"
# include <sys/stat.h>
* Prototypes...
*/
-extern void cupsDirClose(cups_dir_t *dp);
-extern cups_dir_t *cupsDirOpen(const char *directory);
-extern cups_dentry_t *cupsDirRead(cups_dir_t *dp);
-extern void cupsDirRewind(cups_dir_t *dp);
+extern void cupsDirClose(cups_dir_t *dp) _CUPS_API_1_2;
+extern cups_dir_t *cupsDirOpen(const char *directory) _CUPS_API_1_2;
+extern cups_dentry_t *cupsDirRead(cups_dir_t *dp) _CUPS_API_1_2;
+extern void cupsDirRewind(cups_dir_t *dp) _CUPS_API_1_2;
# ifdef __cplusplus
* Include necessary headers...
*/
+# include "versioning.h"
# include <sys/types.h>
# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
# define __CUPS_SSIZE_T_DEFINED
* Prototypes...
*/
-extern int cupsFileClose(cups_file_t *fp);
-extern int cupsFileCompression(cups_file_t *fp);
-extern int cupsFileEOF(cups_file_t *fp);
+extern int cupsFileClose(cups_file_t *fp) _CUPS_API_1_2;
+extern int cupsFileCompression(cups_file_t *fp) _CUPS_API_1_2;
+extern int cupsFileEOF(cups_file_t *fp) _CUPS_API_1_2;
extern const char *cupsFileFind(const char *filename, const char *path,
int executable, char *buffer,
- int bufsize);
-extern int cupsFileFlush(cups_file_t *fp);
-extern int cupsFileGetChar(cups_file_t *fp);
+ int bufsize) _CUPS_API_1_2;
+extern int cupsFileFlush(cups_file_t *fp) _CUPS_API_1_2;
+extern int cupsFileGetChar(cups_file_t *fp) _CUPS_API_1_2;
extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen,
- char **value, int *linenum);
+ char **value, int *linenum) _CUPS_API_1_2;
extern size_t cupsFileGetLine(cups_file_t *fp, char *buf,
- size_t buflen);
-extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen);
-extern int cupsFileLock(cups_file_t *fp, int block);
-extern int cupsFileNumber(cups_file_t *fp);
-extern cups_file_t *cupsFileOpen(const char *filename, const char *mode);
-extern cups_file_t *cupsFileOpenFd(int fd, const char *mode);
-extern int cupsFilePeekChar(cups_file_t *fp);
-extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...);
-extern int cupsFilePutChar(cups_file_t *fp, int c);
-extern int cupsFilePuts(cups_file_t *fp, const char *s);
-extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes);
-extern off_t cupsFileRewind(cups_file_t *fp);
-extern off_t cupsFileSeek(cups_file_t *fp, off_t pos);
-extern cups_file_t *cupsFileStderr(void);
-extern cups_file_t *cupsFileStdin(void);
-extern cups_file_t *cupsFileStdout(void);
-extern off_t cupsFileTell(cups_file_t *fp);
-extern int cupsFileUnlock(cups_file_t *fp);
-extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes);
+ size_t buflen) _CUPS_API_1_2;
+extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen) _CUPS_API_1_2;
+extern int cupsFileLock(cups_file_t *fp, int block) _CUPS_API_1_2;
+extern int cupsFileNumber(cups_file_t *fp) _CUPS_API_1_2;
+extern cups_file_t *cupsFileOpen(const char *filename, const char *mode) _CUPS_API_1_2;
+extern cups_file_t *cupsFileOpenFd(int fd, const char *mode) _CUPS_API_1_2;
+extern int cupsFilePeekChar(cups_file_t *fp) _CUPS_API_1_2;
+extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...) _CUPS_API_1_2;
+extern int cupsFilePutChar(cups_file_t *fp, int c) _CUPS_API_1_2;
+extern int cupsFilePuts(cups_file_t *fp, const char *s) _CUPS_API_1_2;
+extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes) _CUPS_API_1_2;
+extern off_t cupsFileRewind(cups_file_t *fp) _CUPS_API_1_2;
+extern off_t cupsFileSeek(cups_file_t *fp, off_t pos) _CUPS_API_1_2;
+extern cups_file_t *cupsFileStderr(void) _CUPS_API_1_2;
+extern cups_file_t *cupsFileStdin(void) _CUPS_API_1_2;
+extern cups_file_t *cupsFileStdout(void) _CUPS_API_1_2;
+extern off_t cupsFileTell(cups_file_t *fp) _CUPS_API_1_2;
+extern int cupsFileUnlock(cups_file_t *fp) _CUPS_API_1_2;
+extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes) _CUPS_API_1_2;
# ifdef __cplusplus
"0123456789"
"-._~"
"%"
- "!$&'()*+,;=", *ptr))
+ "!$&'()*+,;=\\", *ptr))
{
*host = '\0';
return (HTTP_URI_BAD_HOSTNAME);
* Include necessary headers...
*/
+# include "versioning.h"
# include <string.h>
# include <time.h>
# include <sys/types.h>
# endif /* LOCAL_PEERCRED && !SO_PEERCRED */
# endif /* WIN32 */
-/*
- * With GCC 3.0 and higher, we can mark old APIs "deprecated" so you get
- * a warning at compile-time.
- */
-
-# if defined(__GNUC__) && __GNUC__ > 2
-# define _HTTP_DEPRECATED __attribute__ ((__deprecated__))
-# else
-# define _HTTP_DEPRECATED
-# endif /* __GNUC__ && __GNUC__ > 2 */
-
/*
* C++ magic...
# endif /* __GNUC__ */
;
extern int httpPut(http_t *http, const char *uri);
-extern int httpRead(http_t *http, char *buffer, int length) _HTTP_DEPRECATED;
+extern int httpRead(http_t *http, char *buffer, int length) _CUPS_DEPRECATED;
extern int httpReconnect(http_t *http);
extern void httpSeparate(const char *uri, char *method,
char *username, char *host, int *port,
- char *resource) _HTTP_DEPRECATED;
+ char *resource) _CUPS_DEPRECATED;
extern void httpSetField(http_t *http, http_field_t field,
const char *value);
extern const char *httpStatus(http_status_t status);
extern int httpTrace(http_t *http, const char *uri);
extern http_status_t httpUpdate(http_t *http);
-extern int httpWrite(http_t *http, const char *buffer, int length) _HTTP_DEPRECATED;
-extern char *httpEncode64(char *out, const char *in) _HTTP_DEPRECATED;
-extern char *httpDecode64(char *out, const char *in) _HTTP_DEPRECATED;
-extern int httpGetLength(http_t *http) _HTTP_DEPRECATED;
+extern int httpWrite(http_t *http, const char *buffer, int length) _CUPS_DEPRECATED;
+extern char *httpEncode64(char *out, const char *in) _CUPS_DEPRECATED;
+extern char *httpDecode64(char *out, const char *in) _CUPS_DEPRECATED;
+extern int httpGetLength(http_t *http) _CUPS_DEPRECATED;
extern char *httpMD5(const char *, const char *, const char *,
char [33]);
extern char *httpMD5Final(const char *, const char *, const char *,
extern char *httpMD5String(const unsigned char *, char [33]);
/**** New in CUPS 1.1.19 ****/
-extern void httpClearCookie(http_t *http);
-extern const char *httpGetCookie(http_t *http);
-extern void httpSetCookie(http_t *http, const char *cookie);
-extern int httpWait(http_t *http, int msec);
+extern void httpClearCookie(http_t *http) _CUPS_API_1_1_19;
+extern const char *httpGetCookie(http_t *http) _CUPS_API_1_1_19;
+extern void httpSetCookie(http_t *http, const char *cookie) _CUPS_API_1_1_19;
+extern int httpWait(http_t *http, int msec) _CUPS_API_1_1_19;
/**** New in CUPS 1.1.21 ****/
-extern char *httpDecode64_2(char *out, int *outlen, const char *in);
+extern char *httpDecode64_2(char *out, int *outlen, const char *in) _CUPS_API_1_1_21;
extern char *httpEncode64_2(char *out, int outlen, const char *in,
- int inlen);
+ int inlen) _CUPS_API_1_1_21;
extern void httpSeparate2(const char *uri,
char *method, int methodlen,
char *username, int usernamelen,
char *host, int hostlen, int *port,
- char *resource, int resourcelen) _HTTP_DEPRECATED;
+ char *resource, int resourcelen) _CUPS_DEPRECATED;
/**** New in CUPS 1.2 ****/
-extern int httpAddrAny(const http_addr_t *addr);
-extern http_addrlist_t *httpAddrConnect(http_addrlist_t *addrlist, int *sock);
+extern int httpAddrAny(const http_addr_t *addr) _CUPS_API_1_2;
+extern http_addrlist_t *httpAddrConnect(http_addrlist_t *addrlist, int *sock) _CUPS_API_1_2;
extern int httpAddrEqual(const http_addr_t *addr1,
- const http_addr_t *addr2);
-extern void httpAddrFreeList(http_addrlist_t *addrlist);
+ const http_addr_t *addr2) _CUPS_API_1_2;
+extern void httpAddrFreeList(http_addrlist_t *addrlist) _CUPS_API_1_2;
extern http_addrlist_t *httpAddrGetList(const char *hostname, int family,
- const char *service);
-extern int httpAddrLength(const http_addr_t *addr);
-extern int httpAddrLocalhost(const http_addr_t *addr);
+ const char *service) _CUPS_API_1_2;
+extern int httpAddrLength(const http_addr_t *addr) _CUPS_API_1_2;
+extern int httpAddrLocalhost(const http_addr_t *addr) _CUPS_API_1_2;
extern char *httpAddrLookup(const http_addr_t *addr,
- char *name, int namelen);
+ char *name, int namelen) _CUPS_API_1_2;
extern char *httpAddrString(const http_addr_t *addr,
- char *s, int slen);
+ char *s, int slen) _CUPS_API_1_2;
extern http_uri_status_t httpAssembleURI(http_uri_coding_t encoding,
char *uri, int urilen,
const char *scheme,
const char *username,
const char *host, int port,
- const char *resource);
+ const char *resource) _CUPS_API_1_2;
extern http_uri_status_t httpAssembleURIf(http_uri_coding_t encoding,
char *uri, int urilen,
const char *scheme,
const char *username,
const char *host, int port,
- const char *resourcef, ...);
-extern int httpFlushWrite(http_t *http);
-extern int httpGetBlocking(http_t *http);
-extern const char *httpGetDateString2(time_t t, char *s, int slen);
-extern int httpGetFd(http_t *http);
-extern const char *httpGetHostname(http_t *http, char *s, int slen);
-extern off_t httpGetLength2(http_t *http);
-extern http_status_t httpGetStatus(http_t *http);
+ const char *resourcef, ...) _CUPS_API_1_2;
+extern int httpFlushWrite(http_t *http) _CUPS_API_1_2;
+extern int httpGetBlocking(http_t *http) _CUPS_API_1_2;
+extern const char *httpGetDateString2(time_t t, char *s, int slen) _CUPS_API_1_2;
+extern int httpGetFd(http_t *http) _CUPS_API_1_2;
+extern const char *httpGetHostname(http_t *http, char *s, int slen) _CUPS_API_1_2;
+extern off_t httpGetLength2(http_t *http) _CUPS_API_1_2;
+extern http_status_t httpGetStatus(http_t *http) _CUPS_API_1_2;
extern char *httpGetSubField2(http_t *http, http_field_t field,
const char *name, char *value,
- int valuelen);
-extern ssize_t httpRead2(http_t *http, char *buffer, size_t length);
+ int valuelen) _CUPS_API_1_2;
+extern ssize_t httpRead2(http_t *http, char *buffer, size_t length) _CUPS_API_1_2;
extern http_uri_status_t httpSeparateURI(http_uri_coding_t decoding,
const char *uri,
char *scheme, int schemelen,
char *username, int usernamelen,
char *host, int hostlen, int *port,
- char *resource, int resourcelen);
-extern void httpSetExpect(http_t *http, http_status_t expect);
-extern void httpSetLength(http_t *http, size_t length);
+ char *resource, int resourcelen) _CUPS_API_1_2;
+extern void httpSetExpect(http_t *http, http_status_t expect) _CUPS_API_1_2;
+extern void httpSetLength(http_t *http, size_t length) _CUPS_API_1_2;
extern ssize_t httpWrite2(http_t *http, const char *buffer,
- size_t length);
+ size_t length) _CUPS_API_1_2;
/**** New in CUPS 1.3 ****/
-extern char *httpGetAuthString(http_t *http);
+extern char *httpGetAuthString(http_t *http) _CUPS_API_1_3;
extern void httpSetAuthString(http_t *http, const char *scheme,
- const char *data);
+ const char *data) _CUPS_API_1_3;
/*
* C++ magic...
/**** New in CUPS 1.1.19 ****/
extern ipp_attribute_t *ippAddCollection(ipp_t *ipp, ipp_tag_t group,
- const char *name, ipp_t *value);
+ const char *name, ipp_t *value) _CUPS_API_1_1_19;
extern ipp_attribute_t *ippAddCollections(ipp_t *ipp, ipp_tag_t group,
const char *name, int num_values,
- const ipp_t **values);
-extern void ippDeleteAttribute(ipp_t *ipp, ipp_attribute_t *attr);
-extern ipp_state_t ippReadFile(int fd, ipp_t *ipp);
-extern ipp_state_t ippWriteFile(int fd, ipp_t *ipp);
+ const ipp_t **values) _CUPS_API_1_1_19;
+extern void ippDeleteAttribute(ipp_t *ipp, ipp_attribute_t *attr) _CUPS_API_1_1_19;
+extern ipp_state_t ippReadFile(int fd, ipp_t *ipp) _CUPS_API_1_1_19;
+extern ipp_state_t ippWriteFile(int fd, ipp_t *ipp) _CUPS_API_1_1_19;
/**** New in CUPS 1.2 ****/
extern ipp_attribute_t *ippAddOctetString(ipp_t *ipp, ipp_tag_t group,
const char *name,
- const void *data, int datalen);
-extern ipp_status_t ippErrorValue(const char *name);
-extern ipp_t *ippNewRequest(ipp_op_t op);
-extern const char *ippOpString(ipp_op_t op);
-extern ipp_op_t ippOpValue(const char *name);
+ const void *data, int datalen) _CUPS_API_1_2;
+extern ipp_status_t ippErrorValue(const char *name) _CUPS_API_1_2;
+extern ipp_t *ippNewRequest(ipp_op_t op) _CUPS_API_1_2;
+extern const char *ippOpString(ipp_op_t op) _CUPS_API_1_2;
+extern ipp_op_t ippOpValue(const char *name) _CUPS_API_1_2;
extern ipp_state_t ippReadIO(void *src, ipp_iocb_t cb, int blocking,
- ipp_t *parent, ipp_t *ipp);
+ ipp_t *parent, ipp_t *ipp) _CUPS_API_1_2;
extern ipp_state_t ippWriteIO(void *dst, ipp_iocb_t cb, int blocking,
- ipp_t *parent, ipp_t *ipp);
+ ipp_t *parent, ipp_t *ipp) _CUPS_API_1_2;
/*
extern float ppdPageWidth(ppd_file_t *ppd, const char *name);
/**** New in CUPS 1.1.19 ****/
-extern const char *ppdErrorString(ppd_status_t status);
+extern const char *ppdErrorString(ppd_status_t status) _CUPS_API_1_1_19;
extern ppd_attr_t *ppdFindAttr(ppd_file_t *ppd, const char *name,
- const char *spec);
+ const char *spec) _CUPS_API_1_1_19;
extern ppd_attr_t *ppdFindNextAttr(ppd_file_t *ppd, const char *name,
- const char *spec);
-extern ppd_status_t ppdLastError(int *line);
+ const char *spec) _CUPS_API_1_1_19;
+extern ppd_status_t ppdLastError(int *line) _CUPS_API_1_1_19;
/**** New in CUPS 1.1.20 ****/
-extern void ppdSetConformance(ppd_conform_t c);
+extern void ppdSetConformance(ppd_conform_t c) _CUPS_API_1_1_20;
/**** New in CUPS 1.2 ****/
extern int ppdCollect2(ppd_file_t *ppd, ppd_section_t section,
- float min_order, ppd_choice_t ***choices);
+ float min_order, ppd_choice_t ***choices) _CUPS_API_1_2;
extern int ppdEmitAfterOrder(ppd_file_t *ppd, FILE *fp,
ppd_section_t section, int limit,
- float min_order);
-extern int ppdEmitJCLEnd(ppd_file_t *ppd, FILE *fp);
+ float min_order) _CUPS_API_1_2;
+extern int ppdEmitJCLEnd(ppd_file_t *ppd, FILE *fp) _CUPS_API_1_2;
extern char *ppdEmitString(ppd_file_t *ppd, ppd_section_t section,
- float min_order);
+ float min_order) _CUPS_API_1_2;
extern ppd_coption_t *ppdFindCustomOption(ppd_file_t *ppd,
- const char *keyword);
+ const char *keyword) _CUPS_API_1_2;
extern ppd_cparam_t *ppdFindCustomParam(ppd_coption_t *opt,
- const char *name);
-extern ppd_cparam_t *ppdFirstCustomParam(ppd_coption_t *opt);
-extern ppd_option_t *ppdFirstOption(ppd_file_t *ppd);
-extern ppd_cparam_t *ppdNextCustomParam(ppd_coption_t *opt);
-extern ppd_option_t *ppdNextOption(ppd_file_t *ppd);
-extern int ppdLocalize(ppd_file_t *ppd);
-extern ppd_file_t *ppdOpen2(cups_file_t *fp);
+ const char *name) _CUPS_API_1_2;
+extern ppd_cparam_t *ppdFirstCustomParam(ppd_coption_t *opt) _CUPS_API_1_2;
+extern ppd_option_t *ppdFirstOption(ppd_file_t *ppd) _CUPS_API_1_2;
+extern ppd_cparam_t *ppdNextCustomParam(ppd_coption_t *opt) _CUPS_API_1_2;
+extern ppd_option_t *ppdNextOption(ppd_file_t *ppd) _CUPS_API_1_2;
+extern int ppdLocalize(ppd_file_t *ppd) _CUPS_API_1_2;
+extern ppd_file_t *ppdOpen2(cups_file_t *fp) _CUPS_API_1_2;
/**** New in CUPS 1.3 ****/
extern const char *ppdLocalizeIPPReason(ppd_file_t *ppd,
const char *reason,
const char *scheme,
- char *buffer, size_t bufsize);
+ char *buffer, size_t bufsize) _CUPS_API_1_3;
/*
#ifndef _CUPS_SIDECHANNEL_H_
# define _CUPS_SIDECHANNEL_H_
+/*
+ * Include necessary headers...
+ */
+
+# include "versioning.h"
+
+
/*
* C++ magic...
*/
extern cups_sc_status_t cupsSideChannelDoRequest(cups_sc_command_t command,
char *data, int *datalen,
- double timeout);
+ double timeout) _CUPS_API_1_3;
extern int cupsSideChannelRead(cups_sc_command_t *command,
cups_sc_status_t *status,
char *data, int *datalen,
- double timeout);
+ double timeout) _CUPS_API_1_3;
extern int cupsSideChannelWrite(cups_sc_command_t command,
cups_sc_status_t status,
const char *data, int datalen,
- double timeout);
+ double timeout) _CUPS_API_1_3;
# ifdef __cplusplus
extern int cupsCharsetToUTF8(cups_utf8_t *dest,
const char *src,
const int maxout,
- const cups_encoding_t encoding);
+ const cups_encoding_t encoding) _CUPS_API_1_2;
extern int cupsUTF8ToCharset(char *dest,
const cups_utf8_t *src,
const int maxout,
- const cups_encoding_t encoding);
+ const cups_encoding_t encoding) _CUPS_API_1_2;
extern int cupsUTF8ToUTF32(cups_utf32_t *dest,
const cups_utf8_t *src,
- const int maxout);
+ const int maxout) _CUPS_API_1_2;
extern int cupsUTF32ToUTF8(cups_utf8_t *dest,
const cups_utf32_t *src,
- const int maxout);
+ const int maxout) _CUPS_API_1_2;
# ifdef __cplusplus
}
<H3><A NAME="IPP">Internet Printing Protocol (IPP)</A></H3>
-<P>IPP is the only protocol that CUPS supports natively, and is also supported by many network printers. We recommend using this protocol over others whenever the printer or server supports it. IPP printing normally happens over port 631 and uses the <tt>http</tt> and <tt>ipp</tt> URI schemes:</P>
+<P>IPP is the only protocol that CUPS supports natively and is supported by some network printers and print servers. However, since many printers do not implement IPP properly, only use IPP when the vendor actually documents official support for it. IPP printing normally happens over port 631 and uses the <tt>http</tt> and <tt>ipp</tt> URI schemes:</P>
<PRE>
http://<i>ip-address-or-hostname</i>:<i>port-number</i>/<i>resource</i>
lpd://<I>address</I>/pr3</TD>
</TR>
<TR>
- <TD>Hewlett Packard JetDirect w/o IPP</TD>
+ <TD>Hewlett Packard JetDirect</TD>
<TD>socket://<I>address</I>:9100<BR>
socket://<I>address</I>:9101<BR>
socket://<I>address</I>:9102</TD>
</TR>
-<TR>
- <TD>Hewlett Packard JetDirect w/IPP</TD>
- <TD>ipp://<I>address</I>/ipp<BR>
- ipp://<I>address</I>/ipp/port1<BR>
- ipp://<I>address</I>/ipp/port2<BR>
- ipp://<I>address</I>/ipp/port3</TD>
-</TR>
<TR>
<TD>Intel® NetportExpress XL, PRO/100</TD>
<TD>lpd://<I>address</I>/LPT1_PASSTHRU<BR>
* Prototypes...
*/
-extern void cupsImageClose(cups_image_t *img);
+extern void cupsImageClose(cups_image_t *img) _CUPS_API_1_2;
extern void cupsImageCMYKToBlack(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageCMYKToCMY(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageCMYKToCMYK(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageCMYKToRGB(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageCMYKToWhite(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern int cupsImageGetCol(cups_image_t *img, int x, int y,
- int height, cups_ib_t *pixels);
-extern cups_icspace_t cupsImageGetColorSpace(cups_image_t *img);
-extern int cupsImageGetDepth(cups_image_t *img);
-extern unsigned cupsImageGetHeight(cups_image_t *img);
+ int height, cups_ib_t *pixels) _CUPS_API_1_2;
+extern cups_icspace_t cupsImageGetColorSpace(cups_image_t *img) _CUPS_API_1_2;
+extern int cupsImageGetDepth(cups_image_t *img) _CUPS_API_1_2;
+extern unsigned cupsImageGetHeight(cups_image_t *img) _CUPS_API_1_2;
extern int cupsImageGetRow(cups_image_t *img, int x, int y,
- int width, cups_ib_t *pixels);
-extern unsigned cupsImageGetWidth(cups_image_t *img);
-extern unsigned cupsImageGetXPPI(cups_image_t *img);
-extern unsigned cupsImageGetYPPI(cups_image_t *img);
+ int width, cups_ib_t *pixels) _CUPS_API_1_2;
+extern unsigned cupsImageGetWidth(cups_image_t *img) _CUPS_API_1_2;
+extern unsigned cupsImageGetXPPI(cups_image_t *img) _CUPS_API_1_2;
+extern unsigned cupsImageGetYPPI(cups_image_t *img) _CUPS_API_1_2;
extern void cupsImageLut(cups_ib_t *pixels, int count,
- const cups_ib_t *lut);
+ const cups_ib_t *lut) _CUPS_API_1_2;
extern cups_image_t *cupsImageOpen(const char *filename,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
- const cups_ib_t *lut);
+ const cups_ib_t *lut) _CUPS_API_1_2;
extern void cupsImageRGBAdjust(cups_ib_t *pixels, int count,
- int saturation, int hue);
+ int saturation, int hue) _CUPS_API_1_2;
extern void cupsImageRGBToBlack(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageRGBToCMY(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageRGBToCMYK(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageRGBToRGB(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageRGBToWhite(const cups_ib_t *in,
- cups_ib_t *out, int count);
-extern void cupsImageSetMaxTiles(cups_image_t *img, int max_tiles);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
+extern void cupsImageSetMaxTiles(cups_image_t *img, int max_tiles) _CUPS_API_1_2;
extern void cupsImageSetProfile(float d, float g,
- float matrix[3][3]);
-extern void cupsImageSetRasterColorSpace(cups_cspace_t cs);
+ float matrix[3][3]) _CUPS_API_1_2;
+extern void cupsImageSetRasterColorSpace(cups_cspace_t cs) _CUPS_API_1_2;
extern void cupsImageWhiteToBlack(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageWhiteToCMY(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageWhiteToCMYK(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageWhiteToRGB(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
extern void cupsImageWhiteToWhite(const cups_ib_t *in,
- cups_ib_t *out, int count);
+ cups_ib_t *out, int count) _CUPS_API_1_2;
# ifdef __cplusplus
ppd_file_t *ppd,
int num_options,
cups_option_t *options,
- cups_interpret_cb_t func);
+ cups_interpret_cb_t func) _CUPS_API_1_2;
extern unsigned cupsRasterReadHeader2(cups_raster_t *r,
- cups_page_header2_t *h);
+ cups_page_header2_t *h) _CUPS_API_1_2;
extern unsigned cupsRasterWriteHeader2(cups_raster_t *r,
- cups_page_header2_t *h);
+ cups_page_header2_t *h) _CUPS_API_1_2;
/**** New in CUPS 1.3 ****/
-extern const char *cupsRasterErrorString(void);
+extern const char *cupsRasterErrorString(void) _CUPS_API_1_3;
# ifdef __cplusplus
}
.\" which should have been included with this file. If this file is
.\" file is missing or damaged, see the license at "http://www.cups.org/".
.\"
-.TH cupsfilter 8 "Common UNIX Printing System" "29 August 2007" "Apple Inc."
+.TH cupsfilter 8 "Common UNIX Printing System" "19 October 2007" "Apple Inc."
.SH NAME
cupsfilter \- convert a file to another format using cups filters
.SH SYNOPSIS
.I config-file
] -j
.I job-id[,N]
--m
+[ -m
.I mime/type
-[ -n
+] [ -n
.I copies
] [ -o
.I name=value
.SH DESCRIPTION
\fIcupsfilter\fR is a front-end to the CUPS filter subsystem which allows you
to convert a file to a specific format, just as if you had printed the file
-through CUPS.
+through CUPS. By default, \fIcupsfilter\fR generates a PDF file.
.SH OPTIONS
.TP 5
-c config-file
.TP 5
-m mime/type
.br
-Specifies the destination file type.
+Specifies the destination file type. The default file type is application/pdf.
.TP 5
-n copies
.br
-t title
.br
Specifies the document title.
+.SH KNOWN ISSUES
+\fIcupsfilter\fR currently does not use the filters defined in the PPD file.
+This will be addressed in a future CUPS release.
.SH SEE ALSO
\fIcupsd.conf(5)\fR
.br
*/
con->best = cupsdFindBest(con->uri, con->http.state);
+ con->type = AUTH_NONE;
cupsdLogMessage(CUPSD_LOG_DEBUG2,
"cupsdAuthorize: con->uri=\"%s\", con->best=%p(%s)",
}
#endif /* HAVE_AUTHORIZATION_H */
- if (type == AUTH_NONE)
- {
- /*
- * No authorization required, return early...
- */
-
- cupsdLogMessage(CUPSD_LOG_DEBUG,
- "cupsdAuthorize: No authentication required.");
- return;
- }
- else if (!*authorization)
+ if (!*authorization)
{
/*
* No authorization data provided, return early...
username);
AuthorizationFreeItemSet(authinfo);
+
+ con->type = AUTH_BASIC;
}
#endif /* HAVE_AUTHORIZATION_H */
#if defined(SO_PEERCRED) && defined(AF_LOCAL)
cupsdLogMessage(CUPSD_LOG_DEBUG,
"cupsdAuthorize: Authorized as %s using PeerCred",
username);
+
+ con->type = AUTH_BASIC;
}
#endif /* SO_PEERCRED && AF_LOCAL */
else if (!strncmp(authorization, "Local", 5) &&
"found!");
return;
}
+
+ con->type = AUTH_BASIC;
}
- else if (!strncmp(authorization, "Basic", 5) &&
- (type == AUTH_BASIC || type == AUTH_BASICDIGEST))
+ else if (!strncmp(authorization, "Basic", 5))
{
/*
* Get the Basic authentication data...
switch (type)
{
+ default :
case AUTH_BASIC :
{
#if HAVE_LIBPAM
username);
break;
}
+
+ con->type = type;
}
- else if (!strncmp(authorization, "Digest", 6) && type == AUTH_DIGEST)
+ else if (!strncmp(authorization, "Digest", 6))
{
/*
* Get the username, password, and nonce from the Digest attributes...
cupsdLogMessage(CUPSD_LOG_DEBUG,
"cupsdAuthorize: Authorized as %s using Digest",
username);
+
+ con->type = AUTH_DIGEST;
}
#ifdef HAVE_GSSAPI
else if (!strncmp(authorization, "Negotiate", 9))
gss_delete_sec_context(&minor_status, &context, GSS_C_NO_BUFFER);
con->gss_have_creds = 1;
+
+ con->type = AUTH_NEGOTIATE;
}
else
gss_release_name(&minor_status, &client_name);
}
#endif /* HAVE_GSSAPI */
- else if (type != AUTH_NONE)
+ else
{
char scheme[256]; /* Auth scheme... */
- static const char * const types[] = /* Auth types */
- {
- "None",
- "Basic",
- "Digest",
- "BasicDigest",
- "Negotiate"
- };
if (sscanf(authorization, "%255s", scheme) != 1)
strcpy(scheme, "UNKNOWN");
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Bad authentication data \"%s ...\", expected \"%s ...\"",
- scheme, types[type]);
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Bad authentication data \"%s ...\"",
+ scheme);
return;
}
const char *owner)/* I - Owner of object */
{
int i, j, /* Looping vars */
- auth; /* Authorization status */
+ auth, /* Authorization status */
+ type; /* Type of authentication */
unsigned address[4]; /* Authorization address */
cupsd_location_t *best; /* Best match for location so far */
int hostlen; /* Length of hostname */
};
static const char * const types[] = /* Auth types */
{
- "NONE",
- "BASIC",
- "DIGEST",
- "BASICDIGEST",
- "KERBEROS"
+ "None",
+ "Basic",
+ "Digest",
+ "BasicDigest",
+ "Negotiate"
};
best = con->best;
+ if ((type = best->type) == AUTH_DEFAULT)
+ type = DefaultAuthType;
+
cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdIsAuthorized: level=AUTH_%s, type=AUTH_%s, "
+ "cupsdIsAuthorized: level=AUTH_%s, type=%s, "
"satisfy=AUTH_SATISFY_%s, num_names=%d",
- levels[best->level], types[best->type],
+ levels[best->level], types[type],
best->satisfy ? "ANY" : "ALL", best->num_names);
if (best->limit == AUTH_LIMIT_IPP)
if ((best->encryption >= HTTP_ENCRYPT_REQUIRED && !con->http.tls &&
strcasecmp(con->http.hostname, "localhost") &&
best->satisfy == AUTH_SATISFY_ALL) &&
- !(best->type == AUTH_NEGOTIATE ||
- (best->type == AUTH_NONE && DefaultAuthType == AUTH_NEGOTIATE)))
+ !(type == AUTH_NEGOTIATE ||
+ (type == AUTH_NONE && DefaultAuthType == AUTH_NEGOTIATE)))
{
cupsdLogMessage(CUPSD_LOG_DEBUG,
"cupsdIsAuthorized: Need upgrade to TLS...");
*/
if (best->level == AUTH_ANON || /* Anonymous access - allow it */
- (best->type == AUTH_NONE && best->num_names == 0))
+ (type == AUTH_NONE && best->num_names == 0))
return (HTTP_OK);
- if (!con->username[0] && best->type == AUTH_NONE &&
+ if (!con->username[0] && type == AUTH_NONE &&
best->limit == AUTH_LIMIT_IPP)
{
/*
return (HTTP_OK); /* unless overridden with Satisfy */
}
+ if (con->type != type && type != AUTH_NONE &&
+ (con->type != AUTH_BASIC || type != AUTH_BASICDIGEST))
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Authorized using %s, expected %s!",
+ types[con->type], types[type]);
+
+ return (HTTP_UNAUTHORIZED);
+ }
+
strlcpy(username, con->username, sizeof(username));
}
time_t start; /* Request start time */
http_state_t operation; /* Request operation */
off_t bytes; /* Bytes transferred for this request */
+ int type; /* AuthType for username */
char username[256], /* Username from Authorization: line */
password[33], /* Password from Authorization: line */
uri[HTTP_MAX_URI],
else if (pclass->type & CUPS_PRINTER_IMPLICIT)
{
/*
- * Check the default policy, then tename the implicit class to "AnyClass"
+ * Check the default policy, then rename the implicit class to "AnyClass"
* or remove it...
*/
else if ((status = cupsdCheckPolicy(pclass->op_policy_ptr, con,
NULL)) != HTTP_OK)
{
- send_http_error(con, status, NULL);
+ send_http_error(con, status, pclass);
return;
}
else
else if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con,
NULL)) != HTTP_OK)
{
- send_http_error(con, status, NULL);
+ send_http_error(con, status, printer);
return;
}
else
* Do we have a valid device URI?
*/
+ http_uri_status_t uri_status; /* URI separation status */
+
+
need_restart_job = 1;
- httpSeparateURI(HTTP_URI_CODING_ALL, attr->values[0].string.text, scheme,
- sizeof(scheme), username, sizeof(username), host,
- sizeof(host), &port, resource, sizeof(resource));
+ uri_status = httpSeparateURI(HTTP_URI_CODING_ALL,
+ attr->values[0].string.text,
+ scheme, sizeof(scheme),
+ username, sizeof(username),
+ host, sizeof(host), &port,
+ resource, sizeof(resource));
+
+ if (uri_status < HTTP_URI_OK)
+ {
+ send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad device-uri \"%s\"!"),
+ attr->values[0].string.text);
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "add_printer: httpSeparateURI returned %d", uri_status);
+ return;
+ }
if (!strcmp(scheme, "file"))
{
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, NULL);
+ send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, NULL);
+ send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
return;
}
if ((status = cupsdCheckPolicy(dest->op_policy_ptr, con, NULL)) != HTTP_OK)
{
- send_http_error(con, status, NULL);
+ send_http_error(con, status, dest);
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, NULL);
+ send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, NULL);
+ send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, NULL);
+ send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, NULL);
+ send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, NULL);
+ send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
return;
}
printer && printer->num_auth_info_required > 0 &&
!strcmp(printer->auth_info_required[0], "negotiate"))
cupsdSendError(con, status, AUTH_NEGOTIATE);
+ else if (printer)
+ {
+ char resource[HTTP_MAX_URI]; /* Resource portion of URI */
+ cupsd_location_t *auth; /* Pointer to authentication element */
+
+
+ if (printer->type & CUPS_PRINTER_CLASS)
+ snprintf(resource, sizeof(resource), "/classes/%s", printer->name);
+ else
+ snprintf(resource, sizeof(resource), "/printers/%s", printer->name);
+
+ if ((auth = cupsdFindBest(resource, HTTP_POST)) == NULL ||
+ auth->type == AUTH_NONE)
+ auth = cupsdFindPolicyOp(printer->op_policy_ptr, IPP_PRINT_JOB);
+
+ cupsdSendError(con, status, auth ? auth->type : AUTH_NONE);
+ }
else
cupsdSendError(con, status, AUTH_NONE);
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, NULL);
+ send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
return;
}
}
if (SAMBAServer == NULL)
+ {
SAMBAServer = cupsServer();
+ if (SAMBAServer[0] == '/') /* Use localhost instead of domain socket */
+ SAMBAServer = "localhost";
+ }
+
if ((status = export_dest(http, argv[i])) != 0)
return (status);
}
*/
if (SAMBAServer == NULL)
+ {
SAMBAServer = cupsServer();
+ if (SAMBAServer[0] == '/') /* Use localhost instead of domain socket */
+ SAMBAServer = "localhost";
+ }
+
num_dests = cupsGetDests2(http, &dests);
for (j = 0, status = 0; j < num_dests; j ++)