components/proftpd/mod_solaris_priv.c
author Tomas Klacko <tomas.klacko@oracle.com>
Mon, 05 Aug 2013 23:04:24 +0200
branchs11u1-sru
changeset 2716 c042db93c4a6
parent 881 b3186e256788
child 2205 af632779536e
child 3676 36119782570e
permissions -rw-r--r--
16286302 proftpd throws out audit session create fail when user enters a wrong password 16806394 solaris_priv_post_pass() does not call priv_freeset()
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
2716
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
     5
 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
305
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) {
2716
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   147
  int res = -1;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   148
  priv_set_t *p = NULL;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   149
  priv_set_t *i = NULL;
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   150
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   151
  if (!use_privs)
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   152
    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
   153
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   154
  pr_signals_block();
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   155
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   156
  /* 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
   157
   * 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
   158
   * 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
   159
   * 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
   160
   *
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   161
   * 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
   162
   * never need.
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
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   165
  i = priv_allocset();
2716
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   166
  if (i == NULL)
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   167
    goto out;
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   168
  priv_basicset(i);
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   169
  priv_delset(i, PRIV_PROC_EXEC);
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   170
  priv_delset(i, PRIV_PROC_FORK);
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   171
  priv_delset(i, PRIV_PROC_INFO);
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   172
  priv_delset(i, PRIV_PROC_SESSION);
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   173
  setppriv(PRIV_SET, PRIV_INHERITABLE, i);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   174
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   175
  p = priv_allocset();
2716
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   176
  if (p == NULL)
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   177
    goto out;
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   178
  priv_basicset(p);
707
5953149bd743 7130322 proftpd in the default configuration does not have required privileges
tomas klacko - Sun Microsystems - Prague Czech Republic <tomas.klacko@oracle.com>
parents: 619
diff changeset
   179
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   180
  priv_addset(p, PRIV_NET_PRIVADDR);
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   181
  priv_addset(p, PRIV_PROC_AUDIT);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   182
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   183
  priv_delset(p, PRIV_PROC_EXEC);
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   184
  priv_delset(p, PRIV_PROC_FORK);
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   185
  priv_delset(p, PRIV_PROC_INFO);
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   186
  priv_delset(p, PRIV_PROC_SESSION);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   187
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   188
  if (solaris_priv_flags & PRIV_USE_SETID)
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   189
    priv_addset(p, PRIV_PROC_SETID);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   190
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   191
  /* 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
   192
  if (solaris_priv_flags & PRIV_USE_FILE_CHOWN)
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   193
    priv_addset(p, PRIV_FILE_CHOWN);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   194
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   195
  if (solaris_priv_flags & PRIV_USE_FILE_CHOWN_SELF)
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   196
    priv_addset(p, PRIV_FILE_CHOWN_SELF);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   197
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   198
  if (solaris_priv_flags & PRIV_USE_DAC_READ)
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   199
    priv_addset(p, PRIV_FILE_DAC_READ);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   200
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   201
  if (solaris_priv_flags & PRIV_USE_DAC_WRITE)
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   202
    priv_addset(p, PRIV_FILE_DAC_WRITE);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   203
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   204
  if (solaris_priv_flags & PRIV_USE_DAC_SEARCH)
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   205
    priv_addset(p, PRIV_FILE_DAC_SEARCH);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   206
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   207
  if (solaris_priv_flags & PRIV_USE_FILE_OWNER)
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   208
    priv_addset(p, PRIV_FILE_OWNER);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   209
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   210
  if (solaris_priv_flags & PRIV_DROP_FILE_WRITE)
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   211
    priv_delset(p, PRIV_FILE_WRITE);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   212
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   213
  res = setppriv(PRIV_SET, PRIV_PERMITTED, p);
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   214
  res = setppriv(PRIV_SET, PRIV_EFFECTIVE, p);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   215
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   216
  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
   217
    pr_log_pri(PR_LOG_ERR, MOD_SOLARIS_PRIV_VERSION ": setreuid: %s",
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   218
	strerror(errno));
2716
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   219
    priv_freeset(i);
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   220
    priv_freeset(p);
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   221
    pr_signals_unblock();
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   222
    end_login(1);
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   223
  }
2716
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   224
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   225
out:
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   226
  if (i != NULL)
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   227
    priv_freeset(i);
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   228
  if (p != NULL)
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   229
    priv_freeset(p);
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   230
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   231
  pr_signals_unblock();
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   232
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   233
  if (res != -1) {
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   234
    /* That's it!  Disable all further id switching */
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   235
    session.disable_id_switching = TRUE;
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   236
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   237
  } else {
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   238
    pr_log_pri(PR_LOG_NOTICE, MOD_SOLARIS_PRIV_VERSION ": attempt to configure "
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   239
      "privileges failed, reverting to normal operation");
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   240
  }
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   241
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   242
  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
   243
}
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   244
2716
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   245
static void log_err_permitted(const char* fn) {
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   246
  pr_log_pri(PR_LOG_ERR, MOD_SOLARIS_PRIV_VERSION ": %s(%s): %s",
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   247
    fn, "permitted", strerror(errno));
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   248
}
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   249
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   250
static void log_err_effective(const char* fn) {
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   251
  pr_log_pri(PR_LOG_ERR, MOD_SOLARIS_PRIV_VERSION ": %s(%s): %s",
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   252
    fn, "effective", strerror(errno));
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   253
}
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   254
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   255
MODRET solaris_priv_post_fail(cmd_rec *cmd) {
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   256
  priv_set_t* permitted_set = NULL;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   257
  priv_set_t* effective_set = NULL;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   258
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   259
  if ((permitted_set = priv_allocset()) == NULL) {
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   260
    log_err_permitted("priv_allocset");
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   261
    goto out;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   262
  }
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   263
  if ((effective_set = priv_allocset()) == NULL) {
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   264
    log_err_effective("priv_allocset");
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   265
    goto out;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   266
  }
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   267
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   268
  if (getppriv(PRIV_PERMITTED, permitted_set) != 0) {
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   269
    log_err_permitted("getppriv");
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   270
    goto out;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   271
  }
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   272
  if (getppriv(PRIV_EFFECTIVE, effective_set) != 0) {
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   273
    log_err_effective("getppriv");
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   274
    goto out;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   275
  }
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   276
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   277
  if (priv_addset(permitted_set, PRIV_PROC_AUDIT) != 0) {
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   278
    log_err_permitted("priv_addset");
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   279
    goto out;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   280
  }
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   281
  if (priv_addset(effective_set, PRIV_PROC_AUDIT) != 0) {
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   282
    log_err_effective("priv_addset");
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   283
    goto out;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   284
  }
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   285
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   286
  if (setppriv(PRIV_SET, PRIV_PERMITTED, permitted_set) != 0) {
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   287
    log_err_permitted("setppriv");
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   288
    goto out;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   289
  }
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   290
  if (setppriv(PRIV_SET, PRIV_EFFECTIVE, effective_set) != 0) {
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   291
    log_err_effective("setppriv");
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   292
    goto out;
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   293
  }
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   294
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   295
out:
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   296
  if (permitted_set != NULL)
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   297
    priv_freeset(permitted_set);
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   298
  if (effective_set != NULL)
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   299
    priv_freeset(effective_set);
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   300
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   301
  return PR_DECLINED(cmd);
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   302
}
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   303
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   304
/* Initialization routines
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   305
 */
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   306
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   307
static int solaris_priv_sess_init(void) {
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   308
  /* Check to see if the lowering of privileges has been disabled in the
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   309
   * configuration file.
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
  if (use_privs) {
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   312
    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
   313
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   314
    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
   315
    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
   316
        *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
   317
      pr_log_debug(DEBUG3, MOD_SOLARIS_PRIV_VERSION
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   318
        ": lowering of privileges disabled");
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   319
      use_privs = FALSE;
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   320
    }
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
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   323
  /* Check for which specific privileges to include/exclude. */
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   324
  if (use_privs) {
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   325
    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
   326
    config_rec *c;
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   327
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   328
    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
   329
    if (c != NULL) {
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   330
      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
   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_FILE_CHOWN)) {
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
          ": 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
   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_READ) {
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_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
   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_DAC_WRITE) {
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_DAC_WRITE 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
      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
   348
        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
   349
          ": 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
   350
      }
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   351
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   352
      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
   353
        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
   354
          ": 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
   355
      }
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   356
    }
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   357
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   358
    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
   359
    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
   360
        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
   361
          ": 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
   362
        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
   363
    }
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   364
	    
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   365
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   366
    /* 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
   367
     * 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
   368
     * Revoking root privs completely requires the SETUID/SETGID
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   369
     * privileges.
305
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
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   372
    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
   373
        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
   374
      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
   375
      if (c &&
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   376
          *((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
   377
        use_setuid = TRUE;
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
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   381
    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
   382
        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
   383
      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
   384
      if (c &&
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   385
          *((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
   386
        use_setuid = TRUE;
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
    }
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   389
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   390
    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
   391
      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
   392
      if (c &&
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   393
          *((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
   394
        use_setuid = TRUE;
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
    }
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
    if (use_setuid) {
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   399
      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
   400
      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
   401
        ": adding PRIV_SETID ");
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
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   406
  return 0;
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
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   409
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
   410
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   411
  return 0;
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
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   415
/* Module API tables
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   416
 */
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   417
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   418
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
   419
  { "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
   420
  { "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
   421
  { NULL, 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
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   424
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
   425
  { POST_CMD, C_PASS, G_NONE, solaris_priv_post_pass, FALSE, FALSE },
2716
c042db93c4a6 16286302 proftpd throws out audit session create fail when user enters a wrong password
Tomas Klacko <tomas.klacko@oracle.com>
parents: 881
diff changeset
   426
  { POST_CMD_ERR, C_PASS, G_NONE, solaris_priv_post_fail, FALSE, FALSE },
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   427
  { 0, NULL }
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
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   430
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
   431
  NULL, NULL,
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   432
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   433
  /* Module API version */
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   434
  0x20,
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   435
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   436
  /* Module name */
881
b3186e256788 7162794 proftpd drops privilege too early breaking PAM assumptions
Tomas Klacko <tomas.klacko@oracle.com>
parents: 765
diff changeset
   437
  "privileges",
305
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   438
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   439
  /* 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
   440
  solaris_priv_conftab,
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   441
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   442
  /* 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
   443
  solaris_priv_cmdtab,
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   444
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   445
  /* 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
   446
  NULL,
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   447
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   448
  /* Module initialization */
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   449
  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
   450
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   451
  /* Session initialization */
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   452
  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
   453
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   454
  /* Module version */
e95b65443448 PSARC 2011/088 Replace WU-ftpd with modern FTP server proftpd
Milan Jurik <Milan.Jurik@oracle.com>
parents:
diff changeset
   455
  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
   456
};