~ubuntu-branches/ubuntu/trusty/screen/trusty-backports

1 by Nathaniel McCallum
Import upstream version 4.0.2
1
/* Copyright (c) 1993-2002
2
 *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
3
 *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
4
 * Copyright (c) 1987 Oliver Laumann
5
 *
6
 * This program is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 2, or (at your option)
9
 * any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program (see the file COPYING); if not, write to the
18
 * Free Software Foundation, Inc.,
19
 * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
20
 *
21
 ****************************************************************
22
 */
23
24
#ifdef MULTIUSER
25
26
/* three known bits: */
27
#define ACL_EXEC 0		
28
#define ACL_WRITE 1
29
#define ACL_READ 2
30
31
#define ACL_BITS_PER_CMD 1	/* for comm.h */
32
#define ACL_BITS_PER_WIN 3	/* for window.h */
33
34
#define USER_CHUNK 8
35
36
#define ACLBYTE(data, w)   ((data)[(w) >> 3])
37
#define ACLBIT(w)   (0x80 >> ((w) & 7))
38
39
typedef unsigned char * AclBits;
40
41
/*
42
 * How a user joins a group.
43
 * Here is the node to construct one list per user.
44
 */
45
struct aclusergroup
46
{
47
  struct acluser *u;	/* the user who borrows us his rights */
48
  struct aclusergroup *next;
49
};
50
#endif /* MULTIUSER */
51
52
/***************
53
 *  ==> user.h
54
 */
55
56
/*
57
 * a copy buffer
58
 */
59
struct plop
60
{
61
  char *buf;
62
  int len;
63
#ifdef ENCODINGS
64
  int enc;
65
#endif
66
};
67
68
/*
69
 * A User has a list of groups, and points to other users.  
70
 * users is the User entry of the session owner (creator)
71
 * and anchors all other users. Add/Delete users there.
72
 */
73
typedef struct acluser
74
{
75
  struct acluser *u_next;		/* continue the main user list */
76
  char u_name[20+1];		/* login name how he showed up */
77
  char *u_password;		/* his password (may be NullStr). */
78
  int  u_checkpassword;		/* nonzero if this u_password is valid */
79
  int  u_detachwin;		/* the window where he last detached */
80
  int  u_detachotherwin;	/* window that was "other" when he detached */
81
  int  u_Esc, u_MetaEsc;	/* the users screen escape character */
82
#ifdef COPY_PASTE
83
  struct plop u_plop;
84
#endif
85
#ifdef MULTIUSER
86
  int u_id;			/* a uniq index in the bitfields. */
87
  AclBits u_umask_w_bits[ACL_BITS_PER_WIN];	/* his window create umask */
88
  struct aclusergroup *u_group;	/* linked list of pointers to other users */
89
#endif
90
} User;
91
92
extern int DefaultEsc, DefaultMetaEsc;
93