Skip to content

Commit 467f76e

Browse files
Remove tainted string functions \nper apalmblad/pull/29/files
Signed-off-by: Thomas Powell <[email protected]>
1 parent 7896211 commit 467f76e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pwd/shadow.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ static VALUE convert_pw_struct( struct passwd *entry )
5656
{
5757
/* Hmm. Why custom pw_change instead of sp_lstchg? */
5858
return rb_struct_new(rb_sPasswdEntry,
59-
rb_tainted_str_new2(entry->pw_name), /* sp_namp */
60-
rb_tainted_str_new2(entry->pw_passwd), /* sp_pwdp, encryped password */
59+
rb_str_new2(entry->pw_name), /* sp_namp */
60+
rb_str_new2(entry->pw_passwd), /* sp_pwdp, encryped password */
6161
Qnil, /* sp_lstchg, date when the password was last changed (in days since Jan 1, 1970) */
6262
Qnil, /* sp_min, days that password must stay same */
6363
Qnil, /* sp_max, days until password changes. */
@@ -66,7 +66,7 @@ static VALUE convert_pw_struct( struct passwd *entry )
6666
INT2FIX(difftime(entry->pw_change, 0) / (24*60*60)), /* pw_change */
6767
INT2FIX(difftime(entry->pw_expire, 0) / (24*60*60)), /* sp_expire */
6868
Qnil, /* sp_flag */
69-
rb_tainted_str_new2(entry->pw_class), /* sp_loginclass, user access class */
69+
rb_str_new2(entry->pw_class), /* sp_loginclass, user access class */
7070
NULL);
7171
}
7272

shadow/shadow.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ static VALUE rb_sGroupEntry;
3131
static VALUE rb_eFileLock;
3232

3333

34-
static VALUE convert_pw_struct( struct spwd *entry )
34+
static VALUE convert_pw_struct( struct spwd *entry )
3535
{
3636
return rb_struct_new(rb_sPasswdEntry,
37-
rb_tainted_str_new2(entry->sp_namp),
38-
rb_tainted_str_new2(entry->sp_pwdp),
37+
rb_str_new2(entry->sp_namp),
38+
rb_str_new2(entry->sp_pwdp),
3939
INT2FIX(entry->sp_lstchg),
4040
INT2FIX(entry->sp_min),
4141
INT2FIX(entry->sp_max),

0 commit comments

Comments
 (0)