etc 1.2.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +97 -0
- data/ext/etc/etc.c +87 -85
- data/ext/etc/extconf.rb +2 -4
- data/logs/ChangeLog-1.0.0 +65 -0
- data/logs/ChangeLog-1.0.1 +71 -0
- data/logs/ChangeLog-1.1.0 +143 -0
- data/logs/ChangeLog-1.2.0 +124 -0
- data/logs/ChangeLog-1.3.0 +83 -0
- data/logs/ChangeLog-1.3.1 +145 -0
- data/logs/ChangeLog-1.4.0 +73 -0
- data/test/etc/test_etc.rb +1 -0
- metadata +32 -63
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '08b76e02c19850983f9c765cd8f73f5353e7ea1c2295892874284056a0f33572'
|
|
4
|
+
data.tar.gz: 4c2bb4327bc82cdf40ba72195fed02594bb8af35888712e46139a225a58f67f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b400ec775900dd0c4505e7d0ec93e3939c9f9ccd3147ec607f7e4d0347e8361492011effb196026cbcd511bdbd79d59f1ce0f0bca2534e60d3f80651d5ed2296
|
|
7
|
+
data.tar.gz: 99f69faaa9b2bd7de984f5056f6ca89cfa9a9e4f6e572d03c0c7239ffac6897ab3c548790b1c53a0c71d90206da977d312c618f0f6d4beaed88c0070d842bc2f
|
data/ChangeLog
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
-*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
commit b3e9d9ceb0984d54c9b0d5d2e6c20e007be824fb
|
|
4
|
+
Author: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
|
5
|
+
AuthorDate: 2022-12-05 15:05:09 +0900
|
|
6
|
+
Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
|
7
|
+
CommitDate: 2022-12-05 15:05:09 +0900
|
|
8
|
+
|
|
9
|
+
Bump version to 1.4.1
|
|
10
|
+
|
|
11
|
+
commit 6c9a0b4e5db79160709282bc14aae3ed6d423cee
|
|
12
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
13
|
+
AuthorDate: 2022-06-19 10:59:03 +0900
|
|
14
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
15
|
+
CommitDate: 2022-06-19 10:59:03 +0900
|
|
16
|
+
|
|
17
|
+
[DOC] Markup constant path names
|
|
18
|
+
|
|
19
|
+
commit a8801e07d17a3535c8e9534d7167b67096cc5282
|
|
20
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
21
|
+
AuthorDate: 2022-06-19 10:45:11 +0900
|
|
22
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
23
|
+
CommitDate: 2022-06-19 10:45:11 +0900
|
|
24
|
+
|
|
25
|
+
[DOC] Markup string literals
|
|
26
|
+
|
|
27
|
+
commit ea517399741f20fbea1bed65a784a38b7a1f0390
|
|
28
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
29
|
+
AuthorDate: 2022-06-19 10:43:43 +0900
|
|
30
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
31
|
+
CommitDate: 2022-06-19 10:44:41 +0900
|
|
32
|
+
|
|
33
|
+
[DOC] Fix reference to different module
|
|
34
|
+
|
|
35
|
+
commit e7343b4e6950d1604eb46940456920ec8beb96d5
|
|
36
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
37
|
+
AuthorDate: 2022-06-19 10:26:21 +0900
|
|
38
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
39
|
+
CommitDate: 2022-06-19 10:26:21 +0900
|
|
40
|
+
|
|
41
|
+
[DOC] Update
|
|
42
|
+
|
|
43
|
+
System-dependent feature macros are automatically detected by
|
|
44
|
+
extconf.rb, and are not used by users.
|
|
45
|
+
|
|
46
|
+
commit 8f24e74346f737ea2f9834558715aa48c2471a1c
|
|
47
|
+
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
|
48
|
+
AuthorDate: 2022-04-11 04:23:17 +0000
|
|
49
|
+
Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
|
50
|
+
CommitDate: 2022-04-11 13:29:46 +0900
|
|
51
|
+
|
|
52
|
+
Bump actions/upload-artifact from 2 to 3
|
|
53
|
+
|
|
54
|
+
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
|
|
55
|
+
- [Release notes](https://github.com/actions/upload-artifact/releases)
|
|
56
|
+
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
updated-dependencies:
|
|
60
|
+
- dependency-name: actions/upload-artifact
|
|
61
|
+
dependency-type: direct:production
|
|
62
|
+
update-type: version-update:semver-major
|
|
63
|
+
...
|
|
64
|
+
|
|
65
|
+
Signed-off-by: dependabot[bot] <support@github.com>
|
|
66
|
+
|
|
67
|
+
commit 9354594223de532bedf3630f053ea65b186c6cbc
|
|
68
|
+
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
|
69
|
+
AuthorDate: 2022-03-25 16:54:32 +0900
|
|
70
|
+
Commit: GitHub <noreply@github.com>
|
|
71
|
+
CommitDate: 2022-03-25 16:54:32 +0900
|
|
72
|
+
|
|
73
|
+
Bump actions/checkout from 2 to 3 (#21)
|
|
74
|
+
|
|
75
|
+
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
|
|
76
|
+
- [Release notes](https://github.com/actions/checkout/releases)
|
|
77
|
+
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
|
|
78
|
+
- [Commits](https://github.com/actions/checkout/compare/v2...v3)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
updated-dependencies:
|
|
82
|
+
- dependency-name: actions/checkout
|
|
83
|
+
dependency-type: direct:production
|
|
84
|
+
update-type: version-update:semver-major
|
|
85
|
+
...
|
|
86
|
+
|
|
87
|
+
Signed-off-by: dependabot[bot] <support@github.com>
|
|
88
|
+
|
|
89
|
+
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
|
90
|
+
|
|
91
|
+
commit d4805047a01a979a0c060436fa73e79120967e2c
|
|
92
|
+
Author: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
|
93
|
+
AuthorDate: 2022-03-25 16:47:16 +0900
|
|
94
|
+
Commit: GitHub <noreply@github.com>
|
|
95
|
+
CommitDate: 2022-03-25 16:47:16 +0900
|
|
96
|
+
|
|
97
|
+
Added dependabot (#20)
|
data/ext/etc/etc.c
CHANGED
|
@@ -52,7 +52,7 @@ char *getenv();
|
|
|
52
52
|
#endif
|
|
53
53
|
char *getlogin();
|
|
54
54
|
|
|
55
|
-
#define RUBY_ETC_VERSION "1.
|
|
55
|
+
#define RUBY_ETC_VERSION "1.4.1"
|
|
56
56
|
|
|
57
57
|
#ifdef HAVE_RB_DEPRECATE_CONSTANT
|
|
58
58
|
void rb_deprecate_constant(VALUE mod, const char *name);
|
|
@@ -62,22 +62,21 @@ void rb_deprecate_constant(VALUE mod, const char *name);
|
|
|
62
62
|
|
|
63
63
|
#include "constdefs.h"
|
|
64
64
|
|
|
65
|
-
#ifdef
|
|
66
|
-
#include "ruby/
|
|
65
|
+
#ifdef HAVE_RUBY_ATOMIC_H
|
|
66
|
+
# include "ruby/atomic.h"
|
|
67
67
|
#else
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
68
|
+
typedef int rb_atomic_t;
|
|
69
|
+
# define RUBY_ATOMIC_CAS(var, oldval, newval) \
|
|
70
|
+
((var) == (oldval) ? ((var) = (newval), (oldval)) : (var))
|
|
71
|
+
# define RUBY_ATOMIC_EXCHANGE(var, newval) \
|
|
72
|
+
atomic_exchange(&var, newval)
|
|
73
|
+
static inline rb_atomic_t
|
|
74
|
+
atomic_exchange(volatile rb_atomic_t *var, rb_atomic_t newval)
|
|
75
|
+
{
|
|
76
|
+
rb_atomic_t oldval = *var;
|
|
77
|
+
*var = newval;
|
|
78
|
+
return oldval;
|
|
79
79
|
}
|
|
80
|
-
#define rb_native_mutex_initialize rb_native_mutex_unlock
|
|
81
80
|
#endif
|
|
82
81
|
|
|
83
82
|
/* call-seq:
|
|
@@ -191,7 +190,8 @@ setup_passwd(struct passwd *pwd)
|
|
|
191
190
|
/* call-seq:
|
|
192
191
|
* getpwuid(uid) -> Passwd
|
|
193
192
|
*
|
|
194
|
-
* Returns the
|
|
193
|
+
* Returns the <tt>/etc/passwd</tt> information for the user with the given
|
|
194
|
+
* integer +uid+.
|
|
195
195
|
*
|
|
196
196
|
* The information is returned as a Passwd struct.
|
|
197
197
|
*
|
|
@@ -230,8 +230,8 @@ etc_getpwuid(int argc, VALUE *argv, VALUE obj)
|
|
|
230
230
|
/* call-seq:
|
|
231
231
|
* getpwnam(name) -> Passwd
|
|
232
232
|
*
|
|
233
|
-
* Returns the
|
|
234
|
-
* +name+.
|
|
233
|
+
* Returns the <tt>/etc/passwd</tt> information for the user with specified
|
|
234
|
+
* login +name+.
|
|
235
235
|
*
|
|
236
236
|
* The information is returned as a Passwd struct.
|
|
237
237
|
*
|
|
@@ -258,12 +258,14 @@ etc_getpwnam(VALUE obj, VALUE nam)
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
#ifdef HAVE_GETPWENT
|
|
261
|
-
static
|
|
261
|
+
static rb_atomic_t passwd_blocking;
|
|
262
262
|
static VALUE
|
|
263
263
|
passwd_ensure(VALUE _)
|
|
264
264
|
{
|
|
265
265
|
endpwent();
|
|
266
|
-
|
|
266
|
+
if (RUBY_ATOMIC_EXCHANGE(passwd_blocking, 0) != 1) {
|
|
267
|
+
rb_raise(rb_eRuntimeError, "unexpected passwd_blocking");
|
|
268
|
+
}
|
|
267
269
|
return Qnil;
|
|
268
270
|
}
|
|
269
271
|
|
|
@@ -282,7 +284,7 @@ passwd_iterate(VALUE _)
|
|
|
282
284
|
static void
|
|
283
285
|
each_passwd(void)
|
|
284
286
|
{
|
|
285
|
-
if (
|
|
287
|
+
if (RUBY_ATOMIC_CAS(passwd_blocking, 0, 1)) {
|
|
286
288
|
rb_raise(rb_eRuntimeError, "parallel passwd iteration");
|
|
287
289
|
}
|
|
288
290
|
rb_ensure(passwd_iterate, 0, passwd_ensure, 0);
|
|
@@ -294,7 +296,7 @@ each_passwd(void)
|
|
|
294
296
|
* Etc.passwd -> Passwd
|
|
295
297
|
*
|
|
296
298
|
* Provides a convenient Ruby iterator which executes a block for each entry
|
|
297
|
-
* in the
|
|
299
|
+
* in the <tt>/etc/passwd</tt> file.
|
|
298
300
|
*
|
|
299
301
|
* The code block is passed an Passwd struct.
|
|
300
302
|
*
|
|
@@ -329,13 +331,14 @@ etc_passwd(VALUE obj)
|
|
|
329
331
|
* Etc::Passwd.each { |struct| block } -> Passwd
|
|
330
332
|
* Etc::Passwd.each -> Enumerator
|
|
331
333
|
*
|
|
332
|
-
* Iterates for each entry in the
|
|
334
|
+
* Iterates for each entry in the <tt>/etc/passwd</tt> file if a block is
|
|
335
|
+
* given.
|
|
333
336
|
*
|
|
334
337
|
* If no block is given, returns the Enumerator.
|
|
335
338
|
*
|
|
336
339
|
* The code block is passed an Passwd struct.
|
|
337
340
|
*
|
|
338
|
-
* See
|
|
341
|
+
* See Etc.getpwent above for details.
|
|
339
342
|
*
|
|
340
343
|
* Example:
|
|
341
344
|
*
|
|
@@ -359,8 +362,8 @@ etc_each_passwd(VALUE obj)
|
|
|
359
362
|
return obj;
|
|
360
363
|
}
|
|
361
364
|
|
|
362
|
-
/* Resets the process of reading the
|
|
363
|
-
* to ::getpwent will return the first entry again.
|
|
365
|
+
/* Resets the process of reading the <tt>/etc/passwd</tt> file, so that the
|
|
366
|
+
* next call to ::getpwent will return the first entry again.
|
|
364
367
|
*/
|
|
365
368
|
static VALUE
|
|
366
369
|
etc_setpwent(VALUE obj)
|
|
@@ -371,8 +374,8 @@ etc_setpwent(VALUE obj)
|
|
|
371
374
|
return Qnil;
|
|
372
375
|
}
|
|
373
376
|
|
|
374
|
-
/* Ends the process of scanning through the
|
|
375
|
-
* ::getpwent, and closes the file.
|
|
377
|
+
/* Ends the process of scanning through the <tt>/etc/passwd</tt> file begun
|
|
378
|
+
* with ::getpwent, and closes the file.
|
|
376
379
|
*/
|
|
377
380
|
static VALUE
|
|
378
381
|
etc_endpwent(VALUE obj)
|
|
@@ -383,7 +386,7 @@ etc_endpwent(VALUE obj)
|
|
|
383
386
|
return Qnil;
|
|
384
387
|
}
|
|
385
388
|
|
|
386
|
-
/* Returns an entry from the
|
|
389
|
+
/* Returns an entry from the <tt>/etc/passwd</tt> file.
|
|
387
390
|
*
|
|
388
391
|
* The first time it is called it opens the file and returns the first entry;
|
|
389
392
|
* each successive call returns the next entry, or +nil+ if the end of the file
|
|
@@ -434,7 +437,7 @@ setup_group(struct group *grp)
|
|
|
434
437
|
* getgrgid(group_id) -> Group
|
|
435
438
|
*
|
|
436
439
|
* Returns information about the group with specified integer +group_id+,
|
|
437
|
-
* as found in
|
|
440
|
+
* as found in <tt>/etc/group</tt>.
|
|
438
441
|
*
|
|
439
442
|
* The information is returned as a Group struct.
|
|
440
443
|
*
|
|
@@ -472,7 +475,7 @@ etc_getgrgid(int argc, VALUE *argv, VALUE obj)
|
|
|
472
475
|
* getgrnam(name) -> Group
|
|
473
476
|
*
|
|
474
477
|
* Returns information about the group with specified +name+, as found in
|
|
475
|
-
*
|
|
478
|
+
* <tt>/etc/group</tt>.
|
|
476
479
|
*
|
|
477
480
|
* The information is returned as a Group struct.
|
|
478
481
|
*
|
|
@@ -500,12 +503,14 @@ etc_getgrnam(VALUE obj, VALUE nam)
|
|
|
500
503
|
}
|
|
501
504
|
|
|
502
505
|
#ifdef HAVE_GETGRENT
|
|
503
|
-
static
|
|
506
|
+
static rb_atomic_t group_blocking;
|
|
504
507
|
static VALUE
|
|
505
508
|
group_ensure(VALUE _)
|
|
506
509
|
{
|
|
507
510
|
endgrent();
|
|
508
|
-
|
|
511
|
+
if (RUBY_ATOMIC_EXCHANGE(group_blocking, 0) != 1) {
|
|
512
|
+
rb_raise(rb_eRuntimeError, "unexpected group_blocking");
|
|
513
|
+
}
|
|
509
514
|
return Qnil;
|
|
510
515
|
}
|
|
511
516
|
|
|
@@ -525,7 +530,7 @@ group_iterate(VALUE _)
|
|
|
525
530
|
static void
|
|
526
531
|
each_group(void)
|
|
527
532
|
{
|
|
528
|
-
if (
|
|
533
|
+
if (RUBY_ATOMIC_CAS(group_blocking, 0, 1)) {
|
|
529
534
|
rb_raise(rb_eRuntimeError, "parallel group iteration");
|
|
530
535
|
}
|
|
531
536
|
rb_ensure(group_iterate, 0, group_ensure, 0);
|
|
@@ -533,7 +538,7 @@ each_group(void)
|
|
|
533
538
|
#endif
|
|
534
539
|
|
|
535
540
|
/* Provides a convenient Ruby iterator which executes a block for each entry
|
|
536
|
-
* in the
|
|
541
|
+
* in the <tt>/etc/group</tt> file.
|
|
537
542
|
*
|
|
538
543
|
* The code block is passed an Group struct.
|
|
539
544
|
*
|
|
@@ -569,7 +574,8 @@ etc_group(VALUE obj)
|
|
|
569
574
|
* Etc::Group.each { |group| block } -> obj
|
|
570
575
|
* Etc::Group.each -> Enumerator
|
|
571
576
|
*
|
|
572
|
-
* Iterates for each entry in the
|
|
577
|
+
* Iterates for each entry in the <tt>/etc/group</tt> file if a block is
|
|
578
|
+
* given.
|
|
573
579
|
*
|
|
574
580
|
* If no block is given, returns the Enumerator.
|
|
575
581
|
*
|
|
@@ -596,8 +602,8 @@ etc_each_group(VALUE obj)
|
|
|
596
602
|
}
|
|
597
603
|
#endif
|
|
598
604
|
|
|
599
|
-
/* Resets the process of reading the
|
|
600
|
-
* to ::getgrent will return the first entry again.
|
|
605
|
+
/* Resets the process of reading the <tt>/etc/group</tt> file, so that the
|
|
606
|
+
* next call to ::getgrent will return the first entry again.
|
|
601
607
|
*/
|
|
602
608
|
static VALUE
|
|
603
609
|
etc_setgrent(VALUE obj)
|
|
@@ -608,8 +614,8 @@ etc_setgrent(VALUE obj)
|
|
|
608
614
|
return Qnil;
|
|
609
615
|
}
|
|
610
616
|
|
|
611
|
-
/* Ends the process of scanning through the
|
|
612
|
-
* ::getgrent, and closes the file.
|
|
617
|
+
/* Ends the process of scanning through the <tt>/etc/group</tt> file begun
|
|
618
|
+
* by ::getgrent, and closes the file.
|
|
613
619
|
*/
|
|
614
620
|
static VALUE
|
|
615
621
|
etc_endgrent(VALUE obj)
|
|
@@ -620,7 +626,7 @@ etc_endgrent(VALUE obj)
|
|
|
620
626
|
return Qnil;
|
|
621
627
|
}
|
|
622
628
|
|
|
623
|
-
/* Returns an entry from the
|
|
629
|
+
/* Returns an entry from the <tt>/etc/group</tt> file.
|
|
624
630
|
*
|
|
625
631
|
* The first time it is called it opens the file and returns the first entry;
|
|
626
632
|
* each successive call returns the next entry, or +nil+ if the end of the file
|
|
@@ -654,9 +660,11 @@ VALUE rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc);
|
|
|
654
660
|
/*
|
|
655
661
|
* Returns system configuration directory.
|
|
656
662
|
*
|
|
657
|
-
* This is typically "/etc"
|
|
658
|
-
* compiled. For example, if Ruby is built and installed in
|
|
659
|
-
* returns "/usr/local/etc" on other
|
|
663
|
+
* This is typically <code>"/etc"</code>, but is modified by the prefix used
|
|
664
|
+
* when Ruby was compiled. For example, if Ruby is built and installed in
|
|
665
|
+
* <tt>/usr/local</tt>, returns <code>"/usr/local/etc"</code> on other
|
|
666
|
+
* platforms than Windows.
|
|
667
|
+
*
|
|
660
668
|
* On Windows, this always returns the directory provided by the system.
|
|
661
669
|
*/
|
|
662
670
|
static VALUE
|
|
@@ -954,11 +962,13 @@ io_pathconf(VALUE io, VALUE arg)
|
|
|
954
962
|
static int
|
|
955
963
|
etc_nprocessors_affin(void)
|
|
956
964
|
{
|
|
957
|
-
cpu_set_t *cpuset;
|
|
965
|
+
cpu_set_t *cpuset, cpuset_buff[1024 / sizeof(cpu_set_t)];
|
|
958
966
|
size_t size;
|
|
959
967
|
int ret;
|
|
960
968
|
int n;
|
|
961
969
|
|
|
970
|
+
CPU_ZERO_S(sizeof(cpuset_buff), cpuset_buff);
|
|
971
|
+
|
|
962
972
|
/*
|
|
963
973
|
* XXX:
|
|
964
974
|
* man page says CPU_ALLOC takes number of cpus. But it is not accurate
|
|
@@ -977,13 +987,12 @@ etc_nprocessors_affin(void)
|
|
|
977
987
|
*/
|
|
978
988
|
for (n=64; n <= 16384; n *= 2) {
|
|
979
989
|
size = CPU_ALLOC_SIZE(n);
|
|
980
|
-
if (size >=
|
|
990
|
+
if (size >= sizeof(cpuset_buff)) {
|
|
981
991
|
cpuset = xcalloc(1, size);
|
|
982
992
|
if (!cpuset)
|
|
983
993
|
return -1;
|
|
984
994
|
} else {
|
|
985
|
-
cpuset =
|
|
986
|
-
CPU_ZERO_S(size, cpuset);
|
|
995
|
+
cpuset = cpuset_buff;
|
|
987
996
|
}
|
|
988
997
|
|
|
989
998
|
ret = sched_getaffinity(0, size, cpuset);
|
|
@@ -992,10 +1001,10 @@ etc_nprocessors_affin(void)
|
|
|
992
1001
|
ret = CPU_COUNT_S(size, cpuset);
|
|
993
1002
|
}
|
|
994
1003
|
|
|
995
|
-
if (size >=
|
|
1004
|
+
if (size >= sizeof(cpuset_buff)) {
|
|
996
1005
|
xfree(cpuset);
|
|
997
1006
|
}
|
|
998
|
-
if (ret > 0) {
|
|
1007
|
+
if (ret > 0 || errno != EINVAL) {
|
|
999
1008
|
return ret;
|
|
1000
1009
|
}
|
|
1001
1010
|
}
|
|
@@ -1063,11 +1072,12 @@ etc_nprocessors(VALUE obj)
|
|
|
1063
1072
|
|
|
1064
1073
|
/*
|
|
1065
1074
|
* The Etc module provides access to information typically stored in
|
|
1066
|
-
* files in the
|
|
1075
|
+
* files in the <tt>/etc</tt> directory on Unix systems.
|
|
1067
1076
|
*
|
|
1068
1077
|
* The information accessible consists of the information found in the
|
|
1069
|
-
*
|
|
1070
|
-
* temporary directory (
|
|
1078
|
+
* <tt>/etc/passwd</tt> and <tt>/etc/group</tt> files, plus information
|
|
1079
|
+
* about the system's temporary directory (<tt>/tmp</tt>) and configuration
|
|
1080
|
+
* directory (<tt>/etc</tt>).
|
|
1071
1081
|
*
|
|
1072
1082
|
* The Etc module provides a more reliable way to access information about
|
|
1073
1083
|
* the logged in user than environment variables such as +$USER+.
|
|
@@ -1092,9 +1102,9 @@ Init_etc(void)
|
|
|
1092
1102
|
{
|
|
1093
1103
|
VALUE mEtc;
|
|
1094
1104
|
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1105
|
+
#ifdef HAVE_RB_EXT_RACTOR_SAFE
|
|
1106
|
+
RB_EXT_RACTOR_SAFE(true);
|
|
1107
|
+
#endif
|
|
1098
1108
|
mEtc = rb_define_module("Etc");
|
|
1099
1109
|
rb_define_const(mEtc, "VERSION", rb_str_new_cstr(RUBY_ETC_VERSION));
|
|
1100
1110
|
init_constants(mEtc);
|
|
@@ -1154,16 +1164,18 @@ Init_etc(void)
|
|
|
1154
1164
|
#endif
|
|
1155
1165
|
NULL);
|
|
1156
1166
|
#if 0
|
|
1157
|
-
/*
|
|
1167
|
+
/*
|
|
1168
|
+
* Passwd is a placeholder Struct for user database on Unix systems.
|
|
1158
1169
|
*
|
|
1159
|
-
*
|
|
1170
|
+
* === The struct contains the following members
|
|
1160
1171
|
*
|
|
1161
1172
|
* name::
|
|
1162
1173
|
* contains the short login name of the user as a String.
|
|
1163
1174
|
* passwd::
|
|
1164
1175
|
* contains the encrypted password of the user as a String.
|
|
1165
|
-
* an 'x' is returned if shadow passwords are in
|
|
1166
|
-
*
|
|
1176
|
+
* an <code>'x'</code> is returned if shadow passwords are in
|
|
1177
|
+
* use. An <code>'*'</code> is returned if the user cannot
|
|
1178
|
+
* log in using a password.
|
|
1167
1179
|
* uid::
|
|
1168
1180
|
* contains the integer user ID (uid) of the user.
|
|
1169
1181
|
* gid::
|
|
@@ -1173,37 +1185,31 @@ Init_etc(void)
|
|
|
1173
1185
|
* shell::
|
|
1174
1186
|
* contains the path to the login shell of the user as a String.
|
|
1175
1187
|
*
|
|
1176
|
-
* === The following members below are
|
|
1188
|
+
* === The following members below are system-dependent
|
|
1177
1189
|
*
|
|
1178
1190
|
* gecos::
|
|
1179
1191
|
* contains a longer String description of the user, such as
|
|
1180
1192
|
* a full name. Some Unix systems provide structured information in the
|
|
1181
1193
|
* gecos field, but this is system-dependent.
|
|
1182
|
-
* must be compiled with +HAVE_STRUCT_PASSWD_PW_GECOS+
|
|
1183
1194
|
* change::
|
|
1184
|
-
* password change time(integer)
|
|
1195
|
+
* password change time(integer).
|
|
1185
1196
|
* quota::
|
|
1186
|
-
* quota value(integer)
|
|
1197
|
+
* quota value(integer).
|
|
1187
1198
|
* age::
|
|
1188
|
-
* password age(integer)
|
|
1199
|
+
* password age(integer).
|
|
1189
1200
|
* class::
|
|
1190
|
-
* user access class(string)
|
|
1201
|
+
* user access class(string).
|
|
1191
1202
|
* comment::
|
|
1192
|
-
* comment(string)
|
|
1203
|
+
* comment(string).
|
|
1193
1204
|
* expire::
|
|
1194
|
-
* account expiration time(integer)
|
|
1205
|
+
* account expiration time(integer).
|
|
1195
1206
|
*/
|
|
1196
|
-
|
|
1207
|
+
sPasswd = rb_define_class_under(mEtc, "Passwd", rb_cStruct);
|
|
1197
1208
|
#endif
|
|
1198
|
-
rb_define_const(rb_cStruct, "Passwd", sPasswd); /* deprecated name */
|
|
1199
|
-
rb_deprecate_constant(rb_cStruct, "Passwd");
|
|
1200
1209
|
rb_extend_object(sPasswd, rb_mEnumerable);
|
|
1201
1210
|
rb_define_singleton_method(sPasswd, "each", etc_each_passwd, 0);
|
|
1202
|
-
|
|
1203
|
-
rb_native_mutex_initialize(&passwd_blocking);
|
|
1204
|
-
#endif
|
|
1211
|
+
|
|
1205
1212
|
#ifdef HAVE_GETGRENT
|
|
1206
|
-
rb_native_mutex_initialize(&group_blocking);
|
|
1207
1213
|
sGroup = rb_struct_define_under(mEtc, "Group", "name",
|
|
1208
1214
|
#ifdef HAVE_STRUCT_GROUP_GR_PASSWD
|
|
1209
1215
|
"passwd",
|
|
@@ -1211,31 +1217,27 @@ Init_etc(void)
|
|
|
1211
1217
|
"gid", "mem", NULL);
|
|
1212
1218
|
|
|
1213
1219
|
#if 0
|
|
1214
|
-
/*
|
|
1215
|
-
*
|
|
1216
|
-
* Group is a Struct that is only available when compiled with +HAVE_GETGRENT+.
|
|
1220
|
+
/*
|
|
1221
|
+
* Group is a placeholder Struct for user group database on Unix systems.
|
|
1217
1222
|
*
|
|
1218
|
-
* The struct contains the following members
|
|
1223
|
+
* === The struct contains the following members
|
|
1219
1224
|
*
|
|
1220
1225
|
* name::
|
|
1221
1226
|
* contains the name of the group as a String.
|
|
1222
1227
|
* passwd::
|
|
1223
|
-
* contains the encrypted password as a String. An 'x' is
|
|
1228
|
+
* contains the encrypted password as a String. An <code>'x'</code> is
|
|
1224
1229
|
* returned if password access to the group is not available; an empty
|
|
1225
1230
|
* string is returned if no password is needed to obtain membership of
|
|
1226
1231
|
* the group.
|
|
1227
|
-
*
|
|
1228
|
-
* Must be compiled with +HAVE_STRUCT_GROUP_GR_PASSWD+.
|
|
1232
|
+
* This is system-dependent.
|
|
1229
1233
|
* gid::
|
|
1230
1234
|
* contains the group's numeric ID as an integer.
|
|
1231
1235
|
* mem::
|
|
1232
1236
|
* is an Array of Strings containing the short login names of the
|
|
1233
1237
|
* members of the group.
|
|
1234
1238
|
*/
|
|
1235
|
-
|
|
1239
|
+
sGroup = rb_define_class_under(mEtc, "Group", rb_cStruct);
|
|
1236
1240
|
#endif
|
|
1237
|
-
rb_define_const(rb_cStruct, "Group", sGroup); /* deprecated name */
|
|
1238
|
-
rb_deprecate_constant(rb_cStruct, "Group");
|
|
1239
1241
|
rb_extend_object(sGroup, rb_mEnumerable);
|
|
1240
1242
|
rb_define_singleton_method(sGroup, "each", etc_each_group, 0);
|
|
1241
1243
|
#endif
|
data/ext/etc/extconf.rb
CHANGED
|
@@ -47,10 +47,8 @@ if !File.exist?("#{srcdir}/depend")
|
|
|
47
47
|
%x[#{RbConfig.ruby} #{srcdir}/mkconstants.rb -o #{srcdir}/constdefs.h]
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
]
|
|
53
|
-
have_func('rb_deprecate_constant(Qnil, "None")', [decl])
|
|
50
|
+
# TODO: remove when dropping 2.7 support, as exported since 3.0
|
|
51
|
+
have_func('rb_deprecate_constant(Qnil, "None")')
|
|
54
52
|
|
|
55
53
|
$distcleanfiles << "constdefs.h"
|
|
56
54
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
-*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
commit 3402a9366fba4d2bf2f4ea20df16c95121876bc4
|
|
4
|
+
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
5
|
+
AuthorDate: 2017-12-13 14:31:00 +0900
|
|
6
|
+
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
7
|
+
CommitDate: 2017-12-13 14:31:00 +0900
|
|
8
|
+
|
|
9
|
+
Bump release date
|
|
10
|
+
|
|
11
|
+
commit be7fadb654340282ff71a500a47f88a0b4c47a1d
|
|
12
|
+
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
13
|
+
AuthorDate: 2017-12-13 14:30:42 +0900
|
|
14
|
+
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
15
|
+
CommitDate: 2017-12-13 14:30:42 +0900
|
|
16
|
+
|
|
17
|
+
Added badge of Travis
|
|
18
|
+
|
|
19
|
+
commit 97aca32b82f6cd8c309ae515e36d86c4d4822e4c
|
|
20
|
+
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
21
|
+
AuthorDate: 2017-12-13 14:23:26 +0900
|
|
22
|
+
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
23
|
+
CommitDate: 2017-12-13 14:23:26 +0900
|
|
24
|
+
|
|
25
|
+
prepare to release 1.0.0
|
|
26
|
+
|
|
27
|
+
commit 744646073bcd4e7c5b65ae5921cf4c1d5697e35e
|
|
28
|
+
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
29
|
+
AuthorDate: 2017-11-28 12:17:10 +0900
|
|
30
|
+
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
31
|
+
CommitDate: 2017-11-28 12:20:44 +0900
|
|
32
|
+
|
|
33
|
+
Pick commits from ruby core repository.
|
|
34
|
+
|
|
35
|
+
* https://github.com/ruby/ruby/commit/0f7fed9253
|
|
36
|
+
* https://github.com/ruby/ruby/commit/8fc8587e05
|
|
37
|
+
* https://github.com/ruby/ruby/commit/1333c0f0df
|
|
38
|
+
* https://github.com/ruby/ruby/commit/e4ff51b05a
|
|
39
|
+
* https://github.com/ruby/ruby/commit/1852b4a866
|
|
40
|
+
* https://github.com/ruby/ruby/commit/b5b2bd86f1
|
|
41
|
+
* https://github.com/ruby/ruby/commit/253fd5fe6b
|
|
42
|
+
|
|
43
|
+
commit 0e8f8547412d33a35752ef4272d78fc18cf3a5ed
|
|
44
|
+
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
45
|
+
AuthorDate: 2017-10-20 16:51:22 +0900
|
|
46
|
+
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
47
|
+
CommitDate: 2017-10-20 16:51:22 +0900
|
|
48
|
+
|
|
49
|
+
Update README with rdoc of Etc module
|
|
50
|
+
|
|
51
|
+
commit 86a04b45feed2bc88d44399e127ed675d5d0f41c
|
|
52
|
+
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
53
|
+
AuthorDate: 2017-09-13 14:32:17 +0900
|
|
54
|
+
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
55
|
+
CommitDate: 2017-09-13 14:32:17 +0900
|
|
56
|
+
|
|
57
|
+
make frozen
|
|
58
|
+
|
|
59
|
+
commit 91ce5d0039fe10d86b35a3c114fabb9a7ae86344
|
|
60
|
+
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
61
|
+
AuthorDate: 2017-07-18 14:38:26 +0900
|
|
62
|
+
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
|
63
|
+
CommitDate: 2017-07-18 14:38:26 +0900
|
|
64
|
+
|
|
65
|
+
fixed wrong license name
|