Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/utils/profiles.c

    r587 r740  
    1 /* 
    2    Samba Unix/Linux SMB client utility profiles.c 
    3    
    4    Copyright (C) Richard Sharpe, <rsharpe@richardsharpe.com>   2002 
    5    Copyright (C) Jelmer Vernooij (conversion to popt)          2003 
    6    Copyright (C) Gerald (Jerry) Carter                         2005 
     1/*
     2   Samba Unix/Linux SMB client utility profiles.c
     3
     4   Copyright (C) Richard Sharpe, <rsharpe@richardsharpe.com>   2002
     5   Copyright (C) Jelmer Vernooij (conversion to popt)          2003
     6   Copyright (C) Gerald (Jerry) Carter                         2005
    77
    88   This program is free software; you can redistribute it and/or modify
     
    1010   the Free Software Foundation; either version 3 of the License, or
    1111   (at your option) any later version.
    12    
     12
    1313   This program is distributed in the hope that it will be useful,
    1414   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1616   GNU General Public License for more details.
    17    
     17
    1818   You should have received a copy of the GNU General Public License
    19    along with this program.  If not, see <http://www.gnu.org/licenses/>. 
     19   along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2020*/
    21                                  
     21
    2222#include "includes.h"
    23 #include "regfio.h"
     23#include "system/filesys.h"
     24#include "popt_common.h"
     25#include "registry/reg_objects.h"
     26#include "registry/regfio.h"
     27#include "../libcli/security/security.h"
    2428
    2529/* GLOBAL VARIABLES */
    2630
    27 DOM_SID old_sid, new_sid;
     31struct dom_sid old_sid, new_sid;
    2832int change = 0, new_val = 0;
    2933int opt_verbose = False;
     
    5660********************************************************************/
    5761
    58 static bool swap_sid_in_acl( SEC_DESC *sd, DOM_SID *s1, DOM_SID *s2 )
     62static bool swap_sid_in_acl( struct security_descriptor *sd, struct dom_sid *s1, struct dom_sid *s2 )
    5963{
    60         SEC_ACL *theacl;
     64        struct security_acl *theacl;
    6165        int i;
    6266        bool update = False;
    6367
    6468        verbose_output("  Owner SID: %s\n", sid_string_tos(sd->owner_sid));
    65         if ( sid_equal( sd->owner_sid, s1 ) ) {
     69        if ( dom_sid_equal( sd->owner_sid, s1 ) ) {
    6670                sid_copy( sd->owner_sid, s2 );
    6771                update = True;
    68                 verbose_output("  New Owner SID: %s\n", 
     72                verbose_output("  New Owner SID: %s\n",
    6973                        sid_string_tos(sd->owner_sid));
    7074
     
    7276
    7377        verbose_output("  Group SID: %s\n", sid_string_tos(sd->group_sid));
    74         if ( sid_equal( sd->group_sid, s1 ) ) {
     78        if ( dom_sid_equal( sd->group_sid, s1 ) ) {
    7579                sid_copy( sd->group_sid, s2 );
    7680                update = True;
    77                 verbose_output("  New Group SID: %s\n", 
     81                verbose_output("  New Group SID: %s\n",
    7882                        sid_string_tos(sd->group_sid));
    7983        }
     
    8286        verbose_output("  DACL: %d entries:\n", theacl->num_aces);
    8387        for ( i=0; i<theacl->num_aces; i++ ) {
    84                 verbose_output("    Trustee SID: %s\n", 
     88                verbose_output("    Trustee SID: %s\n",
    8589                        sid_string_tos(&theacl->aces[i].trustee));
    86                 if ( sid_equal( &theacl->aces[i].trustee, s1 ) ) {
     90                if ( dom_sid_equal( &theacl->aces[i].trustee, s1 ) ) {
    8791                        sid_copy( &theacl->aces[i].trustee, s2 );
    8892                        update = True;
    89                         verbose_output("    New Trustee SID: %s\n", 
     93                        verbose_output("    New Trustee SID: %s\n",
    9094                                sid_string_tos(&theacl->aces[i].trustee));
    9195                }
     
    96100        verbose_output("  SACL: %d entries: \n", theacl->num_aces);
    97101        for ( i=0; i<theacl->num_aces; i++ ) {
    98                 verbose_output("    Trustee SID: %s\n", 
     102                verbose_output("    Trustee SID: %s\n",
    99103                        sid_string_tos(&theacl->aces[i].trustee));
    100                 if ( sid_equal( &theacl->aces[i].trustee, s1 ) ) {
     104                if ( dom_sid_equal( &theacl->aces[i].trustee, s1 ) ) {
    101105                        sid_copy( &theacl->aces[i].trustee, s2 );
    102106                        update = True;
    103                         verbose_output("    New Trustee SID: %s\n", 
     107                        verbose_output("    New Trustee SID: %s\n",
    104108                                sid_string_tos(&theacl->aces[i].trustee));
    105109                }
     
    117121{
    118122        REGF_NK_REC *key, *subkey;
    119         SEC_DESC *new_sd;
     123        struct security_descriptor *new_sd;
    120124        struct regval_ctr *values;
    121125        struct regsubkey_ctr *subkeys;
     
    140144        }
    141145
    142         if ( !(values = TALLOC_ZERO_P( subkeys, struct regval_ctr )) ) {
     146        werr = regval_ctr_init(subkeys, &values);
     147        if (!W_ERROR_IS_OK(werr)) {
    143148                TALLOC_FREE( subkeys );
    144149                DEBUG(0,("copy_registry_tree: talloc() failure!\n"));
     
    150155        for ( i=0; i<nk->num_values; i++ ) {
    151156                regval_ctr_addvalue( values, nk->values[i].valuename, nk->values[i].type,
    152                         (const char *)nk->values[i].data, (nk->values[i].data_size & ~VK_DATA_IN_OFFSET) );
     157                        nk->values[i].data, (nk->values[i].data_size & ~VK_DATA_IN_OFFSET) );
    153158        }
    154159
     
    212217        /* setup logging options */
    213218
    214         setup_logging( "profiles", True );
    215         dbf = x_stderr;
    216         x_setbuf( x_stderr, NULL );
     219        setup_logging( "profiles", DEBUG_STDERR);
    217220
    218221        pc = poptGetContext("profiles", argc, (const char **)argv, long_options,
Note: See TracChangeset for help on using the changeset viewer.