annotate src/lock.h @ 288:c02c4eb95f95 noffle

[svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user and noffle-group configs. * src/configfile.c,src/fetch.c,src/fetchlist.c,src/protocol.c, src/server.c: Replace strcpy() with Utl_cpyStr() where appropriate. See Debian bug 168128. * src/control.c,src/configfile.c,src/noffle.c: Replace [s]scanf("%s") with [s]scanf(MAXCHAR_FMT). * src/noffle.c: Log warning if noffle.conf is world readable. * src/noffle.c: Restrict most options to news admins; i.e. those who are root or news on running Noffle. * Makefile.in,acconfig.h,aclocal.m4,config.h.in,configure,configure.in, docs/Makefile.in,docs/noffle.conf.5,packages/Makefile.in, packages/redhat/Makefile.in,src/Makefile.am,src/Makefile.in, src/authenticate.c,src/authenticate.h,src/noffle.c,src/server.c: Add basic authentication using either Noffle-specific user file or authenticating via PAM (service 'noffle'). PAM authentication needs to run as root, so a Noffle server that needs PAM must be started by root. Helpful (?) error messages will be logged if not. Noffle will switch ruid and euid to 'news' (or whatever is configured) ASAP. * src/noffle.c: Add uid checking.
author bears
date Fri, 10 Jan 2003 23:25:45 +0000
parents 8ea6b5ddc5a5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
1 /*
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
2 lock.h
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
3
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
4 Opening/Closing of the various databases: article overview database,
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
5 articla database, groups database, outgoing articles database, requests
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
6 database. Handles global lock.
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
7
165
8ea6b5ddc5a5 [svn] * src/lock.h,src/lock.c,src/noffle.c: Add lazy lock release. Only release
bears
parents: 127
diff changeset
8 $Id: lock.h 249 2001-01-25 13:38:31Z bears $
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
9 */
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
10
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
11 #ifndef LOCK_H
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
12 #define LOCK_H
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
13
45
32ba1198c6fa [svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents: 43
diff changeset
14 #if HAVE_CONFIG_H
32ba1198c6fa [svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents: 43
diff changeset
15 #include <config.h>
32ba1198c6fa [svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents: 43
diff changeset
16 #endif
32ba1198c6fa [svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents: 43
diff changeset
17
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
18 #include "common.h"
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
19
127
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
20 enum LockRequestWait { LOCK_WAIT, LOCK_NOWAIT };
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
21
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
22 /* Open all databases and set global lock. */
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
23 Bool
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
24 Lock_openDatabases( void );
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
25
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
26 /* Close all databases and release global lock. */
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
27 void
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
28 Lock_closeDatabases( void );
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
29
165
8ea6b5ddc5a5 [svn] * src/lock.h,src/lock.c,src/noffle.c: Add lazy lock release. Only release
bears
parents: 127
diff changeset
30 /* Ensure all databases synced to disc. */
8ea6b5ddc5a5 [svn] * src/lock.h,src/lock.c,src/noffle.c: Add lazy lock release. Only release
bears
parents: 127
diff changeset
31 void
8ea6b5ddc5a5 [svn] * src/lock.h,src/lock.c,src/noffle.c: Add lazy lock release. Only release
bears
parents: 127
diff changeset
32 Lock_syncDatabases( void );
8ea6b5ddc5a5 [svn] * src/lock.h,src/lock.c,src/noffle.c: Add lazy lock release. Only release
bears
parents: 127
diff changeset
33
127
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
34 /* Check the global lock held. */
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
35 Bool
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
36 Lock_gotLock( void );
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
37
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
38 /* Get fetch lock. */
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
39 Bool
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
40 Lock_getFetchLock( enum LockRequestWait wait );
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
41
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
42 /* Release fetch lock. */
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
43 void
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
44 Lock_releaseFetchLock( void );
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
45
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
46 /* Check the fetch lock held. */
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
47 Bool
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
48 Lock_fetchLock( void );
3c71e28c8eef [svn] Release-1-0 mergedocs/NOTES
bears
parents: 45
diff changeset
49
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
50 #endif