Fixed crash bug in display_print_info_1()
[ira/wip.git] / source3 / rpcclient / cmd_spoolss.c
index 2f80295a5344d8b09453bdc8f0adb75631441aba..74601563f2e45ec6952f5a655250fa64ba27d763 100644 (file)
@@ -82,58 +82,6 @@ static NTSTATUS cmd_spoolss_not_implemented(struct cli_state *cli,
        return NT_STATUS_OK;
 }
 
-/****************************************************************************
- display sec_ace structure
- ****************************************************************************/
-static void display_sec_ace(SEC_ACE *ace)
-{
-       fstring sid_str;
-
-       sid_to_string(sid_str, &ace->trustee);
-       printf("\t\tSID: %s\n", sid_str);
-
-       printf("\t\ttype:[%d], flags:[0x%02x], mask:[0x%08x]\n", 
-              ace->type, ace->flags, ace->info.mask);
-}
-
-/****************************************************************************
- display sec_acl structure
- ****************************************************************************/
-static void display_sec_acl(SEC_ACL *acl)
-{
-       if (acl->size != 0 && acl->num_aces != 0) {
-               int i;
-
-               printf("\t\tRevision:[%d]\n", acl->revision);
-               for (i = 0; i < acl->num_aces; i++) {
-                       display_sec_ace(&acl->ace[i]);
-               }
-       }
-}
-
-/****************************************************************************
- display sec_desc structure
- ****************************************************************************/
-static void display_sec_desc(SEC_DESC *sec)
-{
-       fstring sid_str;
-
-       printf("\tRevision:[%d]\n", sec->revision);
-
-       if (sec->off_owner_sid) {
-               sid_to_string(sid_str, sec->owner_sid);
-               printf("\tOwner SID: %s\n", sid_str);
-       }
-
-       if (sec->off_grp_sid) {
-               sid_to_string(sid_str, sec->grp_sid);
-               printf("\tGroup SID: %s\n", sid_str);
-       }
-
-       if (sec->off_sacl) display_sec_acl(sec->sacl);
-       if (sec->off_dacl) display_sec_acl(sec->dacl);
-}
-
 /***********************************************************************
  * Get printer information
  */
@@ -236,9 +184,19 @@ static void display_print_info_1(PRINTER_INFO_1 *i1)
        fstring name;
        fstring comm;
 
-       rpcstr_pull(desc, i1->description.buffer, sizeof(desc), 0, STR_TERMINATE);
-       rpcstr_pull(name, i1->name.buffer, sizeof(name), 0, STR_TERMINATE);
-       rpcstr_pull(comm, i1->comment.buffer, sizeof(comm), 0, STR_TERMINATE);
+       desc[0] = name[0] = comm[0] = 0;
+
+       if (i1->description.buffer)
+               rpcstr_pull(desc, i1->description.buffer, sizeof(desc), 0, 
+                           STR_TERMINATE);
+
+       if (i1->name.buffer)
+               rpcstr_pull(name, i1->name.buffer, sizeof(name), 0, 
+                           STR_TERMINATE);
+
+       if (i1->comment.buffer)
+               rpcstr_pull(comm, i1->comment.buffer, sizeof(comm), 0, 
+                           STR_TERMINATE);
 
        printf("\tflags:[0x%x]\n", i1->flags);
        printf("\tname:[%s]\n", name);
@@ -932,7 +890,7 @@ static BOOL init_drv_info_3_members (
        }
        for (i=0; i<len; i++)
        {
-               info->dependentfiles[i] = (uint16)str2[i];
+               info->dependentfiles[i] = SSVAL(&info->dependentfiles[i], 0, str2[i]);
        }
        info->dependentfiles[len] = '\0';