r4917: Merge some of Derrell.Lipman@UnwiredUniverse.com obvious fixes.
authorJeremy Allison <jra@samba.org>
Sat, 22 Jan 2005 01:22:39 +0000 (01:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:55:07 +0000 (10:55 -0500)
Added text explaining units in pdbedit time fields.
Jeremy.

source/lib/account_pol.c
source/libsmb/cliconnect.c
source/libsmb/clisecdesc.c
source/utils/pdbedit.c

index 72d6e77ddda8fd5b2b681ec06f25490a742f5fe5..5997d9180aedfab499eaecf4ba4035c3de05e2db 100644 (file)
@@ -118,8 +118,8 @@ static const struct {
        {AP_MIN_PASSWORD_LEN, "min password length"},
        {AP_PASSWORD_HISTORY, "password history"},
        {AP_USER_MUST_LOGON_TO_CHG_PASS, "user must logon to change password"},
-       {AP_MAX_PASSWORD_AGE, "maximum password age"},
-       {AP_MIN_PASSWORD_AGE,"minimum password age"},
+       {AP_MAX_PASSWORD_AGE, "maximum password age (seconds since 1970)"},
+       {AP_MIN_PASSWORD_AGE,"minimum password age (seconds since 1970)"},
        {AP_LOCK_ACCOUNT_DURATION, "lockout duration"},
        {AP_RESET_COUNT_TIME, "reset count minutes"},
        {AP_BAD_ATTEMPT_LOCKOUT, "bad lockout attempt"},
index 29a9533bd24a305f90d36e027a9185d72a449111..659e12429222ab6d72eae47c219d7fd50dbf1b5e 100644 (file)
@@ -989,7 +989,12 @@ BOOL cli_tdis(struct cli_state *cli)
        if (!cli_receive_smb(cli))
                return False;
        
-       return !cli_is_error(cli);
+       if (cli_is_error(cli)) {
+               return False;
+       }
+
+       cli->cnum = -1;
+       return True;
 }
 
 /****************************************************************************
index b79ea9d14ba602cc82e4a9352cde205eb6bdb68f..24757434794068b23552c41f9aa4e1a5ee5293f7 100644 (file)
@@ -30,6 +30,7 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli, int fnum,
        char *rparam=NULL, *rdata=NULL;
        unsigned int rparam_count=0, rdata_count=0;
        prs_struct pd;
+       BOOL pd_initialized = False;
        SEC_DESC *psd = NULL;
 
        SIVAL(param, 0, fnum);
@@ -56,7 +57,10 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli, int fnum,
        if (cli_is_error(cli))
                goto cleanup;
 
-       prs_init(&pd, rdata_count, mem_ctx, UNMARSHALL);
+       if (!prs_init(&pd, rdata_count, mem_ctx, UNMARSHALL)) {
+               goto cleanup;
+       }
+       pd_initialized = True;
        prs_copy_data_in(&pd, rdata, rdata_count);
        prs_set_offset(&pd,0);
 
@@ -70,7 +74,8 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli, int fnum,
        SAFE_FREE(rparam);
        SAFE_FREE(rdata);
 
-       prs_mem_free(&pd);
+       if (pd_initialized)
+               prs_mem_free(&pd);
        return psd;
 }
 
index ea2faebdff42d5aac690ea1780baaf0cedc20d6c..c12618cd7a12f30666e23c302a6a175c28a36a61 100644 (file)
@@ -694,8 +694,8 @@ int main (int argc, char **argv)
                {"force-initialized-passwords", 0, POPT_ARG_NONE, &force_initialised_password, 0, "Force initialization of corrupt password strings in a passdb backend", NULL},
                {"bad-password-count-reset", 'z', POPT_ARG_NONE, &badpw_reset, 0, "reset bad password count", NULL},
                {"logon-hours-reset", 'Z', POPT_ARG_NONE, &hours_reset, 0, "reset logon hours", NULL},
-               {"pwd-can-change-time", 0, POPT_ARG_STRING, &pwd_can_change_time, 0, "Set password can change time (unix time if time format no provided)", NULL },
-               {"pwd-must-change-time", 0, POPT_ARG_STRING, &pwd_must_change_time, 0, "Set password can change time (unix time if time format no provided)", NULL },
+               {"pwd-can-change-time", 0, POPT_ARG_STRING, &pwd_can_change_time, 0, "Set password can change time (unix time in seconds since 1970 if time format no provided)", NULL },
+               {"pwd-must-change-time", 0, POPT_ARG_STRING, &pwd_must_change_time, 0, "Set password can change time (unix time in seconds since 1970 if time format no provided)", NULL },
                {"time-format", 0, POPT_ARG_STRING, &pwd_time_format, 0, "The time format for time parameters", NULL },
                POPT_COMMON_SAMBA
                POPT_TABLEEND