This file is indexed.

/usr/share/dirsrv/data/DSSharedLib is in 389-ds-base 1.3.4.9-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
libpath_add()
{
    [ -z "$1" ] && return
    LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
}

# pass in a string that ends in dirsrv-name or slapd-name,
# and convert it to just "name"
normalize_server_id()
{
    servid=$1
    servid=`echo "$servid" | sed 's/^.*\///'`
    servid=`echo "$servid" | sed 's/^dirsrv-//'`
    servid=`echo "$servid" | sed 's/^slapd-//'`
    echo $servid
}

# look for all initconfig files in the given directory
# the initconfig files are the files used in the startup scripts
# to start each instance
# e.g. /etc/sysconfig/dirsrv-INST
# these scripts contain the pointer CONFIG_DIR to where the instance
# configuration files are to be found
# if the given directory is empty, look in /etc/default
# if not running as root, look for non-system instances in
# $HOME/.dirsrv
# ignore the dirsrv-admin admin server config file
#
get_initconfig_files()
{
    dir=${1:-/etc/default}
    # convert
    # uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),.....
    # to
    # 0
    # this is the only portable, secure way to determine the id number
    userid=`id | awk -F'[=(]+' '{print $2}'`
    if [ "$userid" -ne 0 ] ; then
        # magic - see start-dirsrv, DSCreate.pm::get_initconfigdir, etc.
        extradir=$HOME/.dirsrv
        if [ -d $extradir ] ; then
            extra="$extradir/dirsrv-*"
        fi
    fi
    # setting the env var forces the use of it and nothing else
    if [ -n "$INITCONFIGDIR" ] ; then
        dir=$INITCONFIGDIR
        extra=
    fi
    retfiles=
    found=1
    for file in $dir/dirsrv-* $extra ; do
        if [ ! -r "$file" ] ; then continue ; fi
        case "$file" in */dirsrv-admin) continue ;; esac
        if [ -z "$retfiles" ] ; then
            retfiles=$file
        else
            retfiles="$retfiles $file"
        fi
        found=0
    done
    echo $retfiles
    return $found # 0 return means success - at least one found
}

#
#  get_init_file()
#  
#  The init file is the instance specific file under
#  the @initconfig@ directory e.g.
#  /etc/sysconfig/dirsrv-instance
#  The presence and readability of this file means this is a
#  valid instance of directory server (except dirsrv-admin)
#  The CONFIG_DIR directive in this file tells us where to
#  look for the main server config
#  First grab all the dirsrv init files
#  Then check if a server id was provided, if not, return the
#  one found if there is only one
#  If a servid was provided, make sure there is an init file
#  for that instance
#  Return the /etc/default/dirsrv-$servid file name
#
get_init_file()
{
    dir=$1
    servid=$2
    first="yes"
    inst_count=0
    instances="<none>"

    # normalize servid, if given
    if [ -n "$servid" ]
    then
        servid=`normalize_server_id $servid`
    fi

    for configfile in `get_initconfig_files $dir`
    do
        inst_count=`expr $inst_count + 1`
        id=`normalize_server_id $configfile`
        if [ -n "$servid" ] && [ "$id" = "$servid" ]
        then
            # found it
            echo $configfile
            exit 0
        fi
        if  [ $first = "yes" ]
        then
            instances=$id
            first="no"
        else
            instances=$instances", $id"
        fi
    done

    # server id not provided, check if there is only one instance
    if [ -z "$servid" ] && [ $inst_count -eq 1 ]
    then
        # return the file
        echo $configfile
        exit 0
    else 
        # Either we have an invalid name, or more than one instance is available
        # Return the available instances instead of the config file
        echo $instances
        exit 1;
    fi
}

#
#
#
process_dse ()
{
    configdir=$1
    pid=$2
    file="$configdir/dse.ldif"
    OLD_IFS=$IFS
    IFS=""
    while read -r LINE
    do
        case $LINE in
            ' '*)
                ;;
            *)
                if [ -n "$output" ]
                then
                    echo "$output" >> /tmp/DSSharedLib.$pid
                    output=""
                fi
                ;;
        esac
        if [ -n "$output" ]
        then
            case $LINE in
                ' '*)
                    # continuation line, strip the space and append it
                    LINE=`echo "$LINE" | sed -e 's/^ //'`
                    output=$output$LINE
                    ;;
            esac
        else
            case $LINE in
                nsslapd-certdir*|\
                nsslapd-ldapiautobind*|\
                nsslapd-ldapilisten*|\
                nsslapd-ldapifilepath*|\
                nsslapd-localhost*|\
                nsslapd-port*|\
                nsslapd-rootdn*|\
                nsslapd-securePort*|\
                nsslapd-security*)
                    output=$LINE
                    ;;
            esac
        fi
    
    done < $file

    IFS=$OLD_IFS
}

#
# Check protocol
#
check_protocol ()
{
    protocol=$1
    security=$2
    ldapi=$3
    openldap=$4
       
    if [ "$protocol" = "LDAPI" ] && [ "$openldap" != "yes" ]; then
        echo ""
        exit
    elif [ "$protocol" = "LDAPI" ] && [ "$ldapi" = "off" ]; then
        echo ""
        exit
    elif [ "$protocol" = "STARTTLS" ]; then
        if [ -z "$security" ] || [ "$security" = "off" ]; then
            echo ""
            exit
        fi
    elif [ "$protocol" = "LDAPS" ]; then
        if [ -z "$security" ] || [ "$security" = "off" ]; then
            echo ""
            exit
        fi
    fi
    
    if [ "$protocol" != "" ]; then
        if [ "$protocol" != "STARTTLS" ] && 
           [ "$protocol" != "LDAPS" ] &&
           [ "$protocol" != "LDAPI" ] && 
           [ "$protocol" != "LDAP" ]
        then
            echo ""
            exit
        fi
    fi

    echo "$protocol"
}