1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
--- src/user.c.orig 2012-08-16 19:03:51.000000000 +0000
+++ src/user.c 2012-10-08 19:13:02.000000000 +0000
@@ -546,11 +546,11 @@
"change real name of user '%s' (%d) to '%s'",
user->user_name, user->uid, name);
- argv[0] = "/usr/sbin/usermod";
- argv[1] = "-c";
- argv[2] = name;
- argv[3] = "--";
- argv[4] = user->user_name;
+ argv[0] = "/usr/sbin/pw";
+ argv[1] = "usermod";
+ argv[2] = user->user_name;
+ argv[3] = "-c";
+ argv[4] = name;
argv[5] = NULL;
error = NULL;
@@ -620,11 +620,11 @@
"change name of user '%s' (%d) to '%s'",
old_name, user->uid, name);
- argv[0] = "/usr/sbin/usermod";
- argv[1] = "-l";
- argv[2] = name;
- argv[3] = "--";
- argv[4] = user->user_name;
+ argv[0] = "/usr/sbin/pw";
+ argv[1] = "usermod";
+ argv[2] = user->user_name;
+ argv[3] = "-n";
+ argv[4] = name;
argv[5] = NULL;
error = NULL;
@@ -964,11 +964,11 @@
"change shell of user '%s' (%d) to '%s'",
user->user_name, user->uid, shell);
- argv[0] = "/usr/sbin/usermod";
- argv[1] = "-s";
- argv[2] = shell;
- argv[3] = "--";
- argv[4] = user->user_name;
+ argv[0] = "/usr/sbin/pw";
+ argv[1] = "usermod";
+ argv[2] = user->user_name;
+ argv[3] = "-s";
+ argv[4] = shell;
argv[5] = NULL;
error = NULL;
@@ -1224,11 +1224,10 @@
sys_log (context,
"%s account of user '%s' (%d)",
locked ? "locking" : "unlocking", user->user_name, user->uid);
- argv[0] = "/usr/sbin/usermod";
- argv[1] = locked ? "-L" : "-U";
- argv[2] = "--";
- argv[3] = user->user_name;
- argv[4] = NULL;
+ argv[0] = "/usr/sbin/pw";
+ argv[1] = locked ? "lock" : "unlock";
+ argv[2] = user->user_name;
+ argv[3] = NULL;
error = NULL;
if (!spawn_with_login_uid (context, argv, &error)) {
@@ -1315,11 +1314,11 @@
g_free (groups);
- argv[0] = "/usr/sbin/usermod";
- argv[1] = "-G";
- argv[2] = str->str;
- argv[3] = "--";
- argv[4] = user->user_name;
+ argv[0] = "/usr/sbin/pw";
+ argv[1] = "usermod";
+ argv[2] = user->user_name;
+ argv[3] = "-G";
+ argv[4] = str->str;
argv[5] = NULL;
g_string_free (str, FALSE);
@@ -1386,10 +1385,8 @@
mode == PASSWORD_MODE_NONE) {
argv[0] = "/usr/bin/passwd";
- argv[1] = "-d";
- argv[2] = "--";
- argv[3] = user->user_name;
- argv[4] = NULL;
+ argv[1] = user->user_name;
+ argv[2] = NULL;
error = NULL;
if (!spawn_with_login_uid (context, argv, &error)) {
@@ -1399,12 +1396,11 @@
}
if (mode == PASSWORD_MODE_SET_AT_LOGIN) {
- argv[0] = "/usr/bin/chage";
- argv[1] = "-d";
+ argv[0] = "/usr/bin/chpass";
+ argv[1] = "-e";
argv[2] = "0";
- argv[3] = "--";
- argv[4] = user->user_name;
- argv[5] = NULL;
+ argv[3] = user->user_name;
+ argv[4] = NULL;
error = NULL;
if (!spawn_with_login_uid (context, argv, &error)) {
@@ -1428,11 +1424,10 @@
}
}
else if (user->locked) {
- argv[0] = "/usr/sbin/usermod";
- argv[1] = "-U";
- argv[2] = "--";
- argv[3] = user->user_name;
- argv[4] = NULL;
+ argv[0] = "/usr/sbin/pw";
+ argv[1] = "unlock";
+ argv[2] = user->user_name;
+ argv[3] = NULL;
error = NULL;
if (!spawn_with_login_uid (context, argv, &error)) {
@@ -1503,12 +1498,11 @@
g_object_freeze_notify (G_OBJECT (user));
- argv[0] = "/usr/sbin/usermod";
+ argv[0] = "/usr/bin/chpass";
argv[1] = "-p";
argv[2] = strings[0];
- argv[3] = "--";
- argv[4] = user->user_name;
- argv[5] = NULL;
+ argv[3] = user->user_name;
+ argv[4] = NULL;
error = NULL;
if (!spawn_with_login_uid (context, argv, &error)) {
|