|
|
1.1 root 1: /* uucp_upd.c -> add new maillist entry to L.sys and Permissions.
2: create uucp spool directory. We don't really care about our
3: return status here. We will pront warnings and go about
4: our business. Hopefully, the user will be smart enough
5: to know to quit and fix whatever is broken.
6: */
7:
8:
9: #include <stdio.h>
10: #include <errno.h>
11: #include "contents.h"
12:
13: void uucp_upd()
14: {
15:
16: FILE *permfile;
17: FILE *lsysfile;
18: char perm_entry[76];
19: char lsys_entry[76];
20: char dir_cmd[76];
21: int errno;
22:
23: /* build and write our Permissions entry */
24:
25: if( (permfile = fopen("/usr/lib/uucp/Permissions","a")) == NULL){
26: printf("Error opening file [/usr/lib/uucp/Permissions]\n");
27: printf("Error is %s\n",sys_errlist[errno]);
28: printf("You will have to manually edit your uucp configuration files.\n");
29: return;
30: }else{
31: sprintf(perm_entry,"MACHINE=%s LOGNAME=nuucp \\ \n",new_mail_rec.site);
32: fprintf(permfile,"%s",perm_entry);
33: sprintf(perm_entry,"\tCOMMANDS=rmail:rnews:uucp \\ \n");
34: fprintf(permfile,"%s",perm_entry);
35: sprintf(perm_entry,"\tREAD=/usr/spool/uucppublic \\ \n");
36: fprintf(permfile,"%s",perm_entry);
37: sprintf(perm_entry,"\tWRITE=/usr/spool/uucppublic/uploads \\ \n");
38: fprintf(permfile,"%s",perm_entry);
39: sprintf(perm_entry,"\tREQUEST=yes SENDFILES=yes\n");
40: fprintf(permfile,"%s",perm_entry);
41: fclose(permfile);
42: }
43:
44:
45: /* build and write our L.sys entry */
46:
47: if( (lsysfile = fopen("/usr/lib/uucp/L.sys","a")) == NULL){
48: printf("Error opening file [/usr/lib/uucp/L.sys]\n");
49: printf("Error is %s\n",sys_errlist[errno]);
50: printf("You will have to manually edit your uucp configuration files.\n");
51: return;
52: }else{
53: sprintf(lsys_entry,"%s Never ACU 9600 5551212 \"\" \\n in: hello",new_mail_rec.site);
54: fprintf(lsysfile,"%s",lsys_entry);
55: fclose(lsysfile);
56: }
57:
58: /* build the spool directory */
59:
60: sprintf(dir_cmd,"su uucp /bin/mkdir /usr/spool/uucp/%s",new_mail_rec.site);
61: if (system(dir_cmd)){
62: printf("Spool directory creation failed.\n");
63: printf("You will have to create one manually");
64: }
65:
66: }
67:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.