author | Jiri Sasek <Jiri.Sasek@Sun.COM> |
Wed, 06 Jul 2011 02:16:21 +0200 | |
changeset 368 | 9a01d3a61f01 |
parent 305 | e95b65443448 |
child 601 | 5502502b0840 |
child 2250 | e145454a43d2 |
permissions | -rw-r--r-- |
305
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
1 |
/* |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
2 |
* ProFTPD - FTP server daemon |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
3 |
* Copyright (c) 1997, 1998 Public Flood Software |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
4 |
* Copyright (c) 2003-2010 The ProFTPD Project team |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
5 |
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
6 |
* |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
7 |
* This program is free software; you can redistribute it and/or modify |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
8 |
* it under the terms of the GNU General Public License as published by |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
9 |
* the Free Software Foundation; either version 2 of the License, or |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
10 |
* (at your option) any later version. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
11 |
* |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
12 |
* This program is distributed in the hope that it will be useful, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
15 |
* GNU General Public License for more details. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
16 |
* |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
18 |
* along with this program; if not, write to the Free Software |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
20 |
* |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
21 |
* As a special exemption, the copyright holders give permission to link |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
22 |
* this program with OpenSSL and distribute the resulting executable without |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
23 |
* including the source code for OpenSSL in the source distribution. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
24 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
25 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
26 |
/* Use Solaris privileges to severely limit root's access. After user |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
27 |
* authentication, this module _completely_ gives up most privileges, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
28 |
* except for the * bare minimum functionality that is required. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
29 |
* VERY highly recommended for security-consious admins. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
30 |
* |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
31 |
* The concept of this was copied from the Linux mod_cap. Solaris |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
32 |
* also has the concept of basic privileges that we can take away to further |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
33 |
* restrict a process lower than what a normal user process can do, this |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
34 |
* module removes some of those as well. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
35 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
36 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
37 |
#include <stdio.h> |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
38 |
#include <stdlib.h> |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
39 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
40 |
#include <priv.h> |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
41 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
42 |
#include "conf.h" |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
43 |
#include "privs.h" |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
44 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
45 |
#define MOD_SOLARIS_PRIV_VERSION "mod_solaris_priv/1.0" |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
46 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
47 |
/* Configuration handlers |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
48 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
49 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
50 |
#define PRIV_USE_FILE_CHOWN 0x0001 |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
51 |
#define PRIV_USE_FILE_CHOWN_SELF 0x0002 |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
52 |
#define PRIV_USE_DAC_READ 0x0004 |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
53 |
#define PRIV_USE_DAC_WRITE 0x0008 |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
54 |
#define PRIV_USE_DAC_SEARCH 0x0010 |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
55 |
#define PRIV_USE_SETID 0x0020 |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
56 |
#define PRIV_USE_FILE_OWNER 0x0040 |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
57 |
#define PRIV_DROP_FILE_WRITE 0x0080 |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
58 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
59 |
static unsigned int solaris_priv_flags = 0; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
60 |
static unsigned char use_privs = TRUE; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
61 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
62 |
MODRET set_solaris_priv(cmd_rec *cmd) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
63 |
unsigned int flags = 0; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
64 |
config_rec *c = NULL; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
65 |
register unsigned int i = 0; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
66 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
67 |
if (cmd->argc - 1 < 1) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
68 |
CONF_ERROR(cmd, "need at least one parameter"); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
69 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
70 |
CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
71 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
72 |
/* PRIV_CHOWN is enabled by default. */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
73 |
flags |= PRIV_USE_FILE_CHOWN; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
74 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
75 |
for (i = 1; i < cmd->argc; i++) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
76 |
char *cp = cmd->argv[i]; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
77 |
cp++; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
78 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
79 |
if (*cmd->argv[i] != '+' && *cmd->argv[i] != '-') |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
80 |
CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, ": bad option: '", |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
81 |
cmd->argv[i], "'", NULL)); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
82 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
83 |
if (strcasecmp(cp, "PRIV_USE_FILE_CHOWN") == 0) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
84 |
if (*cmd->argv[i] == '-') |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
85 |
flags &= ~PRIV_USE_FILE_CHOWN; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
86 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
87 |
} else if (strcasecmp(cp, "PRIV_FILE_CHOWN_SELF") == 0) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
88 |
if (*cmd->argv[i] == '-') |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
89 |
flags &= ~PRIV_USE_FILE_CHOWN_SELF; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
90 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
91 |
} else if (strcasecmp(cp, "PRIV_DAC_READ") == 0) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
92 |
if (*cmd->argv[i] == '+') |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
93 |
flags |= PRIV_USE_DAC_READ; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
94 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
95 |
} else if (strcasecmp(cp, "PRIV_DAC_WRITE") == 0) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
96 |
if (*cmd->argv[i] == '+') |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
97 |
flags |= PRIV_USE_DAC_WRITE; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
98 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
99 |
} else if (strcasecmp(cp, "PRIV_DAC_SEARCH") == 0) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
100 |
if (*cmd->argv[i] == '+') |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
101 |
flags |= PRIV_USE_DAC_SEARCH; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
102 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
103 |
} else if (strcasecmp(cp, "PRIV_FILE_OWNER") == 0) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
104 |
if (*cmd->argv[i] == '+') |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
105 |
flags |= PRIV_USE_FILE_OWNER; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
106 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
107 |
} else { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
108 |
CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "unknown privilege: '", |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
109 |
cp, "'", NULL)); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
110 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
111 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
112 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
113 |
c = add_config_param(cmd->argv[0], 1, NULL); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
114 |
c->argv[0] = pcalloc(c->pool, sizeof(unsigned int)); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
115 |
*((unsigned int *) c->argv[0]) = flags; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
116 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
117 |
return PR_HANDLED(cmd); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
118 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
119 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
120 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
121 |
MODRET set_solaris_priv_engine(cmd_rec *cmd) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
122 |
int bool = -1; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
123 |
config_rec *c = NULL; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
124 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
125 |
CHECK_ARGS(cmd, 1); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
126 |
CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
127 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
128 |
bool = get_boolean(cmd, 1); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
129 |
if (bool == -1) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
130 |
CONF_ERROR(cmd, "expecting Boolean parameter"); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
131 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
132 |
c = add_config_param(cmd->argv[0], 1, NULL); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
133 |
c->argv[0] = pcalloc(c->pool, sizeof(unsigned char)); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
134 |
*((unsigned char *) c->argv[0]) = bool; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
135 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
136 |
return PR_HANDLED(cmd); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
137 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
138 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
139 |
/* Command handlers |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
140 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
141 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
142 |
/* The POST_CMD handler for "PASS" is only called after PASS has |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
143 |
* successfully completed, which means authentication is successful, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
144 |
* so we can "tweak" our root access down to almost nothing. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
145 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
146 |
MODRET solaris_priv_post_pass(cmd_rec *cmd) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
147 |
int res = 0; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
148 |
priv_set_t *p, *i; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
149 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
150 |
if (!use_privs) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
151 |
return PR_DECLINED(cmd); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
152 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
153 |
pr_signals_block(); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
154 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
155 |
/* The only privilege we need is PRIV_NET_PRIVADDR (bind |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
156 |
* ports < 1024). Everything else can be discarded. We set this |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
157 |
* in the permitted set only, as when we switch away from root |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
158 |
* we lose effective anyhow, and must reset it. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
159 |
* |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
160 |
* We also remove the basic Solaris privileges we know we will |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
161 |
* never need. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
162 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
163 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
164 |
i = priv_allocset(); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
165 |
priv_basicset(i); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
166 |
priv_delset(i, PRIV_PROC_EXEC); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
167 |
priv_delset(i, PRIV_PROC_FORK); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
168 |
priv_delset(i, PRIV_PROC_INFO); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
169 |
priv_delset(i, PRIV_PROC_SESSION); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
170 |
setppriv(PRIV_SET, PRIV_INHERITABLE, i); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
171 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
172 |
p = priv_allocset(); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
173 |
priv_basicset(p); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
174 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
175 |
priv_addset(p, PRIV_NET_PRIVADDR); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
176 |
priv_addset(p, PRIV_PROC_AUDIT); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
177 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
178 |
priv_delset(p, PRIV_PROC_EXEC); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
179 |
priv_delset(p, PRIV_PROC_FORK); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
180 |
priv_delset(p, PRIV_PROC_INFO); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
181 |
priv_delset(p, PRIV_PROC_SESSION); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
182 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
183 |
if (solaris_priv_flags & PRIV_USE_SETID) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
184 |
priv_addset(p, PRIV_PROC_SETID); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
185 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
186 |
/* Add any of the configurable privileges. */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
187 |
if (solaris_priv_flags & PRIV_USE_FILE_CHOWN) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
188 |
priv_addset(p, PRIV_FILE_CHOWN); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
189 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
190 |
if (solaris_priv_flags & PRIV_USE_FILE_CHOWN_SELF) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
191 |
priv_addset(p, PRIV_FILE_CHOWN_SELF); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
192 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
193 |
if (solaris_priv_flags & PRIV_USE_DAC_READ) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
194 |
priv_addset(p, PRIV_FILE_DAC_READ); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
195 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
196 |
if (solaris_priv_flags & PRIV_USE_DAC_WRITE) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
197 |
priv_addset(p, PRIV_FILE_DAC_WRITE); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
198 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
199 |
if (solaris_priv_flags & PRIV_USE_DAC_SEARCH) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
200 |
priv_addset(p, PRIV_FILE_DAC_SEARCH); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
201 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
202 |
if (solaris_priv_flags & PRIV_USE_FILE_OWNER) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
203 |
priv_addset(p, PRIV_FILE_OWNER); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
204 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
205 |
if (solaris_priv_flags & PRIV_DROP_FILE_WRITE) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
206 |
priv_delset(p, PRIV_FILE_WRITE); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
207 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
208 |
res = setppriv(PRIV_SET, PRIV_PERMITTED, p); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
209 |
res = setppriv(PRIV_SET, PRIV_EFFECTIVE, p); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
210 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
211 |
if (setreuid(session.uid, session.uid) == -1) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
212 |
pr_log_pri(PR_LOG_ERR, MOD_SOLARIS_PRIV_VERSION ": setreuid: %s", |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
213 |
strerror(errno)); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
214 |
pr_signals_unblock(); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
215 |
end_login(1); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
216 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
217 |
pr_signals_unblock(); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
218 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
219 |
if (res != -1) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
220 |
/* That's it! Disable all further id switching */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
221 |
session.disable_id_switching = TRUE; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
222 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
223 |
} else { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
224 |
pr_log_pri(PR_LOG_NOTICE, MOD_SOLARIS_PRIV_VERSION ": attempt to configure " |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
225 |
"capabilities failed, reverting to normal operation"); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
226 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
227 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
228 |
return PR_DECLINED(cmd); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
229 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
230 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
231 |
/* The POST_CMD_ERR handler for "PASS" is only called after PASS has |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
232 |
* failed so we need only limited set of privs to complete cleanup and logging. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
233 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
234 |
MODRET solaris_priv_post_fail(cmd_rec *cmd) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
235 |
int res = 0; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
236 |
priv_set_t *p, *i; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
237 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
238 |
if (!use_privs) |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
239 |
return PR_DECLINED(cmd); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
240 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
241 |
pr_signals_block(); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
242 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
243 |
/* The only privilege we need is PRIV_NET_PRIVADDR (bind |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
244 |
* ports < 1024). Everything else can be discarded. We set this |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
245 |
* in the permitted set only, as when we switch away from root |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
246 |
* we lose effective anyhow, and must reset it. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
247 |
* |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
248 |
* We also remove the basic Solaris privileges we know we will |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
249 |
* never need. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
250 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
251 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
252 |
i = priv_allocset(); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
253 |
priv_basicset(i); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
254 |
priv_delset(i, PRIV_PROC_EXEC); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
255 |
priv_delset(i, PRIV_PROC_FORK); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
256 |
priv_delset(i, PRIV_PROC_INFO); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
257 |
priv_delset(i, PRIV_PROC_SESSION); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
258 |
setppriv(PRIV_SET, PRIV_INHERITABLE, i); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
259 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
260 |
p = priv_allocset(); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
261 |
priv_basicset(p); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
262 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
263 |
priv_addset(p, PRIV_NET_PRIVADDR); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
264 |
priv_addset(p, PRIV_PROC_AUDIT); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
265 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
266 |
priv_delset(p, PRIV_PROC_EXEC); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
267 |
priv_delset(p, PRIV_PROC_FORK); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
268 |
priv_delset(p, PRIV_PROC_INFO); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
269 |
priv_delset(p, PRIV_PROC_SESSION); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
270 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
271 |
res = setppriv(PRIV_SET, PRIV_PERMITTED, p); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
272 |
res = setppriv(PRIV_SET, PRIV_EFFECTIVE, p); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
273 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
274 |
if (setreuid(session.uid, session.uid) == -1) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
275 |
pr_log_pri(PR_LOG_ERR, MOD_SOLARIS_PRIV_VERSION ": setreuid: %s", |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
276 |
strerror(errno)); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
277 |
pr_signals_unblock(); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
278 |
end_login(1); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
279 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
280 |
pr_signals_unblock(); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
281 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
282 |
if (res != -1) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
283 |
/* That's it! Disable all further id switching */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
284 |
session.disable_id_switching = TRUE; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
285 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
286 |
} else { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
287 |
pr_log_pri(PR_LOG_NOTICE, MOD_SOLARIS_PRIV_VERSION ": attempt to configure " |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
288 |
"capabilities failed, reverting to normal operation"); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
289 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
290 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
291 |
return PR_DECLINED(cmd); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
292 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
293 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
294 |
/* Initialization routines |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
295 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
296 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
297 |
static int solaris_priv_sess_init(void) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
298 |
/* Check to see if the lowering of capabilities has been disabled in the |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
299 |
* configuration file. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
300 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
301 |
if (use_privs) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
302 |
unsigned char *solaris_priv_engine; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
303 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
304 |
solaris_priv_engine = get_param_ptr(main_server->conf, "PrivilegeEngine", FALSE); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
305 |
if (solaris_priv_engine && |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
306 |
*solaris_priv_engine == FALSE) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
307 |
pr_log_debug(DEBUG3, MOD_SOLARIS_PRIV_VERSION |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
308 |
": lowering of capabilities disabled"); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
309 |
use_privs = FALSE; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
310 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
311 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
312 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
313 |
/* Check for which specific capabilities to include/exclude. */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
314 |
if (use_privs) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
315 |
int use_setuid = FALSE; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
316 |
config_rec *c; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
317 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
318 |
c = find_config(main_server->conf, CONF_PARAM, "PrivilegeSet", FALSE); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
319 |
if (c != NULL) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
320 |
solaris_priv_flags = *((unsigned int *) c->argv[0]); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
321 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
322 |
if (!(solaris_priv_flags & PRIV_USE_FILE_CHOWN)) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
323 |
pr_log_debug(DEBUG3, MOD_SOLARIS_PRIV_VERSION |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
324 |
": removing PRIV_CHOWN privilege"); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
325 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
326 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
327 |
if (solaris_priv_flags & PRIV_USE_DAC_READ) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
328 |
pr_log_debug(DEBUG3, MOD_SOLARIS_PRIV_VERSION |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
329 |
": adding PRIV_FILE_DAC_READ privilege"); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
330 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
331 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
332 |
if (solaris_priv_flags & PRIV_USE_DAC_WRITE) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
333 |
pr_log_debug(DEBUG3, MOD_SOLARIS_PRIV_VERSION |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
334 |
": adding PRIV_FILE_DAC_WRITE privilege"); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
335 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
336 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
337 |
if (solaris_priv_flags & PRIV_USE_DAC_SEARCH) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
338 |
pr_log_debug(DEBUG3, MOD_SOLARIS_PRIV_VERSION |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
339 |
": adding PRIV_DAC_SEARCH privilege"); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
340 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
341 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
342 |
if (solaris_priv_flags & PRIV_USE_FILE_OWNER) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
343 |
pr_log_debug(DEBUG3, MOD_SOLARIS_PRIV_VERSION |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
344 |
": adding PRIV_FILE_OWNER privilege"); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
345 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
346 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
347 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
348 |
c = find_config(main_server->conf, CONF_PARAM, "AllowOverwrite", FALSE); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
349 |
if (c && *((int *) c->argv[0]) == FALSE) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
350 |
pr_log_debug(DEBUG3, MOD_SOLARIS_PRIV_VERSION |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
351 |
": removing PRIV_FILE_WRITE basic privilege"); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
352 |
solaris_priv_flags |= PRIV_DROP_FILE_WRITE; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
353 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
354 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
355 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
356 |
/* We also need to check for things which want to revoke root privs |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
357 |
* altogether: mod_exec, mod_sftp, and the RootRevoke directive. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
358 |
* Revoking root privs completely requires the SETUID/SETGID |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
359 |
* capabilities. |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
360 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
361 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
362 |
if (use_setuid == FALSE && |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
363 |
pr_module_exists("mod_sftp.c")) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
364 |
c = find_config(main_server->conf, CONF_PARAM, "SFTPEngine", FALSE); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
365 |
if (c && |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
366 |
*((int *) c->argv[0]) == TRUE) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
367 |
use_setuid = TRUE; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
368 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
369 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
370 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
371 |
if (use_setuid == FALSE && |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
372 |
pr_module_exists("mod_exec.c")) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
373 |
c = find_config(main_server->conf, CONF_PARAM, "ExecEngine", FALSE); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
374 |
if (c && |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
375 |
*((unsigned char *) c->argv[0]) == TRUE) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
376 |
use_setuid = TRUE; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
377 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
378 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
379 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
380 |
if (use_setuid == FALSE) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
381 |
c = find_config(main_server->conf, CONF_PARAM, "RootRevoke", FALSE); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
382 |
if (c && |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
383 |
*((unsigned char *) c->argv[0]) == TRUE) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
384 |
use_setuid = TRUE; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
385 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
386 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
387 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
388 |
if (use_setuid) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
389 |
solaris_priv_flags |= PRIV_USE_SETID; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
390 |
pr_log_debug(DEBUG3, MOD_SOLARIS_PRIV_VERSION |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
391 |
": adding PRIV_SETID "); |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
392 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
393 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
394 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
395 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
396 |
return 0; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
397 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
398 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
399 |
static int solaris_priv_module_init(void) { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
400 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
401 |
return 0; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
402 |
} |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
403 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
404 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
405 |
/* Module API tables |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
406 |
*/ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
407 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
408 |
static conftable solaris_priv_conftab[] = { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
409 |
{ "PrivilegeEngine", set_solaris_priv_engine, NULL }, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
410 |
{ "PrivilegeSet", set_solaris_priv, NULL }, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
411 |
{ NULL, NULL, NULL } |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
412 |
}; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
413 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
414 |
static cmdtable solaris_priv_cmdtab[] = { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
415 |
{ POST_CMD, C_PASS, G_NONE, solaris_priv_post_pass, FALSE, FALSE }, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
416 |
{ POST_CMD_ERR, C_PASS, G_NONE, solaris_priv_post_fail, FALSE, FALSE }, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
417 |
{ 0, NULL } |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
418 |
}; |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
419 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
420 |
module solaris_priv_module = { |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
421 |
NULL, NULL, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
422 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
423 |
/* Module API version */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
424 |
0x20, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
425 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
426 |
/* Module name */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
427 |
"cap", |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
428 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
429 |
/* Module configuration handler table */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
430 |
solaris_priv_conftab, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
431 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
432 |
/* Module command handler table */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
433 |
solaris_priv_cmdtab, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
434 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
435 |
/* Module authentication handler table */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
436 |
NULL, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
437 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
438 |
/* Module initialization */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
439 |
solaris_priv_module_init, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
440 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
441 |
/* Session initialization */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
442 |
solaris_priv_sess_init, |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
443 |
|
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
444 |
/* Module version */ |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
445 |
MOD_SOLARIS_PRIV_VERSION |
e95b65443448
PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff
changeset
|
446 |
}; |