File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ VERBOSE=true
4
+ if [ " $1 " = " -q" ]; then
5
+ VERBOSE=false
6
+ shift
7
+ fi
8
+
9
+ if [ $# != 0 ]; then
10
+ echo " Usage: htdestroytoken [-q]" >&2
11
+ echo " Removes bearer and vault tokens" >&2
12
+ echo " -q means to do it silently" >&2
13
+ exit 2
14
+ fi
15
+
16
+ # UID is a standard bash variable
17
+ TOKENFILE=" ${BEARER_TOKEN_FILE:- ${XDG_RUNTIME_DIR:-/ tmp} / bt_u$UID } "
18
+ for FILE in $TOKENFILE /tmp/vt_u$UID * ; do
19
+ if [ -f " $FILE " ]; then
20
+ if $VERBOSE ; then
21
+ echo " Removing $FILE "
22
+ fi
23
+ rm -f $FILE
24
+ fi
25
+ done
Original file line number Diff line number Diff line change @@ -104,7 +104,9 @@ cat > $RPM_BUILD_ROOT%{_bindir}/%{name} <<'!EOF!'
104
104
#!/bin/bash
105
105
exec %{_libexecdir }/%{name }/%{name } "$@"
106
106
! EOF!
107
+ cp htdestroytoken $RPM_BUILD_ROOT%{_bindir }
107
108
cp httokendecode $RPM_BUILD_ROOT%{_bindir }
109
+ ln -s httokendecode $RPM_BUILD_ROOT%{_bindir }/htdecodetoken
108
110
chmod +x $RPM_BUILD_ROOT%{_bindir }/*
109
111
gzip -c %{name }.1 > $RPM_BUILD_ROOT%{_datadir }/man/man1/%{name }.1.gz
110
112
@@ -125,6 +127,8 @@ rm -rf $RPM_BUILD_ROOT
125
127
# Fix httokendecode -H functionality to only attempt to convert a parsed word
126
128
# if it is entirely numeric, not if it just contains one digit. At the same
127
129
# time, rewrite the functionality in native bash instead of using grep and sed.
130
+ # Add htdestroytoken command.
131
+ # Add a symlink htdecodetoken pointing to httokendecode.
128
132
129
133
*
Thu Jun 16 2022 Dave Dykstra <[email protected] > 1.15-1
130
134
- Revert to prior method for allowing --vaultalias as an alternate name
You can’t perform that action at this time.
0 commit comments