root/trunk/fink/main/finkinfo/lprng.patch
Revision 124, 10.2 kB (checked in by broder, 17 years ago) |
---|
-
LPRng-3.8.28/src/common/krb5_auth.c
old new 61 61 KRB5_PROTOTYPE((krb5_context, 62 62 krb5_pointer, 63 63 krb5_data *)); 64 65 #define SOCKET int 66 #define SOCKET_ERRNO errno 67 #define SOCKET_EINTR EINTR 68 #define SOCKET_READ(a,b,c) read(a,b,c) 69 #define SOCKET_WRITE(a,b,c) write(a,b,c) 70 #define krb5_xfree(a) free((char*)(a)) 71 /* 72 * lib/krb5/os/net_read.c 73 * 74 * Copyright 1987, 1988, 1990 by the Massachusetts Institute of Technology. 75 * All Rights Reserved. 76 * 77 * Export of this software from the United States of America may 78 * require a specific license from the United States Government. 79 * It is the responsibility of any person or organization contemplating 80 * export to obtain such a license before exporting. 81 * 82 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and 83 * distribute this software and its documentation for any purpose and 84 * without fee is hereby granted, provided that the above copyright 85 * notice appear in all copies and that both that copyright notice and 86 * this permission notice appear in supporting documentation, and that 87 * the name of M.I.T. not be used in advertising or publicity pertaining 88 * to distribution of the software without specific, written prior 89 * permission. Furthermore if you modify this software you must label 90 * your software as modified software and not distribute it in such a 91 * fashion that it might be confused with the original M.I.T. software. 92 * M.I.T. makes no representations about the suitability of 93 * this software for any purpose. It is provided "as is" without express 94 * or implied warranty. 95 * 96 */ 97 98 /* 99 * krb5_net_read() reads from the file descriptor "fd" to the buffer 100 * "buf", until either 1) "len" bytes have been read or 2) cannot 101 * read anymore from "fd". It returns the number of bytes read 102 * or a read() error. (The calling interface is identical to 103 * read(2).) 104 * 105 * XXX must not use non-blocking I/O 106 */ 107 108 int 109 krb5_net_read(krb5_context context, int fd, register char *buf, register int len) 110 { 111 int cc, len2 = 0; 112 113 do { 114 cc = SOCKET_READ((SOCKET)fd, buf, len); 115 if (cc < 0) { 116 if (SOCKET_ERRNO == SOCKET_EINTR) 117 continue; 118 119 /* XXX this interface sucks! */ 120 errno = SOCKET_ERRNO; 121 122 return(cc); /* errno is already set */ 123 } 124 else if (cc == 0) { 125 return(len2); 126 } else { 127 buf += cc; 128 len2 += cc; 129 len -= cc; 130 } 131 } while (len > 0); 132 return(len2); 133 } 134 /* 135 * lib/krb5/os/net_write.c 136 * 137 * Copyright 1987, 1988, 1990 by the Massachusetts Institute of Technology. 138 * All Rights Reserved. 139 * 140 * Export of this software from the United States of America may 141 * require a specific license from the United States Government. 142 * It is the responsibility of any person or organization contemplating 143 * export to obtain such a license before exporting. 144 * 145 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and 146 * distribute this software and its documentation for any purpose and 147 * without fee is hereby granted, provided that the above copyright 148 * notice appear in all copies and that both that copyright notice and 149 * this permission notice appear in supporting documentation, and that 150 * the name of M.I.T. not be used in advertising or publicity pertaining 151 * to distribution of the software without specific, written prior 152 * permission. Furthermore if you modify this software you must label 153 * your software as modified software and not distribute it in such a 154 * fashion that it might be confused with the original M.I.T. software. 155 * M.I.T. makes no representations about the suitability of 156 * this software for any purpose. It is provided "as is" without express 157 * or implied warranty. 158 * 159 */ 160 161 /* 162 * krb5_net_write() writes "len" bytes from "buf" to the file 163 * descriptor "fd". It returns the number of bytes written or 164 * a write() error. (The calling interface is identical to 165 * write(2).) 166 * 167 * XXX must not use non-blocking I/O 168 */ 169 170 int 171 krb5_net_write(krb5_context context, int fd, register const char *buf, int len) 172 { 173 int cc; 174 register int wrlen = len; 175 do { 176 cc = SOCKET_WRITE((SOCKET)fd, buf, wrlen); 177 if (cc < 0) { 178 if (SOCKET_ERRNO == SOCKET_EINTR) 179 continue; 180 181 /* XXX this interface sucks! */ 182 errno = SOCKET_ERRNO; 183 184 return(cc); 185 } 186 else { 187 buf += cc; 188 wrlen -= cc; 189 } 190 } while (wrlen > 0); 191 return(len); 192 } 193 /* 194 * lib/krb5/os/read_msg.c 195 * 196 * Copyright 1991 by the Massachusetts Institute of Technology. 197 * All Rights Reserved. 198 * 199 * Export of this software from the United States of America may 200 * require a specific license from the United States Government. 201 * It is the responsibility of any person or organization contemplating 202 * export to obtain such a license before exporting. 203 * 204 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and 205 * distribute this software and its documentation for any purpose and 206 * without fee is hereby granted, provided that the above copyright 207 * notice appear in all copies and that both that copyright notice and 208 * this permission notice appear in supporting documentation, and that 209 * the name of M.I.T. not be used in advertising or publicity pertaining 210 * to distribution of the software without specific, written prior 211 * permission. Furthermore if you modify this software you must label 212 * your software as modified software and not distribute it in such a 213 * fashion that it might be confused with the original M.I.T. software. 214 * M.I.T. makes no representations about the suitability of 215 * this software for any purpose. It is provided "as is" without express 216 * or implied warranty. 217 * 218 * 219 * Write a message to the network 220 */ 221 222 krb5_error_code 223 krb5_read_message(krb5_context context, krb5_pointer fdp, krb5_data *inbuf) 224 { 225 krb5_int32 len; 226 int len2, ilen; 227 char *buf = NULL; 228 int fd = *( (int *) fdp); 229 230 if ((len2 = krb5_net_read(context, fd, (char *)&len, 4)) != 4) 231 return((len2 < 0) ? errno : ECONNABORTED); 232 len = ntohl(len); 233 234 if ((len & VALID_UINT_BITS) != len) /* Overflow size_t??? */ 235 return ENOMEM; 236 237 inbuf->length = ilen = (int) len; 238 if (ilen) { 239 /* 240 * We may want to include a sanity check here someday.... 241 */ 242 if (!(buf = malloc(ilen))) { 243 return(ENOMEM); 244 } 245 if ((len2 = krb5_net_read(context, fd, buf, ilen)) != ilen) { 246 krb5_xfree(buf); 247 return((len2 < 0) ? errno : ECONNABORTED); 248 } 249 } 250 inbuf->data = buf; 251 return(0); 252 } 253 /* 254 * lib/krb5/os/write_msg.c 255 * 256 * Copyright 1991 by the Massachusetts Institute of Technology. 257 * All Rights Reserved. 258 * 259 * Export of this software from the United States of America may 260 * require a specific license from the United States Government. 261 * It is the responsibility of any person or organization contemplating 262 * export to obtain such a license before exporting. 263 * 264 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and 265 * distribute this software and its documentation for any purpose and 266 * without fee is hereby granted, provided that the above copyright 267 * notice appear in all copies and that both that copyright notice and 268 * this permission notice appear in supporting documentation, and that 269 * the name of M.I.T. not be used in advertising or publicity pertaining 270 * to distribution of the software without specific, written prior 271 * permission. Furthermore if you modify this software you must label 272 * your software as modified software and not distribute it in such a 273 * fashion that it might be confused with the original M.I.T. software. 274 * M.I.T. makes no representations about the suitability of 275 * this software for any purpose. It is provided "as is" without express 276 * or implied warranty. 277 * 278 * 279 * convenience sendauth/recvauth functions 280 */ 281 282 krb5_error_code 283 krb5_write_message(krb5_context context, krb5_pointer fdp, krb5_data *outbuf) 284 { 285 krb5_int32 len; 286 int fd = *( (int *) fdp); 287 288 len = htonl(outbuf->length); 289 if (krb5_net_write(context, fd, (char *)&len, 4) < 0) { 290 return(errno); 291 } 292 if (outbuf->length && (krb5_net_write(context, fd, outbuf->data, outbuf->length) < 0)) { 293 return(errno); 294 } 295 return(0); 296 } 64 297 /* 65 298 * server_krb5_auth( 66 299 * char *keytabfile, server key tab file - /etc/lpr.keytab -
LPRng-3.8.28/src/common/proctitle.c
old new 174 174 # endif 175 175 # if SPT_TYPE == SPT_PSSTRINGS 176 176 # include <machine/vmparam.h> 177 # include <sys/exec.h>177 //# include <sys/exec.h> 178 178 # ifndef PS_STRINGS /* hmmmm.... apparently not available after all */ 179 179 # undef SPT_TYPE 180 180 # define SPT_TYPE SPT_REUSEARGV
Note: See TracBrowser for help on using the browser.