Commit graph

131 commits

Author SHA1 Message Date
Nobuyoshi Nakada
40391faeab [ruby/etc] Fix inconsistent dll linkage warning
e4c71e5996
2023-11-05 11:50:07 +00:00
Nobuyoshi Nakada
88f1d380ea [ruby/etc] Start 1.4.3
a9e4d4730d
2023-10-29 07:15:24 +00:00
Nobuyoshi Nakada
47cb789332 [ruby/etc] Declare getlogin even if unistd.h is not available
Although MinGW provides this header but not the function, Windows
version ruby provides the function.

f7fa1884fa
2023-07-12 16:22:54 +00:00
Nobuyoshi Nakada
efd8ea366b [ruby/etc] Declare getlogin only if unistd.h is not available
365398ea47
2023-07-12 14:18:39 +00:00
Benoit Daloze
610038f3bf [ruby/etc] Use the correct pattern for the fallback of rb_io_descriptor()
* See d1d9aef45c

5185685003
2023-05-29 19:31:55 +00:00
Samuel Williams
00d6674636 [ruby/etc] Remove usage of IO internals.
(https://github.com/ruby/etc/pull/26)

ea15eceb13
2023-05-28 05:08:40 +00:00
Hiroshi SHIBATA
d7baa17b49 [ruby/etc] Bump version to 1.4.2
5cac138538
2022-12-09 05:57:49 +00:00
Hiroshi SHIBATA
a0deb64909 [ruby/etc] Bump version to 1.4.1
b3e9d9ceb0
2022-12-05 06:07:32 +00:00
卜部昌平
437800d3b0 getenv: is in stdlib.h
getenv is a very basic function that has been in stdlib.h since
ISO/IEC 9899:1990.  There is absolutely zero need for us to redeclare.

pty.c already includes stdlib.h out of the box so we need nothing.
2022-09-21 11:44:09 +09:00
Nobuyoshi Nakada
5f8c73405e [ruby/etc] [DOC] Markup constant path names
6c9a0b4e5d
2022-06-19 11:06:43 +09:00
Nobuyoshi Nakada
ea38758322 [ruby/etc] [DOC] Markup string literals
a8801e07d1
2022-06-19 10:46:50 +09:00
Nobuyoshi Nakada
cc67a11768 [ruby/etc] [DOC] Fix reference to different module
ea51739974
2022-06-19 10:46:48 +09:00
Nobuyoshi Nakada
c594370c6e [ruby/etc] [DOC] Update
System-dependent feature macros are automatically detected by
extconf.rb, and are not used by users.

e7343b4e69
2022-06-19 10:46:47 +09:00
Nobuyoshi Nakada
462079611a [ruby/etc] Remove deprecate constants under Struct
143edbd215
2022-01-02 15:03:29 +09:00
Nobuyoshi Nakada
eb294491c0 [ruby/etc] bump up to 1.4.0
ca41f182f6
2022-01-02 15:03:05 +09:00
Nobuyoshi Nakada
91d09ca95b [ruby/etc] bump up to 1.3.1
82dd69a4cf
2022-01-02 14:52:31 +09:00
Nobuyoshi Nakada
bb0a725f1f [ruby/etc] [DOC] Refine Etc::Passwd#passwd description
17b99fe42e
2022-01-02 14:52:28 +09:00
Nobuyoshi Nakada
314effdf77 [ruby/etc] [DOC] Document Etc::Passwd and Etc::Group as classes
106429f10b
2022-01-02 14:52:27 +09:00
Hiroshi SHIBATA
847eeafd65 [ruby/etc] Bump up etc version to 1.3.0
85ca541d0b
2021-10-19 20:55:33 +09:00
Nobuyoshi Nakada
d210950196
[ruby/etc] Get rid of alloca in the loop
c989bacc4c
2021-10-14 18:44:27 +09:00
Nobuyoshi Nakada
d2aaf865e3 [ruby/etc] Added fallback definition of RUBY_ATOMIC_EXCHANGE
0c5900bd21
2021-01-11 11:39:12 +09:00
Nobuyoshi Nakada
f6e2c41db3 [ruby/etc] Check blocking variables at release
f017bdfedf
2021-01-11 11:39:10 +09:00
Nobuyoshi Nakada
66719d7dc8 etc: use atomic operation instead of mutex 2020-12-24 11:43:21 +09:00
Hiroshi SHIBATA
5cf25c55a6
Update version for Ractor-safe extensions 2020-12-23 14:03:54 +09:00
Marc-Andre Lafortune
cd63f0358f [ruby/etc] Make Ractor safe 2020-12-22 19:46:07 -05:00
Marc-Andre Lafortune
3286380ebc [ruby/etc] Refactor locks using mutex API 2020-12-22 19:46:07 -05:00
Nobuyoshi Nakada
97f73bd0e2
Ignore upper bits of pw_change on macOS too 2020-04-09 12:23:15 +09:00
Nobuyoshi Nakada
f099bb040c
Ignore upper bits of pw_expire on macOS
`pw_expire` is declared as `time_t`, but actually not, and
`getpwuid` returns a garbage there.

Also the declaration of `struct passwd` in pwd.h and the manual
page contradict each other, interal `pw_fields` is mentioned only
in the latter.  Maybe there is a confusion.
2020-04-09 09:44:18 +09:00
Nobuyoshi Nakada
d8720eb7de
Suppress -Wshorten-64-to-32 warnings 2020-04-08 16:28:38 +09:00
Nobuyoshi Nakada
78b6eb9f9f
[ruby/etc] Deprecate names under Struct
25c538120c
2020-04-02 22:01:01 +09:00
Nobuyoshi Nakada
bd0a7d8dd5
Revert "[ruby/etc] Deprecate names under Struct"
This reverts commit 69f698d85a.

Again.
2020-04-02 22:00:00 +09:00
Nobuyoshi Nakada
69f698d85a
[ruby/etc] Deprecate names under Struct
25c538120c
2020-04-02 21:20:58 +09:00
Nobuyoshi Nakada
fad0a1451b
Revert "[ruby/etc] Deprecate names under Struct"
This reverts commit 919b175afc.

Since 604689628d, to let `try_run`
work before LIBRUBY_SO is installed, `try_link` links against the
static library which defines even symbols unexported in the shared
library.
2020-04-01 19:29:39 +09:00
Nobuyoshi Nakada
919b175afc
[ruby/etc] Deprecate names under Struct
25c538120c
2020-04-01 18:34:25 +09:00
Hiroshi SHIBATA
56567c7648 [ruby/etc] Bump version to 1.1.0
78987ce56a
2019-11-30 18:11:01 +09:00
Jeremy Evans
398cd3cc7d [ruby/etc] Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.

Still untaint the tmpdir object on Ruby <2.7, as returning
a tainted string there could cause problems.
2019-11-18 01:00:25 +02:00
Jeremy Evans
ffd0820ab3 Deprecate taint/trust and related methods, and make the methods no-ops
This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
2019-11-18 01:00:25 +02:00
Jeremy Evans
c5c05460ac Warn on access/modify of $SAFE, and remove effects of modifying $SAFE
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.

This modifies some internal functions that took a safe level argument
to no longer take the argument.

rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.

One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd.  We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
2019-11-18 01:00:25 +02:00
卜部昌平
7b6fde4258 drop-in type check for rb_define_module_function
We can check the function pointer passed to rb_define_module_function
like how we do so in rb_define_method.  The difference is that this
changeset reveales lots of atiry mismatches.
2019-08-29 18:34:09 +09:00
卜部昌平
703783324c rb_ensure now free from ANYARGS
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit deletes ANYARGS from
rb_ensure, which also revealed many arity / type mismatches.
2019-08-27 15:52:26 +09:00
Nobuyoshi Nakada
1d2ec4b216
Added Etc::VERSION 2019-07-10 12:33:29 +09:00
Samuel Williams
d17344cfc5 Remove IA64 support. 2019-06-19 23:30:04 +12:00
stomar
0f7fed9253 etc.c: improve docs for sysconfdir
* ext/etc/etc.c: [DOC] small language fixes for etc_sysconfdir docs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:08:34 +00:00
nobu
8fc8587e05 sysconfdir on Windows
* ext/etc/etc.c (etc_sysconfdir): mentioned special case on
  Windows.  [ruby-core:43110] [Bug #6121]

* ext/etc/extconf.rb: define SYSCONFDIR only if sysconfdir is set
  in RbConfig::CONFIG and not empty.

* win32/Makefile.sub (config.status): sysconfdir is not used on
  Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 13:48:08 +00:00
naruse
1333c0f0df Revert "sysconfdir on Windows"
This reverts commit r60279.
This breaks mswin build:
https://ci.appveyor.com/project/ruby/ruby/build/1.0.5571

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 11:15:20 +00:00
nobu
e4ff51b05a sysconfdir on Windows
* ext/etc/etc.c (etc_sysconfdir): mentioned special case on
  Windows.  [ruby-core:43110] [Bug #6121]

* win32/Makefile.sub (config.status): sysconfdir is not used on
  Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21 14:19:23 +00:00
nobu
1852b4a866 ext: check if null byte is contained
[ruby-dev:50267] [Bug #13953]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-30 08:35:23 +00:00
nobu
253fd5fe6b ext: adjust indent [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-27 05:08:53 +00:00
nobu
c3262bceee etc.c: retry with allocated string buffer
* ext/etc/etc.c (etc_systmpdir): retry with allocated string
  buffer if static buffer size is not enough.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-02 12:21:42 +00:00
nobu
038c0e5a80 ext: suppress warnings
* ext/{etc,openssl,tk}: Adding parens and comparisons around
  assignments to get rid of Wparentheses warnings.  [Fix GH-875]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-19 03:19:20 +00:00