~ubuntu-branches/ubuntu/maverick/xorg-server/maverick-security

« back to all changes in this revision

Viewing changes to include/os.h

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2010-08-05 11:25:14 UTC
  • mfrom: (1.1.35 upstream) (0.1.14 experimental)
  • Revision ID: james.westby@ubuntu.com-20100805112514-q4efdgj3nblevos2
Tags: 2:1.8.99.905-1ubuntu1
* Merge from (unreleased) Debian experimental.  Remaining Ubuntu changes:
  - rules, control:
    + Disable SELinux, libaudit-dev is not in main yet (LP 406226).
      Drop libaudit-dev from build-deps.
  - rules: Enable xcsecurity (LP 247537).
  - local/xvfb-run*: Add correct docs about error codes (LP 328205)
  - rules: Add --with-extra-module-dir to support GL alternatives.
  - control: Xvfb depends on xauth, x11-xkb-utils. (LP 500102)
  - rules, local/64-xorg-xkb.rules: Don't use keyboard-configuration
    until it's available.
  - control: Update some versioned Breaks for Ubuntu versions.
  - debian/patches:
    + 100_rethrow_signals.patch:
      When aborting, re-raise signals for apport
    + 109_fix-swcursor-crash.patch:
      Avoid dereferencing null pointer while reloading cursors during
      resume. (LP 371405)
    + 111_armel-drv-fallbacks.patch:
      Add support for armel driver fallbacks.
    + 121_only_switch_vt_when_active.diff:
      Add a check to prevent the X server from changing the VT when killing
      GDM from the console.
    + 122_xext_fix_card32_overflow_in_xauth.patch:
      Fix server crash when “xauth generate” is called with large timeout.
    + 157_check_null_modes.patch, 162_null_crtc_in_rotation.patch,
      166_nullptr_xinerama_keyrepeat.patch, 167_nullptr_xisbread.patch
      169_mipointer_nullptr_checks.patch,
      172_cwgetbackingpicture_nullptr_check.patch:
      Fix various segfaults in xserver by checking pointers for NULL
      values before dereferencing them.
    + 165_man_xorg_conf_no_device_ident.patch
      Correct man page
    + 168_glibc_trace_to_stderr.patch:
      Report abort traces to stderr instead of terminal
    + 184_virtual_devices_autodetect.patch:
      Use vesa for qemu device, which is not supported by cirrus
    + 187_edid_quirk_hp_nc8430.patch:
      Quirk for another LPL monitor (LP 380009)
    + 188_default_primary_to_first_busid.patch:
      Pick the first device and carry on (LP 459512)
    + 189_xserver_1.5.0_bg_none_root.patch:
      Create a root window with no background.
    + 190_cache-xkbcomp_output_for_fast_start_up.patch:
      Cache keyboard settings.
    + 191-Xorg-add-an-extra-module-path.patch:
      Add support for the alternatives module path.
    + 197_xvfb-randr.patch:
      Adds xrandr support to xvfb. (LP 516123)
    + 198_nohwaccess.patch:
      Adds a -nohwaccess argument to make X not access the hardware
      ports directly.
    + 200_randr-null.patch:
      Clarify a pointer initialization.
* Update changelog entries for 1.8.1.902-1 which became 1.8.99.904-1
* Drop 196_xvfbscreeninit-handling.patch: it's semantically empty, and now 
  doesn't apply.  Merge remaining #include change into 197_xvfb-randr.patch
* New upstream version will start correctly when no outputs are connected,
  as long as the video driver can dynamically resize the framebuffer
  (true for all KMS drivers) (LP: #337889)
* New upstream version fixes crash on non-admin logout with KDE (LP: #569879)
* Refresh 111_armel-drv-fallbacks.patch to fix the build on armel

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
 
215
215
#ifndef _HAVE_XALLOC_DECLS
216
216
#define _HAVE_XALLOC_DECLS
217
 
extern _X_EXPORT pointer Xalloc(unsigned long /*amount*/);
218
 
extern _X_EXPORT pointer Xcalloc(unsigned long /*amount*/);
219
 
extern _X_EXPORT pointer Xrealloc(pointer /*ptr*/, unsigned long /*amount*/);
220
 
extern _X_EXPORT void Xfree(pointer /*ptr*/);
 
217
 
 
218
/*
 
219
 * Use malloc(3) instead.
 
220
 */
 
221
extern _X_EXPORT void *Xalloc(unsigned long /*amount*/) _X_DEPRECATED;
 
222
/*
 
223
 * Use calloc(3) instead
 
224
 */
 
225
extern _X_EXPORT void *Xcalloc(unsigned long /*amount*/) _X_DEPRECATED;
 
226
/*
 
227
 * Use realloc(3) instead
 
228
 */
 
229
extern _X_EXPORT void *Xrealloc(void * /*ptr*/, unsigned long /*amount*/)
 
230
    _X_DEPRECATED;
 
231
/*
 
232
 * Use free(3) instead
 
233
 */
 
234
extern _X_EXPORT void Xfree(void * /*ptr*/) _X_DEPRECATED;
 
235
 
221
236
#endif
222
237
 
223
 
extern _X_EXPORT pointer XNFalloc(unsigned long /*amount*/);
224
 
extern _X_EXPORT pointer XNFcalloc(unsigned long /*amount*/);
225
 
extern _X_EXPORT pointer XNFrealloc(pointer /*ptr*/, unsigned long /*amount*/);
 
238
/*
 
239
 * This function malloc(3)s buffer, terminating the server if there is not
 
240
 * enough memory.
 
241
 */
 
242
extern _X_EXPORT void *XNFalloc(unsigned long /*amount*/);
 
243
/*
 
244
 * This function calloc(3)s buffer, terminating the server if there is not
 
245
 * enough memory.
 
246
 */
 
247
extern _X_EXPORT void *XNFcalloc(unsigned long /*amount*/);
 
248
/*
 
249
 * This function realloc(3)s passed buffer, terminating the server if there is
 
250
 * not enough memory.
 
251
 */
 
252
extern _X_EXPORT void *XNFrealloc(void * /*ptr*/, unsigned long /*amount*/);
226
253
 
 
254
/*
 
255
 * This function strdup(3)s passed string. The only difference from the library
 
256
 * function that it is safe to pass NULL, as NULL will be returned.
 
257
 */
227
258
extern _X_EXPORT char *Xstrdup(const char *s);
 
259
 
 
260
/*
 
261
 * This function strdup(3)s passed string, terminating the server if there is
 
262
 * not enough memory. If NULL is passed to this function, NULL is returned.
 
263
 */
228
264
extern _X_EXPORT char *XNFstrdup(const char *s);
229
 
extern _X_EXPORT char *Xprintf(const char *fmt, ...);
 
265
 
 
266
extern _X_EXPORT char *Xprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
230
267
extern _X_EXPORT char *Xvprintf(const char *fmt, va_list va);
231
 
extern _X_EXPORT char *XNFprintf(const char *fmt, ...);
 
268
extern _X_EXPORT char *XNFprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
232
269
extern _X_EXPORT char *XNFvprintf(const char *fmt, va_list va);
233
270
 
234
271
typedef void (*OsSigHandlerPtr)(int /* sig */);
262
299
 
263
300
extern _X_EXPORT void OsReleaseSignals (void);
264
301
 
265
 
extern _X_EXPORT void OsAbort (void);
 
302
extern _X_EXPORT void OsAbort (void) _X_NORETURN;
266
303
 
267
304
#if !defined(WIN32)
268
305
extern _X_EXPORT int System(char *);
285
322
    ClientPtr   /*client*/,
286
323
    int         /*family*/,
287
324
    unsigned    /*length*/,
288
 
    pointer     /*pAddr*/);
 
325
    const void */*pAddr*/);
289
326
 
290
327
extern _X_EXPORT Bool ForEachHostInFamily (
291
328
    int     /*family*/,
369
406
 
370
407
extern _X_EXPORT XID CheckAuthorization(
371
408
    unsigned int /*namelength*/,
372
 
    char * /*name*/,
 
409
    const char * /*name*/,
373
410
    unsigned int /*datalength*/,
374
 
    char * /*data*/,
 
411
    const char * /*data*/,
375
412
    ClientPtr /*client*/,
376
413
    char ** /*reason*/
377
414
);
380
417
 
381
418
extern _X_EXPORT int RemoveAuthorization (
382
419
    unsigned short      name_length,
383
 
    char                *name,
 
420
    const char          *name,
384
421
    unsigned short      data_length,
385
 
    char                *data);
 
422
    const char          *data);
386
423
 
387
424
extern _X_EXPORT int AddAuthorization(
388
425
    unsigned int        /*name_length*/,
389
 
    char *              /*name*/,
 
426
    const char *        /*name*/,
390
427
    unsigned int        /*data_length*/,
391
428
    char *              /*data*/);
392
429
 
393
430
#ifdef XCSECURITY
394
431
extern _X_EXPORT XID GenerateAuthorization(
395
432
    unsigned int   /* name_length */,
396
 
    char        *  /* name */,
 
433
    const char  *  /* name */,
397
434
    unsigned int   /* data_length */,
398
 
    char        *  /* data */,
 
435
    const char  *  /* data */,
399
436
    unsigned int * /* data_length_return */,
400
437
    char        ** /* data_return */);
401
438
#endif
488
525
    X_UNKNOWN = -1              /* unknown -- this must always be last */
489
526
} MessageType;
490
527
 
491
 
/* XXX Need to check which GCC versions have the format(printf) attribute. */
492
 
#if defined(__GNUC__) && (__GNUC__ > 2)
493
 
#define _printf_attribute(a,b) __attribute((format(__printf__,a,b)))
494
 
#else
495
 
#define _printf_attribute(a,b) /**/
496
 
#endif
497
 
 
498
528
extern _X_EXPORT const char *LogInit(const char *fname, const char *backup);
499
529
extern _X_EXPORT void LogClose(void);
500
530
extern _X_EXPORT Bool LogSetParameter(LogParameter param, int value);
501
531
extern _X_EXPORT void LogVWrite(int verb, const char *f, va_list args);
502
 
extern _X_EXPORT void LogWrite(int verb, const char *f, ...) _printf_attribute(2,3);
 
532
extern _X_EXPORT void LogWrite(int verb, const char *f, ...) _X_ATTRIBUTE_PRINTF(2,3);
503
533
extern _X_EXPORT void LogVMessageVerb(MessageType type, int verb, const char *format,
504
534
                            va_list args);
505
535
extern _X_EXPORT void LogMessageVerb(MessageType type, int verb, const char *format,
506
 
                           ...) _printf_attribute(3,4);
 
536
                           ...) _X_ATTRIBUTE_PRINTF(3,4);
507
537
extern _X_EXPORT void LogMessage(MessageType type, const char *format, ...)
508
 
                        _printf_attribute(2,3);
 
538
                        _X_ATTRIBUTE_PRINTF(2,3);
509
539
extern _X_EXPORT void FreeAuditTimer(void);
510
 
extern _X_EXPORT void AuditF(const char *f, ...) _printf_attribute(1,2);
 
540
extern _X_EXPORT void AuditF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
511
541
extern _X_EXPORT void VAuditF(const char *f, va_list args);
512
 
extern _X_EXPORT void FatalError(const char *f, ...) _printf_attribute(1,2)
513
 
#if defined(__GNUC__) && (__GNUC__ > 2)
514
 
__attribute((noreturn))
515
 
#endif
516
 
;
 
542
extern _X_EXPORT void FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_NORETURN;
517
543
 
518
544
#ifdef DEBUG
519
545
#define DebugF ErrorF
522
548
#endif
523
549
 
524
550
extern _X_EXPORT void VErrorF(const char *f, va_list args);
525
 
extern _X_EXPORT void ErrorF(const char *f, ...) _printf_attribute(1,2);
 
551
extern _X_EXPORT void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
526
552
extern _X_EXPORT void Error(char *str);
527
553
extern _X_EXPORT void LogPrintMarkers(void);
528
554