r25598: Add missing become_root/unbecome_root around calls of add_aliases.
[samba.git] / source / rpcclient / cmd_unixinfo.c
index cafe0097628a5749f05007f7a22496f0af686533..e6f1e04a457a551b2f515a9218380c118a4a74c1 100644 (file)
@@ -6,7 +6,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -15,8 +15,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
@@ -27,7 +26,7 @@ static NTSTATUS cmd_unixinfo_uid2sid(struct rpc_pipe_client *cli,
                                     int argc, const char **argv)
 {
        uid_t uid;
-       DOM_SID *sid;
+       DOM_SID sid;
        NTSTATUS result;
 
        if (argc != 2) {
@@ -41,7 +40,7 @@ static NTSTATUS cmd_unixinfo_uid2sid(struct rpc_pipe_client *cli,
        if (!NT_STATUS_IS_OK(result))
                goto done;
 
-       printf("%s\n", sid_string_static(sid));
+       printf("%s\n", sid_string_static(&sid));
 
 done:
        return result;
@@ -81,7 +80,7 @@ static NTSTATUS cmd_unixinfo_gid2sid(struct rpc_pipe_client *cli,
                                     int argc, const char **argv)
 {
        gid_t gid;
-       DOM_SID *sid;
+       DOM_SID sid;
        NTSTATUS result;
 
        if (argc != 2) {
@@ -96,7 +95,7 @@ static NTSTATUS cmd_unixinfo_gid2sid(struct rpc_pipe_client *cli,
        if (!NT_STATUS_IS_OK(result))
                goto done;
 
-       printf("%s\n", sid_string_static(sid));
+       printf("%s\n", sid_string_static(&sid));
 
 done:
        return result;
@@ -156,8 +155,14 @@ static NTSTATUS cmd_unixinfo_getpwuid(struct rpc_pipe_client *cli,
                uids[i] = atoi(argv[i+1]);
        }
 
+       info = TALLOC_ARRAY(mem_ctx, struct unixinfo_GetPWUidInfo, num_uids);
+       if (info == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
+
+
        result = rpccli_unixinfo_GetPWUid(cli, mem_ctx, &num_uids, uids,
-                                         &info);
+                                         info);
 
        if (!NT_STATUS_IS_OK(result)) {
                return result;