~ubuntu-branches/ubuntu/feisty/cvsd/feisty

« back to all changes in this revision

Viewing changes to cvsd-buginfo.in

  • Committer: Bazaar Package Importer
  • Author(s): Arthur de Jong
  • Date: 2006-08-20 14:22:58 UTC
  • mfrom: (2.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20060820142258-drqc8vgtguu884q6
Tags: 1.0.13
* cvsd-buildroot: further portability improvements on 64 bit platforms
* added Portuguese debconf translation by Ricardo Silva (closes: #383067)
* added warnings and errors on failing to close a socket
* added LSB headers to init script

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#
16
16
# You should have received a copy of the GNU General Public License
17
17
# along with this program; if not, write to the Free Software
18
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
19
 
20
20
CONFIGFILE="@CONFIGFILE@"
21
21
 
55
55
    echo "cvsd-buginfo (cvsd) @VERSION@"
56
56
    echo "Written by Arthur de Jong."
57
57
    echo ""
58
 
    echo "Copyright (C) 2004 Arthur de Jong."
 
58
    echo "Copyright (C) 2004, 2005, 2006 Arthur de Jong."
59
59
    echo "This is free software; see the source for copying conditions.  There is NO"
60
60
    echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
61
61
    exit 0
82
82
echo " "@CONFIGURE_CMD@
83
83
echo ""
84
84
 
 
85
# dump OS info
 
86
echo "uname -a output:"
 
87
echo " "`uname -`
 
88
echo ""
 
89
 
85
90
# check if cvs is enabled in /etc/inetd.conf
86
91
if grep '^ *cvspserver' /etc/inetd.conf > /dev/null 2>&1 || \
87
92
   grep '^ *2401' /etc/inetd.conf > /dev/null 2>&1
104
109
  ROOTJAIL=`sed -n 's/^[[:space:]]*RootJail[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\1/p' < "$CONFIGFILE"`
105
110
  # get list of repositories
106
111
  REPOSSES=`sed -n 's/^[[:space:]]*Repos[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\1/p' < "$CONFIGFILE"`
 
112
  # get cvsd user
 
113
  CVSDUSER=`sed -n 's/^[[:space:]]*Uid[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\1/p' < "$CONFIGFILE"`
107
114
else
108
115
  echo "Error: $CONFIGFILE does not exist!"
109
116
  echo ""
110
117
  ROOTJAIL=""
111
118
  REPOSSES=""
 
119
  CVSDUSER=""
112
120
  # try this, maybe a chroot jail is there
113
121
  [ -d "/var/lib/cvsd" ] && ROOTJAIL="/var/lib/cvsd"
114
122
fi
126
134
elif [ -d "$ROOTJAIL" ]
127
135
then
128
136
  echo "$ROOTJAIL:"
129
 
  ( find "$ROOTJAIL"/. -maxdepth 0 -print
130
 
    find "$ROOTJAIL"{,/bin,/dev,/etc,/lib,/usr,/usr/bin,/usr/lib,/tmp} -mindepth 1 -maxdepth 1 -print
131
 
  ) | xargs ls -ld | sed "s|$ROOTJAIL/||;s/^ *[0-9]* *[0-9]* *\([^ ]*\) *[0-9]* */ \1 /"
 
137
  ( find "$ROOTJAIL" \
 
138
         "$ROOTJAIL"/usr \
 
139
         "$ROOTJAIL"/tmp \
 
140
         "$ROOTJAIL"/var \
 
141
          -maxdepth 1 -print 2> /dev/null
 
142
    find "$ROOTJAIL"/bin \
 
143
         "$ROOTJAIL"/dev \
 
144
         "$ROOTJAIL"/etc \
 
145
         "$ROOTJAIL"/lib* \
 
146
         "$ROOTJAIL"/usr/bin \
 
147
         "$ROOTJAIL"/usr/lib* \
 
148
         -print  2> /dev/null
 
149
  ) | sort -u | xargs ls -ld | \
 
150
      sed "s|$ROOTJAIL/||;s/^ *[0-9]* *[0-9]* *\([^ ]*\) *[0-9]* */ \1 /"
132
151
  echo ""
133
152
else
134
153
  echo "Error: $ROOTJAIL does not exist!"
151
170
  fi
152
171
fi
153
172
 
154
 
 
155
173
# dump cvs info
156
174
echo "$(which cvs):"
157
 
ls -l $(which cvs) | sed "s/^ *[0-9]* *[0-9]* *\([^ ]*\) *[0-9]* */ \1 /"
 
175
ls -l $(which cvs) | sed 's/^ *[0-9]* *[0-9]* *\([^ ]*\) *[0-9]* */ \1 /'
158
176
echo ""
159
177
 
160
178
# dump cvs version
182
200
if [ -n "$ROOTJAIL" ] && [ -r "$ROOTJAIL/etc/passwd" ]
183
201
then
184
202
  echo "$ROOTJAIL/etc/passwd: (passwds removed)"
185
 
  sed "s/^\([^:]*\):[^:]*:\([^:]*:[^:]*\):[^:]*:\(.*\)$/ \1::\2::\3/" < \
 
203
  sed 's/^\([^:]*\):[^:]*:\([^:]*:[^:]*\):[^:]*:\(.*\)$/ \1::\2::\3/' < \
186
204
    "$ROOTJAIL/etc/passwd" | head -n $maxlines
187
205
  if [ `wc -l < "$ROOTJAIL/etc/passwd"` -gt $maxlines ]
188
206
  then
191
209
  echo ""
192
210
fi
193
211
 
194
 
# TODO: check if all users in $ROOTJAIL/etc/passwd exist in /etc/passwd (or with getent) (see cvsd-buildroot)
 
212
# find some users in system passwd file (start with chroot uids)
 
213
users="`sed -n 's/^\([^:]*\):.*/\1/p' < $ROOTJAIL/etc/passwd`"
 
214
# add configured user
 
215
users="$users $CVSDUSER"
 
216
# filter out duplicate entries
 
217
users="`( for i in $users ; do echo $i ; done ) | sort -u`"
 
218
 
 
219
# dump anonymized system passwd file
 
220
echo "System passwd file: (passwds removed)"
 
221
for i in $users
 
222
do
 
223
  ( getent passwd $i 2>/dev/null || \
 
224
    grep '^'$i: /etc/passwd ) | \
 
225
    sed 's/^\([^:]*\):[^:]*:\([^:]*:[^:]*\):[^:]*:\(.*\)$/ \1::\2::\3/'
 
226
done
 
227
echo ""
195
228
 
196
229
# dump some info per repository
197
230
maxlines=2