Hardware Reference
In-Depth Information
and then enumerate each conduit with the following:
for CONDUIT in ${CONDUIT_ARRAY[@]}
do
CMD=$MINBASE/etc/msg/$CONDUIT/xmit/cmd
if [ -f $CMD ]; then
# existing conduit - send the message to each user
fi
done
Knowing the conduit, you can consult the conduit-specific address book in $MINBASE/etc/msg/[conduit_name]
to replace the username with a number. You use a space-separated list as follows:
steev 012345678
teddy 012347890
As mentioned previously, this results in the SMS-specific script dealing only with the canonical form of phone
number and limits the complexity in each of the protocol scripts. Obviously, if the address is already in its canonical
form, then it won't appear on the left side of the list, and you can revert to the original input. When sending
information, you also check a second list of addresses that consists of non-Minerva users and can be used to store
your work numbers. This code appears thus as follows:
ADDRBOOK=$MINBASE/etc/msg/$CONDUIT/addr/alias
if [ -f $ADDRBOOK ]; then
ALIAS=`grep -m 1 "^$TOADDR " $ADDRBOOK | sed "s/^[^ ]* //"`
if [ "$ALIAS" != "" ]; then
TOADDR=$ALIAS
fi
fi
It is then a simple case of calling the driver script and optionally logging the message details to a file:
$CMD $CONDUIT $TOADDR $MSG
Input Conduits: Receiving Messages
This uses the same set of abstraction principles as transmission but in reverse. Minerva has a basic script, called
msgrcv , which processes any commands found in the message, regardless of where the message originated. This
script then checks to see whether the sender is allowed to issue that command and refuse it if not.
N This process is the most obvious example of the insecurity present with the system, since any Linux user
is able to call the script with valid parameters and bypass your security. Even if you made all the files read-only, it
is no effort for someone to copy or retype these locally and execute the commands. This is yet another reason why
Linux-oriented local users should be banned from the server.
Note
 
Search WWH ::




Custom Search