File: fakeroot.h

package info (click to toggle)
fakeroot 0.0-17
  • links: PTS
  • area: main
  • in suites: slink
  • size: 160 kB
  • ctags: 189
  • sloc: ansic: 690; cpp: 543; makefile: 126; sh: 68
file content (95 lines) | stat: -rw-r--r-- 1,641 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include <sys/types.h>
#include <sys/stat.h>

#define MAXMSG 2048
#define MAXPATH 1500
#define FAKE_PROJ 'C'
#define FAKEROOTKEY_ENV "FAKEROOTKEY"
#define LDD_BINARY "/usr/bin/ldd"

typedef  enum {chown_func, fchown_func, 
	/*2*/  chmod_func, fchmod_func,
	/*4*/  mknod_func, 
	       stat_func,
	/*6*/  unlink_func, 
	/*7*/  checklibc_func, 
	       debian_pedantic_func,
	       debug_func, debugdata_func,
	       last_func} func_id;

/*any *_param struct that is used for question/answer communications
  with the daemon must have this structure as first element */

struct q_and_a_serial{
  pid_t pid;
  int   serial;
};

struct q_and_a_func_id{
  func_id id;
  pid_t pid;
  int   serial;
};

struct my_msgbuf{
  long mtype;
  char mtext[MAXMSG];
};

struct chown_param{
  uid_t owner;
  gid_t group;
  struct stat st;
};
struct fchown_param{
  uid_t owner;
  gid_t group;
  struct stat st;
};

struct chmod_param{
  mode_t mode;
  struct stat st;
};
struct fchmod_param{
  mode_t mode;
  struct stat st;
};

struct mknod_param{
  mode_t mode;
  dev_t  dev;
  struct stat st;
};

struct stat_param{
  struct stat st;
};

struct unlink_param{
  struct stat st;  
};

struct checklibc_param{
  int check;
  char path[MAXPATH];
};

struct debianpedantic_param{
  int debian;
};
struct debug_param{
  int  pid;
  char msg[MAXPATH];
};

extern void  fakeroot_debug();


/* this function is both defined in the header file, as
   that was the easiest: it needs to be defined in both
   the lib and the fakeroot main programme */
void *get_par(struct my_msgbuf *buf){
  return (void *) ((char *)buf->mtext+sizeof(struct q_and_a_func_id));
};