~ubuntu-branches/debian/jessie/systemd/jessie

« back to all changes in this revision

Viewing changes to src/util.h

  • Committer: Package Import Robot
  • Author(s): Tollef Fog Heen, Tollef Fog Heen, Michael Biebl
  • Date: 2012-04-03 19:59:17 UTC
  • mfrom: (1.1.10) (6.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20120403195917-l532urrbg4pkreas
Tags: 44-1
[ Tollef Fog Heen ]
* New upstream version.
  - Backport 3492207: journal: PAGE_SIZE is not known on ppc and other
    archs
  - Backport 5a2a2a1: journal: react with immediate rotation to a couple
    of more errors
  - Backport 693ce21: util: never follow symlinks in rm_rf_children()
    Fixes CVE-2012-1174, closes: #664364
* Drop output message from init-functions hook, it's pointless.
* Only rmdir /lib/init/rw if it exists.
* Explicitly order debian-fixup before sysinit.target to prevent a
  possible race condition with the creation of sockets.  Thanks to
  Michael Biebl for debugging this.
* Always restart the initctl socket on upgrades, to mask sysvinit
  removing it.

[ Michael Biebl ]
* Remove workaround for non-interactive sessions from pam config again.
* Create compat /dev/initctl symlink in case we are upgrading from a system
  running a newer version of sysvinit (using /run/initctl) and sysvinit is
  replaced with systemd-sysv during the upgrade. Closes: #663219
* Install new man pages.
* Build-Depend on valac (>= 0.12) instead of valac-0.12. Closes: #663323

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
#define FORMAT_TIMESTAMP_MAX 64
68
68
#define FORMAT_TIMESTAMP_PRETTY_MAX 256
69
69
#define FORMAT_TIMESPAN_MAX 64
 
70
#define FORMAT_BYTES_MAX 8
70
71
 
71
 
#define ANSI_HIGHLIGHT_ON "\x1B[1;31m"
 
72
#define ANSI_HIGHLIGHT_ON "\x1B[1;39m"
 
73
#define ANSI_HIGHLIGHT_RED_ON "\x1B[1;31m"
72
74
#define ANSI_HIGHLIGHT_GREEN_ON "\x1B[1;32m"
73
75
#define ANSI_HIGHLIGHT_OFF "\x1B[0m"
74
76
 
248
250
 
249
251
int rmdir_parents(const char *path, const char *stop);
250
252
 
251
 
int get_process_name(pid_t pid, char **name);
252
 
int get_process_cmdline(pid_t pid, size_t max_length, char **line);
 
253
int get_process_comm(pid_t pid, char **name);
 
254
int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char **line);
 
255
int get_process_exe(pid_t pid, char **name);
 
256
int get_process_uid(pid_t pid, uid_t *uid);
253
257
 
254
258
char hexchar(int x);
255
259
int unhexchar(char c);
274
278
 
275
279
char *ascii_strlower(char *path);
276
280
 
277
 
bool dirent_is_file(struct dirent *de);
 
281
bool dirent_is_file(const struct dirent *de);
 
282
bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix);
 
283
 
278
284
bool ignore_file(const char *filename);
279
285
 
280
286
bool chars_intersect(const char *a, const char *b);
321
327
 
322
328
int chvt(int vt);
323
329
 
324
 
int read_one_char(FILE *f, char *ret, bool *need_nl);
 
330
int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl);
325
331
int ask(char *ret, const char *replies, const char *text, ...);
326
332
 
327
 
int reset_terminal_fd(int fd);
 
333
int reset_terminal_fd(int fd, bool switch_to_text);
328
334
int reset_terminal(const char *name);
329
335
 
330
336
int open_terminal(const char *name, int mode);
363
369
int get_ctty(pid_t, dev_t *_devnr, char **r);
364
370
 
365
371
int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid);
 
372
int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid);
366
373
 
367
374
int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_sticky);
368
375
 
370
377
 
371
378
cpu_set_t* cpu_set_malloc(unsigned *ncpus);
372
379
 
373
 
void status_vprintf(const char *format, va_list ap);
374
 
void status_printf(const char *format, ...);
 
380
void status_vprintf(const char *status, bool ellipse, const char *format, va_list ap);
 
381
void status_printf(const char *status, bool ellipse, const char *format, ...);
375
382
void status_welcome(void);
376
383
 
377
 
int columns(void);
 
384
int fd_columns(int fd);
 
385
unsigned columns(void);
 
386
 
 
387
int fd_lines(int fd);
 
388
unsigned lines(void);
378
389
 
379
390
int running_in_chroot(void);
380
391
 
381
 
char *ellipsize(const char *s, unsigned length, unsigned percent);
 
392
char *ellipsize(const char *s, size_t length, unsigned percent);
 
393
char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent);
382
394
 
383
395
int touch(const char *path);
384
396
 
403
415
void filter_environ(const char *prefix);
404
416
 
405
417
bool tty_is_vc(const char *tty);
 
418
bool tty_is_vc_resolve(const char *tty);
406
419
int vtnr_from_tty(const char *tty);
407
420
const char *default_term_for_tty(const char *tty);
408
421
 
415
428
bool plymouth_running(void);
416
429
 
417
430
void parse_syslog_priority(char **p, int *priority);
 
431
void skip_syslog_pid(char **buf);
 
432
void skip_syslog_date(char **buf);
418
433
 
419
434
int have_effective_cap(int value);
420
435
 
443
458
int hwclock_set_time(const struct tm *tm);
444
459
 
445
460
int audit_session_from_pid(pid_t pid, uint32_t *id);
 
461
int audit_loginuid_from_pid(pid_t pid, uid_t *uid);
446
462
 
447
463
bool display_is_local(const char *display);
448
464
int socket_from_display(const char *display, char **path);
450
466
int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home);
451
467
int get_group_creds(const char **groupname, gid_t *gid);
452
468
 
 
469
int in_group(const char *name);
 
470
 
453
471
int glob_exists(const char *path);
454
472
 
455
473
int dirent_ensure_type(DIR *d, struct dirent *de);
465
483
 
466
484
int block_get_whole_disk(dev_t d, dev_t *ret);
467
485
 
468
 
int file_is_sticky(const char *p);
 
486
int file_is_priv_sticky(const char *p);
469
487
 
470
488
int strdup_or_null(const char *a, char **b);
471
489
 
506
524
 
507
525
bool kexec_loaded(void);
508
526
 
 
527
int prot_from_flags(int flags);
 
528
 
 
529
unsigned long cap_last_cap(void);
 
530
 
 
531
char *format_bytes(char *buf, size_t l, off_t t);
 
532
 
 
533
int fd_wait_for_event(int fd, int event, usec_t timeout);
 
534
 
 
535
void* memdup(const void *p, size_t l);
 
536
 
 
537
int rtc_open(int flags);
 
538
 
 
539
int is_kernel_thread(pid_t pid);
 
540
 
 
541
int fd_inc_sndbuf(int fd, size_t n);
 
542
int fd_inc_rcvbuf(int fd, size_t n);
 
543
 
509
544
#endif