Start converting to GPL v3+ (ref: ticket #23900)
[screen-lua.git] / src / acls.h
blob5e02c2f792703f7fab0b88acbe1b758053848b52
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
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 3, or (at your option)
9 * any later version.
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program (see the file COPYING); if not, see
18 * http://www.gnu.org/licenses/, or contact Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
21 ****************************************************************
24 #ifdef MULTIUSER
26 /* three known bits: */
27 #define ACL_EXEC 0
28 #define ACL_WRITE 1
29 #define ACL_READ 2
31 #define ACL_BITS_PER_CMD 1 /* for comm.h */
32 #define ACL_BITS_PER_WIN 3 /* for window.h */
34 #define USER_CHUNK 8
36 #define ACLBYTE(data, w) ((data)[(w) >> 3])
37 #define ACLBIT(w) (0x80 >> ((w) & 7))
39 typedef unsigned char * AclBits;
42 * How a user joins a group.
43 * Here is the node to construct one list per user.
45 struct aclusergroup
47 struct acluser *u; /* the user who borrows us his rights */
48 struct aclusergroup *next;
50 #endif /* MULTIUSER */
52 /***************
53 * ==> user.h
57 * a copy buffer
59 struct plop
61 char *buf;
62 int len;
63 #ifdef ENCODINGS
64 int enc;
65 #endif
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.
73 typedef struct acluser
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;
92 extern int DefaultEsc, DefaultMetaEsc;