rev |
line source |
yuuji@0
|
1 /* ========================================================================
|
yuuji@0
|
2 * Copyright 1988-2006 University of Washington
|
yuuji@0
|
3 *
|
yuuji@0
|
4 * Licensed under the Apache License, Version 2.0 (the "License");
|
yuuji@0
|
5 * you may not use this file except in compliance with the License.
|
yuuji@0
|
6 * You may obtain a copy of the License at
|
yuuji@0
|
7 *
|
yuuji@0
|
8 * http://www.apache.org/licenses/LICENSE-2.0
|
yuuji@0
|
9 *
|
yuuji@0
|
10 *
|
yuuji@0
|
11 * ========================================================================
|
yuuji@0
|
12 */
|
yuuji@0
|
13
|
yuuji@0
|
14 /*
|
yuuji@0
|
15 * Program: UNIX environment routines
|
yuuji@0
|
16 *
|
yuuji@0
|
17 * Author: Mark Crispin
|
yuuji@0
|
18 * Networks and Distributed Computing
|
yuuji@0
|
19 * Computing & Communications
|
yuuji@0
|
20 * University of Washington
|
yuuji@0
|
21 * Administration Building, AG-44
|
yuuji@0
|
22 * Seattle, WA 98195
|
yuuji@0
|
23 * Internet: MRC@CAC.Washington.EDU
|
yuuji@0
|
24 *
|
yuuji@0
|
25 * Date: 1 August 1988
|
yuuji@0
|
26 * Last Edited: 30 August 2006
|
yuuji@0
|
27 */
|
yuuji@0
|
28
|
yuuji@0
|
29
|
yuuji@0
|
30 typedef struct dotlock_base {
|
yuuji@0
|
31 char lock[MAILTMPLEN];
|
yuuji@0
|
32 int pipei;
|
yuuji@0
|
33 int pipeo;
|
yuuji@0
|
34 } DOTLOCK;
|
yuuji@0
|
35
|
yuuji@0
|
36
|
yuuji@0
|
37 /* Bits that can be set in restrictBox */
|
yuuji@0
|
38
|
yuuji@0
|
39 #define RESTRICTROOT 0x1 /* restricted box doesn't allow root */
|
yuuji@0
|
40 #define RESTRICTOTHERUSER 0x2 /* restricted box doesn't allow other user */
|
yuuji@0
|
41
|
yuuji@0
|
42 /* Subscription definitions for UNIX */
|
yuuji@0
|
43
|
yuuji@0
|
44 #define SUBSCRIPTIONFILE(t) sprintf (t,"%s/.mailboxlist",myhomedir ())
|
yuuji@0
|
45 #define SUBSCRIPTIONTEMP(t) sprintf (t,"%s/.mlbxlsttmp",myhomedir ())
|
yuuji@0
|
46
|
yuuji@0
|
47
|
yuuji@0
|
48 /* dorc() options */
|
yuuji@0
|
49
|
yuuji@0
|
50 #define SYSCONFIG "/etc/c-client.cf"
|
yuuji@0
|
51
|
yuuji@0
|
52
|
yuuji@0
|
53 /* Special users */
|
yuuji@0
|
54
|
yuuji@0
|
55 #define ANONYMOUSUSER "nobody" /* anonymous user */
|
yuuji@0
|
56 #define UNLOGGEDUSER "root" /* unlogged-in user */
|
yuuji@0
|
57 #define ADMINGROUP "mailadm" /* mail administrator group */
|
yuuji@0
|
58
|
yuuji@0
|
59 /* Function prototypes */
|
yuuji@0
|
60
|
yuuji@0
|
61 #include "env.h"
|
yuuji@0
|
62
|
yuuji@0
|
63 void rfc822_fixed_date (char *date);
|
yuuji@0
|
64 long env_init (char *user,char *home);
|
yuuji@0
|
65 char *myusername_full (unsigned long *flags);
|
yuuji@0
|
66 #define MU_LOGGEDIN 0
|
yuuji@0
|
67 #define MU_NOTLOGGEDIN 1
|
yuuji@0
|
68 #define MU_ANONYMOUS 2
|
yuuji@0
|
69 #define myusername() \
|
yuuji@0
|
70 myusername_full (NIL)
|
yuuji@0
|
71 char *sysinbox ();
|
yuuji@0
|
72 char *mailboxdir (char *dst,char *dir,char *name);
|
yuuji@0
|
73 long dotlock_lock (char *file,DOTLOCK *base,int fd);
|
yuuji@0
|
74 long dotlock_unlock (DOTLOCK *base);
|
yuuji@0
|
75 int lockname (char *lock,char *fname,int op,long *pid);
|
yuuji@0
|
76 int lockfd (int fd,char *lock,int op);
|
yuuji@0
|
77 int lock_work (char *lock,void *sbuf,int op,long *pid);
|
yuuji@0
|
78 long chk_notsymlink (char *name,void *sbuf);
|
yuuji@0
|
79 void unlockfd (int fd,char *lock);
|
yuuji@0
|
80 long set_mbx_protections (char *mailbox,char *path);
|
yuuji@0
|
81 long get_dir_protection (char *mailbox);
|
yuuji@0
|
82 MAILSTREAM *user_flags (MAILSTREAM *stream);
|
yuuji@0
|
83 char *default_user_flag (unsigned long i);
|
yuuji@0
|
84 void dorc (char *file,long flag);
|
yuuji@0
|
85 long path_create (MAILSTREAM *stream,char *mailbox);
|
yuuji@0
|
86 void grim_pid_reap_status (int pid,int killreq,void *status);
|
yuuji@0
|
87 #define grim_pid_reap(pid,killreq) \
|
yuuji@0
|
88 grim_pid_reap_status (pid,killreq,NIL)
|
yuuji@0
|
89 long safe_write (int fd,char *buf,long nbytes);
|
yuuji@0
|
90 void *arm_signal (int sig,void *action);
|
yuuji@0
|
91 struct passwd *checkpw (struct passwd *pw,char *pass,int argc,char *argv[]);
|
yuuji@0
|
92 long loginpw (struct passwd *pw,int argc,char *argv[]);
|
yuuji@0
|
93 long pw_login (struct passwd *pw,char *auser,char *user,char *home,int argc,
|
yuuji@0
|
94 char *argv[]);
|
yuuji@0
|
95 void *mm_blocknotify (int reason,void *data);
|