[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
[samba.git] / source / utils / pdbedit.c
index 5dff7e5a93fba649efa8adc26ace1136588f4d3c..66a706d1ce99c990ffa4a5bd1e29358495ba8305 100644 (file)
@@ -8,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -17,8 +17,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
@@ -759,6 +758,7 @@ int main (int argc, char **argv)
        static BOOL pw_from_stdin = False;
        struct pdb_methods *bin, *bout, *bdef;
        char *configfile = NULL;
+       TALLOC_CTX *frame = talloc_stackframe();
        poptContext pc;
        struct poptOption long_options[] = {
                POPT_AUTOHELP
@@ -799,6 +799,7 @@ int main (int argc, char **argv)
        /* we shouldn't have silly checks like this */
        if (getuid() != 0) {
                d_fprintf(stderr, "You must be root to use pdbedit\n");
+               TALLOC_FREE(frame);
                return -1;
        }
        
@@ -827,8 +828,7 @@ int main (int argc, char **argv)
        if (user_name == NULL)
                user_name = poptGetArg(pc);
 
-       if (!lp_load(configfile?configfile:dyn_CONFIGFILE,
-                    True,False,False,True)) {
+       if (!lp_load(dyn_CONFIGFILE,True,False,False,True)) {
                fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
                exit(1);
        }
@@ -1051,5 +1051,6 @@ int main (int argc, char **argv)
        }
        poptPrintHelp(pc, stderr, 0);
 
+       TALLOC_FREE(frame);
        return 1;
 }