ALT Linux Bugzilla
– Attachment 1114 Details for
Bug 7959
Закрывать дескрипторы при старте
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
dhcpcd-1.3.22-pl4-close-all.patch
dhcpcd-1.3.22-pl4-close-all.patch (text/plain), 530 bytes, created by
Anton Farygin
on 2005-09-14 14:34:38 MSD
(
hide
)
Description:
dhcpcd-1.3.22-pl4-close-all.patch
Filename:
MIME Type:
Creator:
Anton Farygin
Created:
2005-09-14 14:34:38 MSD
Size:
530 bytes
patch
obsolete
>--- dhcpcd.c.fd 2005-09-14 18:26:58 +0400 >+++ dhcpcd.c 2005-09-14 18:27:06 +0400 >@@ -108,7 +108,7 @@ > int s = 1; > int k = 1; > int i = 1; >- int j; >+ int j,fd; > > /* > * Ensure that fds 0, 1, 2 are open, to /dev/null if nowhere else. >@@ -118,8 +118,9 @@ > */ > j=open("/dev/null",O_RDWR); > while ( j < 2 && j >= 0 ) j = dup(j); >- if ( j > 2 ) close(j); >- >+ j = sysconf (_SC_OPEN_MAX); >+ for (fd = 3; fd < j; fd++) close(fd); >+ > if ( geteuid() ) > { > fprintf(stderr,"**** %s: not a superuser\n",argc[0]);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 7959
: 1114