Changeset 232 for branches/samba-3.2.x/source/utils
- Timestamp:
- May 27, 2009, 9:09:42 AM (16 years ago)
- Location:
- branches/samba-3.2.x/source/utils
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/utils/net_ads.c
r138 r232 307 307 tried_closest_dc = True; /* avoid loop */ 308 308 309 if (!ads ->config.tried_closest_dc) {309 if (!ads_closest_dc(ads)) { 310 310 311 311 namecache_delete(ads->server.realm, 0x1C); -
branches/samba-3.2.x/source/utils/net_rpc_join.c
r228 r232 240 240 CHECK_RPC_ERR(rpccli_samr_Connect2(pipe_hnd, mem_ctx, 241 241 pipe_hnd->cli->desthost, 242 SEC_RIGHTS_MAXIMUM_ALLOWED, 242 SAMR_ACCESS_ENUM_DOMAINS 243 | SAMR_ACCESS_OPEN_DOMAIN, 243 244 &sam_pol), 244 245 "could not connect to SAM database"); … … 247 248 CHECK_RPC_ERR(rpccli_samr_OpenDomain(pipe_hnd, mem_ctx, 248 249 &sam_pol, 249 SEC_RIGHTS_MAXIMUM_ALLOWED, 250 SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1 251 | SAMR_DOMAIN_ACCESS_CREATE_USER 252 | SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, 250 253 domain_sid, 251 254 &domain_pol), -
branches/samba-3.2.x/source/utils/net_status.c
r133 r232 20 20 #include "utils/net.h" 21 21 22 static int show_session(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, 23 void *state) 24 { 25 bool *parseable = (bool *)state; 22 static int show_session(struct db_record *rec, void *private_data) 23 { 24 bool *parseable = (bool *)private_data; 26 25 struct sessionid sessionid; 27 26 28 if ( dbuf.dsize != sizeof(sessionid))29 return 0; 30 31 memcpy(&sessionid, dbuf.dptr, sizeof(sessionid));27 if (rec->value.dsize != sizeof(sessionid)) 28 return 0; 29 30 memcpy(&sessionid, rec->value.dptr, sizeof(sessionid)); 32 31 33 32 if (!process_exists(sessionid.pid)) { … … 52 51 static int net_status_sessions(int argc, const char **argv) 53 52 { 54 TDB_CONTEXT *tdb;53 struct db_context *db; 55 54 bool parseable; 56 55 … … 70 69 } 71 70 72 tdb = tdb_open_log(lock_path("sessionid.tdb"), 0, 73 TDB_DEFAULT, O_RDONLY, 0); 74 75 if (tdb == NULL) { 71 db = db_open(NULL, lock_path("sessionid.tdb"), 0, 72 TDB_CLEAR_IF_FIRST, O_RDONLY, 0644); 73 if (db == NULL) { 76 74 d_fprintf(stderr, "%s not initialised\n", lock_path("sessionid.tdb")); 77 75 return -1; 78 76 } 79 77 80 tdb_traverse(tdb, show_session, &parseable);81 tdb_close(tdb);78 db->traverse_read(db, show_session, &parseable); 79 TALLOC_FREE(db); 82 80 83 81 return 0; … … 109 107 }; 110 108 111 static int collect_pid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, 112 void *state) 113 { 114 struct sessionids *ids = (struct sessionids *)state; 109 static int collect_pid(struct db_record *rec, void *private_data) 110 { 111 struct sessionids *ids = (struct sessionids *)private_data; 115 112 struct sessionid sessionid; 116 113 117 if ( dbuf.dsize != sizeof(sessionid))118 return 0; 119 120 memcpy(&sessionid, dbuf.dptr, sizeof(sessionid));114 if (rec->value.dsize != sizeof(sessionid)) 115 return 0; 116 117 memcpy(&sessionid, rec->value.dptr, sizeof(sessionid)); 121 118 122 119 if (!process_exists(sessionid.pid)) … … 172 169 { 173 170 struct sessionids ids; 174 TDB_CONTEXT *tdb;171 struct db_context *db; 175 172 176 173 ids.num_entries = 0; 177 174 ids.entries = NULL; 178 175 179 tdb = tdb_open_log(lock_path("sessionid.tdb"), 0, 180 TDB_DEFAULT, O_RDONLY, 0); 181 182 if (tdb == NULL) { 176 db = db_open(NULL, lock_path("sessionid.tdb"), 0, 177 TDB_CLEAR_IF_FIRST, O_RDONLY, 0644); 178 if (db == NULL) { 183 179 d_fprintf(stderr, "%s not initialised\n", lock_path("sessionid.tdb")); 184 180 return -1; 185 181 } 186 182 187 tdb_traverse(tdb, collect_pid, &ids);188 tdb_close(tdb);183 db->traverse_read(db, collect_pid, &ids); 184 TALLOC_FREE(db); 189 185 190 186 connections_forall(show_share_parseable, &ids); -
branches/samba-3.2.x/source/utils/smbcacls.c
r228 r232 738 738 if (!cli_set_secdesc(cli, fnum, sd)) { 739 739 printf("ERROR: secdesc set failed: %s\n", cli_errstr(cli)); 740 cli_close(cli, fnum); 741 return EXIT_FAILED; 740 742 } 741 743 -
branches/samba-3.2.x/source/utils/smbpasswd.c
r133 r232 431 431 432 432 if((local_flags & LOCAL_SET_PASSWORD) && (new_passwd == NULL)) { 433 struct passwd *passwd = getpwnam_alloc(NULL, user_name); 434 435 if (!passwd) { 436 fprintf(stderr, "Cannot locate Unix account for " 437 "'%s'!\n", user_name); 438 exit(1); 439 } 440 TALLOC_FREE(passwd); 441 433 442 new_passwd = prompt_for_new_password(stdin_passwd_get); 434 443
Note:
See TracChangeset
for help on using the changeset viewer.