Display a nice error message if the user%password specified for net rpc
authorTim Potter <tpot@samba.org>
Fri, 14 Dec 2001 03:55:44 +0000 (03:55 +0000)
committerTim Potter <tpot@samba.org>
Fri, 14 Dec 2001 03:55:44 +0000 (03:55 +0000)
join does not have administrator privileges.
(This used to be commit af24b1036c8ceaa37e6b68ac988401846c5c7fe4)

source3/utils/net_rpc_join.c

index c9fa52a7340bc42d33ae42ad5dafd4ae1979e03c..16b0ccbaa806bb4a81b35600270801659e40b56c 100644 (file)
@@ -141,6 +141,14 @@ int net_rpc_join(int argc, const char **argv)
        if (!NT_STATUS_IS_OK(result) && 
            !NT_STATUS_EQUAL(result, NT_STATUS_USER_EXISTS)) {
                d_printf("Create of workstation account failed\n");
+
+               /* If NT_STATUS_ACCESS_DENIED then we have a valid
+                  username/password combo but the user does not have
+                  administrator access. */
+
+               if (NT_STATUS_V(result) == NT_STATUS_V(NT_STATUS_ACCESS_DENIED))
+                       d_printf("User specified does not have administrator privileges\n");
+
                goto done;
        }
 
@@ -286,5 +294,3 @@ done:
 
        return retval;
 }
-
-