summaryrefslogtreecommitdiffstats
path: root/service
blob: 4a5992b190145b18204a6a139dc5e6bcc4382428 (plain)
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
#!/bin/sh

# Set up a default search path.
PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
export PATH

VERSION="`basename $0` ver. 0.91"
USAGE="Usage: `basename $0` < option > | --status-all | \
[ service_name [ command | --full-restart ] ]"
SERVICE=
SERVICEDIR="/etc/init.d"
OPTIONS=

if [ $# -eq 0 ]; then
   echo $"${USAGE}" >&2
   exit 1
fi

cd /
while [ $# -gt 0 ]; do
  case "${1}" in
    --help | -h | --h* )
       echo $"${USAGE}" >&2
       exit 0
       ;;
    --version | -V )
       echo $"${VERSION}" >&2
       exit 0
       ;;
    *)
       if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then
          cd ${SERVICEDIR}
          for SERVICE in * ; do
            case "${SERVICE}" in
              functions | halt | killall | single| linuxconf| kudzu | \
                  *rpmorig | *rpmnew | *rpmsave | *~ | *.orig)
                  ;;
              *)
                if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
                  env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" status
                fi
                ;;
            esac
          done
          exit 0
       elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then
          SERVICE="${1}"
          if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
            env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" stop
            env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" start
            exit $?
          fi
       elif [ -z "${SERVICE}" ]; then
         SERVICE="${1}"
       else
         OPTIONS="${OPTIONS} ${1}"
       fi
       shift
       ;;
   esac
done

if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
   env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" ${OPTIONS}
else
   echo $"${SERVICE}: unrecognized service" >&2
   exit 1
fi
4' href='#n134'>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 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486
The operating-system specific functions provide an interface between the
other parts of the \libname{libkrb5.a} libraries and the operating system.

Beware! Any of the functions below are allowed to be implemented as
macros.  Prototypes for functions can be found in {\tt
<krb5.h>}; other definitions (including macros, if used) are
in {\tt <krb5/libos.h>}.

The following global symbols are provided in \libname{libos.a}.  If you
wish to substitute for any of them, you must substitute for all of them
(they are all declared and initialized in the same object file):
\begin{description}
% These come from src/lib/osconfig.c
\item[extern char *\globalname{krb5_defkeyname}:] default name of key
table file
\item[extern char *\globalname{krb5_lname_file}:] name of aname/lname
translation database
\item[extern int \globalname{krb5_max_dgram_size}:] maximum allowable
datagram size
\item[extern int \globalname{krb5_max_skdc_timeout}:] maximum
per-message KDC reply timeout
\item[extern int \globalname{krb5_skdc_timeout_shift}:] shift factor
(bits) to exponentially back-off the KDC timeouts
\item[extern int \globalname{krb5_skdc_timeout_1}:] initial KDC timeout
\item[extern char *\globalname{krb5_kdc_udp_portname}:] name of KDC UDP port
\item[extern char *\globalname{krb5_default_pwd_prompt1}:] first prompt
for password reading.
\item[extern char *\globalname{krb5_default_pwd_prompt2}:] second prompt

\end{description}

\subsubsection{Operating specific context}
The \datatype{krb5_context} has space for operating system specific
data. These functions are called from \funcname{krb5_init_context} and
\funcname{krb5_free_context}, but are included here for completeness.

\begin{funcdecl}{krb5_os_init_context}{krb5_error_code}{\funcinout}
\funcarg{krb5_context}{context}
\end{funcdecl}

\internalfunc

Initializes \funcparam{context{\ptsto}os_context} and establishes the
location of the initial configuration files. 

\begin{funcdecl}{krb5_os_free_context}{krb5_error_code}{\funcinout}
\funcarg{krb5_context}{context}
\end{funcdecl}

\internalfunc

Frees the operating system specific portion of \funcparam{context}. 

\subsubsection{Configuration based functions}
These functions allow access to configuration specific information. In
some cases, the configuration may be overriden by program control.


\begin{funcdecl}{krb5_set_config_files}{krb5_error_code}{\funcinout}
\funcarg{krb5_context}{context}
\funcin
\funcarg{const char **}{filenames}
\end{funcdecl}

Sets the list of configuration files to be examined in determining
machine defaults. \funcparam{filenames} is an array of files to check in
order. The array must have a NULL entry as the last element.

Returns system errors.

\begin{funcdecl}{krb5_get_krbhst}{krb5_error_code}{\funcin}
\funcarg{krb5_context}{context}
\funcarg{const krb5_data *}{realm}
\funcout
\funcarg{char ***}{hostlist}
\end{funcdecl}

Figures out the Kerberos server names for the given \funcparam{realm},
filling in \funcparam{hostlist} with a null terminated array of
pointers to hostnames. 
 
If \funcparam{realm} is unknown, the filled-in pointer is set to NULL.

The pointer array and strings pointed to are all in allocated storage,
and should be freed by the caller when finished.

Returns system errors.

\begin{funcdecl}{krb5_free_krbhst}{krb5_error_code}{\funcin}
\funcarg{krb5_context}{context}
\funcarg{char * const *}{hostlist}
\end{funcdecl}

Frees the storage taken by a host list returned by \funcname{krb5_get_krbhst}.

\begin{funcdecl}{krb5_get_default_realm}{krb5_error_code}{\funcin}
\funcarg{krb5_context}{context}
\funcout
\funcarg{char **}{lrealm}
\end{funcdecl}

Retrieves the default realm to be used if no user-specified realm is
available (e.g. to interpret a user-typed principal name with the
realm omitted for convenience), filling in \funcparam{lrealm} with a
pointer to the default realm in allocated storage.

It is the caller's responsibility for freeing the allocated storage
pointed to be \funcparam{lream} when it is finished with it.