diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 22:51:44 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 22:51:44 +0000 |
commit | 06c0a71d2315756db874e98bc4f760ca3283b6a6 (patch) | |
tree | df385c84041f3fd8328e7a50caef4495ef2734a8 /loginutils | |
parent | b6aae0f38194cd39960a898606ee65d4be93a895 (diff) | |
download | busybox-w32-06c0a71d2315756db874e98bc4f760ca3283b6a6.tar.gz busybox-w32-06c0a71d2315756db874e98bc4f760ca3283b6a6.tar.bz2 busybox-w32-06c0a71d2315756db874e98bc4f760ca3283b6a6.zip |
preparatory patch for -Wwrite-strings #3
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/adduser.c | 4 | ||||
-rw-r--r-- | loginutils/getty.c | 16 | ||||
-rw-r--r-- | loginutils/passwd.c | 4 | ||||
-rw-r--r-- | loginutils/su.c | 6 |
4 files changed, 15 insertions, 15 deletions
diff --git a/loginutils/adduser.c b/loginutils/adduser.c index ea0b89a9b..5a48e9cbb 100644 --- a/loginutils/adduser.c +++ b/loginutils/adduser.c | |||
@@ -169,7 +169,7 @@ int adduser_main(int argc, char **argv) | |||
169 | bb_error_msg_and_die(bb_msg_perm_denied_are_you_root); | 169 | bb_error_msg_and_die(bb_msg_perm_denied_are_you_root); |
170 | } | 170 | } |
171 | 171 | ||
172 | pw.pw_gecos = "Linux User,,,"; | 172 | pw.pw_gecos = (char *)"Linux User,,,"; |
173 | pw.pw_shell = (char *)DEFAULT_SHELL; | 173 | pw.pw_shell = (char *)DEFAULT_SHELL; |
174 | pw.pw_dir = NULL; | 174 | pw.pw_dir = NULL; |
175 | 175 | ||
@@ -185,7 +185,7 @@ int adduser_main(int argc, char **argv) | |||
185 | 185 | ||
186 | /* create a passwd struct */ | 186 | /* create a passwd struct */ |
187 | pw.pw_name = argv[optind]; | 187 | pw.pw_name = argv[optind]; |
188 | pw.pw_passwd = "x"; | 188 | pw.pw_passwd = (char *)"x"; |
189 | pw.pw_uid = 0; | 189 | pw.pw_uid = 0; |
190 | pw.pw_gid = usegroup ? xgroup2gid(usegroup) : 0; /* exits on failure */ | 190 | pw.pw_gid = usegroup ? xgroup2gid(usegroup) : 0; /* exits on failure */ |
191 | 191 | ||
diff --git a/loginutils/getty.c b/loginutils/getty.c index f2c2b4afb..8f81cafcc 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <time.h> | 33 | #include <time.h> |
34 | #if ENABLE_FEATURE_WTMP | 34 | #if ENABLE_FEATURE_WTMP |
35 | extern void updwtmp(const char *filename, const struct utmp *ut); | 35 | extern void updwtmp(const char *filename, const struct utmp *ut); |
36 | static void update_utmp(char *line); | 36 | static void update_utmp(const char *line); |
37 | #endif | 37 | #endif |
38 | #endif /* LOGIN_PROCESS */ | 38 | #endif /* LOGIN_PROCESS */ |
39 | 39 | ||
@@ -85,10 +85,10 @@ static void update_utmp(char *line); | |||
85 | struct options { | 85 | struct options { |
86 | int flags; /* toggle switches, see below */ | 86 | int flags; /* toggle switches, see below */ |
87 | unsigned timeout; /* time-out period */ | 87 | unsigned timeout; /* time-out period */ |
88 | char *login; /* login program */ | 88 | const char *login; /* login program */ |
89 | char *tty; /* name of tty */ | 89 | const char *tty; /* name of tty */ |
90 | char *initstring; /* modem init string */ | 90 | const char *initstring; /* modem init string */ |
91 | char *issue; /* alternative issue file */ | 91 | const char *issue; /* alternative issue file */ |
92 | int numspeed; /* number of baud rates to try */ | 92 | int numspeed; /* number of baud rates to try */ |
93 | int speeds[MAX_SPEED]; /* baud rates to be tried */ | 93 | int speeds[MAX_SPEED]; /* baud rates to be tried */ |
94 | }; | 94 | }; |
@@ -187,7 +187,7 @@ static void parse_args(int argc, char **argv, struct options *op) | |||
187 | const char *p = op->initstring; | 187 | const char *p = op->initstring; |
188 | char *q; | 188 | char *q; |
189 | 189 | ||
190 | q = op->initstring = xstrdup(op->initstring); | 190 | op->initstring = q = xstrdup(op->initstring); |
191 | /* copy optarg into op->initstring decoding \ddd | 191 | /* copy optarg into op->initstring decoding \ddd |
192 | octal codes into chars */ | 192 | octal codes into chars */ |
193 | while (*p) { | 193 | while (*p) { |
@@ -233,7 +233,7 @@ static void xdup2(int srcfd, int dstfd, const char *tty) | |||
233 | } | 233 | } |
234 | 234 | ||
235 | /* open_tty - set up tty as standard { input, output, error } */ | 235 | /* open_tty - set up tty as standard { input, output, error } */ |
236 | static void open_tty(char *tty, struct termios *tp, int local) | 236 | static void open_tty(const char *tty, struct termios *tp, int local) |
237 | { | 237 | { |
238 | int chdir_to_root = 0; | 238 | int chdir_to_root = 0; |
239 | 239 | ||
@@ -655,7 +655,7 @@ static void termios_final(struct options *op, struct termios *tp, struct chardat | |||
655 | #ifdef SYSV_STYLE | 655 | #ifdef SYSV_STYLE |
656 | #if ENABLE_FEATURE_UTMP | 656 | #if ENABLE_FEATURE_UTMP |
657 | /* update_utmp - update our utmp entry */ | 657 | /* update_utmp - update our utmp entry */ |
658 | static void update_utmp(char *line) | 658 | static void update_utmp(const char *line) |
659 | { | 659 | { |
660 | struct utmp ut; | 660 | struct utmp ut; |
661 | struct utmp *utp; | 661 | struct utmp *utp; |
diff --git a/loginutils/passwd.c b/loginutils/passwd.c index 5c822b190..ab20f2807 100644 --- a/loginutils/passwd.c +++ b/loginutils/passwd.c | |||
@@ -53,7 +53,7 @@ static void crypt_make_salt(char *p, int cnt) | |||
53 | static char* new_password(const struct passwd *pw, uid_t myuid, int algo) | 53 | static char* new_password(const struct passwd *pw, uid_t myuid, int algo) |
54 | { | 54 | { |
55 | char salt[sizeof("$N$XXXXXXXX")]; /* "$N$XXXXXXXX" or "XX" */ | 55 | char salt[sizeof("$N$XXXXXXXX")]; /* "$N$XXXXXXXX" or "XX" */ |
56 | char *orig = ""; | 56 | char *orig = (char*)""; |
57 | char *newp = NULL; | 57 | char *newp = NULL; |
58 | char *cipher = NULL; | 58 | char *cipher = NULL; |
59 | char *cp = NULL; | 59 | char *cp = NULL; |
@@ -241,7 +241,7 @@ int passwd_main(int argc, char **argv) | |||
241 | /*STATE_ALGO_des = 0x20, not needed yet */ | 241 | /*STATE_ALGO_des = 0x20, not needed yet */ |
242 | }; | 242 | }; |
243 | unsigned opt; | 243 | unsigned opt; |
244 | char *opt_a = ""; | 244 | const char *opt_a = ""; |
245 | const char *filename; | 245 | const char *filename; |
246 | char *myname; | 246 | char *myname; |
247 | char *name; | 247 | char *name; |
diff --git a/loginutils/su.c b/loginutils/su.c index e1c1591aa..9a134dd88 100644 --- a/loginutils/su.c +++ b/loginutils/su.c | |||
@@ -14,9 +14,9 @@ | |||
14 | int su_main(int argc, char **argv) | 14 | int su_main(int argc, char **argv) |
15 | { | 15 | { |
16 | unsigned flags; | 16 | unsigned flags; |
17 | char *opt_shell = 0; | 17 | char *opt_shell = NULL; |
18 | char *opt_command = 0; | 18 | char *opt_command = NULL; |
19 | char *opt_username = "root"; | 19 | const char *opt_username = "root"; |
20 | struct passwd *pw; | 20 | struct passwd *pw; |
21 | uid_t cur_uid = getuid(); | 21 | uid_t cur_uid = getuid(); |
22 | const char *tty; | 22 | const char *tty; |