Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
03387bc0
Commit
03387bc0
authored
Aug 10, 2002
by
Per Cederqvist
Browse files
"kom-errno.h" must now be included before "manipulate.h".
(do_query_read_texts): Fix error code computations. (Bug 161 & Bug 703).
parent
ebc7b074
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server/person.c
View file @
03387bc0
/*
* $Id: person.c,v 0.6
6
2002/0
4
/1
2
1
2
:1
1:03 by
er
s
Exp $
* $Id: person.c,v 0.6
7
2002/0
8
/1
0
1
8
:1
6:49 ced
er Exp $
* Copyright (C) 1991-1999, 2001 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
...
...
@@ -59,11 +59,11 @@
#include
"com.h"
#include
"async.h"
#include
"connections.h"
#include
"kom-errno.h"
#include
"manipulate.h"
#include
"string-malloc.h"
#include
"debug.h"
#include
"cache.h"
#include
"kom-errno.h"
#include
"server/smalloc.h"
#include
"kom-config.h"
#include
"log.h"
...
...
@@ -996,13 +996,10 @@ set_passwd (Pers_no person,
/*
* Ask which texts a person has read in a certain conference.
* Can be done before login. Will return
EMPTY_MEMBERSHIP
if VICTIM
* Can be done before login. Will return
an empty membership
if VICTIM
* has his unread_is_secret-flag set. This can not be distinguished
* from the case when VICTIM has not read any texts in CONF_NO. This
* is a feature, not a bug. (FIXME (bug 161): At least I think so. /ceder)
*
* FIXME (bug 161): Well, I've changed my mind. This call is full of
* security holes. /ceder
* is a feature, not a bug.
*
* Will fail if VICTIM is not a member of CONF_NO.
*/
...
...
@@ -1014,48 +1011,37 @@ do_query_read_texts(Pers_no victim,
{
Person
*
victim_p
;
Membership
*
membp
;
enum
access
victim_acc
;
enum
memb_visibility
vis
;
CHK_CONNECTION
(
FAILURE
);
GET_P_STAT
(
victim_p
,
victim
,
FAILURE
);
victim_acc
=
access_perm
(
victim
,
active_connection
,
unlimi
ted
)
;
if
(
victim_acc
<=
none
)
if
(
!
(
access_perm
(
victim
,
active_connection
,
read_protec
ted
)
>=
read_protected
)
)
{
err_stat
=
victim
;
kom_errno
=
KOM_UNDEF_PERS
;
return
FAILURE
;
}
if
(
access_perm
(
conf_no
,
active_connection
,
read_protected
)
<=
none
)
{
err_stat
=
conf_no
;
kom_errno
=
KOM_UNDEF_CONF
;
return
FAILURE
;
}
membp
=
locate_membership
(
conf_no
,
victim_p
);
if
(
membp
==
NULL
)
{
err_stat
=
conf_no
;
kom_errno
=
KOM_NOT_MEMBER
;
set_conf_errno
(
active_connection
,
conf_no
,
KOM_NOT_MEMBER
);
return
FAILURE
;
}
if
(
membp
->
type
.
secret
&&
!
is_supervisor
(
victim
,
ACTPERS
,
ACT_P
)
&&
!
ENA
(
admin
,
4
))
/* OK -- Guarded */
vis
=
membership_visible
(
active_connection
,
victim
,
conf_no
,
membp
->
type
,
FALSE
,
FALSE
);
if
(
vis
==
mv_none
)
{
err_stat
=
conf_no
;
kom_errno
=
KOM_NOT_MEMBER
;
set_conf_errno
(
active_connection
,
conf_no
,
KOM_NOT_MEMBER
);
return
FAILURE
;
}
*
result
=
*
membp
;
if
(
victim_p
->
flags
.
unread_is_secret
&&
victim_acc
!=
unlimited
)
if
(
vis
==
mv_censor_unread
)
{
result
->
last_time_read
=
NO_TIME
;
result
->
last_text_read
=
0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment