test: ctseacc.c File Reference

Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# ctseacc.c File Reference

`#include "tsecomm.c"`

Go to the source code of this file.

## Functions

BOOLEAN | TestSeInitialize ()
BOOLEAN | TestSeUnnamedCreate ()
BOOLEAN | TestSeNamedCreate ()
BOOLEAN | TestSeQuerySecurity ()
BOOLEAN | TestSeSetSecurity ()
BOOLEAN | TestSeAccess ()
BOOLEAN | TSeAcc ()

## Variables

NTSTATUS | Status
STRING | Event1Name
STRING | Process1Name
UNICODE_STRING | UnicodeEvent1Name
UNICODE_STRING | UnicodeProcess1Name
OBJECT_ATTRIBUTES | NullObjectAttributes
HANDLE | Event1
OBJECT_ATTRIBUTES | Event1ObjectAttributes
PSECURITY_DESCRIPTOR | Event1SecurityDescriptor
PSID | Event1Owner
PSID | Event1Group
PACL | Event1Dacl
PACL | Event1Sacl
PACL | TDacl
BOOLEAN | TDaclPresent
BOOLEAN | TDaclDefaulted
PACL | TSacl
BOOLEAN | TSaclPresent
BOOLEAN | TSaclDefaulted
PSID | TOwner
BOOLEAN | TOwnerDefaulted
PSID | TGroup
BOOLEAN | TGroupDefaulted
HANDLE | Process1
OBJECT_ATTRIBUTES | Process1ObjectAttributes

## Function Documentation

BOOLEAN TestSeAccess | ( |  | ) |

Definition at line 636 of file ctseacc.c.

References ASSERT, DbgPrint, Event1, Event1ObjectAttributes, Event1SecurityDescriptor, FALSE, NT_SUCCESS, NtClose(), NtCreateEvent(), NtSetEvent(), NULL, RtlCreateSecurityDescriptor(), Status, and TRUE.

Referenced by TSeAcc().

    00638         :
    00639 //
    00640 //      Creation
    00641 //          No Access Requested (should be rejected)
    00642 //          Specific Access Requested
    00643 //              - Attempted Granted
    00644 //              - Attempt Ungranted
    00645 //          Access System Security
    00646 //
    00647 //       Open Existing
    00648 //          No Access Requested (should be rejected)
    00649 //          Specific Access Requested
    00650 //              - Attempted Granted
    00651 //              - Attempt Ungranted
    00652 //          Access System Security
    00653 //
    00654
    00655 {
    00656     BOOLEAN CompletionStatus = TRUE;
    00657
    00658     DbgPrint("                                                               ");
    00659     DbgPrint("  Not Implemented.\n");
    00660 #if 0
    00661
    00662     DbgPrint("Se:     Creation...\n");
    00663     DbgPrint("Se:         No Access Requested (should be rejected)... ");
    00664     DbgPrint("  Not Implemented.\n");
    00665     DbgPrint("Se:         Specific Access Requested... ");
    00666     DbgPrint("  Not Implemented.\n");
    00667     DbgPrint("Se:             - Attempted Granted... ");
    00668     DbgPrint("  Not Implemented.\n");
    00669     DbgPrint("Se:             - Attempt Ungranted... ");
    00670     DbgPrint("  Not Implemented.\n");
    00671     DbgPrint("Se:         Access System Security... ");
    00672     DbgPrint("  Not Implemented.\n");
    00673
    00674     DbgPrint("Se:      Open Existing...\n");
    00675     DbgPrint("Se:         No Access Requested (should be rejected)... ");
    00676     DbgPrint("  Not Implemented.\n");
    00677     DbgPrint("Se:         Specific Access Requested... ");
    00678     DbgPrint("  Not Implemented.\n");
    00679     DbgPrint("Se:             - Attempted Granted... ");
    00680     DbgPrint("  Not Implemented.\n");
    00681     DbgPrint("Se:             - Attempt Ungranted... ");
    00682     DbgPrint("  Not Implemented.\n");
    00683     DbgPrint("Se:         Access System Security... ");
    00684     DbgPrint("  Not Implemented.\n");
    00685 #endif //0
    00686
    00687 #if 0  //old code
    00688 // Without security descriptor
    00689 // Simple desired access mask...
    00690 //
    00691
    00692     DbgPrint("Se:     Test1b... \n");         // Attempt ungranted access
    00693     Status = NtSetEvent(
    00694                  Event1,
    00695                  NULL
    00696                  );
    00697     ASSERT(!NT_SUCCESS(Status));
    00698
    00699     DbgPrint("Se:     Test1c... \n");         // Delete object
    00700     Status = NtClose(Event1);
    00701     ASSERT(NT_SUCCESS(Status));
    00702
    00703
    00704     //
    00705     // Without security descriptor
    00706     // Simple desired access mask...
    00707     //
    00708
    00709     DbgPrint("Se:     Test2a... \n");         // unnamed object, specific access
    00710     Status = NtCreateEvent(
    00711                  &Event1,
    00712                  (EVENT_MODIFY_STATE | STANDARD_DELETE),
    00713                  &Event1ObjectAttributes,
    00714                  NotificationEvent,
    00715                  FALSE
    00716                  );
    00717     ASSERT(NT_SUCCESS(Status));
    00718
    00719     DbgPrint("Se:     Test2b... \n");         // Attempt granted specific access
    00720     Status = NtSetEvent(
    00721                  Event1,
    00722                  NULL
    00723                  );
    00724     ASSERT(NT_SUCCESS(Status));
    00725
    00726     DbgPrint("Se:     Test2c... \n");         // Delete object
    00727
    00728
    00729     //
    00730     // Without security descriptor
    00731     // Generic desired access mask...
    00732     //
    00733
    00734     DbgPrint("Se:     Test3a... \n");         // Unnamed object, generic mask
    00735     Status = NtCreateEvent(
    00736                  &Event1,
    00737                  GENERIC_EXECUTE,
    00738                  &Event1ObjectAttributes,
    00739                  NotificationEvent,
    00740                  FALSE
    00741                  );
    00742     ASSERT(NT_SUCCESS(Status));
    00743
    00744     DbgPrint("Se:     Test3b... \n");         // Attempt implied granted access
    00745     Status = NtSetEvent(
    00746                  Event1,
    00747                  NULL
    00748                  );
    00749     ASSERT(NT_SUCCESS(Status));
    00750
    00751     DbgPrint("Se:     Test3c... \n");         // Delete object
    00752     Status = NtClose(Event1);
    00753     ASSERT(NT_SUCCESS(Status));
    00754
    00755
    00756     //
    00757     // Without security descriptor
    00758     // Empty desired access mask...
    00759     //
    00760
    00761     DbgPrint("Se:     Test4a... \n");         // Empty desired access
    00762     Status = NtCreateEvent(
    00763                  &Event1,
    00764                  0,
    00765                  &Event1ObjectAttributes,
    00766                  NotificationEvent,
    00767                  FALSE
    00768                  );
    00769     ASSERT(!NT_SUCCESS(Status));
    00770
    00771
    00772     RtlCreateSecurityDescriptor( Event1SecurityDescriptor,
    00773                                  SECURITY_DESCRIPTOR_REVISION);
    00774     InitializeObjectAttributes(&Event1ObjectAttributes,
    00775                                NULL, 0, NULL,
    00776                                Event1SecurityDescriptor);
    00777     DbgPrint("Se:     Empty Security Descriptor... \n");
    00778
    00779     //
    00780     // Without security descriptor
    00781     // Simple desired access mask...
    00782     //
    00783
    00784     DbgPrint("Se:     Test1a... \n");         // Create unnamed object
    00785     Status = NtCreateEvent(
    00786                  &Event1,
    00787                  STANDARD_DELETE,
    00788                  &Event1ObjectAttributes,
    00789                  NotificationEvent,
    00790                  FALSE
    00791                  );
    00792     ASSERT(NT_SUCCESS(Status));
    00793
    00794     DbgPrint("Se:     Test1b... \n");         // Attempt ungranted access
    00795     Status = NtSetEvent(
    00796                  Event1,
    00797                  NULL
    00798                  );
    00799     ASSERT(!NT_SUCCESS(Status));
    00800
    00801     DbgPrint("Se:     Test1c... \n");         // Delete object
    00802     Status = NtClose(Event1);
    00803     ASSERT(NT_SUCCESS(Status));
    00804
    00805
    00806     //
    00807     // Without security descriptor
    00808     // Simple desired access mask...
    00809     //
    00810
    00811     DbgPrint("Se:     Test2a... \n");         // unnamed object, specific access
    00812     Status = NtCreateEvent(
    00813                  &Event1,
    00814                  (EVENT_MODIFY_STATE | STANDARD_DELETE),
    00815                  &Event1ObjectAttributes,
    00816                  NotificationEvent,
    00817                  FALSE
    00818                  );
    00819     ASSERT(NT_SUCCESS(Status));
    00820
    00821     DbgPrint("Se:     Test2b... \n");         // Attempt granted specific access
    00822     Status = NtSetEvent(
    00823                  Event1,
    00824                  NULL
    00825                  );
    00826     ASSERT(NT_SUCCESS(Status));
    00827
    00828     DbgPrint("Se:     Test2c... \n");         // Delete object
    00829     Status = NtClose(Event1);
    00830     ASSERT(NT_SUCCESS(Status));
    00831
    00832
    00833     //
    00834     // Without security descriptor
    00835     // Generic desired access mask...
    00836     //
    00837
    00838     DbgPrint("Se:     Test3a... \n");         // Unnamed object, generic mask
    00839     Status = NtCreateEvent(
    00840                  &Event1,
    00841                  GENERIC_EXECUTE,
    00842                  &Event1ObjectAttributes,
    00843                  NotificationEvent,
    00844                  FALSE
    00845                  );
    00846     ASSERT(NT_SUCCESS(Status));
    00847
    00848     DbgPrint("Se:     Test3b... \n");         // Attempt implied granted access
    00849     Status = NtSetEvent(
    00850                  Event1,
    00851                  NULL
    00852                  );
    00853     ASSERT(NT_SUCCESS(Status));
    00854
    00855     DbgPrint("Se:     Test3c... \n");         // Delete object
    00856     Status = NtClose(Event1);
    00857     ASSERT(NT_SUCCESS(Status));
    00858
    00859
    00860     //
    00861     // Without security descriptor
    00862     // Empty desired access mask...
    00863     //
    00864
    00865     DbgPrint("Se:     Test4a... \n");         // Empty desired access
    00866     Status = NtCreateEvent(
    00867                  &Event1,
    00868                  0,
    00869                  &Event1ObjectAttributes,
    00870                  NotificationEvent,
    00871                  FALSE
    00872                  );
    00873     ASSERT(!NT_SUCCESS(Status));
    00874 #endif // old code
    00875
    00876     return CompletionStatus;
    00877 }

BOOLEAN TestSeInitialize | ( |  | ) |

Definition at line 86 of file ctseacc.c.

References Event1Name, Event1SecurityDescriptor, NT_SUCCESS, NULL, NullObjectAttributes, PagedPool, Process1Name, RtlAnsiStringToUnicodeString(), RtlInitString(), SEASSERT_SUCCESS, Status, TDacl, TRUE, TSacl, UnicodeEvent1Name, and UnicodeProcess1Name.

Referenced by TSeAcc().

    00087 {
    00088
    00089     Event1SecurityDescriptor = (PSECURITY_DESCRIPTOR)TstAllocatePool( PagedPool, 1024 );
    00090
    00091     RtlInitString(&Event1Name, "\\SecurityTestEvent1");
    00092     Status = RtlAnsiStringToUnicodeString(
    00093                  &UnicodeEvent1Name,
    00094                  &Event1Name,
    00095                  TRUE );  SEASSERT_SUCCESS( NT_SUCCESS(Status) );
    00096     RtlInitString(&Process1Name, "\\SecurityTestProcess1");
    00097     Status = RtlAnsiStringToUnicodeString(
    00098                  &UnicodeProcess1Name,
    00099                  &Process1Name,
    00100                  TRUE );  SEASSERT_SUCCESS( NT_SUCCESS(Status) );
    00101
    00102     InitializeObjectAttributes(&NullObjectAttributes, NULL, 0, NULL, NULL);
    00103
    00104     //
    00105     // Build an ACL or two for use.
    00106
    00107     TDacl        = (PACL)TstAllocatePool( PagedPool, 256 );
    00108     TSacl        = (PACL)TstAllocatePool( PagedPool, 256 );
    00109
    00110     TDacl->AclRevision=TSacl->AclRevision=ACL_REVISION;
    00111     TDacl->Sbz1=TSacl->Sbz1=0;
    00112     TDacl->Sbz2=TSacl->Sbz2=0;
    00113     TDacl->AclSize=256;
    00114     TSacl->AclSize=8;
    00115     TDacl->AceCount=TSacl->AceCount=0;
    00116
    00117     return TRUE;
    00118 }

BOOLEAN TestSeNamedCreate | ( |  | ) |

Definition at line 213 of file ctseacc.c.

References ASSERT, DbgPrint, Event1, Event1ObjectAttributes, Event1SecurityDescriptor, FALSE, NT_SUCCESS, NtClose(), NtCreateEvent(), NULL, RtlCreateSecurityDescriptor(), RtlSetDaclSecurityDescriptor(), Status, TDacl, TRUE, and UnicodeEvent1Name.

Referenced by TSeAcc().

    00215         :
    00216 //      No Security Specified
    00217 //          No Inheritence
    00218 //          Dacl Inheritence
    00219 //          Sacl Inheritence
    00220 //          Dacl Inheritence With Creator ID
    00221 //          Dacl & Sacl Inheritence
    00222 //
    00223 //      Empty Security Descriptor Explicitly Specified
    00224 //          No Inheritence
    00225 //          Dacl Inheritence
    00226 //          Sacl Inheritence
    00227 //          Dacl & Sacl Inheritence
    00228 //
    00229 //      Explicit Dacl Specified
    00230 //          No Inheritence
    00231 //          Dacl Inheritence
    00232 //          Sacl Inheritence
    00233 //          Dacl & Sacl Inheritence
    00234 //
    00235 //      Explicit Sacl Specified (W/Privilege)
    00236 //          No Inheritence
    00237 //          Dacl & Sacl Inheritence
    00238 //
    00239 //      Default Dacl Specified
    00240 //          No Inheritence
    00241 //          Dacl Inheritence
    00242 //          Sacl Inheritence
    00243 //          Dacl & Sacl Inheritence
    00244 //
    00245 //      Default Sacl Specified (W/Privilege)
    00246 //          No Inheritence
    00247 //          Dacl & Sacl Inheritence
    00248 //
    00249 //      Explicit Sacl Specified (W/O Privilege - should be rejected)
    00250 //      Default Sacl Specified (W/O Privilege - should be rejected)
    00251 //
    00252 //      Valid Owner Explicitly Specified
    00253 //      Invalid Owner Explicitly Specified
    00254 //
    00255 //      Explicit Group Specified
    00256 //
    00257 {
    00258
    00259     BOOLEAN CompletionStatus = TRUE;
    00260
    00261
    00262     InitializeObjectAttributes(
    00263         &Event1ObjectAttributes,
    00264         &UnicodeEvent1Name,
    00265         0,
    00266         NULL,
    00267         NULL);
    00268
    00269     DbgPrint("Se:     No Security Specified...                             Test\n");
    00270     DbgPrint("Se:         No Inheritence...                                  ");
    00271     Status = NtCreateEvent(
    00272                  &Event1,
    00273                  DELETE,
    00274                  &Event1ObjectAttributes,
    00275                  NotificationEvent,
    00276                  FALSE
    00277                  );
    00278     if (NT_SUCCESS(Status)) {
    00279         DbgPrint("Succeeded.\n");
    00280     } else {
    00281         DbgPrint(" **** Failed ****\n");
    00282         CompletionStatus = FALSE;
    00283     }
    00284     ASSERT(NT_SUCCESS(Status));
    00285     Status = NtClose(Event1);
    00286     ASSERT(NT_SUCCESS(Status));
    00287
    00288     DbgPrint("Se:         Dacl Inheritence...                                ");
    00289     DbgPrint("  Not Implemented.\n");
    00290     DbgPrint("Se:         Sacl Inheritence...                                ");
    00291     DbgPrint("  Not Implemented.\n");
    00292     DbgPrint("Se:         Dacl Inheritence With Creator ID...                ");
    00293     DbgPrint("  Not Implemented.\n");
    00294     DbgPrint("Se:         Dacl & Sacl Inheritence...                         ");
    00295     DbgPrint("  Not Implemented.\n");
    00296
    00297     DbgPrint("Se:     Empty Security Descriptor Explicitly Specified...    Test\n");
    00298     DbgPrint("Se:         No Inheritence...                                  ");
    00299
    00300     RtlCreateSecurityDescriptor( Event1SecurityDescriptor, 1 );
    00301     InitializeObjectAttributes(&Event1ObjectAttributes,
    00302                                &UnicodeEvent1Name,
    00303                                0,
    00304                                NULL,
    00305                                Event1SecurityDescriptor);
    00306     Status = NtCreateEvent(
    00307                  &Event1,
    00308                  DELETE,
    00309                  &Event1ObjectAttributes,
    00310                  NotificationEvent,
    00311                  FALSE
    00312                  );
    00313     if (NT_SUCCESS(Status)) {
    00314         DbgPrint("Succeeded.\n");
    00315     } else {
    00316         DbgPrint(" **** Failed ****\n");
    00317         CompletionStatus = FALSE;
    00318     }
    00319     ASSERT(NT_SUCCESS(Status));
    00320     Status = NtClose(Event1);
    00321     ASSERT(NT_SUCCESS(Status));
    00322
    00323
    00324
    00325
    00326     DbgPrint("Se:         Dacl Inheritence...                                ");
    00327     DbgPrint("  Not Implemented.\n");
    00328     DbgPrint("Se:         Sacl Inheritence...                                ");
    00329     DbgPrint("  Not Implemented.\n");
    00330     DbgPrint("Se:         Dacl & Sacl Inheritence...                         ");
    00331     DbgPrint("  Not Implemented.\n");
    00332
    00333     DbgPrint("Se:     Explicit Dacl Specified...                           Test\n");
    00334     DbgPrint("Se:         No Inheritence...                                  ");
    00335
    00336     RtlCreateSecurityDescriptor( Event1SecurityDescriptor, 1 );
    00337     RtlSetDaclSecurityDescriptor( Event1SecurityDescriptor, TRUE, TDacl, FALSE );
    00338
    00339     InitializeObjectAttributes(&Event1ObjectAttributes,
    00340                                &UnicodeEvent1Name,
    00341                                0,
    00342                                NULL,
    00343                                Event1SecurityDescriptor);
    00344     Status = NtCreateEvent(
    00345                  &Event1,
    00346                  DELETE,
    00347                  &Event1ObjectAttributes,
    00348                  NotificationEvent,
    00349                  FALSE
    00350                  );
    00351     if (NT_SUCCESS(Status)) {
    00352         DbgPrint("Succeeded.\n");
    00353     } else {
    00354         DbgPrint(" **** Failed ****\n");
    00355         CompletionStatus = FALSE;
    00356     }
    00357     ASSERT(NT_SUCCESS(Status));
    00358     Status = NtClose(Event1);
    00359     ASSERT(NT_SUCCESS(Status));
    00360
    00361     DbgPrint("Se:         Dacl Inheritence...                                ");
    00362     DbgPrint("  Not Implemented.\n");
    00363     DbgPrint("Se:         Sacl Inheritence...                                ");
    00364     DbgPrint("  Not Implemented.\n");
    00365     DbgPrint("Se:         Dacl & Sacl Inheritence...                         ");
    00366     DbgPrint("  Not Implemented.\n");
    00367
    00368     DbgPrint("Se:     Explicit Sacl Specified (W/Privilege)...             Test\n");
    00369     DbgPrint("Se:         No Inheritence...                                  ");
    00370     DbgPrint("  Not Implemented.\n");
    00371     DbgPrint("Se:         Dacl & Sacl Inheritence...                         ");
    00372     DbgPrint("  Not Implemented.\n");
    00373
    00374     DbgPrint("Se:     Default Dacl Specified...                            Test\n");
    00375     DbgPrint("Se:         No Inheritence...                                  ");
    00376     DbgPrint("  Not Implemented.\n");
    00377     DbgPrint("Se:         Dacl Inheritence...                                ");
    00378     DbgPrint("  Not Implemented.\n");
    00379     DbgPrint("Se:         Sacl Inheritence...                                ");
    00380     DbgPrint("  Not Implemented.\n");
    00381     DbgPrint("Se:         Dacl & Sacl Inheritence...                         ");
    00382     DbgPrint("  Not Implemented.\n");
    00383
    00384     DbgPrint("Se:     Default Sacl  (W/Privilege)...                       Test\n");
    00385     DbgPrint("Se:         No Inheritence...                                  ");
    00386     DbgPrint("  Not Implemented.\n");
    00387     DbgPrint("Se:         Dacl & Sacl Inheritence...                         ");
    00388     DbgPrint("  Not Implemented.\n");
    00389
    00390     DbgPrint("Se:     Explicit Sacl (W/O Privilege)...                     Test\n");
    00391     DbgPrint("                                                               ");
    00392     DbgPrint("  Not Implemented.\n");
    00393     DbgPrint("Se:     Default Sacl (W/O Privilege)...                      Test\n");
    00394     DbgPrint("                                                               ");
    00395     DbgPrint("  Not Implemented.\n");
    00396
    00397     DbgPrint("Se:     Valid Owner Explicitly Specified...                  Test\n");
    00398     DbgPrint("                                                               ");
    00399     DbgPrint("  Not Implemented.\n");
    00400     DbgPrint("Se:     Invalid Owner Explicitly Specified...                Test\n");
    00401     DbgPrint("                                                               ");
    00402     DbgPrint("  Not Implemented.\n");
    00403
    00404     DbgPrint("Se:     Explicit Group Specified...                          Test\n");
    00405     DbgPrint("                                                               ");
    00406     DbgPrint("  Not Implemented.\n");
    00407
    00408
    00409
    00410     return CompletionStatus;
    00411
    00412 }

BOOLEAN TestSeQuerySecurity | ( |  | ) |

Definition at line 415 of file ctseacc.c.

References DbgPrint, and TRUE.

Referenced by TSeAcc().

    00417         :
    00418 //      No Security Descriptor
    00419 //          Query Owner
    00420 //          Query Group
    00421 //          Query  Dacl
    00422 //          Query Sacl (Privileged)
    00423 //          Query Sacl (Unprivileged - should be rejected)
    00424 //
    00425 //      Empty Security Descriptor
    00426 //          Query Owner
    00427 //          Query Group
    00428 //          Query  Dacl
    00429 //          Query Sacl (Privileged)
    00430 //          Query Sacl (Unprivileged - should be rejected)
    00431 //
    00432 //      Security Descriptor W/ Owner & Group
    00433 //          Query Owner
    00434 //          Query Group
    00435 //          Query  Dacl
    00436 //          Query Sacl (Privileged)
    00437 //          Query Sacl (Unprivileged - should be rejected)
    00438 //
    00439 //      Full Security Descriptor
    00440 //          Query Owner
    00441 //          Query Group
    00442 //          Query  Dacl
    00443 //          Query Sacl (Privileged)
    00444 //          Query Sacl (Unprivileged - should be rejected)
    00445 //
    00446 {
    00447
    00448     BOOLEAN CompletionStatus = TRUE;
    00449
    00450     DbgPrint("                                                               ");
    00451     DbgPrint("  Not Implemented.\n");
    00452
    00453 #if 0
    00454     DbgPrint("Se:     No Security Descriptor... \n");
    00455     DbgPrint("Se:         Query Owner... ");
    00456     DbgPrint("  Not Implemented.\n");
    00457     DbgPrint("Se:         Query Group... ");
    00458     DbgPrint("  Not Implemented.\n");
    00459     DbgPrint("Se:         Query  Dacl... ");
    00460     DbgPrint("  Not Implemented.\n");
    00461     DbgPrint("Se:         Query Sacl (Privileged)... ");
    00462     DbgPrint("  Not Implemented.\n");
    00463     DbgPrint("Se:         Query Sacl (Unprivileged)... ");
    00464     DbgPrint("  Not Implemented.\n");
    00465
    00466     DbgPrint("Se:     Empty Security Descriptor... \n");
    00467     DbgPrint("Se:         Query Owner... ");
    00468     DbgPrint("  Not Implemented.\n");
    00469     DbgPrint("Se:         Query Group... ");
    00470     DbgPrint("  Not Implemented.\n");
    00471     DbgPrint("Se:         Query  Dacl... ");
    00472     DbgPrint("  Not Implemented.\n");
    00473     DbgPrint("Se:         Query Sacl (Privileged)... ");
    00474     DbgPrint("  Not Implemented.\n");
    00475     DbgPrint("Se:         Query Sacl (Unprivileged)... ");
    00476     DbgPrint("  Not Implemented.\n");
    00477
    00478     DbgPrint("Se:     Security Descriptor W/ Owner & Group... \n");
    00479     DbgPrint("Se:         Query Owner... ");
    00480     DbgPrint("  Not Implemented. \n");
    00481     DbgPrint("Se:         Query Group... ");
    00482     DbgPrint("  Not Implemented.\n");
    00483     DbgPrint("Se:         Query  Dacl... ");
    00484     DbgPrint("  Not Implemented.\n");
    00485     DbgPrint("Se:         Query Sacl (Privileged)... ");
    00486     DbgPrint("  Not Implemented.\n");
    00487     DbgPrint("Se:         Query Sacl (Unprivileged)... ");
    00488     DbgPrint("  Not Implemented.\n");
    00489
    00490     DbgPrint("Se:     Full Security Descriptor...\n");
    00491     DbgPrint("Se:         Query Owner... ");
    00492     DbgPrint("  Not Implemented.\n");
    00493     DbgPrint("Se:         Query Group... ");
    00494     DbgPrint("  Not Implemented.\n");
    00495     DbgPrint("Se:         Query  Dacl... ");
    00496     DbgPrint("  Not Implemented.\n");
    00497     DbgPrint("Se:         Query Sacl (Privileged)... ");
    00498     DbgPrint("  Not Implemented.\n");
    00499     DbgPrint("Se:         Query Sacl (Unprivileged)... ");
    00500     DbgPrint("  Not Implemented.\n");
    00501 #endif //0
    00502
    00503     return CompletionStatus;
    00504 }

BOOLEAN TestSeSetSecurity | ( |  | ) |

Definition at line 507 of file ctseacc.c.

References DbgPrint, and TRUE.

Referenced by TSeAcc().

    00509         :
    00510 //      No Security Descriptor
    00511 //          Set Valid Owner SID
    00512 //          Set Invalid Owner SID
    00513 //          Set Group
    00514 //          Set Dacl (explicitly granted by dacl)
    00515 //          Set Dacl (by virtue of ownership)
    00516 //          Set Dacl (invalid attempt)
    00517 //          Set Sacl (privileged)
    00518 //          Set Sacl (unprivileged - should be rejected)
    00519 //
    00520 //      Empty Security Descriptor
    00521 //          Set Valid Owner SID
    00522 //          Set Invalid Owner SID
    00523 //          Set Group
    00524 //          Set Dacl (explicitly granted by dacl)
    00525 //          Set Dacl (by virtue of ownership)
    00526 //          Set Dacl (invalid attempt)
    00527 //          Set Sacl (privileged)
    00528 //          Set Sacl (unprivileged - should be rejected)
    00529 //
    00530 //      Security Descriptor W/ Owner & Group Only
    00531 //          Set Valid Owner SID
    00532 //          Set Invalid Owner SID
    00533 //          Set Group
    00534 //          Set Dacl (explicitly granted by dacl)
    00535 //          Set Dacl (by virtue of ownership)
    00536 //          Set Dacl (invalid attempt)
    00537 //          Set Sacl (privileged)
    00538 //          Set Sacl (unprivileged - should be rejected)
    00539 //
    00540 //      Full Security Descriptor
    00541 //          Set Valid Owner SID
    00542 //          Set Invalid Owner SID
    00543 //          Set Group
    00544 //          Set Dacl (explicitly granted by dacl)
    00545 //          Set Dacl (by virtue of ownership)
    00546 //          Set Dacl (invalid attempt)
    00547 //          Set Sacl (privileged)
    00548 //          Set Sacl (unprivileged - should be rejected)
    00549 //
    00550 {
    00551
    00552     BOOLEAN CompletionStatus = TRUE;
    00553
    00554     DbgPrint("                                                               ");
    00555     DbgPrint("  Not Implemented.\n");
    00556 #if 0
    00557     DbgPrint("Se:     No Security Descriptor...\n");
    00558     DbgPrint("Se:         Set Valid Owner SID... ");
    00559     DbgPrint("  Not Implemented.\n");
    00560     DbgPrint("Se:         Set Invalid Owner SID... ");
    00561     DbgPrint("  Not Implemented.\n");
    00562     DbgPrint("Se:         Set Group... ");
    00563     DbgPrint("  Not Implemented.\n");
    00564     DbgPrint("Se:         Set Dacl (explicitly granted by dacl)... ");
    00565     DbgPrint("  Not Implemented.\n");
    00566     DbgPrint("Se:         Set Dacl (by virtue of ownership)... ");
    00567     DbgPrint("  Not Implemented.\n");
    00568     DbgPrint("Se:         Set Dacl (invalid attempt)... ");
    00569     DbgPrint("  Not Implemented.\n");
    00570     DbgPrint("Se:         Set Sacl (privileged)... ");
    00571     DbgPrint("  Not Implemented.\n");
    00572     DbgPrint("Se:         Set Sacl (unprivileged - should be rejected)... ");
    00573     DbgPrint("  Not Implemented.\n");
    00574
    00575     DbgPrint("Se:     Empty Security Descriptor...\n");
    00576     DbgPrint("Se:         Set Valid Owner SID... ");
    00577     DbgPrint("  Not Implemented.\n");
    00578     DbgPrint("Se:         Set Invalid Owner SID... ");
    00579     DbgPrint("  Not Implemented.\n");
    00580     DbgPrint("Se:         Set Group... ");
    00581     DbgPrint("  Not Implemented.\n");
    00582     DbgPrint("Se:         Set Dacl (explicitly granted by dacl)... ");
    00583     DbgPrint("  Not Implemented.\n");
    00584     DbgPrint("Se:         Set Dacl (by virtue of ownership)... ");
    00585     DbgPrint("  Not Implemented.\n");
    00586     DbgPrint("Se:         Set Dacl (invalid attempt)... ");
    00587     DbgPrint("  Not Implemented.\n");
    00588     DbgPrint("Se:         Set Sacl (privileged)... ");
    00589     DbgPrint("  Not Implemented.\n");
    00590     DbgPrint("Se:         Set Sacl (unprivileged - should be rejected)... ");
    00591     DbgPrint("  Not Implemented.\n");
    00592
    00593     DbgPrint("Se:     Security Descriptor W/ Owner & Group Only...\n");
    00594     DbgPrint("Se:         Set Valid Owner SID... ");
    00595     DbgPrint("  Not Implemented.\n");
    00596     DbgPrint("Se:         Set Invalid Owner SID... ");
    00597     DbgPrint("  Not Implemented.\n");
    00598     DbgPrint("Se:         Set Group... ");
    00599     DbgPrint("  Not Implemented.\n");
    00600     DbgPrint("Se:         Set Dacl (explicitly granted by dacl)... ");
    00601     DbgPrint("  Not Implemented.\n");
    00602     DbgPrint("Se:         Set Dacl (by virtue of ownership)... ");
    00603     DbgPrint("  Not Implemented.\n");
    00604     DbgPrint("Se:         Set Dacl (invalid attempt)... ");
    00605     DbgPrint("  Not Implemented.\n");
    00606     DbgPrint("Se:         Set Sacl (privileged)... ");
    00607     DbgPrint("  Not Implemented.\n");
    00608     DbgPrint("Se:         Set Sacl (unprivileged - should be rejected)... ");
    00609     DbgPrint("  Not Implemented.\n");
    00610
    00611     DbgPrint("Se:     Full Security Descriptor...\n");
    00612     DbgPrint("Se:         Set Valid Owner SID... ");
    00613     DbgPrint("  Not Implemented.\n");
    00614     DbgPrint("Se:         Set Invalid Owner SID... ");
    00615     DbgPrint("  Not Implemented.\n");
    00616     DbgPrint("Se:         Set Group... ");
    00617     DbgPrint("  Not Implemented.\n");
    00618     DbgPrint("Se:         Set Dacl (explicitly granted by dacl)... ");
    00619     DbgPrint("  Not Implemented.\n");
    00620     DbgPrint("Se:         Set Dacl (by virtue of ownership)... ");
    00621     DbgPrint("  Not Implemented.\n");
    00622     DbgPrint("Se:         Set Dacl (invalid attempt)... ");
    00623     DbgPrint("  Not Implemented.\n");
    00624     DbgPrint("Se:         Set Sacl (privileged)... ");
    00625     DbgPrint("  Not Implemented.\n");
    00626     DbgPrint("Se:         Set Sacl (unprivileged - should be rejected)... ");
    00627     DbgPrint("  Not Implemented.\n");
    00628
    00629 #endif //0
    00630
    00631     return CompletionStatus;
    00632
    00633 }

BOOLEAN TestSeUnnamedCreate | ( |  | ) |

Definition at line 129 of file ctseacc.c.

References ASSERT, DbgPrint, Event1, Event1ObjectAttributes, FALSE, NT_SUCCESS, NtClose(), NtCreateEvent(), NULL, Status, and TRUE.

Referenced by TSeAcc().

    00131         :
    00132 //      No Security Specified
    00133 //          No Inheritence
    00134 //          Dacl Inheritence
    00135 //          Sacl Inheritence
    00136 //          Dacl Inheritence With Creator ID
    00137 //          Dacl & Sacl Inheritence
    00138 //
    00139 //      Empty Security Descriptor Explicitly Specified
    00140 //          No Inheritence
    00141 //          Dacl Inheritence
    00142 //          Sacl Inheritence
    00143 //          Dacl & Sacl Inheritence
    00144 //
    00145 //      Explicit Dacl Specified
    00146 //          No Inheritence
    00147 //          Dacl Inheritence
    00148 //          Sacl Inheritence
    00149 //          Dacl & Sacl Inheritence
    00150 //
    00151 //      Explicit Sacl Specified (W/Privilege)
    00152 //          No Inheritence
    00153 //          Dacl & Sacl Inheritence
    00154 //
    00155 //      Default Dacl Specified
    00156 //          No Inheritence
    00157 //          Dacl Inheritence
    00158 //          Sacl Inheritence
    00159 //          Dacl & Sacl Inheritence
    00160 //
    00161 //      Default Sacl Specified (W/Privilege)
    00162 //          No Inheritence
    00163 //          Dacl & Sacl Inheritence
    00164 //
    00165 //      Explicit Sacl Specified (W/O Privilege - should be rejected)
    00166 //      Default Sacl Specified (W/O Privilege - should be rejected)
    00167 //
    00168 //      Valid Owner Explicitly Specified
    00169 //      Invalid Owner Explicitly Specified
    00170 //
    00171 //      Explicit Group Specified
    00172 //
    00173 {
    00174
    00175
    00176     BOOLEAN CompletionStatus = TRUE;
    00177
    00178     InitializeObjectAttributes(&Event1ObjectAttributes, NULL, 0, NULL, NULL);
    00179     DbgPrint("Se:     No Security Descriptor...                            Test\n");
    00180     DbgPrint("Se:         No Inheritence...                                  ");
    00181
    00182     Status = NtCreateEvent(
    00183                  &Event1,
    00184                  DELETE,
    00185                  &Event1ObjectAttributes,
    00186                  NotificationEvent,
    00187                  FALSE
    00188                  );
    00189     if (NT_SUCCESS(Status)) {
    00190         DbgPrint("Succeeded.\n");
    00191     } else {
    00192         DbgPrint(" **** Failed ****\n");
    00193         CompletionStatus = FALSE;
    00194     }
    00195     ASSERT(NT_SUCCESS(Status));
    00196     Status = NtClose(Event1);
    00197     ASSERT(NT_SUCCESS(Status));
    00198
    00199     DbgPrint("Se:         Dacl Inheritence...                                ");
    00200     DbgPrint("  Not Implemented.\n");
    00201     DbgPrint("Se:         Sacl Inheritence...                                ");
    00202     DbgPrint("  Not Implemented.\n");
    00203     DbgPrint("Se:         Dacl Inheritence W/ Creator ID...                  ");
    00204     DbgPrint("  Not Implemented.\n");
    00205     DbgPrint("Se:         Dacl And Sacl Inheritence...                       ");
    00206     DbgPrint("  Not Implemented.\n");
    00207
    00208     return CompletionStatus;
    00209
    00210 }

BOOLEAN TSeAcc | ( |  | ) |

Definition at line 880 of file ctseacc.c.

References DbgPrint, FALSE, TestSeAccess(), TestSeInitialize(), TestSeNamedCreate(), TestSeQuerySecurity(), TestSeSetSecurity(), TestSeUnnamedCreate(), and TRUE.

Referenced by Test().

    00881 {
    00882     BOOLEAN Result = TRUE;
    00883
    00884     DbgPrint("Se:   Initialization...                                        ");
    00885     TestSeInitialize();
    00886     DbgPrint("Succeeded.\n");
    00887
    00888     DbgPrint("Se:   Unnamed Object Creation Test...                      Suite\n");
    00889     if (!TestSeUnnamedCreate()) {
    00890         Result = FALSE;
    00891     }
    00892     DbgPrint("Se:   Named Object Creation Test...                        Suite\n");
    00893     if (!TestSeNamedCreate()) {
    00894         Result = FALSE;
    00895     }
    00896     DbgPrint("Se:   Query Object Security Descriptor Test...             Suite\n");
    00897     if (!TestSeQuerySecurity()) {
    00898         Result = FALSE;
    00899     }
    00900     DbgPrint("Se:   Set Object Security Descriptor Test...               Suite\n");
    00901     if (!TestSeSetSecurity()) {
    00902         Result = FALSE;
    00903     }
    00904     DbgPrint("Se:   Access Test...                                       Suite\n");
    00905     if (!TestSeAccess()) {
    00906         Result = FALSE;
    00907     }
    00908
    00909     DbgPrint("\n");
    00910     DbgPrint("\n");
    00911     DbgPrint("    ********************\n");
    00912     DbgPrint("    **                **\n");
    00913
    00914     if (Result = TRUE) {
    00915         DbgPrint("    ** Test Succeeded **\n");
    00916     } else {
    00917         DbgPrint("    **  Test Failed   **\n");
    00918     }
    00919
    00920     DbgPrint("    **                **\n");
    00921     DbgPrint("    ********************\n");
    00922     DbgPrint("\n");
    00923     DbgPrint("\n");
    00924
    00925     return Result;
    00926 }

## Variable Documentation

HANDLE Event1

| Definition at line 51 of file ctseacc.c. Referenced by TestSeAccess(), TestSeNamedCreate(), and TestSeUnnamedCreate().

PACL Event1Dacl

| Definition at line 56 of file ctseacc.c.

PSID Event1Group

| Definition at line 55 of file ctseacc.c.

STRING Event1Name

| Definition at line 46 of file ctseacc.c. Referenced by TestSeInitialize().

OBJECT_ATTRIBUTES Event1ObjectAttributes

| Definition at line 52 of file ctseacc.c. Referenced by TestSeAccess(), TestSeNamedCreate(), and TestSeUnnamedCreate().

PSID Event1Owner

| Definition at line 54 of file ctseacc.c.

PACL Event1Sacl

| Definition at line 57 of file ctseacc.c.

PSECURITY_DESCRIPTOR Event1SecurityDescriptor

| Definition at line 53 of file ctseacc.c. Referenced by TestSeAccess(), TestSeInitialize(), and TestSeNamedCreate().

OBJECT_ATTRIBUTES NullObjectAttributes

| Definition at line 49 of file ctseacc.c. Referenced by TestSeInitialize().

HANDLE Process1

| Definition at line 73 of file ctseacc.c.

STRING Process1Name

| Definition at line 46 of file ctseacc.c. Referenced by TestSeInitialize().

OBJECT_ATTRIBUTES Process1ObjectAttributes

| Definition at line 74 of file ctseacc.c.

NTSTATUS Status

| Definition at line 45 of file ctseacc.c.

PACL TDacl

| Definition at line 59 of file ctseacc.c. Referenced by TestSeAclRtl(), TestSeInitialize(), TestSeNamedCreate(), and TestSeSecurityDescriptor().

BOOLEAN TDaclDefaulted

| Definition at line 61 of file ctseacc.c. Referenced by TestSeSecurityDescriptor().

BOOLEAN TDaclPresent

| Definition at line 60 of file ctseacc.c. Referenced by TestSeSecurityDescriptor().

PSID TGroup

| Definition at line 69 of file ctseacc.c. Referenced by TestSeSecurityDescriptor().

BOOLEAN TGroupDefaulted

| Definition at line 70 of file ctseacc.c. Referenced by TestSeSecurityDescriptor().

PSID TOwner

| Definition at line 67 of file ctseacc.c. Referenced by TestSeSecurityDescriptor().

BOOLEAN TOwnerDefaulted

| Definition at line 68 of file ctseacc.c. Referenced by TestSeSecurityDescriptor().

PACL TSacl

| Definition at line 63 of file ctseacc.c. Referenced by TestSeInitialize(), and TestSeSecurityDescriptor().

BOOLEAN TSaclDefaulted

| Definition at line 65 of file ctseacc.c. Referenced by TestSeSecurityDescriptor().

BOOLEAN TSaclPresent

| Definition at line 64 of file ctseacc.c. Referenced by TestSeSecurityDescriptor().

UNICODE_STRING UnicodeEvent1Name

| Definition at line 47 of file ctseacc.c. Referenced by TestSeInitialize(), and TestSeNamedCreate().

UNICODE_STRING UnicodeProcess1Name

| Definition at line 47 of file ctseacc.c. Referenced by TestSeInitialize().