r5790: Added ability to set account description.
authorJohn Terpstra <jht@samba.org>
Tue, 15 Mar 2005 00:42:38 +0000 (00:42 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:56:01 +0000 (10:56 -0500)
(This used to be commit df6f0815af0171a47483f2f3d347d350704a012f)

source3/utils/pdbedit.c

index 3584ef0367aa2e52a2380d9e56bdd6b3427c3ee3..c5ba59487cc1cec40b6a1d22469a393d41068cbb 100644 (file)
@@ -299,6 +299,7 @@ static int fix_users_list (struct pdb_context *in)
 
 static int set_user_info (struct pdb_context *in, const char *username, 
                          const char *fullname, const char *homedir, 
+                         const char *acct_desc, 
                          const char *drive, const char *script, 
                          const char *profile, const char *account_control,
                          const char *user_sid, const char *group_sid,
@@ -346,6 +347,8 @@ static int set_user_info (struct pdb_context *in, const char *username,
 
        if (fullname)
                pdb_set_fullname(sam_pwent, fullname, PDB_CHANGED);
+       if (acct_desc)
+               pdb_set_acct_desc(sam_pwent, acct_desc, PDB_CHANGED);
        if (homedir)
                pdb_set_homedir(sam_pwent, homedir, PDB_CHANGED);
        if (drive)
@@ -641,6 +644,7 @@ int main (int argc, char **argv)
        uint32  setparms, checkparms;
        int opt;
        static char *full_name = NULL;
+       static char *acct_desc = NULL;
        static const char *user_name = NULL;
        static char *home_dir = NULL;
        static char *home_drive = NULL;
@@ -673,13 +677,14 @@ int main (int argc, char **argv)
                {"verbose",     'v', POPT_ARG_NONE, &verbose, 0, "be verbose", NULL },
                {"smbpasswd-style",     'w',POPT_ARG_NONE, &spstyle, 0, "give output in smbpasswd style", NULL},
                {"user",        'u', POPT_ARG_STRING, &user_name, 0, "use username", "USER" },
+               {"account-desc",        'N', POPT_ARG_STRING, &acct_desc, 0, "set account description", NULL},
                {"fullname",    'f', POPT_ARG_STRING, &full_name, 0, "set full name", NULL},
                {"homedir",     'h', POPT_ARG_STRING, &home_dir, 0, "set home directory", NULL},
                {"drive",       'D', POPT_ARG_STRING, &home_drive, 0, "set home drive", NULL},
                {"script",      'S', POPT_ARG_STRING, &logon_script, 0, "set logon script", NULL},
                {"profile",     'p', POPT_ARG_STRING, &profile_path, 0, "set profile path", NULL},
-               {"user SID",    'U', POPT_ARG_STRING, &user_sid, 0, "set user SID or RID", NULL},
-               {"group SID",   'G', POPT_ARG_STRING, &group_sid, 0, "set group SID or RID", NULL},
+               {"user-SID",    'U', POPT_ARG_STRING, &user_sid, 0, "set user SID or RID", NULL},
+               {"group-SID",   'G', POPT_ARG_STRING, &group_sid, 0, "set group SID or RID", NULL},
                {"create",      'a', POPT_ARG_NONE, &add_user, 0, "create user", NULL},
                {"modify",      'r', POPT_ARG_NONE, &modify_user, 0, "modify user", NULL},
                {"machine",     'm', POPT_ARG_NONE, &machine, 0, "account is a machine account", NULL},
@@ -960,6 +965,7 @@ int main (int argc, char **argv)
                        }
                        return set_user_info (bdef, user_name, full_name,
                                              home_dir,
+                                             acct_desc,
                                              home_drive,
                                              logon_script,
                                              profile_path, account_control,