Changeset 740 for vendor/current/source3/utils/profiles.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- 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 7 7 8 8 This program is free software; you can redistribute it and/or modify … … 10 10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 13 13 This program is distributed in the hope that it will be useful, 14 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 16 GNU General Public License for more details. 17 17 18 18 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/>. 20 20 */ 21 21 22 22 #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" 24 28 25 29 /* GLOBAL VARIABLES */ 26 30 27 DOM_SIDold_sid, new_sid;31 struct dom_sid old_sid, new_sid; 28 32 int change = 0, new_val = 0; 29 33 int opt_verbose = False; … … 56 60 ********************************************************************/ 57 61 58 static bool swap_sid_in_acl( SEC_DESC *sd, DOM_SID *s1, DOM_SID*s2 )62 static bool swap_sid_in_acl( struct security_descriptor *sd, struct dom_sid *s1, struct dom_sid *s2 ) 59 63 { 60 SEC_ACL*theacl;64 struct security_acl *theacl; 61 65 int i; 62 66 bool update = False; 63 67 64 68 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 ) ) { 66 70 sid_copy( sd->owner_sid, s2 ); 67 71 update = True; 68 verbose_output(" New Owner SID: %s\n", 72 verbose_output(" New Owner SID: %s\n", 69 73 sid_string_tos(sd->owner_sid)); 70 74 … … 72 76 73 77 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 ) ) { 75 79 sid_copy( sd->group_sid, s2 ); 76 80 update = True; 77 verbose_output(" New Group SID: %s\n", 81 verbose_output(" New Group SID: %s\n", 78 82 sid_string_tos(sd->group_sid)); 79 83 } … … 82 86 verbose_output(" DACL: %d entries:\n", theacl->num_aces); 83 87 for ( i=0; i<theacl->num_aces; i++ ) { 84 verbose_output(" Trustee SID: %s\n", 88 verbose_output(" Trustee SID: %s\n", 85 89 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 ) ) { 87 91 sid_copy( &theacl->aces[i].trustee, s2 ); 88 92 update = True; 89 verbose_output(" New Trustee SID: %s\n", 93 verbose_output(" New Trustee SID: %s\n", 90 94 sid_string_tos(&theacl->aces[i].trustee)); 91 95 } … … 96 100 verbose_output(" SACL: %d entries: \n", theacl->num_aces); 97 101 for ( i=0; i<theacl->num_aces; i++ ) { 98 verbose_output(" Trustee SID: %s\n", 102 verbose_output(" Trustee SID: %s\n", 99 103 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 ) ) { 101 105 sid_copy( &theacl->aces[i].trustee, s2 ); 102 106 update = True; 103 verbose_output(" New Trustee SID: %s\n", 107 verbose_output(" New Trustee SID: %s\n", 104 108 sid_string_tos(&theacl->aces[i].trustee)); 105 109 } … … 117 121 { 118 122 REGF_NK_REC *key, *subkey; 119 SEC_DESC*new_sd;123 struct security_descriptor *new_sd; 120 124 struct regval_ctr *values; 121 125 struct regsubkey_ctr *subkeys; … … 140 144 } 141 145 142 if ( !(values = TALLOC_ZERO_P( subkeys, struct regval_ctr )) ) { 146 werr = regval_ctr_init(subkeys, &values); 147 if (!W_ERROR_IS_OK(werr)) { 143 148 TALLOC_FREE( subkeys ); 144 149 DEBUG(0,("copy_registry_tree: talloc() failure!\n")); … … 150 155 for ( i=0; i<nk->num_values; i++ ) { 151 156 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) ); 153 158 } 154 159 … … 212 217 /* setup logging options */ 213 218 214 setup_logging( "profiles", True ); 215 dbf = x_stderr; 216 x_setbuf( x_stderr, NULL ); 219 setup_logging( "profiles", DEBUG_STDERR); 217 220 218 221 pc = poptGetContext("profiles", argc, (const char **)argv, long_options,
Note:
See TracChangeset
for help on using the changeset viewer.