${NETREG} setvalue ${KEY} ${VALNAME} ${VALTYPE2} ${VALVALUE2}
}
+give_administrative_rights()
+{
+ bin/net -s $SERVERCONFFILE sam createbuiltingroup Administrators
+ if test "x$?" != "x0" ; then
+ echo "ERROR: creating builtin group Administrators"
+ false
+ return
+ fi
+
+ bin/net -s $SERVERCONFFILE sam addmem BUILTIN\\Administrators $USERNAME
+ if test "x$?" != "x0" ; then
+ echo "ERROR: adding user $USERNAME to BUILTIN\\Administrators"
+ false
+ else
+ true
+ fi
+}
+
+take_administrative_rights()
+{
+ bin/net -s $SERVERCONFFILE sam delmem BUILTIN\\Administrators $USERNAME
+ if test "x$?" != "x0" ; then
+ echo "ERROR: removing user $USERNAME from BUILTIN\\Administrators"
+ false
+ else
+ true
+ fi
+}
+
+if test "x${RPC}" = "xrpc" ; then
+testit "giving user ${USERNAME} administrative rights" \
+ give_administrative_rights || \
+ failed=`expr $failed +1`
+fi
+
testit "enumerate HKLM" \
test_enumerate HKLM || \
failed=`expr $failed + 1`
test_deletekey HKLM/testkey || \
failed=`expr $failed + 1`
+if test "x${RPC}" = "xrpc" ; then
+testit "taking administrative rights from user ${USERNAME}" \
+ take_administrative_rights || \
+ failed=`expr $failed +1`
+fi
+
testok $0 $failed