Ignore:
Timestamp:
May 27, 2009, 9:09:42 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.8

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  
    307307                tried_closest_dc = True; /* avoid loop */
    308308
    309                 if (!ads->config.tried_closest_dc) {
     309                if (!ads_closest_dc(ads)) {
    310310
    311311                        namecache_delete(ads->server.realm, 0x1C);
  • branches/samba-3.2.x/source/utils/net_rpc_join.c

    r228 r232  
    240240        CHECK_RPC_ERR(rpccli_samr_Connect2(pipe_hnd, mem_ctx,
    241241                                           pipe_hnd->cli->desthost,
    242                                            SEC_RIGHTS_MAXIMUM_ALLOWED,
     242                                           SAMR_ACCESS_ENUM_DOMAINS
     243                                           | SAMR_ACCESS_OPEN_DOMAIN,
    243244                                           &sam_pol),
    244245                      "could not connect to SAM database");
     
    247248        CHECK_RPC_ERR(rpccli_samr_OpenDomain(pipe_hnd, mem_ctx,
    248249                                             &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,
    250253                                             domain_sid,
    251254                                             &domain_pol),
  • branches/samba-3.2.x/source/utils/net_status.c

    r133 r232  
    2020#include "utils/net.h"
    2121
    22 static int show_session(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf,
    23                         void *state)
    24 {
    25         bool *parseable = (bool *)state;
     22static int show_session(struct db_record *rec, void *private_data)
     23{
     24        bool *parseable = (bool *)private_data;
    2625        struct sessionid sessionid;
    2726
    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));
    3231
    3332        if (!process_exists(sessionid.pid)) {
     
    5251static int net_status_sessions(int argc, const char **argv)
    5352{
    54         TDB_CONTEXT *tdb;
     53        struct db_context *db;
    5554        bool parseable;
    5655
     
    7069        }
    7170
    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) {
    7674                d_fprintf(stderr, "%s not initialised\n", lock_path("sessionid.tdb"));
    7775                return -1;
    7876        }
    7977
    80         tdb_traverse(tdb, show_session, &parseable);
    81         tdb_close(tdb);
     78        db->traverse_read(db, show_session, &parseable);
     79        TALLOC_FREE(db);
    8280
    8381        return 0;
     
    109107};
    110108
    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;
     109static int collect_pid(struct db_record *rec, void *private_data)
     110{
     111        struct sessionids *ids = (struct sessionids *)private_data;
    115112        struct sessionid sessionid;
    116113
    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));
    121118
    122119        if (!process_exists(sessionid.pid))
     
    172169{
    173170        struct sessionids ids;
    174         TDB_CONTEXT *tdb;
     171        struct db_context *db;
    175172
    176173        ids.num_entries = 0;
    177174        ids.entries = NULL;
    178175
    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) {
    183179                d_fprintf(stderr, "%s not initialised\n", lock_path("sessionid.tdb"));
    184180                return -1;
    185181        }
    186182
    187         tdb_traverse(tdb, collect_pid, &ids);
    188         tdb_close(tdb);
     183        db->traverse_read(db, collect_pid, &ids);
     184        TALLOC_FREE(db);
    189185
    190186        connections_forall(show_share_parseable, &ids);
  • branches/samba-3.2.x/source/utils/smbcacls.c

    r228 r232  
    738738        if (!cli_set_secdesc(cli, fnum, sd)) {
    739739                printf("ERROR: secdesc set failed: %s\n", cli_errstr(cli));
     740                cli_close(cli, fnum);
     741                return EXIT_FAILED;
    740742        }
    741743
  • branches/samba-3.2.x/source/utils/smbpasswd.c

    r133 r232  
    431431               
    432432                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
    433442                        new_passwd = prompt_for_new_password(stdin_passwd_get);
    434443                       
Note: See TracChangeset for help on using the changeset viewer.