annotate src/authenticate.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
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
288
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
1 /*
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
2 authenticate.h
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
3
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
4 Do client authentication
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
5
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
6 $Id: authenticate.h 420 2003-01-10 23:25:45Z bears $
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
7 */
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
8
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
9 #ifndef AUTHENTICATE_H
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
10 #define AUTHENTICATE_H
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
11
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
12 #include "common.h"
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
13
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
14 enum AuthResult { AUTH_ERROR, AUTH_DISCONNECT, AUTH_FAILED, AUTH_OK };
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
15
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
16 /* Authenticate a user and password. */
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
17 enum AuthResult
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
18 Auth_authenticate( const char *user, const char *pass );
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
19
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
20 /* Open authentication session. */
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
21 Bool
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
22 Auth_open( void );
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
23
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
24 /* Authentication session now closed. */
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
25 void
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
26 Auth_close( void );
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
27
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
28 /* Check we have appropriate privs for authentication. */
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
29 Bool
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
30 Auth_checkPrivs( void );
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
31
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
32 /* Are are privs sufficient only for admin access? */
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
33 Bool
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
34 Auth_admin( void );
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
35
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
36 /* Drop any privs required for authentication. */
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
37 Bool
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
38 Auth_dropPrivs( void );
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
39
c02c4eb95f95 [svn] * src/configfile.h,src/configfile.c,docs/noffle.conf.5: Add noffle-user
bears
parents:
diff changeset
40 #endif