/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to init.d-mandos

  • Committer: Teddy Hogeborn
  • Date: 2014-03-06 02:26:04 UTC
  • Revision ID: teddy@recompile.se-20140306022604-4uc43taz25cflgi3
Bug fix: Free all memory and give better messages when memory is full.

* plugin-runner.c (add_to_char_array): Bug fix: If realloc fails, do
                                       not change old array pointer.
  (add_environment): Bug fix: If realloc fails, do not change old
                     environment pointer.  Also rename "e" to "envdef"
                     for clarity.
  (main): Bug fix: If realloc fails, do not change old pointers.  Also
          wrap "#pragma GCC" with "#ifdef ___GNUC___".
* plugins.d/mandos-client.c (incbuffer): Bug fix: if realloc fails,
                                         free old buffer.
  (run_network_hooks): Moved variables "directory" and "ret" to their
                       innermost possible scope.
  (take_down_interface): Moved variables "sd", "ret_errno", and
                         "ret_setflags" to their innermost possible
                         scope.
  (main): Removed variable "interfaces_hooks_size".  Also, if argz_add
          fails when adding all found interfaces, the error message
          will now be correct.  Also print error message if, after
          having taken up an interface, argz_add fails to add
          interface to list of interfaces to be taken down.
* plugins.d/mandos-client.xml (OPTIONS): Explain better what "none"
                                         means as argument to
                                         "--interface" by negating
                                         sense.
* plugins.d/password-prompt.c (fprintf_plus): Removed (unused).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
### BEGIN INIT INFO
3
3
# Provides:          mandos
4
 
# Required-Start:    $remote_fs $syslog avahi
5
 
# Required-Stop:     $remote_fs $syslog avahi
 
4
# Required-Start:    $remote_fs $syslog avahi-daemon
 
5
# Required-Stop:     $remote_fs $syslog avahi-daemon
6
6
# Default-Start:     2 3 4 5
7
7
# Default-Stop:      0 1 6
8
8
# Short-Description: Mandos server
9
 
# Description:       Gives encrypted passwords to Mandos clients
 
9
# Description:       Server of encrypted passwords to Mandos clients
10
10
### END INIT INFO
11
11
 
12
12
# Author: Teddy Hogeborn <teddy@recompile.se>
23
23
NAME=mandos
24
24
DAEMON=/usr/sbin/$NAME
25
25
DAEMON_ARGS=""
26
 
PIDFILE=/var/run/$NAME.pid
 
26
if [ -d /run/. ]; then
 
27
    PIDFILE=/run/$NAME.pid
 
28
else
 
29
    PIDFILE=/var/run/$NAME.pid
 
30
fi
27
31
SCRIPTNAME=/etc/init.d/$NAME
28
32
 
29
33
# Exit if the package is not installed
40
44
. /lib/init/vars.sh
41
45
 
42
46
# Define LSB log_* functions.
43
 
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
 
47
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
 
48
# and status_of_proc is working.
44
49
. /lib/lsb/init-functions
45
50
 
46
51
#
118
123
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
119
124
        esac
120
125
        ;;
 
126
  status)
 
127
        status_of_proc "$DAEMON" "$NAME" -p "$PIDFILE" && exit 0 || exit $?
 
128
        ;;
121
129
  #reload|force-reload)
122
130
        #
123
131
        # If do_reload() is not implemented then leave this commented out
144
152
                esac
145
153
                ;;
146
154
          *)
147
 
                # Failed to stop
 
155
                # Failed to stop
148
156
                log_end_msg 1
149
157
                ;;
150
158
        esac
151
159
        ;;
152
160
  *)
153
161
        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
154
 
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
 
162
        echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
155
163
        exit 3
156
164
        ;;
157
165
esac