diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
commit | 1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch) | |
tree | 0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-networking/recipes-daemons | |
download | meta-openembedded-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-networking/recipes-daemons')
115 files changed, 7377 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/atftp/atftp/atftpd.service b/meta-networking/recipes-daemons/atftp/atftp/atftpd.service new file mode 100644 index 0000000000..480bc702e9 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/atftp/atftpd.service | |||
@@ -0,0 +1,10 @@ | |||
1 | [Unit] | ||
2 | Description=Advanced TFTP Server | ||
3 | After=syslog.target network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | ExecStart=/usr/sbin/atftpd --daemon --port 69 | ||
8 | |||
9 | [Install] | ||
10 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-daemons/atftp/atftp_git.bb b/meta-networking/recipes-daemons/atftp/atftp_git.bb new file mode 100644 index 0000000000..ee84f77252 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/atftp_git.bb | |||
@@ -0,0 +1,61 @@ | |||
1 | SUMMARY = "Advanced TFTP server and client" | ||
2 | SECTION = "network" | ||
3 | HOMEPAGE = "http://packages.debian.org/atftp" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | PV = "0.7.1+git${SRCPV}" | ||
7 | PR = "r3" | ||
8 | |||
9 | SRCREV = "be3291a18c069ae23a124ffdc56d64a5ff0bbec7" | ||
10 | |||
11 | SRC_URI = "git://git.code.sf.net/p/atftp/code \ | ||
12 | file://atftpd-0.7_circumvent_tftp_size_restrictions.patch \ | ||
13 | file://atftpd-0.7_unprotected_assignments_crash.patch \ | ||
14 | file://atftpd.init \ | ||
15 | file://atftpd.service \ | ||
16 | file://atftp-0.7-sorcerers_apprentice.patch \ | ||
17 | " | ||
18 | S = "${WORKDIR}/git" | ||
19 | |||
20 | inherit autotools update-rc.d useradd systemd | ||
21 | |||
22 | PACKAGECONFIG ??= "tcp-wrappers" | ||
23 | PACKAGECONFIG[pcre] = "--enable-libpcre,--disable-libpcre,libpcre" | ||
24 | PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" | ||
25 | PACKAGECONFIG[readline] = "--enable-libreadline,--disable-libreadline,readline" | ||
26 | |||
27 | INITSCRIPT_PACKAGES = "${PN}d" | ||
28 | INITSCRIPT_NAME_${PN}d = "atftpd" | ||
29 | INITSCRIPT_PARAMS_${PN}d = "defaults 80" | ||
30 | |||
31 | USERADD_PACKAGES = "${PN}d" | ||
32 | USERADD_PARAM_${PN}d = "--system --no-create-home --shell /bin/false \ | ||
33 | --user-group nobody" | ||
34 | |||
35 | do_install_append() { | ||
36 | install -d ${D}${sysconfdir}/init.d | ||
37 | install -m 0755 ${WORKDIR}/atftpd.init ${D}${sysconfdir}/init.d/atftpd | ||
38 | |||
39 | install -d ${D}/srv/tftp | ||
40 | |||
41 | rm ${D}${sbindir}/in.tftpd | ||
42 | |||
43 | install -d ${D}${systemd_unitdir}/system | ||
44 | install -m 0644 ${WORKDIR}/atftpd.service ${D}${systemd_unitdir}/system | ||
45 | } | ||
46 | |||
47 | PACKAGES =+ "${PN}d" | ||
48 | |||
49 | FILES_${PN} = "${bindir}/*" | ||
50 | |||
51 | FILES_${PN}d = "${sbindir}/* \ | ||
52 | ${sysconfdir} \ | ||
53 | /srv/tftp \ | ||
54 | ${systemd_unitdir}/system/atftpd.service \ | ||
55 | " | ||
56 | |||
57 | SYSTEMD_PACKAGES = "${PN}d" | ||
58 | SYSTEMD_SERVICE_${PN}d = "atftpd.service" | ||
59 | RPROVIDES_${PN}d += "${PN}d-systemd" | ||
60 | RREPLACES_${PN}d += "${PN}d-systemd" | ||
61 | RCONFLICTS_${PN}d += "${PN}d-systemd" | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch b/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch new file mode 100644 index 0000000000..fc64291cd3 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch | |||
@@ -0,0 +1,94 @@ | |||
1 | atftp exhibits the well known "Sorcerer's Apprentice Syndrome"(SAS) problem. | ||
2 | According to RFC 1350, the fix to SAS is quite simple: further copies of the | ||
3 | acknowledgment for a particular data block would be ignored. | ||
4 | |||
5 | Patch originally from OpenSUSE: | ||
6 | https://build.opensuse.org/package/view_file?file=atftp-0.7-sorcerers_apprentice.patch&package=atftp.539&project=openSUSE%3A12.1%3AUpdate&rev=84569792975e00573d7df597d2a6e895 | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
11 | Index: atftp-0.7/tftp_file.c | ||
12 | =================================================================== | ||
13 | --- atftp-0.7.orig/tftp_file.c 2011-11-22 15:12:53.792744083 +0100 | ||
14 | +++ atftp-0.7/tftp_file.c 2011-11-22 15:13:51.706421893 +0100 | ||
15 | @@ -605,6 +605,7 @@ | ||
16 | int timeout_state = state; /* what state should we go on when timeout */ | ||
17 | int result; | ||
18 | long block_number = 0; | ||
19 | + long last_requested_block = -1; | ||
20 | long last_block = -1; | ||
21 | int data_size; /* size of data received */ | ||
22 | int sockfd = data->sockfd; /* just to simplify calls */ | ||
23 | @@ -765,6 +766,17 @@ | ||
24 | connected = 1; | ||
25 | } | ||
26 | block_number = ntohs(tftphdr->th_block); | ||
27 | + | ||
28 | + if (last_requested_block >= block_number) | ||
29 | + { | ||
30 | + if (data->trace) | ||
31 | + fprintf(stderr, "received duplicated ACK <block: %ld >= %ld>\n", | ||
32 | + last_requested_block, block_number); | ||
33 | + break; | ||
34 | + } | ||
35 | + else | ||
36 | + last_requested_block = block_number; | ||
37 | + | ||
38 | if (data->trace) | ||
39 | fprintf(stderr, "received ACK <block: %ld>\n", | ||
40 | block_number); | ||
41 | Index: atftp-0.7/tftpd_file.c | ||
42 | =================================================================== | ||
43 | --- atftp-0.7.orig/tftpd_file.c 2011-11-22 15:12:53.793744112 +0100 | ||
44 | +++ atftp-0.7/tftpd_file.c 2011-11-22 15:15:04.617534260 +0100 | ||
45 | @@ -403,6 +403,7 @@ | ||
46 | int timeout_state = state; | ||
47 | int result; | ||
48 | long block_number = 0; | ||
49 | + long last_requested_block = -1; | ||
50 | long last_block = -1; | ||
51 | int block_loops = 0; | ||
52 | int data_size; | ||
53 | @@ -859,6 +860,32 @@ | ||
54 | { | ||
55 | logger(LOG_DEBUG, "received ACK <block: %d>", block_number); | ||
56 | } | ||
57 | + | ||
58 | + /* check whether the block request isn't already fulfilled */ | ||
59 | + | ||
60 | + /* multicast, block numbers could contain gaps */ | ||
61 | + if (multicast) { | ||
62 | + if (last_requested_block >= block_number) | ||
63 | + { | ||
64 | + if (data->trace) | ||
65 | + logger(LOG_DEBUG, "received duplicated ACK <block: %d >= %d>", last_requested_block, block_number); | ||
66 | + break; | ||
67 | + } | ||
68 | + else | ||
69 | + last_requested_block = block_number; | ||
70 | + /* unicast, blocks should be requested one after another */ | ||
71 | + } else { | ||
72 | + if (last_requested_block + 1 != block_number && last_requested_block != -1) | ||
73 | + { | ||
74 | + if (data->trace) | ||
75 | + logger(LOG_DEBUG, "received out of order ACK <block: %d != %d>", last_requested_block + 1, block_number); | ||
76 | + break; | ||
77 | + } | ||
78 | + else | ||
79 | + last_requested_block = block_number; | ||
80 | + } | ||
81 | + | ||
82 | + | ||
83 | if (ntohs(tftphdr->th_block) == 65535) | ||
84 | { | ||
85 | block_loops++; | ||
86 | @@ -958,6 +985,8 @@ | ||
87 | /* nedd to send an oack to that client */ | ||
88 | state = S_SEND_OACK; | ||
89 | fseek(fp, 0, SEEK_SET); | ||
90 | + /* reset the last block received counter */ | ||
91 | + last_requested_block = -1; | ||
92 | } | ||
93 | else | ||
94 | { | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch new file mode 100644 index 0000000000..280b570b22 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch | |||
@@ -0,0 +1,163 @@ | |||
1 | Fate #303031: Circumvent TFTP size restrictions in atftpd | ||
2 | The size of a single image file that can be transferred with TFTP is limited to | ||
3 | 2^(2*8) *BLOCKSIZE (as per RFC 1350 there are only two bytes for the block | ||
4 | counter). This is problematic for one of our customers who needs to transfer | ||
5 | 100+ MB Windows images using a TFTP client (NT bootloader) which has a | ||
6 | hardwared BLOCKSIZE setting of 1432). | ||
7 | |||
8 | block rollover | ||
9 | http://www.compuphase.com/tftp.htm | ||
10 | |||
11 | Patch originally from OpenSUSE: | ||
12 | https://build.opensuse.org/package/show?package=atftp&project=openSUSE%3A12.2 | ||
13 | |||
14 | Upstream-Status: Pending | ||
15 | |||
16 | Index: git/tftp_def.h | ||
17 | =================================================================== | ||
18 | --- git.orig/tftp_def.h 2012-11-19 16:28:50.221027144 -0800 | ||
19 | +++ git/tftp_def.h 2012-11-20 17:40:54.391206979 -0800 | ||
20 | @@ -32,6 +32,7 @@ | ||
21 | #define TIMEOUT 5 /* Client timeout */ | ||
22 | #define S_TIMEOUT 5 /* Server timout. */ | ||
23 | #define NB_OF_RETRY 5 | ||
24 | +#define MAXBLOCKS 1000000 /* maximum number of blocks in a download */ | ||
25 | |||
26 | /* definition to use tftp_options structure */ | ||
27 | #define OPT_FILENAME 0 | ||
28 | Index: git/tftp_file.c | ||
29 | =================================================================== | ||
30 | --- git.orig/tftp_file.c 2012-11-19 16:28:50.221027144 -0800 | ||
31 | +++ git/tftp_file.c 2012-11-19 16:28:51.201027167 -0800 | ||
32 | @@ -622,8 +622,8 @@ | ||
33 | int state = S_SEND_REQ; /* current state in the state machine */ | ||
34 | int timeout_state = state; /* what state should we go on when timeout */ | ||
35 | int result; | ||
36 | - int block_number = 0; | ||
37 | - int last_block = -1; | ||
38 | + long block_number = 0; | ||
39 | + long last_block = -1; | ||
40 | int data_size; /* size of data received */ | ||
41 | int sockfd = data->sockfd; /* just to simplify calls */ | ||
42 | struct sockaddr_storage sa; /* a copy of data.sa_peer */ | ||
43 | @@ -637,8 +637,8 @@ | ||
44 | int convert = 0; /* if true, do netascii convertion */ | ||
45 | char string[MAXLEN]; | ||
46 | |||
47 | - int prev_block_number = 0; /* needed to support netascii convertion */ | ||
48 | - int prev_file_pos = 0; | ||
49 | + long prev_block_number = 0; /* needed to support netascii convertion */ | ||
50 | + long prev_file_pos = 0; | ||
51 | int temp = 0; | ||
52 | |||
53 | data->file_size = 0; | ||
54 | @@ -745,7 +745,7 @@ | ||
55 | data_size, data->data_buffer); | ||
56 | data->file_size += data_size; | ||
57 | if (data->trace) | ||
58 | - fprintf(stderr, "sent DATA <block: %d, size: %d>\n", | ||
59 | + fprintf(stderr, "sent DATA <block: %ld, size: %d>\n", | ||
60 | block_number + 1, data_size - 4); | ||
61 | state = S_WAIT_PACKET; | ||
62 | break; | ||
63 | @@ -785,7 +785,7 @@ | ||
64 | } | ||
65 | block_number = ntohs(tftphdr->th_block); | ||
66 | if (data->trace) | ||
67 | - fprintf(stderr, "received ACK <block: %d>\n", | ||
68 | + fprintf(stderr, "received ACK <block: %ld>\n", | ||
69 | block_number); | ||
70 | if ((last_block != -1) && (block_number > last_block)) | ||
71 | { | ||
72 | Index: git/tftp_io.c | ||
73 | =================================================================== | ||
74 | --- git.orig/tftp_io.c 2012-11-19 16:28:50.221027144 -0800 | ||
75 | +++ git/tftp_io.c 2012-11-19 16:28:51.201027167 -0800 | ||
76 | @@ -350,8 +350,8 @@ | ||
77 | /* | ||
78 | * Read from file and do netascii conversion if needed | ||
79 | */ | ||
80 | -int tftp_file_read(FILE *fp, char *data_buffer, int data_buffer_size, int block_number, | ||
81 | - int convert, int *prev_block_number, int *prev_file_pos, int *temp) | ||
82 | +int tftp_file_read(FILE *fp, char *data_buffer, int data_buffer_size, long block_number, | ||
83 | + int convert, long *prev_block_number, long *prev_file_pos, int *temp) | ||
84 | { | ||
85 | int i; | ||
86 | int c; | ||
87 | Index: git/tftp_io.h | ||
88 | =================================================================== | ||
89 | --- git.orig/tftp_io.h 2012-11-19 16:28:50.221027144 -0800 | ||
90 | +++ git/tftp_io.h 2012-11-19 16:28:51.201027167 -0800 | ||
91 | @@ -52,8 +52,8 @@ | ||
92 | int tftp_get_packet(int sock1, int sock2, int *sock, struct sockaddr_storage *sa, | ||
93 | struct sockaddr_storage *from, struct sockaddr_storage *to, | ||
94 | int timeout, int *size, char *data); | ||
95 | -int tftp_file_read(FILE *fp, char *buffer, int buffer_size, int block_number, int convert, | ||
96 | - int *prev_block_number, int *prev_file_pos, int *temp); | ||
97 | +int tftp_file_read(FILE *fp, char *buffer, int buffer_size, long block_number, int convert, | ||
98 | + long *prev_block_number, long *prev_file_pos, int *temp); | ||
99 | int tftp_file_write(FILE *fp, char *data_buffer, int data_buffer_size, int block_number, | ||
100 | int data_size, int convert, int *prev_block_number, int *temp); | ||
101 | #endif | ||
102 | Index: git/tftpd_file.c | ||
103 | =================================================================== | ||
104 | --- git.orig/tftpd_file.c 2012-11-19 16:28:50.225027144 -0800 | ||
105 | +++ git/tftpd_file.c 2012-11-19 16:28:51.201027167 -0800 | ||
106 | @@ -407,8 +407,9 @@ | ||
107 | int state = S_BEGIN; | ||
108 | int timeout_state = state; | ||
109 | int result; | ||
110 | - int block_number = 0; | ||
111 | - int last_block = -1; | ||
112 | + long block_number = 0; | ||
113 | + long last_block = -1; | ||
114 | + int block_loops = 0; | ||
115 | int data_size; | ||
116 | struct sockaddr_storage *sa = &data->client_info->client; | ||
117 | struct sockaddr_storage from; | ||
118 | @@ -431,8 +432,8 @@ | ||
119 | struct client_info *client_old = NULL; | ||
120 | struct tftp_opt options[OPT_NUMBER]; | ||
121 | |||
122 | - int prev_block_number = 0; /* needed to support netascii convertion */ | ||
123 | - int prev_file_pos = 0; | ||
124 | + long prev_block_number = 0; /* needed to support netascii convertion */ | ||
125 | + long prev_file_pos = 0; | ||
126 | int temp = 0; | ||
127 | |||
128 | /* look for mode option */ | ||
129 | @@ -565,11 +566,12 @@ | ||
130 | logger(LOG_INFO, "blksize option -> %d", result); | ||
131 | } | ||
132 | |||
133 | - /* Verify that the file can be sent in 2^16 block of BLKSIZE octets */ | ||
134 | - if ((file_stat.st_size / (data->data_buffer_size - 4)) > 65535) | ||
135 | + /* Verify that the file can be sent in MAXBLOCKS blocks of BLKSIZE octets */ | ||
136 | + if ((file_stat.st_size / (data->data_buffer_size - 4)) > MAXBLOCKS) | ||
137 | { | ||
138 | tftp_send_error(sockfd, sa, EUNDEF, data->data_buffer, data->data_buffer_size); | ||
139 | - logger(LOG_NOTICE, "Requested file to big, increase BLKSIZE"); | ||
140 | + logger(LOG_NOTICE, "Requested file too big, increase BLKSIZE"); | ||
141 | + logger(LOG_NOTICE, "Only %d blocks of %d bytes can be served.", MAXBLOCKS, data->data_buffer_size); | ||
142 | if (data->trace) | ||
143 | logger(LOG_DEBUG, "sent ERROR <code: %d, msg: %s>", EUNDEF, | ||
144 | tftp_errmsg[EUNDEF]); | ||
145 | @@ -880,10 +882,15 @@ | ||
146 | } | ||
147 | /* The ACK is from the current client */ | ||
148 | number_of_timeout = 0; | ||
149 | - block_number = ntohs(tftphdr->th_block); | ||
150 | + block_number = (block_loops * 65536) + ntohs(tftphdr->th_block); | ||
151 | if (data->trace) | ||
152 | - logger(LOG_DEBUG, "received ACK <block: %d>", | ||
153 | - block_number); | ||
154 | + { | ||
155 | + logger(LOG_DEBUG, "received ACK <block: %d>", block_number); | ||
156 | + } | ||
157 | + if (ntohs(tftphdr->th_block) == 65535) | ||
158 | + { | ||
159 | + block_loops++; | ||
160 | + }; | ||
161 | if ((last_block != -1) && (block_number > last_block)) | ||
162 | { | ||
163 | state = S_END; | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch new file mode 100644 index 0000000000..28fba6cf50 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch | |||
@@ -0,0 +1,152 @@ | |||
1 | Avoid assigning thread data outside of mutex lock | ||
2 | |||
3 | Patch originally from OpenSUSE: | ||
4 | https://build.opensuse.org/package/show?package=atftp&project=openSUSE%3A12.2 | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Index: git/tftpd_list.c | ||
9 | =================================================================== | ||
10 | --- git.orig/tftpd_list.c 2012-10-24 21:48:47.000000000 -0700 | ||
11 | +++ git/tftpd_list.c 2012-10-24 21:52:04.266205076 -0700 | ||
12 | @@ -49,11 +49,11 @@ | ||
13 | */ | ||
14 | int tftpd_list_add(struct thread_data *new) | ||
15 | { | ||
16 | - struct thread_data *current = thread_data; | ||
17 | + struct thread_data *current; | ||
18 | int ret; | ||
19 | |||
20 | pthread_mutex_lock(&thread_list_mutex); | ||
21 | - | ||
22 | + current = thread_data; | ||
23 | number_of_thread++; | ||
24 | |||
25 | ret = number_of_thread; | ||
26 | @@ -81,11 +81,13 @@ | ||
27 | */ | ||
28 | int tftpd_list_remove(struct thread_data *old) | ||
29 | { | ||
30 | - struct thread_data *current = thread_data; | ||
31 | + struct thread_data *current; | ||
32 | int ret; | ||
33 | |||
34 | pthread_mutex_lock(&thread_list_mutex); | ||
35 | |||
36 | + current = thread_data; | ||
37 | + | ||
38 | number_of_thread--; | ||
39 | ret = number_of_thread; | ||
40 | |||
41 | @@ -137,23 +139,26 @@ | ||
42 | struct thread_data *data, | ||
43 | struct client_info *client) | ||
44 | { | ||
45 | - struct thread_data *current = thread_data; /* head of the list */ | ||
46 | - struct tftp_opt *tftp_options = data->tftp_options; | ||
47 | + struct thread_data *current; /* head of the list */ | ||
48 | + struct tftp_opt *tftp_options; | ||
49 | struct client_info *tmp; | ||
50 | char options[MAXLEN]; | ||
51 | char string[MAXLEN]; | ||
52 | char *index; | ||
53 | int len; | ||
54 | |||
55 | + /* lock the whole list before walking it */ | ||
56 | + pthread_mutex_lock(&thread_list_mutex); | ||
57 | + | ||
58 | *thread = NULL; | ||
59 | |||
60 | + current = thread_data; | ||
61 | + tftp_options = data->tftp_options; | ||
62 | + | ||
63 | opt_request_to_string(tftp_options, options, MAXLEN); | ||
64 | index = strstr(options, "multicast"); | ||
65 | len = (int)index - (int)options; | ||
66 | |||
67 | - /* lock the whole list before walking it */ | ||
68 | - pthread_mutex_lock(&thread_list_mutex); | ||
69 | - | ||
70 | while (current) | ||
71 | { | ||
72 | if (current != data) | ||
73 | @@ -214,9 +219,10 @@ | ||
74 | void tftpd_clientlist_remove(struct thread_data *thread, | ||
75 | struct client_info *client) | ||
76 | { | ||
77 | - struct client_info *tmp = thread->client_info; | ||
78 | + struct client_info *tmp; | ||
79 | |||
80 | pthread_mutex_lock(&thread->client_mutex); | ||
81 | + tmp = thread->client_info; | ||
82 | while ((tmp->next != client) && (tmp->next != NULL)) | ||
83 | tmp = tmp->next; | ||
84 | if (tmp->next == NULL) | ||
85 | @@ -231,9 +237,11 @@ | ||
86 | void tftpd_clientlist_free(struct thread_data *thread) | ||
87 | { | ||
88 | struct client_info *tmp; | ||
89 | - struct client_info *head = thread->client_info; | ||
90 | + struct client_info *head; | ||
91 | |||
92 | pthread_mutex_lock(&thread->client_mutex); | ||
93 | + head = thread->client_info; | ||
94 | + | ||
95 | while (head) | ||
96 | { | ||
97 | tmp = head; | ||
98 | @@ -250,9 +258,10 @@ | ||
99 | struct client_info *client, | ||
100 | struct sockaddr_storage *sock) | ||
101 | { | ||
102 | - struct client_info *head = thread->client_info; | ||
103 | + struct client_info *head; | ||
104 | |||
105 | pthread_mutex_lock(&thread->client_mutex); | ||
106 | + head = thread->client_info; | ||
107 | |||
108 | if (client) | ||
109 | { | ||
110 | @@ -334,10 +343,10 @@ | ||
111 | |||
112 | void tftpd_list_kill_threads(void) | ||
113 | { | ||
114 | - struct thread_data *current = thread_data; /* head of list */ | ||
115 | + struct thread_data *current; /* head of list */ | ||
116 | |||
117 | pthread_mutex_lock(&thread_list_mutex); | ||
118 | - | ||
119 | + current = thread_data; | ||
120 | |||
121 | while (current != NULL) | ||
122 | { | ||
123 | Index: git/tftpd_mcast.c | ||
124 | =================================================================== | ||
125 | --- git.orig/tftpd_mcast.c 2012-10-24 21:48:47.000000000 -0700 | ||
126 | +++ git/tftpd_mcast.c 2012-10-24 21:49:11.570201582 -0700 | ||
127 | @@ -51,9 +51,11 @@ | ||
128 | */ | ||
129 | int tftpd_mcast_get_tid(char **addr, short *port) | ||
130 | { | ||
131 | - struct tid *current = tid_list; | ||
132 | + struct tid *current; | ||
133 | |||
134 | pthread_mutex_lock(&mcast_tid_list); | ||
135 | + current = tid_list; | ||
136 | + | ||
137 | /* walk the list for a free tid */ | ||
138 | while (current != NULL) | ||
139 | { | ||
140 | @@ -74,9 +76,11 @@ | ||
141 | |||
142 | int tftpd_mcast_free_tid(char *addr, short port) | ||
143 | { | ||
144 | - struct tid *current = tid_list; | ||
145 | + struct tid *current; | ||
146 | |||
147 | pthread_mutex_lock(&mcast_tid_list); | ||
148 | + current = tid_list; | ||
149 | + | ||
150 | while (current != NULL) | ||
151 | { | ||
152 | if ((current->used == 1) && (current->port == port) && | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftpd.init b/meta-networking/recipes-daemons/atftp/files/atftpd.init new file mode 100644 index 0000000000..161d97aca7 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftpd.init | |||
@@ -0,0 +1,37 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # This is an init script for openembedded | ||
4 | # Copy it to /etc/init.d/atftpd and type | ||
5 | # > update-rc.d atftpd defaults 60 | ||
6 | # | ||
7 | |||
8 | |||
9 | test -f /usr/sbin/atftpd || exit 0 | ||
10 | |||
11 | test -d /srv/tftp || mkdir -p /srv/tftp | ||
12 | |||
13 | case "$1" in | ||
14 | start) | ||
15 | echo -n "Starting tftp daemon: atftpd" | ||
16 | start-stop-daemon --start --quiet --exec /usr/sbin/atftpd -- --daemon --port 69 | ||
17 | echo "." | ||
18 | ;; | ||
19 | stop) | ||
20 | echo -n "Stopping tftp daemon: atftpd" | ||
21 | start-stop-daemon --stop --quiet --exec /usr/sbin/atftpd | ||
22 | echo "." | ||
23 | ;; | ||
24 | reload|force-reload) | ||
25 | start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/atftpd | ||
26 | ;; | ||
27 | restart) | ||
28 | $0 stop | ||
29 | sleep 1 | ||
30 | $0 start | ||
31 | ;; | ||
32 | *) | ||
33 | echo "Usage: /etc/init.d/atftpd {start|stop|reload|restart|force-reload}" | ||
34 | exit 1 | ||
35 | esac | ||
36 | |||
37 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch new file mode 100644 index 0000000000..742f25de19 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 40971911d653bf53de295d7462c643e4073916b9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe@deserted.net> | ||
3 | Date: Fri, 1 Nov 2013 12:47:18 -0400 | ||
4 | Subject: [PATCH] systemd: allow --with-systemd to take a path arg | ||
5 | |||
6 | If building for a cross-compile environment with systemd it is convenient | ||
7 | to be able to specify a systemd path for the target that may not be the | ||
8 | same as that on the host. | ||
9 | |||
10 | Upstream-status: Submitted [http://www.spinics.net/lists/autofs/msg00740.html] | ||
11 | |||
12 | Signed-off-by: Joe MacDonald <joe@deserted.net> | ||
13 | --- | ||
14 | aclocal.m4 | 10 ++++++++-- | ||
15 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/aclocal.m4 b/aclocal.m4 | ||
18 | index 3e6f223..105e3e9 100644 | ||
19 | --- a/aclocal.m4 | ||
20 | +++ b/aclocal.m4 | ||
21 | @@ -229,8 +229,10 @@ dnl Check the location of the systemd unit files directory | ||
22 | dnl -------------------------------------------------------------------------- | ||
23 | AC_DEFUN([AF_WITH_SYSTEMD], | ||
24 | [AC_ARG_WITH(systemd, | ||
25 | -[ --with-systemd install systemd unit file if systemd unit directory | ||
26 | - is found on system], | ||
27 | +[ --with-systemd@<:@=systemddir@:>@ install systemd unit file. If 'yes' | ||
28 | + probe the system for unit directory. | ||
29 | + If a path is specified, assume that | ||
30 | + is a valid install path.], | ||
31 | [if test "$withval" = yes; then | ||
32 | if test -z "$systemddir"; then | ||
33 | AC_MSG_CHECKING([location of the systemd unit files directory]) | ||
34 | @@ -247,6 +249,10 @@ AC_DEFUN([AF_WITH_SYSTEMD], | ||
35 | else | ||
36 | AC_MSG_RESULT(not found) | ||
37 | fi | ||
38 | +else | ||
39 | + if test "$withval" != no; then | ||
40 | + systemddir=$withval | ||
41 | + fi | ||
42 | fi]) | ||
43 | ]) | ||
44 | |||
45 | -- | ||
46 | 1.7.10.4 | ||
47 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/Makefile.rules-cross.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/Makefile.rules-cross.patch new file mode 100644 index 0000000000..7dc7096c2e --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/Makefile.rules-cross.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | Index: autofs-5.0.7/Makefile.rules | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/Makefile.rules 2012-07-24 23:05:26.000000000 -0700 | ||
4 | +++ autofs-5.0.7/Makefile.rules 2012-10-26 09:23:40.270204270 -0700 | ||
5 | @@ -34,14 +34,14 @@ | ||
6 | else | ||
7 | CFLAGS ?= -O2 -Wall | ||
8 | LDFLAGS = -s | ||
9 | -STRIP = strip --strip-debug | ||
10 | +STRIP = ${TARGET_PREFIX}strip --strip-debug | ||
11 | endif | ||
12 | endif | ||
13 | |||
14 | -CC = gcc | ||
15 | -CXX = g++ | ||
16 | +CC ?= ${TARGET_PREFIX}gcc | ||
17 | +CXX ?= ${TARGET_PREFIX}g++ | ||
18 | CXXFLAGS = $(CFLAGS) | ||
19 | -LD = ld | ||
20 | +LD ?= ${TARGET_PREFIX}ld | ||
21 | SOLDFLAGS = -shared | ||
22 | |||
23 | CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-fix-recursive-mount-deadlock.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-fix-recursive-mount-deadlock.patch new file mode 100644 index 0000000000..e6549a7c8f --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-fix-recursive-mount-deadlock.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | autofs-5.0.6 - fix recursive mount deadlock | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Prior to the vfs-automount changes that went into 2.6.38 | ||
6 | and were finalized in 3.1 it was not possible to block | ||
7 | path walks into multi-mounts whose root was covered by | ||
8 | another mount. To deal with that a write lock was used | ||
9 | to ensure the mount tree construction was completed. This | ||
10 | restricts the types of recursively defined mount maps that | ||
11 | can be used and can lead to a deadlock during lookup. | ||
12 | |||
13 | Now that we can prevent processes walking into multi-mounts | ||
14 | that are under construction we no longer need to use a | ||
15 | write lock. | ||
16 | |||
17 | Also, in the patch below, a cache writelock is changed to | ||
18 | a read lock because a write lock isn't needed since the | ||
19 | map cache entry isn't being updated. | ||
20 | --- | ||
21 | |||
22 | CHANGELOG | 1 + | ||
23 | daemon/direct.c | 14 ++++++++++++-- | ||
24 | 2 files changed, 13 insertions(+), 2 deletions(-) | ||
25 | |||
26 | |||
27 | diff --git a/CHANGELOG b/CHANGELOG | ||
28 | index 936c9ab..9cdad6e 100644 | ||
29 | --- a/CHANGELOG | ||
30 | +++ b/CHANGELOG | ||
31 | @@ -12,6 +12,7 @@ | ||
32 | - configure.in: allow cross compilation. | ||
33 | - README: update mailing list subscription info. | ||
34 | - allow non root user to check status. | ||
35 | +- fix recursive mount deadlock. | ||
36 | |||
37 | 25/07/2012 autofs-5.0.7 | ||
38 | ======================= | ||
39 | diff --git a/daemon/direct.c b/daemon/direct.c | ||
40 | index 7e2f0d7..3e09c5d 100644 | ||
41 | --- a/daemon/direct.c | ||
42 | +++ b/daemon/direct.c | ||
43 | @@ -1285,6 +1285,8 @@ int handle_packet_missing_direct(struct autofs_point *ap, autofs_packet_missing_ | ||
44 | struct timespec wait; | ||
45 | struct timeval now; | ||
46 | int ioctlfd, len, state; | ||
47 | + unsigned int kver_major = get_kver_major(); | ||
48 | + unsigned int kver_minor = get_kver_minor(); | ||
49 | |||
50 | pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &state); | ||
51 | |||
52 | @@ -1297,8 +1299,16 @@ int handle_packet_missing_direct(struct autofs_point *ap, autofs_packet_missing_ | ||
53 | * cache entry we will not be able to find the mapent. So | ||
54 | * we must take the source writelock to ensure the parent | ||
55 | * has mount is complete before we look for the entry. | ||
56 | + * | ||
57 | + * Since the vfs-automount kernel changes we can now block | ||
58 | + * on covered mounts during mount tree construction so a | ||
59 | + * write lock is no longer needed. So we now can handle a | ||
60 | + * wider class of recursively define mount lookups. | ||
61 | */ | ||
62 | - master_source_writelock(ap->entry); | ||
63 | + if (kver_major > 5 || (kver_major == 5 && kver_minor > 1)) | ||
64 | + master_source_readlock(ap->entry); | ||
65 | + else | ||
66 | + master_source_writelock(ap->entry); | ||
67 | map = ap->entry->maps; | ||
68 | while (map) { | ||
69 | /* | ||
70 | @@ -1311,7 +1321,7 @@ int handle_packet_missing_direct(struct autofs_point *ap, autofs_packet_missing_ | ||
71 | } | ||
72 | |||
73 | mc = map->mc; | ||
74 | - cache_writelock(mc); | ||
75 | + cache_readlock(mc); | ||
76 | me = cache_lookup_ino(mc, pkt->dev, pkt->ino); | ||
77 | if (me) | ||
78 | break; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-increase-file-map-read-buffer-size.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-increase-file-map-read-buffer-size.patch new file mode 100644 index 0000000000..39b22212a7 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-increase-file-map-read-buffer-size.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | autofs-5.0.6 - increase file map read buffer size | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | The file map entry read buffer can be too small for larger | ||
6 | multi-mount map entries so increase it. | ||
7 | --- | ||
8 | |||
9 | CHANGELOG | 1 + | ||
10 | include/automount.h | 2 +- | ||
11 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
12 | |||
13 | |||
14 | diff --git a/CHANGELOG b/CHANGELOG | ||
15 | index 9cdad6e..3bdf8a4 100644 | ||
16 | --- a/CHANGELOG | ||
17 | +++ b/CHANGELOG | ||
18 | @@ -13,6 +13,7 @@ | ||
19 | - README: update mailing list subscription info. | ||
20 | - allow non root user to check status. | ||
21 | - fix recursive mount deadlock. | ||
22 | +- increase file map read buffer size. | ||
23 | |||
24 | 25/07/2012 autofs-5.0.7 | ||
25 | ======================= | ||
26 | diff --git a/include/automount.h b/include/automount.h | ||
27 | index 561fcc2..37541f5 100644 | ||
28 | --- a/include/automount.h | ||
29 | +++ b/include/automount.h | ||
30 | @@ -233,7 +233,7 @@ int rmdir_path(struct autofs_point *ap, const char *path, dev_t dev); | ||
31 | #define AUTOFS_LOOKUP_VERSION 5 | ||
32 | |||
33 | #define KEY_MAX_LEN NAME_MAX | ||
34 | -#define MAPENT_MAX_LEN 4095 | ||
35 | +#define MAPENT_MAX_LEN 16384 | ||
36 | #define PARSE_MAX_BUF KEY_MAX_LEN + MAPENT_MAX_LEN + 2 | ||
37 | |||
38 | int lookup_nss_read_master(struct master *master, time_t age); | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-README-update-mailing-list-subscription-info.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-README-update-mailing-list-subscription-info.patch new file mode 100644 index 0000000000..99b61818ca --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-README-update-mailing-list-subscription-info.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | autofs-5.0.7 - README: update mailing list subscription info | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | Following the kernel.org compromise the mailing list was moved to | ||
6 | vger.kernel.org. Update the subscription info and add URLs for the gmane | ||
7 | mailing list archive. | ||
8 | |||
9 | Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
10 | --- | ||
11 | |||
12 | CHANGELOG | 1 + | ||
13 | README | 17 ++++++++++++++--- | ||
14 | 2 files changed, 15 insertions(+), 3 deletions(-) | ||
15 | |||
16 | |||
17 | diff --git a/CHANGELOG b/CHANGELOG | ||
18 | index fe801e8..44c9fb2 100644 | ||
19 | --- a/CHANGELOG | ||
20 | +++ b/CHANGELOG | ||
21 | @@ -10,6 +10,7 @@ | ||
22 | - fix null map entry order handling. | ||
23 | - make description of default MOUNT_WAIT setting clear. | ||
24 | - configure.in: allow cross compilation. | ||
25 | +- README: update mailing list subscription info. | ||
26 | |||
27 | 25/07/2012 autofs-5.0.7 | ||
28 | ======================= | ||
29 | diff --git a/README b/README | ||
30 | index cef16a9..9024e64 100644 | ||
31 | --- a/README | ||
32 | +++ b/README | ||
33 | @@ -43,9 +43,20 @@ Fitzhardinge's <jeremy@goop.org> work on autofs 3. Further enhancements | ||
34 | have been made by Ian Kent <raven@themaw.net>. | ||
35 | |||
36 | If you use or want to help develop autofs, please join the autofs | ||
37 | -mailing list by visiting: | ||
38 | +mailing list by sending an email to: | ||
39 | |||
40 | - http://linux.kernel.org/mailman/listinfo/autofs | ||
41 | + majordomo@vger.kernel.org | ||
42 | |||
43 | -and folling the instructions there to subscribe to the autofs mailing list. | ||
44 | +With the body text: | ||
45 | + | ||
46 | + subscribe autofs | ||
47 | + | ||
48 | +Once subscribed you can send patches to: | ||
49 | + | ||
50 | + autofs@vger.kernel.org | ||
51 | + | ||
52 | +The autofs mailing list archive can be viewed on gmane: | ||
53 | + | ||
54 | + http://news.gmane.org/gmane.linux.kernel.autofs | ||
55 | + http://blog.gmane.org/gmane.linux.kernel.autofs | ||
56 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-symlink-pseudo-option.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-symlink-pseudo-option.patch new file mode 100644 index 0000000000..b0440f4a51 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-symlink-pseudo-option.patch | |||
@@ -0,0 +1,217 @@ | |||
1 | autofs-5.0.7 - add symlink pseudo option | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Add a "symlink" pseudo option to tell the bind mount module to symlink | ||
6 | instead of bind when mounting mounts other than direct mounts and | ||
7 | non-root indirect mount offset mounts (aka. non-root multi-mount | ||
8 | entries). | ||
9 | --- | ||
10 | CHANGELOG | 1 + | ||
11 | include/automount.h | 3 +++ | ||
12 | lib/master_parse.y | 8 +++++++- | ||
13 | lib/master_tok.l | 1 + | ||
14 | man/auto.master.5.in | 8 ++++++++ | ||
15 | modules/mount_autofs.c | 5 +++++ | ||
16 | modules/mount_bind.c | 36 +++++++++++++++++++++++++++++++++++- | ||
17 | 7 files changed, 60 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index c189483..247d334 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -32,6 +32,7 @@ | ||
24 | - fix wildcard multi map regression. | ||
25 | - fix file descriptor leak when reloading the daemon. | ||
26 | - depricate nosymlink pseudo option. | ||
27 | +- add symlink pseudo option. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/include/automount.h b/include/automount.h | ||
32 | index 37541f5..e72fa0d 100644 | ||
33 | --- a/include/automount.h | ||
34 | +++ b/include/automount.h | ||
35 | @@ -455,6 +455,9 @@ struct kernel_mod_version { | ||
36 | /* Don't use bind mounts even when system supports them */ | ||
37 | #define MOUNT_FLAG_NOBIND 0x0020 | ||
38 | |||
39 | +/* Use symlinks instead of bind mounting local mounts */ | ||
40 | +#define MOUNT_FLAG_SYMLINK 0x0040 | ||
41 | + | ||
42 | struct autofs_point { | ||
43 | pthread_t thid; | ||
44 | char *path; /* Mount point name */ | ||
45 | diff --git a/lib/master_parse.y b/lib/master_parse.y | ||
46 | index f925b5a..11caf5b 100644 | ||
47 | --- a/lib/master_parse.y | ||
48 | +++ b/lib/master_parse.y | ||
49 | @@ -57,6 +57,7 @@ static char *type; | ||
50 | static char *format; | ||
51 | static long timeout; | ||
52 | static long negative_timeout; | ||
53 | +static unsigned symlnk; | ||
54 | static unsigned nobind; | ||
55 | static unsigned ghost; | ||
56 | extern unsigned global_selection_options; | ||
57 | @@ -100,7 +101,7 @@ static int master_fprintf(FILE *, char *, ...); | ||
58 | %token COMMENT | ||
59 | %token MAP | ||
60 | %token OPT_TIMEOUT OPT_NTIMEOUT OPT_NOBIND OPT_NOGHOST OPT_GHOST OPT_VERBOSE | ||
61 | -%token OPT_DEBUG OPT_RANDOM OPT_USE_WEIGHT | ||
62 | +%token OPT_DEBUG OPT_RANDOM OPT_USE_WEIGHT OPT_SYMLINK | ||
63 | %token COLON COMMA NL DDASH | ||
64 | %type <strtype> map | ||
65 | %type <strtype> options | ||
66 | @@ -186,6 +187,7 @@ line: | ||
67 | | PATH OPT_USE_WEIGHT { master_notify($1); YYABORT; } | ||
68 | | PATH OPT_DEBUG { master_notify($1); YYABORT; } | ||
69 | | PATH OPT_TIMEOUT { master_notify($1); YYABORT; } | ||
70 | + | PATH OPT_SYMLINK { master_notify($1); YYABORT; } | ||
71 | | PATH OPT_NOBIND { master_notify($1); YYABORT; } | ||
72 | | PATH OPT_GHOST { master_notify($1); YYABORT; } | ||
73 | | PATH OPT_NOGHOST { master_notify($1); YYABORT; } | ||
74 | @@ -557,6 +559,7 @@ option: daemon_option | ||
75 | |||
76 | daemon_option: OPT_TIMEOUT NUMBER { timeout = $2; } | ||
77 | | OPT_NTIMEOUT NUMBER { negative_timeout = $2; } | ||
78 | + | OPT_SYMLINK { symlnk = 1; } | ||
79 | | OPT_NOBIND { nobind = 1; } | ||
80 | | OPT_NOGHOST { ghost = 0; } | ||
81 | | OPT_GHOST { ghost = 1; } | ||
82 | @@ -627,6 +630,7 @@ static void local_init_vars(void) | ||
83 | debug = 0; | ||
84 | timeout = -1; | ||
85 | negative_timeout = 0; | ||
86 | + symlnk = 0; | ||
87 | nobind = 0; | ||
88 | ghost = defaults_get_browse_mode(); | ||
89 | random_selection = global_selection_options & MOUNT_FLAG_RANDOM_SELECT; | ||
90 | @@ -811,6 +815,8 @@ int master_parse_entry(const char *buffer, unsigned int default_timeout, unsigne | ||
91 | entry->ap->flags |= MOUNT_FLAG_RANDOM_SELECT; | ||
92 | if (use_weight) | ||
93 | entry->ap->flags |= MOUNT_FLAG_USE_WEIGHT_ONLY; | ||
94 | + if (symlnk) | ||
95 | + entry->ap->flags |= MOUNT_FLAG_SYMLINK; | ||
96 | if (negative_timeout) | ||
97 | entry->ap->negative_timeout = negative_timeout; | ||
98 | |||
99 | diff --git a/lib/master_tok.l b/lib/master_tok.l | ||
100 | index 30abb15..f9b4e55 100644 | ||
101 | --- a/lib/master_tok.l | ||
102 | +++ b/lib/master_tok.l | ||
103 | @@ -361,6 +361,7 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo | ||
104 | return(NUMBER); | ||
105 | } | ||
106 | |||
107 | + -?symlink { return(OPT_SYMLINK); } | ||
108 | -?nobind { return(OPT_NOBIND); } | ||
109 | -?nobrowse { return(OPT_NOGHOST); } | ||
110 | -g|--ghost|-?browse { return(OPT_GHOST); } | ||
111 | diff --git a/man/auto.master.5.in b/man/auto.master.5.in | ||
112 | index 8007542..bbea43a 100644 | ||
113 | --- a/man/auto.master.5.in | ||
114 | +++ b/man/auto.master.5.in | ||
115 | @@ -159,6 +159,14 @@ on individual map entries of both types. Bind mounting of NFS file | ||
116 | systems can also be prevented for specific map entrys by adding the | ||
117 | "port=" mount option to the entries. | ||
118 | .TP | ||
119 | +.I "symlink" | ||
120 | +This option makes bind mounting use a symlink instead of an actual bind | ||
121 | +mount. It is an autofs specific option that is a pseudo mount option and | ||
122 | +so is given without a leading dash. It may be used with indirect map | ||
123 | +entries only, either in the master map (so it effects all map entries) | ||
124 | +or with individual map entries. The option is ignored for direct mounts | ||
125 | +and non-root offest mount entries. | ||
126 | +.TP | ||
127 | .I "\-r, \-\-random-multimount-selection" | ||
128 | Enables the use of ramdom selection when choosing a host from a | ||
129 | list of replicated servers. This option is applied to this mount | ||
130 | diff --git a/modules/mount_autofs.c b/modules/mount_autofs.c | ||
131 | index ef16020..8c1e600 100644 | ||
132 | --- a/modules/mount_autofs.c | ||
133 | +++ b/modules/mount_autofs.c | ||
134 | @@ -51,6 +51,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, | ||
135 | int argc, status; | ||
136 | int nobind = ap->flags & MOUNT_FLAG_NOBIND; | ||
137 | int ghost = ap->flags & MOUNT_FLAG_GHOST; | ||
138 | + int symlnk = ap->flags & MOUNT_FLAG_SYMLINK; | ||
139 | time_t timeout = ap->entry->maps->exp_timeout; | ||
140 | unsigned logopt = ap->logopt; | ||
141 | struct map_type_info *info; | ||
142 | @@ -120,6 +121,8 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, | ||
143 | nobind = 1; | ||
144 | else if (strncmp(cp, "browse", 6) == 0) | ||
145 | ghost = 1; | ||
146 | + else if (strncmp(cp, "symlink", 7) == 0) | ||
147 | + symlnk = 1; | ||
148 | else if (strncmp(cp, "timeout=", 8) == 0) { | ||
149 | char *val = strchr(cp, '='); | ||
150 | unsigned tout; | ||
151 | @@ -158,6 +161,8 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, | ||
152 | } | ||
153 | nap = entry->ap; | ||
154 | nap->parent = ap; | ||
155 | + if (symlnk) | ||
156 | + nap->flags |= MOUNT_FLAG_SYMLINK; | ||
157 | |||
158 | argc = 1; | ||
159 | |||
160 | diff --git a/modules/mount_bind.c b/modules/mount_bind.c | ||
161 | index 9bce686..4975294 100644 | ||
162 | --- a/modules/mount_bind.c | ||
163 | +++ b/modules/mount_bind.c | ||
164 | @@ -73,10 +73,44 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int | ||
165 | char buf[MAX_ERR_BUF]; | ||
166 | int err; | ||
167 | int i, len; | ||
168 | + int symlnk = (*name != '/' && (ap->flags & MOUNT_FLAG_SYMLINK)); | ||
169 | |||
170 | if (ap->flags & MOUNT_FLAG_REMOUNT) | ||
171 | return 0; | ||
172 | |||
173 | + /* Extract "symlink" pseudo-option which forces local filesystems | ||
174 | + * to be symlinked instead of bound. | ||
175 | + */ | ||
176 | + if (*name != '/' && !symlnk && options) { | ||
177 | + const char *comma; | ||
178 | + int o_len = strlen(options) + 1; | ||
179 | + | ||
180 | + for (comma = options; *comma != '\0';) { | ||
181 | + const char *cp; | ||
182 | + const char *end; | ||
183 | + | ||
184 | + while (*comma == ',') | ||
185 | + comma++; | ||
186 | + | ||
187 | + /* Skip leading white space */ | ||
188 | + while (*comma == ' ' || *comma == '\t') | ||
189 | + comma++; | ||
190 | + | ||
191 | + cp = comma; | ||
192 | + while (*comma != '\0' && *comma != ',') | ||
193 | + comma++; | ||
194 | + | ||
195 | + /* Skip trailing white space */ | ||
196 | + end = comma - 1; | ||
197 | + while (*comma == ' ' || *comma == '\t') | ||
198 | + end--; | ||
199 | + | ||
200 | + o_len = end - cp + 1; | ||
201 | + if (strncmp("symlink", cp, o_len) == 0) | ||
202 | + symlnk = 1; | ||
203 | + } | ||
204 | + } | ||
205 | + | ||
206 | /* Root offset of multi-mount */ | ||
207 | len = strlen(root); | ||
208 | if (root[len - 1] == '/') { | ||
209 | @@ -100,7 +134,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int | ||
210 | if (options == NULL || *options == '\0') | ||
211 | options = "defaults"; | ||
212 | |||
213 | - if (bind_works) { | ||
214 | + if (!symlnk && bind_works) { | ||
215 | int status, existed = 1; | ||
216 | |||
217 | debug(ap->logopt, MODPREFIX "calling mkdir_path %s", fullpath); | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-timeout-option-description-to-man-page.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-timeout-option-description-to-man-page.patch new file mode 100644 index 0000000000..ac598dd729 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-timeout-option-description-to-man-page.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | autofs-5.0.7 - add timeout option description to man page | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | The pseudo option used t set the timeout for map entries is one of | ||
6 | the most most frequently used autofs options but is not mentioned | ||
7 | in auto.master(5). | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 + | ||
11 | man/auto.master.5.in | 5 +++++ | ||
12 | 2 files changed, 6 insertions(+), 0 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index 93b9c26..7b8d185 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -6,6 +6,7 @@ | ||
20 | - fix parse buffer initialization. | ||
21 | - fix typo in automount(8). | ||
22 | - dont wait forever to restart. | ||
23 | +- add timeout option description to man page. | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/man/auto.master.5.in b/man/auto.master.5.in | ||
28 | index 54269f8..21d7544 100644 | ||
29 | --- a/man/auto.master.5.in | ||
30 | +++ b/man/auto.master.5.in | ||
31 | @@ -167,6 +167,11 @@ server is specified in the map entry. If no server weights are given | ||
32 | then each available server will be tried in the order listed, within | ||
33 | proximity. | ||
34 | .TP | ||
35 | +.I "\-t, \-\-timeout <seconds>" | ||
36 | +Set the expire timeout for map entries. This option can be used to | ||
37 | +override the global default given either on the command line | ||
38 | +or in the configuration. | ||
39 | +.TP | ||
40 | .I "\-n, \-\-negative\-timeout <seconds>" | ||
41 | Set the timeout for caching failed key lookups. This option can be | ||
42 | used to override the global default given either on the command line | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch new file mode 100644 index 0000000000..6020c31e23 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | autofs-5.0.7 - allow non root user to check status | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | |||
6 | --- | ||
7 | |||
8 | CHANGELOG | 1 + | ||
9 | redhat/autofs.init.in | 20 +++++++++++++------- | ||
10 | 2 files changed, 14 insertions(+), 7 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/CHANGELOG b/CHANGELOG | ||
14 | index 44c9fb2..936c9ab 100644 | ||
15 | --- a/CHANGELOG | ||
16 | +++ b/CHANGELOG | ||
17 | @@ -11,6 +11,7 @@ | ||
18 | - make description of default MOUNT_WAIT setting clear. | ||
19 | - configure.in: allow cross compilation. | ||
20 | - README: update mailing list subscription info. | ||
21 | +- allow non root user to check status. | ||
22 | |||
23 | 25/07/2012 autofs-5.0.7 | ||
24 | ======================= | ||
25 | diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in | ||
26 | index cd5cb34..fe18b3e 100644 | ||
27 | --- a/redhat/autofs.init.in | ||
28 | +++ b/redhat/autofs.init.in | ||
29 | @@ -167,6 +167,19 @@ function usage_message() { | ||
30 | |||
31 | RETVAL=0 | ||
32 | |||
33 | +# allow non-root users to read status / usage | ||
34 | + | ||
35 | +case "$1" in | ||
36 | + status) | ||
37 | + status -p @@autofspiddir@@/autofs.pid -l autofs $prog | ||
38 | + exit 0; | ||
39 | + ;; | ||
40 | + usage) | ||
41 | + usage_message | ||
42 | + exit 0; | ||
43 | + ;; | ||
44 | +esac | ||
45 | + | ||
46 | # Only the root user may change the service status | ||
47 | if [ `id -u` -ne 0 ] && [ "$1" != "status" ]; then | ||
48 | echo "insufficient privilege to change service status" | ||
49 | @@ -184,9 +197,6 @@ case "$1" in | ||
50 | stop) | ||
51 | stop | ||
52 | ;; | ||
53 | - status) | ||
54 | - status -p @@autofspiddir@@/autofs.pid -l autofs $prog | ||
55 | - ;; | ||
56 | restart|force-reload) | ||
57 | restart | ||
58 | ;; | ||
59 | @@ -202,10 +212,6 @@ case "$1" in | ||
60 | restart | ||
61 | fi | ||
62 | ;; | ||
63 | - usage) | ||
64 | - usage_message | ||
65 | - exit 0 | ||
66 | - ;; | ||
67 | *) | ||
68 | usage_message | ||
69 | exit 2 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch new file mode 100644 index 0000000000..c342d1072e --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | autofs-5.0.7 - Allow nsswitch.conf to not contain "automount:" lines | ||
2 | |||
3 | From: Michael Tokarev <mjt@tls.msk.ru> | ||
4 | |||
5 | Current code does not allow a case when nsswitch.conf | ||
6 | does not mention automount map at all, like all new | ||
7 | installations. It logs a rather unpleasant error | ||
8 | message instead: | ||
9 | |||
10 | syntax error in nsswitch config near [ syntax error ] | ||
11 | |||
12 | this patch has a minimal fix, to allo "file" to be empty. | ||
13 | |||
14 | Whole parser in C is about 25 lines of code, the "grammar" | ||
15 | is trivial, and it is better to ditch all this yacc/lex | ||
16 | stuff, but that will be much more intrusive change. | ||
17 | |||
18 | Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> | ||
19 | Cc: 682266@bugs.debian.org | ||
20 | --- | ||
21 | |||
22 | CHANGELOG | 1 + | ||
23 | lib/nss_parse.y | 1 + | ||
24 | 2 files changed, 2 insertions(+), 0 deletions(-) | ||
25 | |||
26 | |||
27 | diff --git a/CHANGELOG b/CHANGELOG | ||
28 | index bd0dd82..16ac2a0 100644 | ||
29 | --- a/CHANGELOG | ||
30 | +++ b/CHANGELOG | ||
31 | @@ -16,6 +16,7 @@ | ||
32 | - increase file map read buffer size. | ||
33 | - handle new location of systemd. | ||
34 | - fix map entry duplicate offset detection. | ||
35 | +- Allow nsswitch.conf to not contain "automount:" lines. | ||
36 | |||
37 | 25/07/2012 autofs-5.0.7 | ||
38 | ======================= | ||
39 | diff --git a/lib/nss_parse.y b/lib/nss_parse.y | ||
40 | index a39fda4..055e9d7 100644 | ||
41 | --- a/lib/nss_parse.y | ||
42 | +++ b/lib/nss_parse.y | ||
43 | @@ -72,6 +72,7 @@ file: { | ||
44 | nss_debug = YYDEBUG; | ||
45 | #endif | ||
46 | } sources NL | ||
47 | + | /* empty */ | ||
48 | ; | ||
49 | |||
50 | sources: nss_source | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-allow-cross-compilation-update.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-allow-cross-compilation-update.patch new file mode 100644 index 0000000000..a8bc3ce857 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-allow-cross-compilation-update.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | autofs-5.0.7 - configure: allow cross compilation update | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | Run "make distclean" to update configure. This should have been included | ||
6 | in 5936c738 when configure.in was updated but it was missed. | ||
7 | --- | ||
8 | |||
9 | configure | 5 +---- | ||
10 | 1 files changed, 1 insertions(+), 4 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/configure b/configure | ||
14 | index bf62203..ba3bba6 100755 | ||
15 | --- a/configure | ||
16 | +++ b/configure | ||
17 | @@ -5378,10 +5378,7 @@ DAEMON_LDFLAGS= | ||
18 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc -fPIE works" >&5 | ||
19 | $as_echo_n "checking whether gcc -fPIE works... " >&6; } | ||
20 | if test "$cross_compiling" = yes; then : | ||
21 | - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | ||
22 | -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | ||
23 | -as_fn_error $? "cannot run test program while cross compiling | ||
24 | -See \`config.log' for more details" "$LINENO" 5; } | ||
25 | + gcc_supports_pie=no | ||
26 | else | ||
27 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
28 | /* end confdefs.h. */ | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-in-allow-cross-compilation.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-in-allow-cross-compilation.patch new file mode 100644 index 0000000000..ac18bd94bd --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-in-allow-cross-compilation.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | autofs-5.0.7 - configure.in: allow cross compilation | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | The default behaviour of AC_RUN_IFELSE is to stop with an error if cross | ||
6 | compiling. Avoid this by providing the optional 4th argument to set | ||
7 | gcc_supports_pie=no if support for PIE cannot be detected. | ||
8 | |||
9 | Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
10 | --- | ||
11 | |||
12 | CHANGELOG | 1 + | ||
13 | configure.in | 2 +- | ||
14 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
15 | |||
16 | |||
17 | diff --git a/CHANGELOG b/CHANGELOG | ||
18 | index 961e340..fe801e8 100644 | ||
19 | --- a/CHANGELOG | ||
20 | +++ b/CHANGELOG | ||
21 | @@ -9,6 +9,7 @@ | ||
22 | - add timeout option description to man page. | ||
23 | - fix null map entry order handling. | ||
24 | - make description of default MOUNT_WAIT setting clear. | ||
25 | +- configure.in: allow cross compilation. | ||
26 | |||
27 | 25/07/2012 autofs-5.0.7 | ||
28 | ======================= | ||
29 | diff --git a/configure.in b/configure.in | ||
30 | index 1a24e34..90bda62 100644 | ||
31 | --- a/configure.in | ||
32 | +++ b/configure.in | ||
33 | @@ -307,7 +307,7 @@ DAEMON_CFLAGS= | ||
34 | DAEMON_LDFLAGS= | ||
35 | AC_MSG_CHECKING([whether gcc -fPIE works]) | ||
36 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])], | ||
37 | - [gcc_supports_pie=yes], [gcc_supports_pie=no]) | ||
38 | + [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no]) | ||
39 | AC_MSG_RESULT([$gcc_supports_pie]) | ||
40 | if test $gcc_supports_pie = yes ; then | ||
41 | DAEMON_CFLAGS="-fPIE" | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch new file mode 100644 index 0000000000..c784de7c92 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | autofs-5.0.7 - depricate nosymlink pseudo option | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | The undocumented "nosymlink" option was the only way to force local | ||
6 | NFS mounting until the more descriptive "nobind" option was added. | ||
7 | |||
8 | So depricate the "nosymlink" option in favour of the "nobind" option. | ||
9 | --- | ||
10 | CHANGELOG | 1 + | ||
11 | modules/mount_nfs.c | 4 ++++ | ||
12 | 2 files changed, 5 insertions(+) | ||
13 | |||
14 | diff --git a/CHANGELOG b/CHANGELOG | ||
15 | index a7ed212..c189483 100644 | ||
16 | --- a/CHANGELOG | ||
17 | +++ b/CHANGELOG | ||
18 | @@ -31,6 +31,7 @@ | ||
19 | - dont fail on master map self include. | ||
20 | - fix wildcard multi map regression. | ||
21 | - fix file descriptor leak when reloading the daemon. | ||
22 | +- depricate nosymlink pseudo option. | ||
23 | |||
24 | 25/07/2012 autofs-5.0.7 | ||
25 | ======================= | ||
26 | diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c | ||
27 | index bbbb1de..e61320b 100644 | ||
28 | --- a/modules/mount_nfs.c | ||
29 | +++ b/modules/mount_nfs.c | ||
30 | @@ -125,6 +125,10 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int | ||
31 | |||
32 | o_len = end - cp + 1; | ||
33 | if (strncmp("nosymlink", cp, o_len) == 0) { | ||
34 | + warn(ap->logopt, MODPREFIX | ||
35 | + "the \"nosymlink\" option is depricated " | ||
36 | + "and will soon be removed, " | ||
37 | + "use the \"nobind\" option instead"); | ||
38 | nosymlink = 1; | ||
39 | } else if (strncmp("nobind", cp, o_len) == 0) { | ||
40 | nobind = 1; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-do-not-check-for-modprobe.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-do-not-check-for-modprobe.patch new file mode 100644 index 0000000000..af5be6a830 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-do-not-check-for-modprobe.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | Description: Loading autofs module is #ifdef'ed in the source, so | ||
2 | there is no need to check for /proc (which is only used | ||
3 | to load module) or modprobe. Both modprobe and /proc | ||
4 | are always in the fixed location so there's no need to | ||
5 | check for these to start with. | ||
6 | |||
7 | Upstream-Status: Backport [1] | ||
8 | [1] http://www.spinics.net/lists/autofs/msg00139.html | ||
9 | |||
10 | diff -urpN a/configure.in b/configure.in | ||
11 | --- a/configure.in 2013-01-15 11:30:22.000000000 +0800 | ||
12 | +++ b/configure.in 2013-01-15 11:31:45.000000000 +0800 | ||
13 | @@ -34,11 +34,6 @@ AC_MSG_CHECKING([for binaries in]) | ||
14 | AC_MSG_RESULT([$searchpath]) | ||
15 | |||
16 | # | ||
17 | -# Make sure we have "/proc" | ||
18 | -# | ||
19 | -AF_LINUX_PROCFS() | ||
20 | - | ||
21 | -# | ||
22 | # Location of init.d directory? | ||
23 | # | ||
24 | AF_INIT_D() | ||
25 | @@ -142,7 +137,6 @@ AF_PATH_INCLUDE(UMOUNT, umount, /bin/umo | ||
26 | AF_PATH_INCLUDE(E2FSCK, fsck.ext2 e2fsck, , $searchpath) | ||
27 | AF_PATH_INCLUDE(E3FSCK, fsck.ext3 e3fsck, , $searchpath) | ||
28 | AF_PATH_INCLUDE(E4FSCK, fsck.ext4 e4fsck, , $searchpath) | ||
29 | -AF_PATH_INCLUDE(MODPROBE, modprobe, , $searchpath) | ||
30 | |||
31 | AF_CHECK_PROG(LEX, flex lex, , $searchpath) | ||
32 | AF_CHECK_PROG(YACC, bison, , $searchpath) | ||
33 | diff -urpN a/daemon/module.c b/daemon/module.c | ||
34 | --- a/daemon/module.c 2013-01-15 11:30:49.000000000 +0800 | ||
35 | +++ b/daemon/module.c 2013-01-15 11:32:00.000000000 +0800 | ||
36 | @@ -18,6 +18,8 @@ | ||
37 | #include <stdlib.h> | ||
38 | #include "automount.h" | ||
39 | |||
40 | +#if 0 | ||
41 | +/* see comment in daemon/automount.c around load_autofs4_module() call */ | ||
42 | int load_autofs4_module(void) | ||
43 | { | ||
44 | FILE *fp; | ||
45 | @@ -52,6 +54,7 @@ int load_autofs4_module(void) | ||
46 | |||
47 | return 1; | ||
48 | } | ||
49 | +#endif | ||
50 | |||
51 | struct lookup_mod *open_lookup(const char *name, const char *err_prefix, | ||
52 | const char *mapfmt, int argc, const char *const *argv) | ||
53 | diff -urpN a/include/automount.h b/include/automount.h | ||
54 | --- a/include/automount.h 2013-01-15 11:31:10.000000000 +0800 | ||
55 | +++ b/include/automount.h 2013-01-15 11:32:06.000000000 +0800 | ||
56 | @@ -50,16 +50,11 @@ | ||
57 | #error Failed to locate umount(8)! | ||
58 | #endif | ||
59 | |||
60 | -#ifndef HAVE_MODPROBE | ||
61 | -#error Failed to locate modprobe(8)! | ||
62 | -#endif | ||
63 | - | ||
64 | -#ifndef HAVE_LINUX_PROCFS | ||
65 | -#error Failed to verify existence of procfs filesystem! | ||
66 | -#endif | ||
67 | - | ||
68 | +#if 0 | ||
69 | +/* see comment in daemon/automount.c around load_autofs4_module() call */ | ||
70 | #define FS_MODULE_NAME "autofs4" | ||
71 | int load_autofs4_module(void); | ||
72 | +#endif | ||
73 | |||
74 | /* The -s (sloppy) option to mount is good, if we have it... */ | ||
75 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-document-browse-option-in-man-page.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-document-browse-option-in-man-page.patch new file mode 100644 index 0000000000..4641342d24 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-document-browse-option-in-man-page.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | autofs-5.0.7 - document browse option in man page | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | The "browse" option has remained undocumented for a long time. | ||
6 | Finally add a section for it to auto.master(5) making special | ||
7 | note of the potential performance implications. | ||
8 | --- | ||
9 | CHANGELOG | 1 + | ||
10 | man/auto.master.5.in | 11 +++++++++++ | ||
11 | 2 files changed, 12 insertions(+) | ||
12 | |||
13 | diff --git a/CHANGELOG b/CHANGELOG | ||
14 | index ecdea0b..d8e4049 100644 | ||
15 | --- a/CHANGELOG | ||
16 | +++ b/CHANGELOG | ||
17 | @@ -36,6 +36,7 @@ | ||
18 | - fix requires in spec file. | ||
19 | - fix libtirpc build option to require libtirpc-devel if needed. | ||
20 | - fix systemd unidir in spec file. | ||
21 | +- document browse option in man page. | ||
22 | |||
23 | 25/07/2012 autofs-5.0.7 | ||
24 | ======================= | ||
25 | diff --git a/man/auto.master.5.in b/man/auto.master.5.in | ||
26 | index bbea43a..c552e56 100644 | ||
27 | --- a/man/auto.master.5.in | ||
28 | +++ b/man/auto.master.5.in | ||
29 | @@ -147,6 +147,17 @@ multiple file systems should be mounted (`multimounts'). If this option | ||
30 | is given, no file system is mounted at all if at least one file system | ||
31 | can't be mounted. | ||
32 | .TP | ||
33 | +.I "[no]browse" | ||
34 | +This is an autofs specific option that is a pseudo mount option and | ||
35 | +so is given without a leading dash. Use of the browse option pre-creates | ||
36 | +mount point directories for indirect mount maps so the map keys can be | ||
37 | +seen in a directory listing without being mounted. Use of this option | ||
38 | +can cause performance problem if the indirect map is large so it should | ||
39 | +be used with caution. The internal program default is to enable browse | ||
40 | +mode for indirect mounts but the default installed configuration overrides | ||
41 | +this by setting BROWSE_MODE to "no" because of the potential performance | ||
42 | +problem. | ||
43 | +.TP | ||
44 | .I "nobind" | ||
45 | This is an autofs specific option that is a pseudo mount option and | ||
46 | so is given without a leading dash. It may be used either in the master | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-fail-on-master-map-self-include.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-fail-on-master-map-self-include.patch new file mode 100644 index 0000000000..afb908b9e4 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-fail-on-master-map-self-include.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | autofs-5.0.7 - dont fail on master map self include | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | When reading the master map a self included file map should skip the source | ||
6 | and proceed to the next so, in this case, return an nss status that will | ||
7 | allow the map read to continue. In particular not NSS_STATUS_UNAVAIL which | ||
8 | causes the lookup to record a failure or NSS_STATUS_SUCCESS which indicates | ||
9 | a successful lookup and termintes the reading of sources. | ||
10 | --- | ||
11 | CHANGELOG | 1 + | ||
12 | modules/lookup_file.c | 7 ++++--- | ||
13 | 2 files changed, 5 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index 39388a5..97d6f48 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -28,6 +28,7 @@ | ||
20 | - make yellow pages support optional. | ||
21 | - modules/replicated.c: use sin6_addr.s6_addr32. | ||
22 | - workaround missing GNU versionsort extension. | ||
23 | +- dont fail on master map self include. | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/modules/lookup_file.c b/modules/lookup_file.c | ||
28 | index facb305..f37bed9 100644 | ||
29 | --- a/modules/lookup_file.c | ||
30 | +++ b/modules/lookup_file.c | ||
31 | @@ -397,8 +397,9 @@ int lookup_read_master(struct master *master, time_t age, void *context) | ||
32 | unsigned int path_len, ent_len; | ||
33 | int entry, cur_state; | ||
34 | |||
35 | + /* Don't return fail on self include, skip source */ | ||
36 | if (master->recurse) | ||
37 | - return NSS_STATUS_UNAVAIL; | ||
38 | + return NSS_STATUS_TRYAGAIN; | ||
39 | |||
40 | if (master->depth > MAX_INCLUDE_DEPTH) { | ||
41 | error(logopt, MODPREFIX | ||
42 | @@ -443,7 +444,7 @@ int lookup_read_master(struct master *master, time_t age, void *context) | ||
43 | |||
44 | inc = check_master_self_include(master, ctxt); | ||
45 | if (inc) | ||
46 | - master->recurse = 1;; | ||
47 | + master->recurse = 1; | ||
48 | master->depth++; | ||
49 | status = lookup_nss_read_master(master, age); | ||
50 | if (!status) { | ||
51 | @@ -645,7 +646,7 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context) | ||
52 | mc = source->mc; | ||
53 | |||
54 | if (source->recurse) | ||
55 | - return NSS_STATUS_UNAVAIL; | ||
56 | + return NSS_STATUS_TRYAGAIN; | ||
57 | |||
58 | if (source->depth > MAX_INCLUDE_DEPTH) { | ||
59 | error(ap->logopt, | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch new file mode 100644 index 0000000000..64446874cd --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | autofs-5.0.7 - don't schedule new alarms after readmap | ||
2 | |||
3 | From: Leonardo Chiquitto <leonardo.lists@gmail.com> | ||
4 | |||
5 | Currently, a new alarm is scheduled every time the daemon receives | ||
6 | a SIGHUP (map re-read) or SIGUSR1 (forced expiration). Besides that, | ||
7 | map re-reads started on demand when a map is found to be outdated | ||
8 | also generate a new alarm. | ||
9 | |||
10 | Once added, these alarms are never deleted and hence increase the | ||
11 | number of times the daemon wakes up to run the expiration procedure. | ||
12 | After a couple of months, in setups with many mount points, it's | ||
13 | normal to see automount waking up every second to handle the | ||
14 | expiration timer. | ||
15 | |||
16 | This patch removes the alarm scheduling from the readmap cleanup | ||
17 | routine and makes sure the alarm is re-added after the expiration | ||
18 | process only when it was not triggered by SIGUSR1. | ||
19 | |||
20 | I couldn't think of any use case to justify keeping these alarms: | ||
21 | it's critical to have the alarm ticking every timeout/4 seconds, | ||
22 | but more than one periodic alarm running doesn't seem to make | ||
23 | sense. | ||
24 | --- | ||
25 | |||
26 | CHANGELOG | 1 + | ||
27 | daemon/state.c | 6 +----- | ||
28 | 2 files changed, 2 insertions(+), 5 deletions(-) | ||
29 | |||
30 | |||
31 | diff --git a/CHANGELOG b/CHANGELOG | ||
32 | index c9be73e..4cf5621 100644 | ||
33 | --- a/CHANGELOG | ||
34 | +++ b/CHANGELOG | ||
35 | @@ -22,6 +22,7 @@ | ||
36 | - fix init script status return. | ||
37 | - fix use get_proximity() without libtirpc. | ||
38 | - don't use dirent d_type to filter out files in scandir() | ||
39 | +- don't schedule new alarms after readmap. | ||
40 | |||
41 | 25/07/2012 autofs-5.0.7 | ||
42 | ======================= | ||
43 | diff --git a/daemon/state.c b/daemon/state.c | ||
44 | index b451c56..6e23022 100644 | ||
45 | --- a/daemon/state.c | ||
46 | +++ b/daemon/state.c | ||
47 | @@ -144,7 +144,7 @@ void expire_cleanup(void *arg) | ||
48 | ap->submount = 2; | ||
49 | } | ||
50 | |||
51 | - if (!ap->submount) | ||
52 | + if (ap->state == ST_EXPIRE && !ap->submount) | ||
53 | alarm_add(ap, ap->exp_runfreq); | ||
54 | |||
55 | /* FALLTHROUGH */ | ||
56 | @@ -330,13 +330,9 @@ static void do_readmap_cleanup(void *arg) | ||
57 | ap = ra->ap; | ||
58 | |||
59 | st_mutex_lock(); | ||
60 | - | ||
61 | ap->readmap_thread = 0; | ||
62 | st_set_done(ap); | ||
63 | - if (!ap->submount) | ||
64 | - alarm_add(ap, ap->exp_runfreq); | ||
65 | st_ready(ap); | ||
66 | - | ||
67 | st_mutex_unlock(); | ||
68 | |||
69 | free(ra); | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch new file mode 100644 index 0000000000..9c9d99b953 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | autofs-5.0.7 - don't use dirent d_type to filter out files in scandir() | ||
2 | |||
3 | From: Leonardo Chiquitto <leonardo.lists@gmail.com> | ||
4 | |||
5 | The "d_type" field of a dirent structure is not filled in by all | ||
6 | file systems (XFS being one example), so we can't rely on it to | ||
7 | check file types. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 + | ||
11 | modules/lookup_dir.c | 4 ---- | ||
12 | 2 files changed, 1 insertions(+), 4 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index 460bd27..c9be73e 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -21,6 +21,7 @@ | ||
20 | - fix submount offset delete. | ||
21 | - fix init script status return. | ||
22 | - fix use get_proximity() without libtirpc. | ||
23 | +- don't use dirent d_type to filter out files in scandir() | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/modules/lookup_dir.c b/modules/lookup_dir.c | ||
28 | index 658cc29..33901c0 100644 | ||
29 | --- a/modules/lookup_dir.c | ||
30 | +++ b/modules/lookup_dir.c | ||
31 | @@ -103,10 +103,6 @@ static int acceptable_dirent_p(const struct dirent *e) | ||
32 | { | ||
33 | size_t namesz; | ||
34 | |||
35 | - | ||
36 | - if (!(e->d_type == DT_REG || e->d_type == DT_LNK)) | ||
37 | - return 0; | ||
38 | - | ||
39 | namesz = strlen(e->d_name); | ||
40 | if (!namesz) | ||
41 | return 0; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch new file mode 100644 index 0000000000..9973b47faf --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | autofs-5.0.7 - dont wait forever to restart | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | When restarting autofs the daemon must be stopped before it is started | ||
6 | again if it is to function properly. At the moment the init script waits | ||
7 | forever which is not ok if the daemon won't exit for some reason. | ||
8 | |||
9 | So, if the daemon is still running after the stop, run stop() again, wait | ||
10 | a bit longer and if it still hasn't stopped kill it with a SIGKILL to clear | ||
11 | the way for the startup. | ||
12 | --- | ||
13 | |||
14 | CHANGELOG | 1 + | ||
15 | redhat/autofs.init.in | 13 ++++++++++--- | ||
16 | 2 files changed, 11 insertions(+), 3 deletions(-) | ||
17 | |||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index 6051723..93b9c26 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -5,6 +5,7 @@ | ||
24 | - fix ipv6 proximity calculation. | ||
25 | - fix parse buffer initialization. | ||
26 | - fix typo in automount(8). | ||
27 | +- dont wait forever to restart. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in | ||
32 | index ec6d5d6..cd5cb34 100644 | ||
33 | --- a/redhat/autofs.init.in | ||
34 | +++ b/redhat/autofs.init.in | ||
35 | @@ -129,9 +129,16 @@ function restart() { | ||
36 | status autofs > /dev/null 2>&1 | ||
37 | if [ $? -eq 0 ]; then | ||
38 | stop | ||
39 | - while [ -n "`pidof $prog`" ] ; do | ||
40 | - sleep 5 | ||
41 | - done | ||
42 | + if [ -n "`pidof $prog`" ]; then | ||
43 | + # If we failed to stop, try at least one more time | ||
44 | + # after waiting a little while | ||
45 | + sleep 20 | ||
46 | + stop | ||
47 | + auto_pid=`pidof $prog` | ||
48 | + if [ -n "$auto_pid" ]; then | ||
49 | + kill -9 $auto_pid | ||
50 | + fi | ||
51 | + fi | ||
52 | fi | ||
53 | start | ||
54 | } | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-automounter-support-on-parisc.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-automounter-support-on-parisc.patch new file mode 100644 index 0000000000..e00fdc1901 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-automounter-support-on-parisc.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | autofs-5.0.7 - fix automounter support on parisc | ||
2 | |||
3 | From: Helge Deller <deller@gmx.de> | ||
4 | |||
5 | This patch fixes automounter support on the parisc architecture with | ||
6 | 64-bit kernel and 32-bit userspace. | ||
7 | |||
8 | Signed-off-by: Helge Deller <deller@gmx.de> | ||
9 | --- | ||
10 | daemon/automount.c | 1 + | ||
11 | 1 file changed, 1 insertion(+) | ||
12 | |||
13 | diff --git a/daemon/automount.c b/daemon/automount.c | ||
14 | index 4a3eb3d..4c651cf 100644 | ||
15 | --- a/daemon/automount.c | ||
16 | +++ b/daemon/automount.c | ||
17 | @@ -610,6 +610,7 @@ static size_t get_kpkt_len(void) | ||
18 | if (strcmp(un.machine, "alpha") == 0 || | ||
19 | strcmp(un.machine, "ia64") == 0 || | ||
20 | strcmp(un.machine, "x86_64") == 0 || | ||
21 | + strcmp(un.machine, "parisc64") == 0 || | ||
22 | strcmp(un.machine, "ppc64") == 0) | ||
23 | pkt_len += 4; | ||
24 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch new file mode 100644 index 0000000000..8ce6c0f9e3 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch | |||
@@ -0,0 +1,179 @@ | |||
1 | autofs-5.0.7 - fix file descriptor leak when reloading the daemon | ||
2 | |||
3 | From: Leonardo Chiquitto <leonardo.lists@gmail.com> | ||
4 | |||
5 | A customer reported that AutoFS may leak file descriptors when some | ||
6 | maps are modified and the daemon reloaded. I'm able to reproduce the | ||
7 | problem on 5.0.7 by following these steps: | ||
8 | |||
9 | 1. Configure a simple direct mount: | ||
10 | |||
11 | # cat /etc/auto.master | ||
12 | /- /etc/auto.direct | ||
13 | |||
14 | # cat /etc/auto.direct | ||
15 | /nfs server:/nfs | ||
16 | |||
17 | 2. Start the automounter and do NOT trigger the mount | ||
18 | |||
19 | 3. Replace /etc/auto.direct with: | ||
20 | |||
21 | # cat /etc/auto.direct | ||
22 | /nfs/1 server:/nfs | ||
23 | /nfs/2 server:/nfs | ||
24 | |||
25 | 4. Reload: | ||
26 | |||
27 | # kill -HUP $(pidof automount) | ||
28 | |||
29 | >From now on, every reload will leak a file descriptor: | ||
30 | |||
31 | # ls -la /proc/$(pidof automount)/fd | grep /nfs | ||
32 | lr-x------ 1 root root 64 Aug 14 22:08 11 -> /nfs | ||
33 | lr-x------ 1 root root 64 Aug 14 22:08 12 -> /nfs | ||
34 | lr-x------ 1 root root 64 Aug 14 22:08 13 -> /nfs | ||
35 | lr-x------ 1 root root 64 Aug 14 22:08 14 -> /nfs | ||
36 | lr-x------ 1 root root 64 Aug 14 22:08 5 -> /nfs | ||
37 | |||
38 | I've investigated the problem and discovered that the leak happens in | ||
39 | do_umount_autofs_direct(): | ||
40 | |||
41 | - edit imk | ||
42 | The same leak is present in umount_autofs_offset() also. | ||
43 | Updated patch to cover that too. | ||
44 | - end edit | ||
45 | |||
46 | int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list | ||
47 | *mnts, struct mapent *me) | ||
48 | { | ||
49 | (...) | ||
50 | if (me->ioctlfd != -1) { | ||
51 | if (tree_is_mounted(mnts, me->key, MNTS_REAL)) { | ||
52 | error(ap->logopt, | ||
53 | "attempt to umount busy direct mount %s", | ||
54 | me->key); | ||
55 | return 1; | ||
56 | } | ||
57 | ioctlfd = me->ioctlfd; | ||
58 | } else // ioctlfd == -1 | ||
59 | ops->open(ap->logopt, &ioctlfd, me->dev, me->key); <= we open it here | ||
60 | |||
61 | if (ioctlfd >= 0) { | ||
62 | unsigned int status = 1; | ||
63 | |||
64 | rv = ops->askumount(ap->logopt, ioctlfd, &status); | ||
65 | /// at this point, rv == 0 and status == 0 | ||
66 | if (rv) { | ||
67 | char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
68 | error(ap->logopt, "ioctl failed: %s", estr); | ||
69 | return 1; | ||
70 | } else if (!status) { | ||
71 | /// at this point, ap->state == ST_READMAP | ||
72 | if (ap->state != ST_SHUTDOWN_FORCE) { | ||
73 | error(ap->logopt, | ||
74 | "ask umount returned busy for %s", | ||
75 | me->key); | ||
76 | return 1; <= we return here, without closing the fd | ||
77 | } else { | ||
78 | me->ioctlfd = -1; | ||
79 | ops->catatonic(ap->logopt, ioctlfd); | ||
80 | ops->close(ap->logopt, ioctlfd); | ||
81 | goto force_umount; | ||
82 | } | ||
83 | (...) | ||
84 | --- | ||
85 | CHANGELOG | 1 + | ||
86 | daemon/direct.c | 19 ++++++++++++++++--- | ||
87 | 2 files changed, 17 insertions(+), 3 deletions(-) | ||
88 | |||
89 | diff --git a/CHANGELOG b/CHANGELOG | ||
90 | index 46ef335..a7ed212 100644 | ||
91 | --- a/CHANGELOG | ||
92 | +++ b/CHANGELOG | ||
93 | @@ -30,6 +30,7 @@ | ||
94 | - workaround missing GNU versionsort extension. | ||
95 | - dont fail on master map self include. | ||
96 | - fix wildcard multi map regression. | ||
97 | +- fix file descriptor leak when reloading the daemon. | ||
98 | |||
99 | 25/07/2012 autofs-5.0.7 | ||
100 | ======================= | ||
101 | diff --git a/daemon/direct.c b/daemon/direct.c | ||
102 | index 3e09c5d..228a666 100644 | ||
103 | --- a/daemon/direct.c | ||
104 | +++ b/daemon/direct.c | ||
105 | @@ -86,7 +86,8 @@ int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, stru | ||
106 | { | ||
107 | struct ioctl_ops *ops = get_ioctl_ops(); | ||
108 | char buf[MAX_ERR_BUF]; | ||
109 | - int ioctlfd, rv, left, retries; | ||
110 | + int ioctlfd = -1, rv, left, retries; | ||
111 | + int opened = 0; | ||
112 | |||
113 | left = umount_multi(ap, me->key, 0); | ||
114 | if (left) { | ||
115 | @@ -103,8 +104,10 @@ int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, stru | ||
116 | return 1; | ||
117 | } | ||
118 | ioctlfd = me->ioctlfd; | ||
119 | - } else | ||
120 | + } else { | ||
121 | ops->open(ap->logopt, &ioctlfd, me->dev, me->key); | ||
122 | + opened = 1; | ||
123 | + } | ||
124 | |||
125 | if (ioctlfd >= 0) { | ||
126 | unsigned int status = 1; | ||
127 | @@ -113,12 +116,16 @@ int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, stru | ||
128 | if (rv) { | ||
129 | char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
130 | error(ap->logopt, "ioctl failed: %s", estr); | ||
131 | + if (opened && ioctlfd != -1) | ||
132 | + ops->close(ap->logopt, ioctlfd); | ||
133 | return 1; | ||
134 | } else if (!status) { | ||
135 | if (ap->state != ST_SHUTDOWN_FORCE) { | ||
136 | error(ap->logopt, | ||
137 | "ask umount returned busy for %s", | ||
138 | me->key); | ||
139 | + if (opened && ioctlfd != -1) | ||
140 | + ops->close(ap->logopt, ioctlfd); | ||
141 | return 1; | ||
142 | } else { | ||
143 | me->ioctlfd = -1; | ||
144 | @@ -536,7 +543,8 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) | ||
145 | { | ||
146 | struct ioctl_ops *ops = get_ioctl_ops(); | ||
147 | char buf[MAX_ERR_BUF]; | ||
148 | - int ioctlfd, rv = 1, retries; | ||
149 | + int ioctlfd = -1, rv = 1, retries; | ||
150 | + int opened = 0; | ||
151 | |||
152 | if (me->ioctlfd != -1) { | ||
153 | if (is_mounted(_PATH_MOUNTED, me->key, MNTS_REAL)) { | ||
154 | @@ -554,6 +562,7 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) | ||
155 | return 0; | ||
156 | } | ||
157 | ops->open(ap->logopt, &ioctlfd, me->dev, me->key); | ||
158 | + opened = 1; | ||
159 | } | ||
160 | |||
161 | if (ioctlfd >= 0) { | ||
162 | @@ -563,6 +572,8 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) | ||
163 | if (rv) { | ||
164 | char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
165 | logerr("ioctl failed: %s", estr); | ||
166 | + if (opened && ioctlfd != -1) | ||
167 | + ops->close(ap->logopt, ioctlfd); | ||
168 | return 1; | ||
169 | } else if (!status) { | ||
170 | if (ap->state != ST_SHUTDOWN_FORCE) { | ||
171 | @@ -570,6 +581,8 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) | ||
172 | error(ap->logopt, | ||
173 | "ask umount returned busy for %s", | ||
174 | me->key); | ||
175 | + if (opened && ioctlfd != -1) | ||
176 | + ops->close(ap->logopt, ioctlfd); | ||
177 | return 1; | ||
178 | } else { | ||
179 | me->ioctlfd = -1; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-init-script-status-return.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-init-script-status-return.patch new file mode 100644 index 0000000000..a08d62fc3e --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-init-script-status-return.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | autofs-5.0.7 - fix init script status return | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | The patch that added the piddir to configure to fix incorrect init | ||
6 | script status() function returns failed to actually return the value | ||
7 | to the user. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 + | ||
11 | redhat/autofs.init.in | 2 +- | ||
12 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index 76c1f73..5bcb1af 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -19,6 +19,7 @@ | ||
20 | - Allow nsswitch.conf to not contain "automount:" lines. | ||
21 | - fix nobind man page description. | ||
22 | - fix submount offset delete. | ||
23 | +- fix init script status return. | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in | ||
28 | index fe18b3e..9d008ff 100644 | ||
29 | --- a/redhat/autofs.init.in | ||
30 | +++ b/redhat/autofs.init.in | ||
31 | @@ -172,7 +172,7 @@ RETVAL=0 | ||
32 | case "$1" in | ||
33 | status) | ||
34 | status -p @@autofspiddir@@/autofs.pid -l autofs $prog | ||
35 | - exit 0; | ||
36 | + exit $?; | ||
37 | ;; | ||
38 | usage) | ||
39 | usage_message | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-ipv6-proximity-calculation.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-ipv6-proximity-calculation.patch new file mode 100644 index 0000000000..b341ecdd50 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-ipv6-proximity-calculation.patch | |||
@@ -0,0 +1,297 @@ | |||
1 | autofs-5.0.7 - fix ipv6 proximity calculation | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | The socket based ioctl used to get interface information only | ||
6 | return IPv4 information. Change get_proximity() function to use | ||
7 | getifaddrs(3) instead. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 | ||
11 | modules/replicated.c | 149 ++++++++++++++------------------------------------ | ||
12 | 2 files changed, 42 insertions(+), 108 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index dc38580..34c70fa 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -2,6 +2,7 @@ | ||
20 | ======================= | ||
21 | - fix nobind sun escaped map entries. | ||
22 | - fix use cache entry after free in lookup_prune_one_cache(). | ||
23 | +- fix ipv6 proximity calculation. | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/modules/replicated.c b/modules/replicated.c | ||
28 | index 78046c6..bd6003b 100644 | ||
29 | --- a/modules/replicated.c | ||
30 | +++ b/modules/replicated.c | ||
31 | @@ -52,6 +52,7 @@ | ||
32 | #include <net/if.h> | ||
33 | #include <netinet/in.h> | ||
34 | #include <netdb.h> | ||
35 | +#include <ifaddrs.h> | ||
36 | |||
37 | #include "rpc_subs.h" | ||
38 | #include "replicated.h" | ||
39 | @@ -110,58 +111,18 @@ void seed_random(void) | ||
40 | return; | ||
41 | } | ||
42 | |||
43 | -static int alloc_ifreq(struct ifconf *ifc, int sock) | ||
44 | -{ | ||
45 | - int ret, lastlen = ifc_last_len, len = ifc_buf_len; | ||
46 | - char err_buf[MAX_ERR_BUF], *buf; | ||
47 | - | ||
48 | - while (1) { | ||
49 | - buf = malloc(len); | ||
50 | - if (!buf) { | ||
51 | - char *estr = strerror_r(errno, err_buf, MAX_ERR_BUF); | ||
52 | - logerr("malloc: %s", estr); | ||
53 | - return 0; | ||
54 | - } | ||
55 | - | ||
56 | - ifc->ifc_len = len; | ||
57 | - ifc->ifc_req = (struct ifreq *) buf; | ||
58 | - | ||
59 | - ret = ioctl(sock, SIOCGIFCONF, ifc); | ||
60 | - if (ret == -1) { | ||
61 | - char *estr = strerror_r(errno, err_buf, MAX_ERR_BUF); | ||
62 | - logerr("ioctl: %s", estr); | ||
63 | - free(buf); | ||
64 | - return 0; | ||
65 | - } | ||
66 | - | ||
67 | - if (ifc->ifc_len <= lastlen) | ||
68 | - break; | ||
69 | - | ||
70 | - lastlen = ifc->ifc_len; | ||
71 | - len += MAX_IFC_BUF; | ||
72 | - free(buf); | ||
73 | - } | ||
74 | - | ||
75 | - if (lastlen != ifc_last_len) { | ||
76 | - ifc_last_len = lastlen; | ||
77 | - ifc_buf_len = len; | ||
78 | - } | ||
79 | - | ||
80 | - return 1; | ||
81 | -} | ||
82 | - | ||
83 | static unsigned int get_proximity(struct sockaddr *host_addr) | ||
84 | { | ||
85 | + struct ifaddrs *ifa = NULL; | ||
86 | + struct ifaddrs *this; | ||
87 | struct sockaddr_in *addr, *msk_addr, *if_addr; | ||
88 | struct sockaddr_in6 *addr6, *msk6_addr, *if6_addr; | ||
89 | struct in_addr *hst_addr; | ||
90 | struct in6_addr *hst6_addr; | ||
91 | int addr_len; | ||
92 | - char buf[MAX_ERR_BUF], *ptr; | ||
93 | - struct ifconf ifc; | ||
94 | - struct ifreq *ifr, nmptr; | ||
95 | - int sock, ret, i; | ||
96 | + char buf[MAX_ERR_BUF]; | ||
97 | uint32_t mask, ha, ia, *mask6, *ha6, *ia6; | ||
98 | + int ret; | ||
99 | |||
100 | addr = NULL; | ||
101 | addr6 = NULL; | ||
102 | @@ -170,13 +131,14 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
103 | mask6 = NULL; | ||
104 | ha6 = NULL; | ||
105 | ia6 = NULL; | ||
106 | + ha = 0; | ||
107 | |||
108 | switch (host_addr->sa_family) { | ||
109 | case AF_INET: | ||
110 | addr = (struct sockaddr_in *) host_addr; | ||
111 | hst_addr = (struct in_addr *) &addr->sin_addr; | ||
112 | ha = ntohl((uint32_t) hst_addr->s_addr); | ||
113 | - addr_len = sizeof(hst_addr); | ||
114 | + addr_len = sizeof(*hst_addr); | ||
115 | break; | ||
116 | |||
117 | case AF_INET6: | ||
118 | @@ -186,7 +148,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
119 | addr6 = (struct sockaddr_in6 *) host_addr; | ||
120 | hst6_addr = (struct in6_addr *) &addr6->sin6_addr; | ||
121 | ha6 = &hst6_addr->s6_addr32[0]; | ||
122 | - addr_len = sizeof(hst6_addr); | ||
123 | + addr_len = sizeof(*hst6_addr); | ||
124 | break; | ||
125 | #endif | ||
126 | |||
127 | @@ -194,36 +156,29 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
128 | return PROXIMITY_ERROR; | ||
129 | } | ||
130 | |||
131 | - sock = open_sock(AF_INET, SOCK_DGRAM, 0); | ||
132 | - if (sock < 0) { | ||
133 | + ret = getifaddrs(&ifa); | ||
134 | + if (ret) { | ||
135 | char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
136 | - logerr("socket creation failed: %s", estr); | ||
137 | + logerr("getifaddrs: %s", estr); | ||
138 | return PROXIMITY_ERROR; | ||
139 | } | ||
140 | |||
141 | - if (!alloc_ifreq(&ifc, sock)) { | ||
142 | - close(sock); | ||
143 | - return PROXIMITY_ERROR; | ||
144 | - } | ||
145 | - | ||
146 | - /* For each interface */ | ||
147 | - | ||
148 | - /* Is the address a local interface */ | ||
149 | - i = 0; | ||
150 | - ptr = (char *) &ifc.ifc_buf[0]; | ||
151 | - | ||
152 | - while (ptr < (char *) ifc.ifc_req + ifc.ifc_len) { | ||
153 | - ifr = (struct ifreq *) ptr; | ||
154 | + this = ifa; | ||
155 | + while (this) { | ||
156 | + if (this->ifa_flags & IFF_POINTOPOINT || | ||
157 | + this->ifa_addr->sa_data == NULL) { | ||
158 | + this = this->ifa_next; | ||
159 | + continue; | ||
160 | + } | ||
161 | |||
162 | - switch (ifr->ifr_addr.sa_family) { | ||
163 | + switch (this->ifa_addr->sa_family) { | ||
164 | case AF_INET: | ||
165 | if (host_addr->sa_family == AF_INET6) | ||
166 | break; | ||
167 | - if_addr = (struct sockaddr_in *) &ifr->ifr_addr; | ||
168 | + if_addr = (struct sockaddr_in *) this->ifa_addr; | ||
169 | ret = memcmp(&if_addr->sin_addr, hst_addr, addr_len); | ||
170 | if (!ret) { | ||
171 | - close(sock); | ||
172 | - free(ifc.ifc_req); | ||
173 | + freeifaddrs(ifa); | ||
174 | return PROXIMITY_LOCAL; | ||
175 | } | ||
176 | break; | ||
177 | @@ -234,55 +189,41 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
178 | #else | ||
179 | if (host_addr->sa_family == AF_INET) | ||
180 | break; | ||
181 | - | ||
182 | - if6_addr = (struct sockaddr_in6 *) &ifr->ifr_addr; | ||
183 | + if6_addr = (struct sockaddr_in6 *) this->ifa_addr; | ||
184 | ret = memcmp(&if6_addr->sin6_addr, hst6_addr, addr_len); | ||
185 | if (!ret) { | ||
186 | - close(sock); | ||
187 | - free(ifc.ifc_req); | ||
188 | + freeifaddrs(ifa); | ||
189 | return PROXIMITY_LOCAL; | ||
190 | } | ||
191 | #endif | ||
192 | - | ||
193 | default: | ||
194 | break; | ||
195 | } | ||
196 | - | ||
197 | - i++; | ||
198 | - ptr = (char *) &ifc.ifc_req[i]; | ||
199 | + this = this->ifa_next; | ||
200 | } | ||
201 | |||
202 | - i = 0; | ||
203 | - ptr = (char *) &ifc.ifc_buf[0]; | ||
204 | - | ||
205 | - while (ptr < (char *) ifc.ifc_req + ifc.ifc_len) { | ||
206 | - ifr = (struct ifreq *) ptr; | ||
207 | - | ||
208 | - nmptr = *ifr; | ||
209 | - ret = ioctl(sock, SIOCGIFNETMASK, &nmptr); | ||
210 | - if (ret == -1) { | ||
211 | - char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
212 | - logerr("ioctl: %s", estr); | ||
213 | - close(sock); | ||
214 | - free(ifc.ifc_req); | ||
215 | - return PROXIMITY_ERROR; | ||
216 | + this = ifa; | ||
217 | + while (this) { | ||
218 | + if (this->ifa_flags & IFF_POINTOPOINT || | ||
219 | + this->ifa_addr->sa_data == NULL) { | ||
220 | + this = this->ifa_next; | ||
221 | + continue; | ||
222 | } | ||
223 | |||
224 | - switch (ifr->ifr_addr.sa_family) { | ||
225 | + switch (this->ifa_addr->sa_family) { | ||
226 | case AF_INET: | ||
227 | if (host_addr->sa_family == AF_INET6) | ||
228 | break; | ||
229 | - if_addr = (struct sockaddr_in *) &ifr->ifr_addr; | ||
230 | + if_addr = (struct sockaddr_in *) this->ifa_addr; | ||
231 | ia = ntohl((uint32_t) if_addr->sin_addr.s_addr); | ||
232 | |||
233 | - /* Is the address within a localiy attached subnet */ | ||
234 | + /* Is the address within a localy attached subnet */ | ||
235 | |||
236 | - msk_addr = (struct sockaddr_in *) &nmptr.ifr_netmask; | ||
237 | + msk_addr = (struct sockaddr_in *) this->ifa_netmask; | ||
238 | mask = ntohl((uint32_t) msk_addr->sin_addr.s_addr); | ||
239 | |||
240 | if ((ia & mask) == (ha & mask)) { | ||
241 | - close(sock); | ||
242 | - free(ifc.ifc_req); | ||
243 | + freeifaddrs(ifa); | ||
244 | return PROXIMITY_SUBNET; | ||
245 | } | ||
246 | |||
247 | @@ -304,8 +245,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
248 | break; | ||
249 | |||
250 | if ((ia & mask) == (ha & mask)) { | ||
251 | - close(sock); | ||
252 | - free(ifc.ifc_req); | ||
253 | + freeifaddrs(ifa); | ||
254 | return PROXIMITY_NET; | ||
255 | } | ||
256 | break; | ||
257 | @@ -316,35 +256,28 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
258 | #else | ||
259 | if (host_addr->sa_family == AF_INET) | ||
260 | break; | ||
261 | - | ||
262 | - if6_addr = (struct sockaddr_in6 *) &ifr->ifr_addr; | ||
263 | + if6_addr = (struct sockaddr_in6 *) this->ifa_addr; | ||
264 | ia6 = &if6_addr->sin6_addr.s6_addr32[0]; | ||
265 | |||
266 | /* Is the address within the network of the interface */ | ||
267 | |||
268 | - msk6_addr = (struct sockaddr_in6 *) &nmptr.ifr_netmask; | ||
269 | + msk6_addr = (struct sockaddr_in6 *) this->ifa_netmask; | ||
270 | mask6 = &msk6_addr->sin6_addr.s6_addr32[0]; | ||
271 | |||
272 | if (ipv6_mask_cmp(ha6, ia6, mask6)) { | ||
273 | - close(sock); | ||
274 | - free(ifc.ifc_req); | ||
275 | + freeifaddrs(ifa); | ||
276 | return PROXIMITY_SUBNET; | ||
277 | } | ||
278 | |||
279 | /* How do we define "local network" in ipv6? */ | ||
280 | #endif | ||
281 | - break; | ||
282 | - | ||
283 | default: | ||
284 | break; | ||
285 | } | ||
286 | - | ||
287 | - i++; | ||
288 | - ptr = (char *) &ifc.ifc_req[i]; | ||
289 | + this = this->ifa_next; | ||
290 | } | ||
291 | |||
292 | - close(sock); | ||
293 | - free(ifc.ifc_req); | ||
294 | + freeifaddrs(ifa); | ||
295 | |||
296 | return PROXIMITY_OTHER; | ||
297 | } | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-lib-deps.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-lib-deps.patch new file mode 100644 index 0000000000..09fea495df --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-lib-deps.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 54a9bd28a307dd74df044d779ca85adcf36aa202 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe.macdonald@windriver.com> | ||
3 | Date: Tue, 18 Jun 2013 10:05:21 -0400 | ||
4 | Subject: [PATCH] Fix the dependency issue | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | autofs's lib sources have a dependency on a number of files that are | ||
9 | generated by rpcgen during buildtime | ||
10 | |||
11 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
12 | Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com> | ||
13 | --- | ||
14 | lib/Makefile | 1 + | ||
15 | 1 file changed, 1 insertion(+) | ||
16 | |||
17 | diff --git a/lib/Makefile b/lib/Makefile | ||
18 | index 5418009..bff4e1d 100644 | ||
19 | --- a/lib/Makefile | ||
20 | +++ b/lib/Makefile | ||
21 | @@ -75,3 +75,4 @@ install: all | ||
22 | clean: | ||
23 | rm -f $(LIB) $(RPCS) $(OBJS) $(YACCSRC) *.output *~ | ||
24 | |||
25 | +$(OBJS): $(RPCS) | ||
26 | -- | ||
27 | 1.7.10.4 | ||
28 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-libtirpc-build-option.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-libtirpc-build-option.patch new file mode 100644 index 0000000000..8ad2afacff --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-libtirpc-build-option.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | autofs-5.0.7 - fix libtirpc build option | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | |||
6 | --- | ||
7 | CHANGELOG | 1 + | ||
8 | autofs.spec | 17 ++++++++++++++++- | ||
9 | 2 files changed, 17 insertions(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/CHANGELOG b/CHANGELOG | ||
12 | index e848bcd..b6b2679 100644 | ||
13 | --- a/CHANGELOG | ||
14 | +++ b/CHANGELOG | ||
15 | @@ -34,6 +34,7 @@ | ||
16 | - depricate nosymlink pseudo option. | ||
17 | - add symlink pseudo option. | ||
18 | - fix requires in spec file. | ||
19 | +- fix libtirpc build option to require libtirpc-devel if needed. | ||
20 | |||
21 | 25/07/2012 autofs-5.0.7 | ||
22 | ======================= | ||
23 | diff --git a/autofs.spec b/autofs.spec | ||
24 | index 703f7a9..f77acc1 100644 | ||
25 | --- a/autofs.spec | ||
26 | +++ b/autofs.spec | ||
27 | @@ -12,6 +12,10 @@ | ||
28 | # disable them. | ||
29 | %define with_systemd %{?_without_systemd: 0} %{?!_without_systemd: 1} | ||
30 | |||
31 | +# Use --without libtirpc in your rpmbuild command or force values to 0 to | ||
32 | +# disable them. | ||
33 | +%define with_libtirpc %{?_without_libtirpc: 0} %{?!_without_libtirpc: 1} | ||
34 | + | ||
35 | Summary: A tool from automatically mounting and umounting filesystems. | ||
36 | Name: autofs | ||
37 | %define version 5.0.7 | ||
38 | @@ -25,6 +29,9 @@ Buildroot: %{_tmppath}/%{name}-tmp | ||
39 | %if %{with_systemd} | ||
40 | BuildRequires: systemd-units | ||
41 | %endif | ||
42 | +%if %{with_libtirpc} | ||
43 | +BuildRequires: libtirpc-devel | ||
44 | +%endif | ||
45 | BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, cyrus-sasl-devel | ||
46 | Requires: chkconfig | ||
47 | Requires: /bin/bash mktemp sed textutils sh-utils grep /bin/ps | ||
48 | @@ -72,9 +79,17 @@ echo %{version}-%{release} > .version | ||
49 | %define _unitdir %{?_unitdir:/lib/systemd/system} | ||
50 | %define systemd_configure_arg --with-systemd | ||
51 | %endif | ||
52 | +%if %{with_libtirpc} | ||
53 | + %define libtirpc_configure_arg --with-libtirpc | ||
54 | +%endif | ||
55 | |||
56 | %build | ||
57 | -CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc %{?systemd_configure_arg:} | ||
58 | +CFLAGS="$RPM_OPT_FLAGS -Wall" \ | ||
59 | +./configure --libdir=%{_libdir} \ | ||
60 | + --disable-mount-locking \ | ||
61 | + --enable-ignore-busy \ | ||
62 | + %{?systemd_configure_arg:} \ | ||
63 | + %{?libtirpc_configure_arg:} | ||
64 | CFLAGS="$RPM_OPT_FLAGS -Wall" make initdir=/etc/rc.d/init.d DONTSTRIP=1 | ||
65 | |||
66 | %install | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch new file mode 100644 index 0000000000..126d9a25b0 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | autofs-5.0.7 - fix map entry duplicate offset detection | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Recent changes broke the detection of duplicate offsets in map entries. | ||
6 | --- | ||
7 | |||
8 | CHANGELOG | 1 + | ||
9 | lib/cache.c | 2 +- | ||
10 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/CHANGELOG b/CHANGELOG | ||
14 | index 8f6bb3a..bd0dd82 100644 | ||
15 | --- a/CHANGELOG | ||
16 | +++ b/CHANGELOG | ||
17 | @@ -15,6 +15,7 @@ | ||
18 | - fix recursive mount deadlock. | ||
19 | - increase file map read buffer size. | ||
20 | - handle new location of systemd. | ||
21 | +- fix map entry duplicate offset detection. | ||
22 | |||
23 | 25/07/2012 autofs-5.0.7 | ||
24 | ======================= | ||
25 | diff --git a/lib/cache.c b/lib/cache.c | ||
26 | index 9179ad5..1e05a99 100644 | ||
27 | --- a/lib/cache.c | ||
28 | +++ b/lib/cache.c | ||
29 | @@ -659,7 +659,7 @@ int cache_update_offset(struct mapent_cache *mc, const char *mkey, const char *k | ||
30 | |||
31 | me = cache_lookup_distinct(mc, key); | ||
32 | if (me && me->age == age) { | ||
33 | - if (me->multi != owner) | ||
34 | + if (me->multi == owner) | ||
35 | return CHE_DUPLICATE; | ||
36 | } | ||
37 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-man-page-description.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-man-page-description.patch new file mode 100644 index 0000000000..41328a0e49 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-man-page-description.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | autofs-5.0.7 - fix nobind man page description | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Update auto.master(5) to better describe the behavior of the "nobind" | ||
6 | option when used with direct mounts maps. | ||
7 | --- | ||
8 | |||
9 | CHANGELOG | 1 + | ||
10 | man/auto.master.5.in | 10 +++++++--- | ||
11 | 2 files changed, 8 insertions(+), 3 deletions(-) | ||
12 | |||
13 | |||
14 | diff --git a/CHANGELOG b/CHANGELOG | ||
15 | index 16ac2a0..7eb7235 100644 | ||
16 | --- a/CHANGELOG | ||
17 | +++ b/CHANGELOG | ||
18 | @@ -17,6 +17,7 @@ | ||
19 | - handle new location of systemd. | ||
20 | - fix map entry duplicate offset detection. | ||
21 | - Allow nsswitch.conf to not contain "automount:" lines. | ||
22 | +- fix nobind man page description. | ||
23 | |||
24 | 25/07/2012 autofs-5.0.7 | ||
25 | ======================= | ||
26 | diff --git a/man/auto.master.5.in b/man/auto.master.5.in | ||
27 | index 21d7544..8007542 100644 | ||
28 | --- a/man/auto.master.5.in | ||
29 | +++ b/man/auto.master.5.in | ||
30 | @@ -151,9 +151,13 @@ can't be mounted. | ||
31 | This is an autofs specific option that is a pseudo mount option and | ||
32 | so is given without a leading dash. It may be used either in the master | ||
33 | map entry (so it effects all the map entries) or with individual map | ||
34 | -entries to prevent bind mounting of local NFS filesystems. Bind mounting | ||
35 | -of NFS file systems can also be prevented for specific map entrys by | ||
36 | -adding the "port=" mount option to the entries. | ||
37 | +entries to prevent bind mounting of local NFS filesystems. For direct | ||
38 | +mount maps the option is only effective if specified on the first direct | ||
39 | +map entry and is applied to all direct mount maps in the master map. It | ||
40 | +is ignored if given on subsequent direct map entries. It may be used | ||
41 | +on individual map entries of both types. Bind mounting of NFS file | ||
42 | +systems can also be prevented for specific map entrys by adding the | ||
43 | +"port=" mount option to the entries. | ||
44 | .TP | ||
45 | .I "\-r, \-\-random-multimount-selection" | ||
46 | Enables the use of ramdom selection when choosing a host from a | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch new file mode 100644 index 0000000000..b5d7ad26ca --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | autofs-5.0.7 - fix nobind sun escaped map entries | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | If a map contains a Sun colon escape to indicate the mount is a local | ||
6 | file system and the "nobind" option is present there is no hostname in | ||
7 | the mount location and the mount fails. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 4 ++++ | ||
11 | modules/mount_nfs.c | 5 +++-- | ||
12 | 2 files changed, 7 insertions(+), 2 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index 67fdcec..faf4c80 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -1,3 +1,7 @@ | ||
20 | +??/??/2012 autofs-5.0.8 | ||
21 | +======================= | ||
22 | +- fix nobind sun escaped map entries. | ||
23 | + | ||
24 | 25/07/2012 autofs-5.0.7 | ||
25 | ======================= | ||
26 | - fix ipv6 name for lookup fix. | ||
27 | diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c | ||
28 | index 9b8e5f1..bbbb1de 100644 | ||
29 | --- a/modules/mount_nfs.c | ||
30 | +++ b/modules/mount_nfs.c | ||
31 | @@ -263,13 +263,14 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int | ||
32 | } else | ||
33 | strcpy(loc, n_addr); | ||
34 | } else { | ||
35 | - loc = malloc(strlen(this->name) + strlen(this->path) + 2); | ||
36 | + char *host = this->name ? this->name : "localhost"; | ||
37 | + loc = malloc(strlen(host) + strlen(this->path) + 2); | ||
38 | if (!loc) { | ||
39 | char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
40 | error(ap->logopt, "malloc: %s", estr); | ||
41 | goto forced_fail; | ||
42 | } | ||
43 | - strcpy(loc, this->name); | ||
44 | + strcpy(loc, host); | ||
45 | } | ||
46 | strcat(loc, ":"); | ||
47 | strcat(loc, this->path); | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch new file mode 100644 index 0000000000..610afaaa7a --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | autofs-5.0.7 - fix null map entry order handling | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | If a null map entry appears after a corresponding indirect map entry | ||
6 | autofs doesn't handle it properly. | ||
7 | |||
8 | Since it appears after the map entry it should'nt affect it but autofs | ||
9 | doesn't account for this case and assumes the map entry is already | ||
10 | mounted and tries to shut it down causing attempted access to facilities | ||
11 | that don't exist. | ||
12 | --- | ||
13 | |||
14 | CHANGELOG | 1 + | ||
15 | lib/master.c | 32 +++++++++++++++++++++++++++++--- | ||
16 | 2 files changed, 30 insertions(+), 3 deletions(-) | ||
17 | |||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index 7b8d185..79cf673 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -7,6 +7,7 @@ | ||
24 | - fix typo in automount(8). | ||
25 | - dont wait forever to restart. | ||
26 | - add timeout option description to man page. | ||
27 | +- fix null map entry order handling. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/lib/master.c b/lib/master.c | ||
32 | index 904b13d..a0e62f2 100644 | ||
33 | --- a/lib/master.c | ||
34 | +++ b/lib/master.c | ||
35 | @@ -1179,9 +1179,35 @@ int master_mount_mounts(struct master *master, time_t age, int readall) | ||
36 | |||
37 | cache_readlock(nc); | ||
38 | ne = cache_lookup_distinct(nc, this->path); | ||
39 | - if (ne && this->age > ne->age) { | ||
40 | + /* | ||
41 | + * If this path matched a nulled entry the master map entry | ||
42 | + * must be an indirect mount so the master map entry line | ||
43 | + * number may be obtained from this->maps. | ||
44 | + */ | ||
45 | + if (ne) { | ||
46 | + int lineno = ne->age; | ||
47 | cache_unlock(nc); | ||
48 | - st_add_task(ap, ST_SHUTDOWN_PENDING); | ||
49 | + | ||
50 | + /* null entry appears after map entry */ | ||
51 | + if (this->maps->master_line < lineno) { | ||
52 | + warn(ap->logopt, | ||
53 | + "ignoring null entry that appears after " | ||
54 | + "existing entry for %s", this->path); | ||
55 | + goto cont; | ||
56 | + } | ||
57 | + if (ap->state != ST_INIT) { | ||
58 | + st_add_task(ap, ST_SHUTDOWN_PENDING); | ||
59 | + continue; | ||
60 | + } | ||
61 | + /* | ||
62 | + * The map entry hasn't been started yet and we've | ||
63 | + * seen a preceeding null map entry for it so just | ||
64 | + * delete it from the master map entry list so it | ||
65 | + * doesn't get in the road. | ||
66 | + */ | ||
67 | + list_del_init(&this->list); | ||
68 | + master_free_mapent_sources(ap->entry, 1); | ||
69 | + master_free_mapent(ap->entry); | ||
70 | continue; | ||
71 | } | ||
72 | nested = cache_partial_match(nc, this->path); | ||
73 | @@ -1194,7 +1220,7 @@ int master_mount_mounts(struct master *master, time_t age, int readall) | ||
74 | cache_delete(nc, nested->key); | ||
75 | } | ||
76 | cache_unlock(nc); | ||
77 | - | ||
78 | +cont: | ||
79 | st_mutex_lock(); | ||
80 | |||
81 | state_pipe = this->ap->state_pipe[1]; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-parse-buffer-initialization.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-parse-buffer-initialization.patch new file mode 100644 index 0000000000..22bd5da25d --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-parse-buffer-initialization.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | autofs-5.0.7 - fix parse buffer initialization | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | When parsing a master map entry, if the mount point path is longer than | ||
6 | the following map string the lexical analyzer buffer may not have a null | ||
7 | terminator where it is expected. If the map name string also contains a | ||
8 | string that is the same as a map type at the end the map name the map | ||
9 | name is not constructed correctly because of this lack of a string | ||
10 | terminator in the buffer. | ||
11 | --- | ||
12 | |||
13 | CHANGELOG | 1 + | ||
14 | lib/master_tok.l | 4 +++- | ||
15 | 2 files changed, 4 insertions(+), 1 deletions(-) | ||
16 | |||
17 | |||
18 | diff --git a/CHANGELOG b/CHANGELOG | ||
19 | index 34c70fa..276d6ba 100644 | ||
20 | --- a/CHANGELOG | ||
21 | +++ b/CHANGELOG | ||
22 | @@ -3,6 +3,7 @@ | ||
23 | - fix nobind sun escaped map entries. | ||
24 | - fix use cache entry after free in lookup_prune_one_cache(). | ||
25 | - fix ipv6 proximity calculation. | ||
26 | +- fix parse buffer initialization. | ||
27 | |||
28 | 25/07/2012 autofs-5.0.7 | ||
29 | ======================= | ||
30 | diff --git a/lib/master_tok.l b/lib/master_tok.l | ||
31 | index 0d6edb7..30abb15 100644 | ||
32 | --- a/lib/master_tok.l | ||
33 | +++ b/lib/master_tok.l | ||
34 | @@ -74,7 +74,8 @@ int my_yyinput(char *, int); | ||
35 | #define unput(c) (*(char *) --line = c) | ||
36 | #endif | ||
37 | |||
38 | -char buff[1024]; | ||
39 | +#define BUFF_LEN 1024 | ||
40 | +char buff[BUFF_LEN]; | ||
41 | char *bptr; | ||
42 | char *optr = buff; | ||
43 | unsigned int tlen; | ||
44 | @@ -174,6 +175,7 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo | ||
45 | *bptr = '\0'; | ||
46 | strcpy(master_lval.strtype, buff); | ||
47 | bptr = buff; | ||
48 | + memset(buff, 0, BUFF_LEN); | ||
49 | return(PATH); | ||
50 | } | ||
51 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-requires-in-spec-file.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-requires-in-spec-file.patch new file mode 100644 index 0000000000..404c84854f --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-requires-in-spec-file.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | autofs-5.0.7 - fix requires in spec file | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Fix the use of depricated reqires in tar spec file. | ||
6 | --- | ||
7 | CHANGELOG | 1 + | ||
8 | autofs.spec | 4 ++-- | ||
9 | 2 files changed, 3 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/CHANGELOG b/CHANGELOG | ||
12 | index 247d334..e848bcd 100644 | ||
13 | --- a/CHANGELOG | ||
14 | +++ b/CHANGELOG | ||
15 | @@ -33,6 +33,7 @@ | ||
16 | - fix file descriptor leak when reloading the daemon. | ||
17 | - depricate nosymlink pseudo option. | ||
18 | - add symlink pseudo option. | ||
19 | +- fix requires in spec file. | ||
20 | |||
21 | 25/07/2012 autofs-5.0.7 | ||
22 | ======================= | ||
23 | diff --git a/autofs.spec b/autofs.spec | ||
24 | index b8a3b7a..703f7a9 100644 | ||
25 | --- a/autofs.spec | ||
26 | +++ b/autofs.spec | ||
27 | @@ -25,8 +25,8 @@ Buildroot: %{_tmppath}/%{name}-tmp | ||
28 | %if %{with_systemd} | ||
29 | BuildRequires: systemd-units | ||
30 | %endif | ||
31 | -BuildPrereq: autoconf, hesiod-devel, openldap-devel, bison, flex, cyrus-sasl-devel | ||
32 | -Prereq: chkconfig | ||
33 | +BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, cyrus-sasl-devel | ||
34 | +Requires: chkconfig | ||
35 | Requires: /bin/bash mktemp sed textutils sh-utils grep /bin/ps | ||
36 | %if %{with_systemd} | ||
37 | Requires(post): systemd-sysv | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-submount-offset-delete.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-submount-offset-delete.patch new file mode 100644 index 0000000000..b38e21433c --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-submount-offset-delete.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | autofs-5.0.7 - fix submount offset delete | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | As part of the implementation to allow for limited update of | ||
6 | the internal hosts map by using a HUP signal some code that | ||
7 | deleted any offset entries from the cache on lookup was removed | ||
8 | as it appeared to not be needed. | ||
9 | |||
10 | There is however a case where it is needed to avoid a duplicate | ||
11 | cache entry failure on lookup. | ||
12 | --- | ||
13 | |||
14 | CHANGELOG | 1 + | ||
15 | daemon/automount.c | 4 ++-- | ||
16 | 2 files changed, 3 insertions(+), 2 deletions(-) | ||
17 | |||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index 7eb7235..76c1f73 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -18,6 +18,7 @@ | ||
24 | - fix map entry duplicate offset detection. | ||
25 | - Allow nsswitch.conf to not contain "automount:" lines. | ||
26 | - fix nobind man page description. | ||
27 | +- fix submount offset delete. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/daemon/automount.c b/daemon/automount.c | ||
32 | index e56f9e1..4a3eb3d 100644 | ||
33 | --- a/daemon/automount.c | ||
34 | +++ b/daemon/automount.c | ||
35 | @@ -544,8 +544,8 @@ int umount_multi(struct autofs_point *ap, const char *path, int incl) | ||
36 | * If we are a submount we need to umount any offsets our | ||
37 | * parent may have mounted over top of us. | ||
38 | */ | ||
39 | - /*if (ap->submount) | ||
40 | - left += umount_subtree_mounts(ap->parent, path, is_autofs_fs);*/ | ||
41 | + if (ap->submount) | ||
42 | + left += umount_subtree_mounts(ap->parent, path, is_autofs_fs); | ||
43 | |||
44 | left += umount_subtree_mounts(ap, path, is_autofs_fs); | ||
45 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch new file mode 100644 index 0000000000..d856faf429 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch | |||
@@ -0,0 +1,72 @@ | |||
1 | autofs-5.0.7 - fix systemd unidir in spec file | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | |||
6 | --- | ||
7 | CHANGELOG | 1 + | ||
8 | autofs.spec | 16 ++++++++-------- | ||
9 | 2 files changed, 9 insertions(+), 8 deletions(-) | ||
10 | |||
11 | diff --git a/CHANGELOG b/CHANGELOG | ||
12 | index b6b2679..ecdea0b 100644 | ||
13 | --- a/CHANGELOG | ||
14 | +++ b/CHANGELOG | ||
15 | @@ -35,6 +35,7 @@ | ||
16 | - add symlink pseudo option. | ||
17 | - fix requires in spec file. | ||
18 | - fix libtirpc build option to require libtirpc-devel if needed. | ||
19 | +- fix systemd unidir in spec file. | ||
20 | |||
21 | 25/07/2012 autofs-5.0.7 | ||
22 | ======================= | ||
23 | diff --git a/autofs.spec b/autofs.spec | ||
24 | index f77acc1..a768e44 100644 | ||
25 | --- a/autofs.spec | ||
26 | +++ b/autofs.spec | ||
27 | @@ -76,7 +76,7 @@ inkludera n | ||
28 | %setup -q | ||
29 | echo %{version}-%{release} > .version | ||
30 | %if %{with_systemd} | ||
31 | - %define _unitdir %{?_unitdir:/lib/systemd/system} | ||
32 | + %define unitdir %{?_unitdir:/lib/systemd/system} | ||
33 | %define systemd_configure_arg --with-systemd | ||
34 | %endif | ||
35 | %if %{with_libtirpc} | ||
36 | @@ -95,7 +95,7 @@ CFLAGS="$RPM_OPT_FLAGS -Wall" make initdir=/etc/rc.d/init.d DONTSTRIP=1 | ||
37 | %install | ||
38 | rm -rf $RPM_BUILD_ROOT | ||
39 | %if %{with_systemd} | ||
40 | -install -d -m 755 $RPM_BUILD_ROOT%{_unitdir} | ||
41 | +install -d -m 755 $RPM_BUILD_ROOT%{unitdir} | ||
42 | %else | ||
43 | mkdir -p -m755 $RPM_BUILD_ROOT/etc/rc.d/init.d | ||
44 | %endif | ||
45 | @@ -109,9 +109,13 @@ make install mandir=%{_mandir} initdir=/etc/rc.d/init.d INSTALLROOT=$RPM_BUILD_R | ||
46 | echo make -C redhat | ||
47 | make -C redhat | ||
48 | %if %{with_systemd} | ||
49 | -install -m 644 redhat/autofs.service $RPM_BUILD_ROOT%{_unitdir}/autofs.service | ||
50 | +# Configure can get this wrong when the unit files appear under /lib and /usr/lib | ||
51 | +find $RPM_BUILD_ROOT -type f -name autofs.service -exec rm -f {} \; | ||
52 | +install -m 644 redhat/autofs.service $RPM_BUILD_ROOT%{unitdir}/autofs.service | ||
53 | +%define init_file_name %{unitdir}/autofs.service | ||
54 | %else | ||
55 | install -m 755 redhat/autofs.init $RPM_BUILD_ROOT/etc/rc.d/init.d/autofs | ||
56 | +%define init_file_name /etc/rc.d/init.d/autofs | ||
57 | %endif | ||
58 | install -m 644 redhat/autofs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/autofs | ||
59 | |||
60 | @@ -170,11 +174,7 @@ fi | ||
61 | %files | ||
62 | %defattr(-,root,root) | ||
63 | %doc CREDITS CHANGELOG INSTALL COPY* README* samples/ldap* samples/autofs.schema samples/autofs_ldap_auth.conf | ||
64 | -%if %{with_systemd} | ||
65 | -%{_unitdir}/autofs.service | ||
66 | -%else | ||
67 | -%config /etc/rc.d/init.d/autofs | ||
68 | -%endif | ||
69 | +%config %{init_file_name} | ||
70 | %config(noreplace) /etc/auto.master | ||
71 | %config(noreplace,missingok) /etc/auto.misc | ||
72 | %config(noreplace,missingok) /etc/auto.net | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-typo-in-automount-8.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-typo-in-automount-8.patch new file mode 100644 index 0000000000..6d88ce0cbd --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-typo-in-automount-8.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | autofs-5.0.7 - fix typo in automount(8) | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | |||
6 | --- | ||
7 | |||
8 | CHANGELOG | 1 + | ||
9 | man/automount.8 | 2 +- | ||
10 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/CHANGELOG b/CHANGELOG | ||
14 | index 276d6ba..6051723 100644 | ||
15 | --- a/CHANGELOG | ||
16 | +++ b/CHANGELOG | ||
17 | @@ -4,6 +4,7 @@ | ||
18 | - fix use cache entry after free in lookup_prune_one_cache(). | ||
19 | - fix ipv6 proximity calculation. | ||
20 | - fix parse buffer initialization. | ||
21 | +- fix typo in automount(8). | ||
22 | |||
23 | 25/07/2012 autofs-5.0.7 | ||
24 | ======================= | ||
25 | diff --git a/man/automount.8 b/man/automount.8 | ||
26 | index 0186984..dddebce 100644 | ||
27 | --- a/man/automount.8 | ||
28 | +++ b/man/automount.8 | ||
29 | @@ -51,7 +51,7 @@ are over-ridden macro definitions of the same name specified in | ||
30 | mount entries. | ||
31 | .TP | ||
32 | .I "\-f, \-\-foreground" | ||
33 | -Run the daemon in the forground and log to stderr instead of syslog." | ||
34 | +Run the daemon in the foreground and log to stderr instead of syslog." | ||
35 | .TP | ||
36 | .I "\-r, \-\-random-multimount-selection" | ||
37 | Enables the use of ramdom selection when choosing a host from a | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch new file mode 100644 index 0000000000..a469c16868 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | autofs-5.0.7 - fix use cache entry after free mistake | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | Fix an obvious use after free mistake in lookup_prune_one_cache(). | ||
6 | --- | ||
7 | |||
8 | CHANGELOG | 1 + | ||
9 | daemon/lookup.c | 7 +++++-- | ||
10 | 2 files changed, 6 insertions(+), 2 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/CHANGELOG b/CHANGELOG | ||
14 | index faf4c80..dc38580 100644 | ||
15 | --- a/CHANGELOG | ||
16 | +++ b/CHANGELOG | ||
17 | @@ -1,6 +1,7 @@ | ||
18 | ??/??/2012 autofs-5.0.8 | ||
19 | ======================= | ||
20 | - fix nobind sun escaped map entries. | ||
21 | +- fix use cache entry after free in lookup_prune_one_cache(). | ||
22 | |||
23 | 25/07/2012 autofs-5.0.7 | ||
24 | ======================= | ||
25 | diff --git a/daemon/lookup.c b/daemon/lookup.c | ||
26 | index 7909536..e3d9536 100644 | ||
27 | --- a/daemon/lookup.c | ||
28 | +++ b/daemon/lookup.c | ||
29 | @@ -1103,15 +1103,18 @@ void lookup_prune_one_cache(struct autofs_point *ap, struct mapent_cache *mc, ti | ||
30 | if (valid) | ||
31 | cache_delete(mc, key); | ||
32 | else if (!is_mounted(_PROC_MOUNTS, path, MNTS_AUTOFS)) { | ||
33 | + dev_t devid = ap->dev; | ||
34 | status = CHE_FAIL; | ||
35 | + if (ap->type == LKP_DIRECT) | ||
36 | + devid = this->dev; | ||
37 | if (this->ioctlfd == -1) | ||
38 | status = cache_delete(mc, key); | ||
39 | if (status != CHE_FAIL) { | ||
40 | if (ap->type == LKP_INDIRECT) { | ||
41 | if (ap->flags & MOUNT_FLAG_GHOST) | ||
42 | - rmdir_path(ap, path, ap->dev); | ||
43 | + rmdir_path(ap, path, devid); | ||
44 | } else | ||
45 | - rmdir_path(ap, path, this->dev); | ||
46 | + rmdir_path(ap, path, devid); | ||
47 | } | ||
48 | } | ||
49 | cache_unlock(mc); | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch new file mode 100644 index 0000000000..74ed8fa642 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | autofs-5.0.7 - fix use get_proximity() without libtirpc | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | If autofs is not using libtirpc and there are any configured IPv6 | ||
6 | interfaces then get_proximity() will fail with PROXIMITY_UNSUPPORTED. | ||
7 | |||
8 | In this case when checking interfaces the IPv6 interfaces need to be | ||
9 | ignored. | ||
10 | --- | ||
11 | |||
12 | CHANGELOG | 1 + | ||
13 | modules/replicated.c | 8 ++------ | ||
14 | 2 files changed, 3 insertions(+), 6 deletions(-) | ||
15 | |||
16 | |||
17 | diff --git a/CHANGELOG b/CHANGELOG | ||
18 | index 5bcb1af..460bd27 100644 | ||
19 | --- a/CHANGELOG | ||
20 | +++ b/CHANGELOG | ||
21 | @@ -20,6 +20,7 @@ | ||
22 | - fix nobind man page description. | ||
23 | - fix submount offset delete. | ||
24 | - fix init script status return. | ||
25 | +- fix use get_proximity() without libtirpc. | ||
26 | |||
27 | 25/07/2012 autofs-5.0.7 | ||
28 | ======================= | ||
29 | diff --git a/modules/replicated.c b/modules/replicated.c | ||
30 | index bd6003b..6b96320 100644 | ||
31 | --- a/modules/replicated.c | ||
32 | +++ b/modules/replicated.c | ||
33 | @@ -184,9 +184,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
34 | break; | ||
35 | |||
36 | case AF_INET6: | ||
37 | -#ifndef WITH_LIBTIRPC | ||
38 | - return PROXIMITY_UNSUPPORTED; | ||
39 | -#else | ||
40 | +#ifdef WITH_LIBTIRPC | ||
41 | if (host_addr->sa_family == AF_INET) | ||
42 | break; | ||
43 | if6_addr = (struct sockaddr_in6 *) this->ifa_addr; | ||
44 | @@ -251,9 +249,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
45 | break; | ||
46 | |||
47 | case AF_INET6: | ||
48 | -#ifndef WITH_LIBTIRPC | ||
49 | - return PROXIMITY_UNSUPPORTED; | ||
50 | -#else | ||
51 | +#ifdef WITH_LIBTIRPC | ||
52 | if (host_addr->sa_family == AF_INET) | ||
53 | break; | ||
54 | if6_addr = (struct sockaddr_in6 *) this->ifa_addr; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-wildcard-multi-map-regression.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-wildcard-multi-map-regression.patch new file mode 100644 index 0000000000..44e4a18e32 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-wildcard-multi-map-regression.patch | |||
@@ -0,0 +1,225 @@ | |||
1 | autofs-5.0.7 - fix wildcard multi map regression | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | A recent patch that removed code to add the current map entry when | ||
6 | being parsed if it didn't already exist cause wildcard indirect | ||
7 | multi-mount map entries to fail to mount. | ||
8 | |||
9 | Indirect multi-mount map entries need the entry matched by a wildcard | ||
10 | lookup to be added to the map entry cache because subsequent operations | ||
11 | expect a distinct map entry to be present or they will fail. This is | ||
12 | what the code that was removed did but it did so in the wrong place | ||
13 | which caused a deadlock situation. | ||
14 | --- | ||
15 | CHANGELOG | 1 + | ||
16 | modules/lookup_file.c | 23 ++++++++++++++++------- | ||
17 | modules/lookup_ldap.c | 19 +++++++++++++++---- | ||
18 | modules/lookup_nisplus.c | 21 ++++++++++++++++----- | ||
19 | modules/lookup_sss.c | 17 ++++++++++++++--- | ||
20 | modules/lookup_yp.c | 21 ++++++++++++++++----- | ||
21 | 6 files changed, 78 insertions(+), 24 deletions(-) | ||
22 | |||
23 | diff --git a/CHANGELOG b/CHANGELOG | ||
24 | index 97d6f48..46ef335 100644 | ||
25 | --- a/CHANGELOG | ||
26 | +++ b/CHANGELOG | ||
27 | @@ -29,6 +29,7 @@ | ||
28 | - modules/replicated.c: use sin6_addr.s6_addr32. | ||
29 | - workaround missing GNU versionsort extension. | ||
30 | - dont fail on master map self include. | ||
31 | +- fix wildcard multi map regression. | ||
32 | |||
33 | 25/07/2012 autofs-5.0.7 | ||
34 | ======================= | ||
35 | diff --git a/modules/lookup_file.c b/modules/lookup_file.c | ||
36 | index f37bed9..65e5ee6 100644 | ||
37 | --- a/modules/lookup_file.c | ||
38 | +++ b/modules/lookup_file.c | ||
39 | @@ -1040,7 +1040,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
40 | return NSS_STATUS_UNAVAIL; | ||
41 | } | ||
42 | |||
43 | - cache_readlock(mc); | ||
44 | + cache_writelock(mc); | ||
45 | me = cache_lookup_first(mc); | ||
46 | if (me && st.st_mtime <= me->age) { | ||
47 | /* | ||
48 | @@ -1082,7 +1082,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
49 | } | ||
50 | } | ||
51 | |||
52 | - cache_readlock(mc); | ||
53 | + cache_writelock(mc); | ||
54 | do_cache_lookup: | ||
55 | me = cache_lookup(mc, key); | ||
56 | /* | ||
57 | @@ -1098,11 +1098,20 @@ do_cache_lookup: | ||
58 | if (!me) | ||
59 | me = cache_lookup_distinct(mc, "*"); | ||
60 | } | ||
61 | - if (me && me->mapent && (me->source == source || *me->key == '/')) { | ||
62 | - pthread_cleanup_push(cache_lock_cleanup, mc); | ||
63 | - strcpy(mapent_buf, me->mapent); | ||
64 | - mapent = mapent_buf; | ||
65 | - pthread_cleanup_pop(0); | ||
66 | + if (me && me->mapent) { | ||
67 | + /* | ||
68 | + * Add wildcard match for later validation checks and | ||
69 | + * negative cache lookups. | ||
70 | + */ | ||
71 | + if (ap->type == LKP_INDIRECT && *me->key == '*') { | ||
72 | + ret = cache_update(mc, source, key, me->mapent, me->age); | ||
73 | + if (!(ret & (CHE_OK | CHE_UPDATED))) | ||
74 | + me = NULL; | ||
75 | + } | ||
76 | + if (me && (me->source == source || *me->key == '/')) { | ||
77 | + strcpy(mapent_buf, me->mapent); | ||
78 | + mapent = mapent_buf; | ||
79 | + } | ||
80 | } | ||
81 | cache_unlock(mc); | ||
82 | |||
83 | diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c | ||
84 | index 431e50d..83e3215 100644 | ||
85 | --- a/modules/lookup_ldap.c | ||
86 | +++ b/modules/lookup_ldap.c | ||
87 | @@ -2969,7 +2969,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
88 | return status; | ||
89 | } | ||
90 | |||
91 | - cache_readlock(mc); | ||
92 | + cache_writelock(mc); | ||
93 | me = cache_lookup(mc, key); | ||
94 | /* Stale mapent => check for entry in alternate source or wildcard */ | ||
95 | if (me && !me->mapent) { | ||
96 | @@ -2979,9 +2979,20 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
97 | if (!me) | ||
98 | me = cache_lookup_distinct(mc, "*"); | ||
99 | } | ||
100 | - if (me && me->mapent && (me->source == source || *me->key == '/')) { | ||
101 | - strcpy(mapent_buf, me->mapent); | ||
102 | - mapent = mapent_buf; | ||
103 | + if (me && me->mapent) { | ||
104 | + /* | ||
105 | + * Add wildcard match for later validation checks and | ||
106 | + * negative cache lookups. | ||
107 | + */ | ||
108 | + if (ap->type == LKP_INDIRECT && *me->key == '*') { | ||
109 | + ret = cache_update(mc, source, key, me->mapent, me->age); | ||
110 | + if (!(ret & (CHE_OK | CHE_UPDATED))) | ||
111 | + me = NULL; | ||
112 | + } | ||
113 | + if (me && (me->source == source || *me->key == '/')) { | ||
114 | + strcpy(mapent_buf, me->mapent); | ||
115 | + mapent = mapent_buf; | ||
116 | + } | ||
117 | } | ||
118 | cache_unlock(mc); | ||
119 | |||
120 | diff --git a/modules/lookup_nisplus.c b/modules/lookup_nisplus.c | ||
121 | index 9fced96..8237a1e 100644 | ||
122 | --- a/modules/lookup_nisplus.c | ||
123 | +++ b/modules/lookup_nisplus.c | ||
124 | @@ -561,7 +561,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
125 | return status; | ||
126 | } | ||
127 | |||
128 | - cache_readlock(mc); | ||
129 | + cache_writelock(mc); | ||
130 | me = cache_lookup(mc, key); | ||
131 | /* Stale mapent => check for entry in alternate source or wildcard */ | ||
132 | if (me && !me->mapent) { | ||
133 | @@ -571,10 +571,21 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
134 | if (!me) | ||
135 | me = cache_lookup_distinct(mc, "*"); | ||
136 | } | ||
137 | - if (me && me->mapent && (me->source == source || *me->key == '/')) { | ||
138 | - mapent_len = strlen(me->mapent); | ||
139 | - mapent = malloc(mapent_len + 1); | ||
140 | - strcpy(mapent, me->mapent); | ||
141 | + if (me && me->mapent) { | ||
142 | + /* | ||
143 | + * Add wildcard match for later validation checks and | ||
144 | + * negative cache lookups. | ||
145 | + */ | ||
146 | + if (ap->type == LKP_INDIRECT && *me->key == '*') { | ||
147 | + ret = cache_update(mc, source, key, me->mapent, me->age); | ||
148 | + if (!(ret & (CHE_OK | CHE_UPDATED))) | ||
149 | + me = NULL; | ||
150 | + } | ||
151 | + if (me && (me->source == source || *me->key == '/')) { | ||
152 | + mapent_len = strlen(me->mapent); | ||
153 | + mapent = malloc(mapent_len + 1); | ||
154 | + strcpy(mapent, me->mapent); | ||
155 | + } | ||
156 | } | ||
157 | cache_unlock(mc); | ||
158 | |||
159 | diff --git a/modules/lookup_sss.c b/modules/lookup_sss.c | ||
160 | index e0b84cc..5c2ed0a 100644 | ||
161 | --- a/modules/lookup_sss.c | ||
162 | +++ b/modules/lookup_sss.c | ||
163 | @@ -645,9 +645,20 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
164 | if (!me) | ||
165 | me = cache_lookup_distinct(mc, "*"); | ||
166 | } | ||
167 | - if (me && me->mapent && (me->source == source || *me->key == '/')) { | ||
168 | - strcpy(mapent_buf, me->mapent); | ||
169 | - mapent = mapent_buf; | ||
170 | + if (me && me->mapent) { | ||
171 | + /* | ||
172 | + * Add wildcard match for later validation checks and | ||
173 | + * negative cache lookups. | ||
174 | + */ | ||
175 | + if (ap->type == LKP_INDIRECT && *me->key == '*') { | ||
176 | + ret = cache_update(mc, source, key, me->mapent, me->age); | ||
177 | + if (!(ret & (CHE_OK | CHE_UPDATED))) | ||
178 | + me = NULL; | ||
179 | + } | ||
180 | + if (me && (me->source == source || *me->key == '/')) { | ||
181 | + strcpy(mapent_buf, me->mapent); | ||
182 | + mapent = mapent_buf; | ||
183 | + } | ||
184 | } | ||
185 | cache_unlock(mc); | ||
186 | |||
187 | diff --git a/modules/lookup_yp.c b/modules/lookup_yp.c | ||
188 | index 720df2e..a716e1f 100644 | ||
189 | --- a/modules/lookup_yp.c | ||
190 | +++ b/modules/lookup_yp.c | ||
191 | @@ -662,7 +662,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
192 | return status; | ||
193 | } | ||
194 | |||
195 | - cache_readlock(mc); | ||
196 | + cache_writelock(mc); | ||
197 | me = cache_lookup(mc, key); | ||
198 | /* Stale mapent => check for entry in alternate source or wildcard */ | ||
199 | if (me && !me->mapent) { | ||
200 | @@ -672,10 +672,21 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
201 | if (!me) | ||
202 | me = cache_lookup_distinct(mc, "*"); | ||
203 | } | ||
204 | - if (me && me->mapent && (me->source == source || *me->key == '/')) { | ||
205 | - mapent_len = strlen(me->mapent); | ||
206 | - mapent = alloca(mapent_len + 1); | ||
207 | - strcpy(mapent, me->mapent); | ||
208 | + if (me && me->mapent) { | ||
209 | + /* | ||
210 | + * Add wildcard match for later validation checks and | ||
211 | + * negative cache lookups. | ||
212 | + */ | ||
213 | + if (ap->type == LKP_INDIRECT && *me->key == '*') { | ||
214 | + ret = cache_update(mc, source, key, me->mapent, me->age); | ||
215 | + if (!(ret & (CHE_OK | CHE_UPDATED))) | ||
216 | + me = NULL; | ||
217 | + } | ||
218 | + if (me && (me->source == source || *me->key == '/')) { | ||
219 | + mapent_len = strlen(me->mapent); | ||
220 | + mapent = alloca(mapent_len + 1); | ||
221 | + strcpy(mapent, me->mapent); | ||
222 | + } | ||
223 | } | ||
224 | cache_unlock(mc); | ||
225 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-handle-new-location-of-systemd.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-handle-new-location-of-systemd.patch new file mode 100644 index 0000000000..1c26794f50 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-handle-new-location-of-systemd.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | autofs-5.0.7 - Handle new location of systemd | ||
2 | |||
3 | From: Frederic Crozat <fcrozat@suse.com> | ||
4 | |||
5 | Some distributions are moving systemd unit files from /lib to | ||
6 | /usr/lib, so we need to test both directories. | ||
7 | |||
8 | edit: imk | ||
9 | It occurs to me I've forgotten to check for the 64 bit variants | ||
10 | of the directories, so add them as well. | ||
11 | end edit: imk | ||
12 | --- | ||
13 | |||
14 | CHANGELOG | 1 + | ||
15 | aclocal.m4 | 2 +- | ||
16 | configure | 2 +- | ||
17 | 3 files changed, 3 insertions(+), 2 deletions(-) | ||
18 | |||
19 | |||
20 | diff --git a/CHANGELOG b/CHANGELOG | ||
21 | index 3bdf8a4..8f6bb3a 100644 | ||
22 | --- a/CHANGELOG | ||
23 | +++ b/CHANGELOG | ||
24 | @@ -14,6 +14,7 @@ | ||
25 | - allow non root user to check status. | ||
26 | - fix recursive mount deadlock. | ||
27 | - increase file map read buffer size. | ||
28 | +- handle new location of systemd. | ||
29 | |||
30 | 25/07/2012 autofs-5.0.7 | ||
31 | ======================= | ||
32 | diff --git a/aclocal.m4 b/aclocal.m4 | ||
33 | index 1798c8b..47bca0c 100644 | ||
34 | --- a/aclocal.m4 | ||
35 | +++ b/aclocal.m4 | ||
36 | @@ -234,7 +234,7 @@ AC_DEFUN([AF_WITH_SYSTEMD], | ||
37 | [if test "$withval" = yes; then | ||
38 | if test -z "$systemddir"; then | ||
39 | AC_MSG_CHECKING([location of the systemd unit files directory]) | ||
40 | - for systemd_d in /lib/systemd/system; do | ||
41 | + for systemd_d in /usr/lib/systemd/system /usr/lib64/systemd/system /lib/systemd/system /lib64/systemd/system; do | ||
42 | if test -z "$systemddir"; then | ||
43 | if test -d "$systemd_d"; then | ||
44 | systemddir="$systemd_d" | ||
45 | diff --git a/configure b/configure | ||
46 | index ba3bba6..3722a46 100755 | ||
47 | --- a/configure | ||
48 | +++ b/configure | ||
49 | @@ -2157,7 +2157,7 @@ if test "${with_systemd+set}" = set; then : | ||
50 | if test -z "$systemddir"; then | ||
51 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking location of the systemd unit files directory" >&5 | ||
52 | $as_echo_n "checking location of the systemd unit files directory... " >&6; } | ||
53 | - for systemd_d in /lib/systemd/system; do | ||
54 | + for systemd_d in /usr/lib/systemd/system /usr/lib64/systemd/system /lib/systemd/system /lib64/systemd/system; do | ||
55 | if test -z "$systemddir"; then | ||
56 | if test -d "$systemd_d"; then | ||
57 | systemddir="$systemd_d" | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch new file mode 100644 index 0000000000..3a878980a4 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | From 44bdce8c6ed9b30c1643e5981172a4f9025f013c Mon Sep 17 00:00:00 2001 | ||
4 | From: Andreas Oberritter <obi@opendreambox.org> | ||
5 | Date: Wed, 13 Mar 2013 16:17:08 +0100 | ||
6 | Subject: [PATCH] autofs-5.0.7: include linux/nfs.h directly in rpc_subs.h | ||
7 | |||
8 | Fixes compile error with uclibc. Glibc's nfs/nfs.h contains | ||
9 | nothing but "#include linux/nfs.h". rpc_subs.h already includes | ||
10 | other linux/nfs*.h files directly. | ||
11 | |||
12 | Signed-off-by: Andreas Oberritter <obi@opendreambox.org> | ||
13 | --- | ||
14 | include/rpc_subs.h | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/include/rpc_subs.h b/include/rpc_subs.h | ||
18 | index b6d59f9..a2d9648 100644 | ||
19 | --- a/include/rpc_subs.h | ||
20 | +++ b/include/rpc_subs.h | ||
21 | @@ -18,7 +18,7 @@ | ||
22 | |||
23 | #include <rpc/rpc.h> | ||
24 | #include <rpc/pmap_prot.h> | ||
25 | -#include <nfs/nfs.h> | ||
26 | +#include <linux/nfs.h> | ||
27 | #include <linux/nfs2.h> | ||
28 | #include <linux/nfs3.h> | ||
29 | |||
30 | -- | ||
31 | 1.7.10.4 | ||
32 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-usage-in-usage-message.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-usage-in-usage-message.patch new file mode 100644 index 0000000000..1c8a565a29 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-usage-in-usage-message.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | autofs-5.0.7 - include usage in usage message | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | Since usage is a case entry we should also nclude it in the usage | ||
6 | message. | ||
7 | --- | ||
8 | |||
9 | redhat/autofs.init.in | 2 +- | ||
10 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in | ||
14 | index 8e355da..ec6d5d6 100644 | ||
15 | --- a/redhat/autofs.init.in | ||
16 | +++ b/redhat/autofs.init.in | ||
17 | @@ -155,7 +155,7 @@ function reload() { | ||
18 | } | ||
19 | |||
20 | function usage_message() { | ||
21 | - echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart}" | ||
22 | + echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart|usage}" | ||
23 | } | ||
24 | |||
25 | RETVAL=0 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch new file mode 100644 index 0000000000..22e0418e54 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch | |||
@@ -0,0 +1,448 @@ | |||
1 | autofs-5.0.7 - lib/defaults.c: use WITH_LDAP conditional around LDAP types | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | Wrap the inclusion of lookup_ldap.h and functions that use ldap_uri or | ||
6 | ldap_schema with the WITH_LDAP conditional. WITH_LDAP is set by the | ||
7 | configure step when LDAP support is not desired. This also allows | ||
8 | compilation on a system that doesn't have any LDAP libraries. | ||
9 | --- | ||
10 | |||
11 | CHANGELOG | 1 | ||
12 | include/defaults.h | 14 +- | ||
13 | include/lookup_ldap.h | 1 | ||
14 | lib/defaults.c | 325 +++++++++++++++++++++++++------------------------ | ||
15 | modules/lookup_ldap.c | 1 | ||
16 | 5 files changed, 175 insertions(+), 167 deletions(-) | ||
17 | |||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index ba1d65b..1130db6 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -24,6 +24,7 @@ | ||
24 | - don't use dirent d_type to filter out files in scandir() | ||
25 | - don't schedule new alarms after readmap. | ||
26 | - use numeric protocol ids instead of protoent structs. | ||
27 | +- lib/defaults.c: use WITH_LDAP conditional around LDAP types. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/include/defaults.h b/include/defaults.h | ||
32 | index cda2174..871e14b 100644 | ||
33 | --- a/include/defaults.h | ||
34 | +++ b/include/defaults.h | ||
35 | @@ -44,8 +44,16 @@ | ||
36 | |||
37 | #define DEFAULT_MAP_HASH_TABLE_SIZE 1024 | ||
38 | |||
39 | +#ifdef WITH_LDAP | ||
40 | struct ldap_schema; | ||
41 | struct ldap_searchdn; | ||
42 | +void defaults_free_uris(struct list_head *); | ||
43 | +struct list_head *defaults_get_uris(void); | ||
44 | +struct ldap_schema *defaults_get_default_schema(void); | ||
45 | +void defaults_free_searchdns(struct ldap_searchdn *); | ||
46 | +struct ldap_searchdn *defaults_get_searchdns(void); | ||
47 | +struct ldap_schema *defaults_get_schema(void); | ||
48 | +#endif | ||
49 | |||
50 | unsigned int defaults_read_config(unsigned int); | ||
51 | const char *defaults_get_master_map(void); | ||
52 | @@ -57,12 +65,6 @@ unsigned int defaults_get_logging(void); | ||
53 | const char *defaults_get_ldap_server(void); | ||
54 | unsigned int defaults_get_ldap_timeout(void); | ||
55 | unsigned int defaults_get_ldap_network_timeout(void); | ||
56 | -struct list_head *defaults_get_uris(void); | ||
57 | -void defaults_free_uris(struct list_head *); | ||
58 | -struct ldap_schema *defaults_get_default_schema(void); | ||
59 | -struct ldap_schema *defaults_get_schema(void); | ||
60 | -struct ldap_searchdn *defaults_get_searchdns(void); | ||
61 | -void defaults_free_searchdns(struct ldap_searchdn *); | ||
62 | unsigned int defaults_get_mount_nfs_default_proto(void); | ||
63 | unsigned int defaults_get_append_options(void); | ||
64 | unsigned int defaults_get_mount_wait(void); | ||
65 | diff --git a/include/lookup_ldap.h b/include/lookup_ldap.h | ||
66 | index e441a61..9a4ce73 100644 | ||
67 | --- a/include/lookup_ldap.h | ||
68 | +++ b/include/lookup_ldap.h | ||
69 | @@ -8,7 +8,6 @@ | ||
70 | #include <openssl/evp.h> | ||
71 | #include <openssl/err.h> | ||
72 | #include <sasl/sasl.h> | ||
73 | -#include <libxml/tree.h> | ||
74 | #include <krb5.h> | ||
75 | #endif | ||
76 | |||
77 | diff --git a/lib/defaults.c b/lib/defaults.c | ||
78 | index 5ce71b7..ae1162f 100644 | ||
79 | --- a/lib/defaults.c | ||
80 | +++ b/lib/defaults.c | ||
81 | @@ -17,9 +17,12 @@ | ||
82 | #include <ctype.h> | ||
83 | #include <string.h> | ||
84 | |||
85 | +#include "config.h" | ||
86 | #include "list.h" | ||
87 | #include "defaults.h" | ||
88 | +#ifdef WITH_LDAP | ||
89 | #include "lookup_ldap.h" | ||
90 | +#endif | ||
91 | #include "log.h" | ||
92 | #include "automount.h" | ||
93 | |||
94 | @@ -197,6 +200,7 @@ static int parse_line(char *line, char **res, char **value) | ||
95 | return 1; | ||
96 | } | ||
97 | |||
98 | +#ifdef WITH_LDAP | ||
99 | void defaults_free_uris(struct list_head *list) | ||
100 | { | ||
101 | struct list_head *next; | ||
102 | @@ -290,166 +294,6 @@ struct list_head *defaults_get_uris(void) | ||
103 | return list; | ||
104 | } | ||
105 | |||
106 | -/* | ||
107 | - * Read config env variables and check they have been set. | ||
108 | - * | ||
109 | - * This simple minded routine assumes the config file | ||
110 | - * is valid bourne shell script without spaces around "=" | ||
111 | - * and that it has valid values. | ||
112 | - */ | ||
113 | -unsigned int defaults_read_config(unsigned int to_syslog) | ||
114 | -{ | ||
115 | - FILE *f; | ||
116 | - char buf[MAX_LINE_LEN]; | ||
117 | - char *res; | ||
118 | - | ||
119 | - f = open_fopen_r(DEFAULTS_CONFIG_FILE); | ||
120 | - if (!f) | ||
121 | - return 0; | ||
122 | - | ||
123 | - while ((res = fgets(buf, MAX_LINE_LEN, f))) { | ||
124 | - char *key, *value; | ||
125 | - | ||
126 | - if (!parse_line(res, &key, &value)) | ||
127 | - continue; | ||
128 | - | ||
129 | - if (check_set_config_value(key, ENV_NAME_MASTER_MAP, value, to_syslog) || | ||
130 | - check_set_config_value(key, ENV_NAME_TIMEOUT, value, to_syslog) || | ||
131 | - check_set_config_value(key, ENV_NAME_NEGATIVE_TIMEOUT, value, to_syslog) || | ||
132 | - check_set_config_value(key, ENV_NAME_BROWSE_MODE, value, to_syslog) || | ||
133 | - check_set_config_value(key, ENV_NAME_LOGGING, value, to_syslog) || | ||
134 | - check_set_config_value(key, ENV_LDAP_TIMEOUT, value, to_syslog) || | ||
135 | - check_set_config_value(key, ENV_LDAP_NETWORK_TIMEOUT, value, to_syslog) || | ||
136 | - check_set_config_value(key, ENV_NAME_MAP_OBJ_CLASS, value, to_syslog) || | ||
137 | - check_set_config_value(key, ENV_NAME_ENTRY_OBJ_CLASS, value, to_syslog) || | ||
138 | - check_set_config_value(key, ENV_NAME_MAP_ATTR, value, to_syslog) || | ||
139 | - check_set_config_value(key, ENV_NAME_ENTRY_ATTR, value, to_syslog) || | ||
140 | - check_set_config_value(key, ENV_NAME_VALUE_ATTR, value, to_syslog) || | ||
141 | - check_set_config_value(key, ENV_APPEND_OPTIONS, value, to_syslog) || | ||
142 | - check_set_config_value(key, ENV_MOUNT_WAIT, value, to_syslog) || | ||
143 | - check_set_config_value(key, ENV_UMOUNT_WAIT, value, to_syslog) || | ||
144 | - check_set_config_value(key, ENV_AUTH_CONF_FILE, value, to_syslog) || | ||
145 | - check_set_config_value(key, ENV_MAP_HASH_TABLE_SIZE, value, to_syslog) || | ||
146 | - check_set_config_value(key, ENV_MOUNT_NFS_DEFAULT_PROTOCOL, value, to_syslog)) | ||
147 | - ; | ||
148 | - } | ||
149 | - | ||
150 | - if (!feof(f) || ferror(f)) { | ||
151 | - if (!to_syslog) { | ||
152 | - fprintf(stderr, | ||
153 | - "fgets returned error %d while reading %s\n", | ||
154 | - ferror(f), DEFAULTS_CONFIG_FILE); | ||
155 | - } else { | ||
156 | - logmsg("fgets returned error %d while reading %s", | ||
157 | - ferror(f), DEFAULTS_CONFIG_FILE); | ||
158 | - } | ||
159 | - fclose(f); | ||
160 | - return 0; | ||
161 | - } | ||
162 | - | ||
163 | - fclose(f); | ||
164 | - return 1; | ||
165 | -} | ||
166 | - | ||
167 | -const char *defaults_get_master_map(void) | ||
168 | -{ | ||
169 | - char *master; | ||
170 | - | ||
171 | - master = get_env_string(ENV_NAME_MASTER_MAP); | ||
172 | - if (!master) | ||
173 | - return strdup(default_master_map_name); | ||
174 | - | ||
175 | - return (const char *) master; | ||
176 | -} | ||
177 | - | ||
178 | -int defaults_master_set(void) | ||
179 | -{ | ||
180 | - char *val = getenv(ENV_NAME_MASTER_MAP); | ||
181 | - if (!val) | ||
182 | - return 0; | ||
183 | - | ||
184 | - return 1; | ||
185 | -} | ||
186 | - | ||
187 | -unsigned int defaults_get_timeout(void) | ||
188 | -{ | ||
189 | - long timeout; | ||
190 | - | ||
191 | - timeout = get_env_number(ENV_NAME_TIMEOUT); | ||
192 | - if (timeout < 0) | ||
193 | - timeout = DEFAULT_TIMEOUT; | ||
194 | - | ||
195 | - return (unsigned int) timeout; | ||
196 | -} | ||
197 | - | ||
198 | -unsigned int defaults_get_negative_timeout(void) | ||
199 | -{ | ||
200 | - long n_timeout; | ||
201 | - | ||
202 | - n_timeout = get_env_number(ENV_NAME_NEGATIVE_TIMEOUT); | ||
203 | - if (n_timeout <= 0) | ||
204 | - n_timeout = DEFAULT_NEGATIVE_TIMEOUT; | ||
205 | - | ||
206 | - return (unsigned int) n_timeout; | ||
207 | -} | ||
208 | - | ||
209 | -unsigned int defaults_get_browse_mode(void) | ||
210 | -{ | ||
211 | - int res; | ||
212 | - | ||
213 | - res = get_env_yesno(ENV_NAME_BROWSE_MODE); | ||
214 | - if (res < 0) | ||
215 | - res = DEFAULT_BROWSE_MODE; | ||
216 | - | ||
217 | - return res; | ||
218 | -} | ||
219 | - | ||
220 | -unsigned int defaults_get_logging(void) | ||
221 | -{ | ||
222 | - char *res; | ||
223 | - unsigned int logging = DEFAULT_LOGGING; | ||
224 | - | ||
225 | - res = get_env_string(ENV_NAME_LOGGING); | ||
226 | - if (!res) | ||
227 | - return logging; | ||
228 | - | ||
229 | - if (!strcasecmp(res, "none")) | ||
230 | - logging = DEFAULT_LOGGING; | ||
231 | - else { | ||
232 | - if (!strcasecmp(res, "verbose")) | ||
233 | - logging |= LOGOPT_VERBOSE; | ||
234 | - | ||
235 | - if (!strcasecmp(res, "debug")) | ||
236 | - logging |= LOGOPT_DEBUG; | ||
237 | - } | ||
238 | - | ||
239 | - free(res); | ||
240 | - | ||
241 | - return logging; | ||
242 | -} | ||
243 | - | ||
244 | -unsigned int defaults_get_ldap_timeout(void) | ||
245 | -{ | ||
246 | - int res; | ||
247 | - | ||
248 | - res = get_env_number(ENV_LDAP_TIMEOUT); | ||
249 | - if (res < 0) | ||
250 | - res = DEFAULT_LDAP_TIMEOUT; | ||
251 | - | ||
252 | - return res; | ||
253 | -} | ||
254 | - | ||
255 | -unsigned int defaults_get_ldap_network_timeout(void) | ||
256 | -{ | ||
257 | - int res; | ||
258 | - | ||
259 | - res = get_env_number(ENV_LDAP_NETWORK_TIMEOUT); | ||
260 | - if (res < 0) | ||
261 | - res = DEFAULT_LDAP_NETWORK_TIMEOUT; | ||
262 | - | ||
263 | - return res; | ||
264 | -} | ||
265 | - | ||
266 | struct ldap_schema *defaults_get_default_schema(void) | ||
267 | { | ||
268 | struct ldap_schema *schema; | ||
269 | @@ -645,6 +489,167 @@ struct ldap_schema *defaults_get_schema(void) | ||
270 | |||
271 | return schema; | ||
272 | } | ||
273 | +#endif | ||
274 | + | ||
275 | +/* | ||
276 | + * Read config env variables and check they have been set. | ||
277 | + * | ||
278 | + * This simple minded routine assumes the config file | ||
279 | + * is valid bourne shell script without spaces around "=" | ||
280 | + * and that it has valid values. | ||
281 | + */ | ||
282 | +unsigned int defaults_read_config(unsigned int to_syslog) | ||
283 | +{ | ||
284 | + FILE *f; | ||
285 | + char buf[MAX_LINE_LEN]; | ||
286 | + char *res; | ||
287 | + | ||
288 | + f = open_fopen_r(DEFAULTS_CONFIG_FILE); | ||
289 | + if (!f) | ||
290 | + return 0; | ||
291 | + | ||
292 | + while ((res = fgets(buf, MAX_LINE_LEN, f))) { | ||
293 | + char *key, *value; | ||
294 | + | ||
295 | + if (!parse_line(res, &key, &value)) | ||
296 | + continue; | ||
297 | + | ||
298 | + if (check_set_config_value(key, ENV_NAME_MASTER_MAP, value, to_syslog) || | ||
299 | + check_set_config_value(key, ENV_NAME_TIMEOUT, value, to_syslog) || | ||
300 | + check_set_config_value(key, ENV_NAME_NEGATIVE_TIMEOUT, value, to_syslog) || | ||
301 | + check_set_config_value(key, ENV_NAME_BROWSE_MODE, value, to_syslog) || | ||
302 | + check_set_config_value(key, ENV_NAME_LOGGING, value, to_syslog) || | ||
303 | + check_set_config_value(key, ENV_LDAP_TIMEOUT, value, to_syslog) || | ||
304 | + check_set_config_value(key, ENV_LDAP_NETWORK_TIMEOUT, value, to_syslog) || | ||
305 | + check_set_config_value(key, ENV_NAME_MAP_OBJ_CLASS, value, to_syslog) || | ||
306 | + check_set_config_value(key, ENV_NAME_ENTRY_OBJ_CLASS, value, to_syslog) || | ||
307 | + check_set_config_value(key, ENV_NAME_MAP_ATTR, value, to_syslog) || | ||
308 | + check_set_config_value(key, ENV_NAME_ENTRY_ATTR, value, to_syslog) || | ||
309 | + check_set_config_value(key, ENV_NAME_VALUE_ATTR, value, to_syslog) || | ||
310 | + check_set_config_value(key, ENV_APPEND_OPTIONS, value, to_syslog) || | ||
311 | + check_set_config_value(key, ENV_MOUNT_WAIT, value, to_syslog) || | ||
312 | + check_set_config_value(key, ENV_UMOUNT_WAIT, value, to_syslog) || | ||
313 | + check_set_config_value(key, ENV_AUTH_CONF_FILE, value, to_syslog) || | ||
314 | + check_set_config_value(key, ENV_MAP_HASH_TABLE_SIZE, value, to_syslog) || | ||
315 | + check_set_config_value(key, ENV_MOUNT_NFS_DEFAULT_PROTOCOL, value, to_syslog)) | ||
316 | + ; | ||
317 | + } | ||
318 | + | ||
319 | + if (!feof(f) || ferror(f)) { | ||
320 | + if (!to_syslog) { | ||
321 | + fprintf(stderr, | ||
322 | + "fgets returned error %d while reading %s\n", | ||
323 | + ferror(f), DEFAULTS_CONFIG_FILE); | ||
324 | + } else { | ||
325 | + logmsg("fgets returned error %d while reading %s", | ||
326 | + ferror(f), DEFAULTS_CONFIG_FILE); | ||
327 | + } | ||
328 | + fclose(f); | ||
329 | + return 0; | ||
330 | + } | ||
331 | + | ||
332 | + fclose(f); | ||
333 | + return 1; | ||
334 | +} | ||
335 | + | ||
336 | +const char *defaults_get_master_map(void) | ||
337 | +{ | ||
338 | + char *master; | ||
339 | + | ||
340 | + master = get_env_string(ENV_NAME_MASTER_MAP); | ||
341 | + if (!master) | ||
342 | + return strdup(default_master_map_name); | ||
343 | + | ||
344 | + return (const char *) master; | ||
345 | +} | ||
346 | + | ||
347 | +int defaults_master_set(void) | ||
348 | +{ | ||
349 | + char *val = getenv(ENV_NAME_MASTER_MAP); | ||
350 | + if (!val) | ||
351 | + return 0; | ||
352 | + | ||
353 | + return 1; | ||
354 | +} | ||
355 | + | ||
356 | +unsigned int defaults_get_timeout(void) | ||
357 | +{ | ||
358 | + long timeout; | ||
359 | + | ||
360 | + timeout = get_env_number(ENV_NAME_TIMEOUT); | ||
361 | + if (timeout < 0) | ||
362 | + timeout = DEFAULT_TIMEOUT; | ||
363 | + | ||
364 | + return (unsigned int) timeout; | ||
365 | +} | ||
366 | + | ||
367 | +unsigned int defaults_get_negative_timeout(void) | ||
368 | +{ | ||
369 | + long n_timeout; | ||
370 | + | ||
371 | + n_timeout = get_env_number(ENV_NAME_NEGATIVE_TIMEOUT); | ||
372 | + if (n_timeout <= 0) | ||
373 | + n_timeout = DEFAULT_NEGATIVE_TIMEOUT; | ||
374 | + | ||
375 | + return (unsigned int) n_timeout; | ||
376 | +} | ||
377 | + | ||
378 | +unsigned int defaults_get_browse_mode(void) | ||
379 | +{ | ||
380 | + int res; | ||
381 | + | ||
382 | + res = get_env_yesno(ENV_NAME_BROWSE_MODE); | ||
383 | + if (res < 0) | ||
384 | + res = DEFAULT_BROWSE_MODE; | ||
385 | + | ||
386 | + return res; | ||
387 | +} | ||
388 | + | ||
389 | +unsigned int defaults_get_logging(void) | ||
390 | +{ | ||
391 | + char *res; | ||
392 | + unsigned int logging = DEFAULT_LOGGING; | ||
393 | + | ||
394 | + res = get_env_string(ENV_NAME_LOGGING); | ||
395 | + if (!res) | ||
396 | + return logging; | ||
397 | + | ||
398 | + if (!strcasecmp(res, "none")) | ||
399 | + logging = DEFAULT_LOGGING; | ||
400 | + else { | ||
401 | + if (!strcasecmp(res, "verbose")) | ||
402 | + logging |= LOGOPT_VERBOSE; | ||
403 | + | ||
404 | + if (!strcasecmp(res, "debug")) | ||
405 | + logging |= LOGOPT_DEBUG; | ||
406 | + } | ||
407 | + | ||
408 | + free(res); | ||
409 | + | ||
410 | + return logging; | ||
411 | +} | ||
412 | + | ||
413 | +unsigned int defaults_get_ldap_timeout(void) | ||
414 | +{ | ||
415 | + int res; | ||
416 | + | ||
417 | + res = get_env_number(ENV_LDAP_TIMEOUT); | ||
418 | + if (res < 0) | ||
419 | + res = DEFAULT_LDAP_TIMEOUT; | ||
420 | + | ||
421 | + return res; | ||
422 | +} | ||
423 | + | ||
424 | +unsigned int defaults_get_ldap_network_timeout(void) | ||
425 | +{ | ||
426 | + int res; | ||
427 | + | ||
428 | + res = get_env_number(ENV_LDAP_NETWORK_TIMEOUT); | ||
429 | + if (res < 0) | ||
430 | + res = DEFAULT_LDAP_NETWORK_TIMEOUT; | ||
431 | + | ||
432 | + return res; | ||
433 | +} | ||
434 | |||
435 | unsigned int defaults_get_mount_nfs_default_proto(void) | ||
436 | { | ||
437 | diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c | ||
438 | index 3bc4dc5..431e50d 100644 | ||
439 | --- a/modules/lookup_ldap.c | ||
440 | +++ b/modules/lookup_ldap.c | ||
441 | @@ -28,6 +28,7 @@ | ||
442 | #include <arpa/nameser.h> | ||
443 | #include <resolv.h> | ||
444 | #include <lber.h> | ||
445 | +#include <libxml/tree.h> | ||
446 | |||
447 | #define MODULE_LOOKUP | ||
448 | #include "automount.h" | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch new file mode 100644 index 0000000000..a3dd3fb691 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | autofs-5.0.7 - make description of default MOUNT_WAIT setting clear | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | |||
6 | --- | ||
7 | |||
8 | CHANGELOG | 1 + | ||
9 | redhat/autofs.sysconfig.in | 5 +++-- | ||
10 | samples/autofs.conf.default.in | 5 +++-- | ||
11 | 3 files changed, 7 insertions(+), 4 deletions(-) | ||
12 | |||
13 | |||
14 | diff --git a/CHANGELOG b/CHANGELOG | ||
15 | index 79cf673..961e340 100644 | ||
16 | --- a/CHANGELOG | ||
17 | +++ b/CHANGELOG | ||
18 | @@ -8,6 +8,7 @@ | ||
19 | - dont wait forever to restart. | ||
20 | - add timeout option description to man page. | ||
21 | - fix null map entry order handling. | ||
22 | +- make description of default MOUNT_WAIT setting clear. | ||
23 | |||
24 | 25/07/2012 autofs-5.0.7 | ||
25 | ======================= | ||
26 | diff --git a/redhat/autofs.sysconfig.in b/redhat/autofs.sysconfig.in | ||
27 | index 36b924d..a8992c4 100644 | ||
28 | --- a/redhat/autofs.sysconfig.in | ||
29 | +++ b/redhat/autofs.sysconfig.in | ||
30 | @@ -18,8 +18,9 @@ TIMEOUT=300 | ||
31 | # Setting this timeout can cause problems when | ||
32 | # mount would otherwise wait for a server that | ||
33 | # is temporarily unavailable, such as when it's | ||
34 | -# restarting. The defailt of waiting for mount(8) | ||
35 | -# usually results in a wait of around 3 minutes. | ||
36 | +# restarting. The default setting (-1) of waiting | ||
37 | +# for mount(8) usually results in a wait of around | ||
38 | +# 3 minutes. | ||
39 | # | ||
40 | #MOUNT_WAIT=-1 | ||
41 | # | ||
42 | diff --git a/samples/autofs.conf.default.in b/samples/autofs.conf.default.in | ||
43 | index ac2f63b..1da89cf 100644 | ||
44 | --- a/samples/autofs.conf.default.in | ||
45 | +++ b/samples/autofs.conf.default.in | ||
46 | @@ -18,8 +18,9 @@ TIMEOUT=300 | ||
47 | # Setting this timeout can cause problems when | ||
48 | # mount would otherwise wait for a server that | ||
49 | # is temporarily unavailable, such as when it's | ||
50 | -# restarting. The defailt of waiting for mount(8) | ||
51 | -# usually results in a wait of around 3 minutes. | ||
52 | +# restarting. The default setting (-1) of waiting | ||
53 | +# for mount(8) usually results in a wait of around | ||
54 | +# 3 minutes. | ||
55 | # | ||
56 | #MOUNT_WAIT=-1 | ||
57 | # | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-yellow-pages-support-optional.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-yellow-pages-support-optional.patch new file mode 100644 index 0000000000..41996906c1 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-yellow-pages-support-optional.patch | |||
@@ -0,0 +1,156 @@ | |||
1 | autofs-5.0.7 - make yellow pages support optional | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | If rpcsvc/ypclnt.h is not available don't compile in Yellow Pages | ||
6 | support. | ||
7 | --- | ||
8 | |||
9 | CHANGELOG | 1 + | ||
10 | Makefile.conf.in | 3 +++ | ||
11 | configure | 16 ++++++++++++++++ | ||
12 | configure.in | 9 +++++++++ | ||
13 | include/config.h.in | 3 +++ | ||
14 | lib/rpc_subs.c | 1 - | ||
15 | modules/Makefile | 9 +++++++-- | ||
16 | 7 files changed, 39 insertions(+), 3 deletions(-) | ||
17 | |||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index 1130db6..ed17163 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -25,6 +25,7 @@ | ||
24 | - don't schedule new alarms after readmap. | ||
25 | - use numeric protocol ids instead of protoent structs. | ||
26 | - lib/defaults.c: use WITH_LDAP conditional around LDAP types. | ||
27 | +- make yellow pages support optional. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/Makefile.conf.in b/Makefile.conf.in | ||
32 | index 802318b..3766d45 100644 | ||
33 | --- a/Makefile.conf.in | ||
34 | +++ b/Makefile.conf.in | ||
35 | @@ -43,6 +43,9 @@ NISPLUS = @HAVE_NISPLUS@ | ||
36 | # SMBFS support: yes (1) no (0) | ||
37 | SMBFS = @HAVE_SMBMOUNT@ | ||
38 | |||
39 | +# YellowPages support: yes (1) no (0) | ||
40 | +YPCLNT = @HAVE_YPCLNT@ | ||
41 | + | ||
42 | # Support for calling e2fsck when mounting ext2 filesystems | ||
43 | EXT2FS = @HAVE_E2FSCK@ | ||
44 | |||
45 | diff --git a/configure b/configure | ||
46 | index 3722a46..cf6428c 100755 | ||
47 | --- a/configure | ||
48 | +++ b/configure | ||
49 | @@ -614,6 +614,7 @@ XML_FLAGS | ||
50 | LIBLDAP | ||
51 | HAVE_LDAP | ||
52 | LDAP_FLAGS | ||
53 | +HAVE_YPCLNT | ||
54 | HAVE_NISPLUS | ||
55 | EGREP | ||
56 | GREP | ||
57 | @@ -4575,6 +4576,21 @@ fi | ||
58 | |||
59 | |||
60 | |||
61 | +# YellowPages support? | ||
62 | +HAVE_YPCLNT=0 | ||
63 | +ac_fn_c_check_header_mongrel "$LINENO" "rpcsvc/ypclnt.h" "ac_cv_header_rpcsvc_ypclnt_h" "$ac_includes_default" | ||
64 | +if test "x$ac_cv_header_rpcsvc_ypclnt_h" = xyes; then : | ||
65 | + HAVE_YPCLNT=1 | ||
66 | +fi | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | +if test "$HAVE_YPCLNT" = "1"; then | ||
71 | + | ||
72 | +$as_echo "#define HAVE_YPCLNT 1" >>confdefs.h | ||
73 | + | ||
74 | +fi | ||
75 | + | ||
76 | # | ||
77 | # OpenLDAP support? Expect that this may have a special directory... | ||
78 | # | ||
79 | diff --git a/configure.in b/configure.in | ||
80 | index 90bda62..363c376 100644 | ||
81 | --- a/configure.in | ||
82 | +++ b/configure.in | ||
83 | @@ -213,6 +213,15 @@ HAVE_NISPLUS=0 | ||
84 | AC_CHECK_HEADER(rpcsvc/nis.h, HAVE_NISPLUS=1) | ||
85 | AC_SUBST(HAVE_NISPLUS) | ||
86 | |||
87 | +# YellowPages support? | ||
88 | +HAVE_YPCLNT=0 | ||
89 | +AC_CHECK_HEADER([rpcsvc/ypclnt.h], HAVE_YPCLNT=1) | ||
90 | +AC_SUBST(HAVE_YPCLNT) | ||
91 | +if test "$HAVE_YPCLNT" = "1"; then | ||
92 | + AC_DEFINE(HAVE_YPCLNT, 1, | ||
93 | + [Define if using YellowPages]) | ||
94 | +fi | ||
95 | + | ||
96 | # | ||
97 | # OpenLDAP support? Expect that this may have a special directory... | ||
98 | # | ||
99 | diff --git a/include/config.h.in b/include/config.h.in | ||
100 | index 9bdf98a..7f1c5b5 100644 | ||
101 | --- a/include/config.h.in | ||
102 | +++ b/include/config.h.in | ||
103 | @@ -72,6 +72,9 @@ | ||
104 | /* Define to 1 if you have the <unistd.h> header file. */ | ||
105 | #undef HAVE_UNISTD_H | ||
106 | |||
107 | +/* Define if using YellowPages */ | ||
108 | +#undef HAVE_YPCLNT | ||
109 | + | ||
110 | /* Use libxml2 tsd usage workaround */ | ||
111 | #undef LIBXML2_WORKAROUND | ||
112 | |||
113 | diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c | ||
114 | index ad1d557..718caf9 100644 | ||
115 | --- a/lib/rpc_subs.c | ||
116 | +++ b/lib/rpc_subs.c | ||
117 | @@ -27,7 +27,6 @@ | ||
118 | #include <net/if.h> | ||
119 | #include <netinet/in.h> | ||
120 | #include <arpa/inet.h> | ||
121 | -#include <rpcsvc/ypclnt.h> | ||
122 | #include <errno.h> | ||
123 | #include <sys/ioctl.h> | ||
124 | #include <ctype.h> | ||
125 | diff --git a/modules/Makefile b/modules/Makefile | ||
126 | index 939da7c..c5deb24 100644 | ||
127 | --- a/modules/Makefile | ||
128 | +++ b/modules/Makefile | ||
129 | @@ -5,13 +5,13 @@ | ||
130 | -include ../Makefile.conf | ||
131 | include ../Makefile.rules | ||
132 | |||
133 | -SRCS := lookup_yp.c lookup_file.c lookup_program.c lookup_userhome.c \ | ||
134 | +SRCS := lookup_file.c lookup_program.c lookup_userhome.c \ | ||
135 | lookup_multi.c lookup_hosts.c lookup_dir.c \ | ||
136 | parse_sun.c \ | ||
137 | mount_generic.c mount_nfs.c mount_afs.c mount_autofs.c \ | ||
138 | mount_changer.c mount_bind.c | ||
139 | |||
140 | -MODS := lookup_yp.so lookup_file.so lookup_program.so lookup_userhome.so \ | ||
141 | +MODS := lookup_file.so lookup_program.so lookup_userhome.so \ | ||
142 | lookup_multi.so lookup_hosts.so lookup_dir.so \ | ||
143 | parse_sun.so \ | ||
144 | mount_generic.so mount_nfs.so mount_afs.so mount_autofs.so \ | ||
145 | @@ -37,6 +37,11 @@ ifeq ($(NISPLUS), 1) | ||
146 | MODS += lookup_nisplus.so | ||
147 | endif | ||
148 | |||
149 | +ifeq ($(YPCLNT), 1) | ||
150 | + SRCS += lookup_yp.c | ||
151 | + MODS += lookup_yp.so | ||
152 | +endif | ||
153 | + | ||
154 | ifeq ($(LDAP), 1) | ||
155 | SRCS += lookup_ldap.c | ||
156 | MODS += lookup_ldap.so | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch new file mode 100644 index 0000000000..4516bc5f25 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | autofs-5.0.7 - modules/replicated.c: use sin6_addr.s6_addr32 | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | The exported in6.h kernel header provides a convenience macro s6_addr32 | ||
6 | for accessing the 32bit words of an ipv6 address. Use this instead of | ||
7 | __in6_u.__u6_addr32. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 + | ||
11 | modules/replicated.c | 2 +- | ||
12 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index ed17163..4eaa9f9 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -26,6 +26,7 @@ | ||
20 | - use numeric protocol ids instead of protoent structs. | ||
21 | - lib/defaults.c: use WITH_LDAP conditional around LDAP types. | ||
22 | - make yellow pages support optional. | ||
23 | +- modules/replicated.c: use sin6_addr.s6_addr32. | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/modules/replicated.c b/modules/replicated.c | ||
28 | index dbd5513..26f64b8 100644 | ||
29 | --- a/modules/replicated.c | ||
30 | +++ b/modules/replicated.c | ||
31 | @@ -1146,7 +1146,7 @@ try_name: | ||
32 | rr4++; | ||
33 | } else if (this->ai_family == AF_INET6) { | ||
34 | struct sockaddr_in6 *addr = (struct sockaddr_in6 *) this->ai_addr; | ||
35 | - if (!IN6_IS_ADDR_LOOPBACK(addr->sin6_addr.__in6_u.__u6_addr32)) | ||
36 | + if (!IN6_IS_ADDR_LOOPBACK(addr->sin6_addr.s6_addr32)) | ||
37 | rr6++; | ||
38 | } | ||
39 | this = this->ai_next; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-update-kernel-include-files.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-update-kernel-include-files.patch new file mode 100644 index 0000000000..3b6bb926ab --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-update-kernel-include-files.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | autofs-5.0.7 - update kernel include files | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Update autofs include files to include the latest changes. | ||
6 | --- | ||
7 | include/linux/auto_fs.h | 33 ++++++++++----------------------- | ||
8 | include/linux/auto_fs4.h | 3 ++- | ||
9 | 2 files changed, 12 insertions(+), 24 deletions(-) | ||
10 | |||
11 | diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h | ||
12 | index 91d414f..64df1a6 100644 | ||
13 | --- a/include/linux/auto_fs.h | ||
14 | +++ b/include/linux/auto_fs.h | ||
15 | @@ -14,13 +14,8 @@ | ||
16 | #ifndef _LINUX_AUTO_FS_H | ||
17 | #define _LINUX_AUTO_FS_H | ||
18 | |||
19 | -#ifdef __KERNEL__ | ||
20 | -#include <linux/fs.h> | ||
21 | -#include <linux/limits.h> | ||
22 | #include <linux/types.h> | ||
23 | -#include <linux/ioctl.h> | ||
24 | -#else | ||
25 | -#include <asm/types.h> | ||
26 | +#ifndef __KERNEL__ | ||
27 | #include <sys/ioctl.h> | ||
28 | #endif /* __KERNEL__ */ | ||
29 | |||
30 | @@ -32,25 +27,16 @@ | ||
31 | #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION | ||
32 | |||
33 | /* | ||
34 | - * Architectures where both 32- and 64-bit binaries can be executed | ||
35 | - * on 64-bit kernels need this. This keeps the structure format | ||
36 | - * uniform, and makes sure the wait_queue_token isn't too big to be | ||
37 | - * passed back down to the kernel. | ||
38 | - * | ||
39 | - * This assumes that on these architectures: | ||
40 | - * mode 32 bit 64 bit | ||
41 | - * ------------------------- | ||
42 | - * int 32 bit 32 bit | ||
43 | - * long 32 bit 64 bit | ||
44 | - * | ||
45 | - * If so, 32-bit user-space code should be backwards compatible. | ||
46 | + * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed | ||
47 | + * back to the kernel via ioctl from userspace. On architectures where 32- and | ||
48 | + * 64-bit userspace binaries can be executed it's important that the size of | ||
49 | + * autofs_wqt_t stays constant between 32- and 64-bit Linux kernels so that we | ||
50 | + * do not break the binary ABI interface by changing the structure size. | ||
51 | */ | ||
52 | - | ||
53 | -#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \ | ||
54 | - || defined(__powerpc__) || defined(__s390__) | ||
55 | -typedef unsigned int autofs_wqt_t; | ||
56 | -#else | ||
57 | +#if defined(__ia64__) || defined(__alpha__) /* pure 64bit architectures */ | ||
58 | typedef unsigned long autofs_wqt_t; | ||
59 | +#else | ||
60 | +typedef unsigned int autofs_wqt_t; | ||
61 | #endif | ||
62 | |||
63 | /* Packet types */ | ||
64 | @@ -81,6 +67,7 @@ struct autofs_packet_expire { | ||
65 | #define AUTOFS_IOC_FAIL _IO(0x93,0x61) | ||
66 | #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62) | ||
67 | #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int) | ||
68 | +#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t) | ||
69 | #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) | ||
70 | #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) | ||
71 | |||
72 | diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h | ||
73 | index 55fa478..e02982f 100644 | ||
74 | --- a/include/linux/auto_fs4.h | ||
75 | +++ b/include/linux/auto_fs4.h | ||
76 | @@ -12,6 +12,7 @@ | ||
77 | #define _LINUX_AUTO_FS4_H | ||
78 | |||
79 | /* Include common v3 definitions */ | ||
80 | +#include <linux/types.h> | ||
81 | #include <linux/auto_fs.h> | ||
82 | |||
83 | /* autofs v4 definitions */ | ||
84 | @@ -23,7 +24,7 @@ | ||
85 | #define AUTOFS_MIN_PROTO_VERSION 3 | ||
86 | #define AUTOFS_MAX_PROTO_VERSION 5 | ||
87 | |||
88 | -#define AUTOFS_PROTO_SUBVERSION 1 | ||
89 | +#define AUTOFS_PROTO_SUBVERSION 2 | ||
90 | |||
91 | /* Mask for expire behaviour */ | ||
92 | #define AUTOFS_EXP_IMMEDIATE 1 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch new file mode 100644 index 0000000000..113b0a06ef --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch | |||
@@ -0,0 +1,471 @@ | |||
1 | autofs-5.0.7 - use numeric protocol ids instead of protoent structs | ||
2 | |||
3 | From: Leonardo Chiquitto <leonardo.lists@gmail.com> | ||
4 | |||
5 | The function getprotobyname() is not reentrant, so we can't call | ||
6 | it simultaneously from multiple threads. Instead of switching to | ||
7 | the reentrant version which adds more complexity to the code, | ||
8 | lets use numeric protocol IDs instead of protoent structures. | ||
9 | --- | ||
10 | |||
11 | CHANGELOG | 1 + | ||
12 | include/rpc_subs.h | 4 +-- | ||
13 | lib/rpc_subs.c | 80 ++++++++++++++++++-------------------------------- | ||
14 | modules/replicated.c | 42 +++++++++++--------------- | ||
15 | 4 files changed, 50 insertions(+), 77 deletions(-) | ||
16 | |||
17 | |||
18 | diff --git a/CHANGELOG b/CHANGELOG | ||
19 | index 4cf5621..ba1d65b 100644 | ||
20 | --- a/CHANGELOG | ||
21 | +++ b/CHANGELOG | ||
22 | @@ -23,6 +23,7 @@ | ||
23 | - fix use get_proximity() without libtirpc. | ||
24 | - don't use dirent d_type to filter out files in scandir() | ||
25 | - don't schedule new alarms after readmap. | ||
26 | +- use numeric protocol ids instead of protoent structs. | ||
27 | |||
28 | 25/07/2012 autofs-5.0.7 | ||
29 | ======================= | ||
30 | diff --git a/include/rpc_subs.h b/include/rpc_subs.h | ||
31 | index ca474d9..b6d59f9 100644 | ||
32 | --- a/include/rpc_subs.h | ||
33 | +++ b/include/rpc_subs.h | ||
34 | @@ -54,7 +54,7 @@ struct conn_info { | ||
35 | unsigned short port; | ||
36 | unsigned long program; | ||
37 | unsigned long version; | ||
38 | - struct protoent *proto; | ||
39 | + int proto; | ||
40 | unsigned int send_sz; | ||
41 | unsigned int recv_sz; | ||
42 | struct timeval timeout; | ||
43 | @@ -66,7 +66,7 @@ int rpc_udp_getclient(struct conn_info *, unsigned int, unsigned int); | ||
44 | void rpc_destroy_udp_client(struct conn_info *); | ||
45 | int rpc_tcp_getclient(struct conn_info *, unsigned int, unsigned int); | ||
46 | void rpc_destroy_tcp_client(struct conn_info *); | ||
47 | -int rpc_portmap_getclient(struct conn_info *, const char *, struct sockaddr *, size_t, const char *, unsigned int); | ||
48 | +int rpc_portmap_getclient(struct conn_info *, const char *, struct sockaddr *, size_t, int, unsigned int); | ||
49 | int rpc_portmap_getport(struct conn_info *, struct pmap *, unsigned short *); | ||
50 | int rpc_ping_proto(struct conn_info *); | ||
51 | int rpc_ping(const char *, long, long, unsigned int); | ||
52 | diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c | ||
53 | index d33a3c4..ad1d557 100644 | ||
54 | --- a/lib/rpc_subs.c | ||
55 | +++ b/lib/rpc_subs.c | ||
56 | @@ -170,7 +170,7 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i | ||
57 | |||
58 | *client = NULL; | ||
59 | |||
60 | - proto = info->proto->p_proto; | ||
61 | + proto = info->proto; | ||
62 | if (proto == IPPROTO_UDP) | ||
63 | type = SOCK_DGRAM; | ||
64 | else | ||
65 | @@ -201,7 +201,7 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i | ||
66 | in4_raddr = (struct sockaddr_in *) addr; | ||
67 | in4_raddr->sin_port = htons(info->port); | ||
68 | |||
69 | - switch (info->proto->p_proto) { | ||
70 | + switch (info->proto) { | ||
71 | case IPPROTO_UDP: | ||
72 | clnt = clntudp_bufcreate(in4_raddr, | ||
73 | info->program, info->version, | ||
74 | @@ -241,7 +241,7 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i | ||
75 | |||
76 | *client = NULL; | ||
77 | |||
78 | - proto = info->proto->p_proto; | ||
79 | + proto = info->proto; | ||
80 | if (proto == IPPROTO_UDP) | ||
81 | type = SOCK_DGRAM; | ||
82 | else | ||
83 | @@ -292,11 +292,11 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i | ||
84 | nb_addr.maxlen = nb_addr.len = slen; | ||
85 | nb_addr.buf = addr; | ||
86 | |||
87 | - if (info->proto->p_proto == IPPROTO_UDP) | ||
88 | + if (info->proto == IPPROTO_UDP) | ||
89 | clnt = clnt_dg_create(*fd, &nb_addr, | ||
90 | info->program, info->version, | ||
91 | info->send_sz, info->recv_sz); | ||
92 | - else if (info->proto->p_proto == IPPROTO_TCP) { | ||
93 | + else if (info->proto == IPPROTO_TCP) { | ||
94 | ret = connect_nb(*fd, addr, slen, &info->timeout); | ||
95 | if (ret < 0) | ||
96 | return ret; | ||
97 | @@ -355,7 +355,7 @@ static int create_client(struct conn_info *info, CLIENT **client) | ||
98 | memset(&hints, 0, sizeof(hints)); | ||
99 | hints.ai_flags = AI_ADDRCONFIG; | ||
100 | hints.ai_family = AF_UNSPEC; | ||
101 | - if (info->proto->p_proto == IPPROTO_UDP) | ||
102 | + if (info->proto == IPPROTO_UDP) | ||
103 | hints.ai_socktype = SOCK_DGRAM; | ||
104 | else | ||
105 | hints.ai_socktype = SOCK_STREAM; | ||
106 | @@ -370,7 +370,7 @@ static int create_client(struct conn_info *info, CLIENT **client) | ||
107 | |||
108 | haddr = ai; | ||
109 | while (haddr) { | ||
110 | - if (haddr->ai_protocol != info->proto->p_proto) { | ||
111 | + if (haddr->ai_protocol != info->proto) { | ||
112 | haddr = haddr->ai_next; | ||
113 | continue; | ||
114 | } | ||
115 | @@ -417,16 +417,11 @@ out_close: | ||
116 | int rpc_udp_getclient(struct conn_info *info, | ||
117 | unsigned int program, unsigned int version) | ||
118 | { | ||
119 | - struct protoent *pe_proto; | ||
120 | CLIENT *client; | ||
121 | int ret; | ||
122 | |||
123 | if (!info->client) { | ||
124 | - pe_proto = getprotobyname("udp"); | ||
125 | - if (!pe_proto) | ||
126 | - return -ENOENT; | ||
127 | - | ||
128 | - info->proto = pe_proto; | ||
129 | + info->proto = IPPROTO_UDP; | ||
130 | info->timeout.tv_sec = RPC_TOUT_UDP; | ||
131 | info->timeout.tv_usec = 0; | ||
132 | info->send_sz = UDPMSGSIZE; | ||
133 | @@ -458,16 +453,11 @@ void rpc_destroy_udp_client(struct conn_info *info) | ||
134 | int rpc_tcp_getclient(struct conn_info *info, | ||
135 | unsigned int program, unsigned int version) | ||
136 | { | ||
137 | - struct protoent *pe_proto; | ||
138 | CLIENT *client; | ||
139 | int ret; | ||
140 | |||
141 | if (!info->client) { | ||
142 | - pe_proto = getprotobyname("tcp"); | ||
143 | - if (!pe_proto) | ||
144 | - return -ENOENT; | ||
145 | - | ||
146 | - info->proto = pe_proto; | ||
147 | + info->proto = IPPROTO_TCP; | ||
148 | info->timeout.tv_sec = RPC_TOUT_TCP; | ||
149 | info->timeout.tv_usec = 0; | ||
150 | info->send_sz = 0; | ||
151 | @@ -513,23 +503,18 @@ void rpc_destroy_tcp_client(struct conn_info *info) | ||
152 | |||
153 | int rpc_portmap_getclient(struct conn_info *info, | ||
154 | const char *host, struct sockaddr *addr, size_t addr_len, | ||
155 | - const char *proto, unsigned int option) | ||
156 | + int proto, unsigned int option) | ||
157 | { | ||
158 | - struct protoent *pe_proto; | ||
159 | CLIENT *client; | ||
160 | int ret; | ||
161 | |||
162 | - pe_proto = getprotobyname(proto); | ||
163 | - if (!pe_proto) | ||
164 | - return -ENOENT; | ||
165 | - | ||
166 | info->host = host; | ||
167 | info->addr = addr; | ||
168 | info->addr_len = addr_len; | ||
169 | info->program = PMAPPROG; | ||
170 | info->port = PMAPPORT; | ||
171 | info->version = PMAPVERS; | ||
172 | - info->proto = pe_proto; | ||
173 | + info->proto = proto; | ||
174 | info->send_sz = RPCSMALLMSGSIZE; | ||
175 | info->recv_sz = RPCSMALLMSGSIZE; | ||
176 | info->timeout.tv_sec = PMAP_TOUT_UDP; | ||
177 | @@ -537,7 +522,7 @@ int rpc_portmap_getclient(struct conn_info *info, | ||
178 | info->close_option = option; | ||
179 | info->client = NULL; | ||
180 | |||
181 | - if (pe_proto->p_proto == IPPROTO_TCP) | ||
182 | + if (info->proto == IPPROTO_TCP) | ||
183 | info->timeout.tv_sec = PMAP_TOUT_TCP; | ||
184 | |||
185 | ret = create_client(info, &client); | ||
186 | @@ -555,7 +540,7 @@ int rpc_portmap_getport(struct conn_info *info, | ||
187 | struct conn_info pmap_info; | ||
188 | CLIENT *client; | ||
189 | enum clnt_stat status; | ||
190 | - int proto = info->proto->p_proto; | ||
191 | + int proto = info->proto; | ||
192 | int ret; | ||
193 | |||
194 | memset(&pmap_info, 0, sizeof(struct conn_info)); | ||
195 | @@ -633,13 +618,13 @@ int rpc_ping_proto(struct conn_info *info) | ||
196 | { | ||
197 | CLIENT *client; | ||
198 | enum clnt_stat status; | ||
199 | - int proto = info->proto->p_proto; | ||
200 | + int proto = info->proto; | ||
201 | int ret; | ||
202 | |||
203 | if (info->client) | ||
204 | client = info->client; | ||
205 | else { | ||
206 | - if (info->proto->p_proto == IPPROTO_UDP) { | ||
207 | + if (info->proto == IPPROTO_UDP) { | ||
208 | info->send_sz = UDPMSGSIZE; | ||
209 | info->recv_sz = UDPMSGSIZE; | ||
210 | } | ||
211 | @@ -688,7 +673,7 @@ int rpc_ping_proto(struct conn_info *info) | ||
212 | |||
213 | static unsigned int __rpc_ping(const char *host, | ||
214 | unsigned long version, | ||
215 | - char *proto, | ||
216 | + int proto, | ||
217 | long seconds, long micros, | ||
218 | unsigned int option) | ||
219 | { | ||
220 | @@ -696,6 +681,7 @@ static unsigned int __rpc_ping(const char *host, | ||
221 | struct conn_info info; | ||
222 | struct pmap parms; | ||
223 | |||
224 | + info.proto = proto; | ||
225 | info.host = host; | ||
226 | info.addr = NULL; | ||
227 | info.addr_len = 0; | ||
228 | @@ -710,13 +696,9 @@ static unsigned int __rpc_ping(const char *host, | ||
229 | |||
230 | status = RPC_PING_FAIL; | ||
231 | |||
232 | - info.proto = getprotobyname(proto); | ||
233 | - if (!info.proto) | ||
234 | - return status; | ||
235 | - | ||
236 | parms.pm_prog = NFS_PROGRAM; | ||
237 | parms.pm_vers = version; | ||
238 | - parms.pm_prot = info.proto->p_proto; | ||
239 | + parms.pm_prot = info.proto; | ||
240 | parms.pm_port = 0; | ||
241 | |||
242 | status = rpc_portmap_getport(&info, &parms, &info.port); | ||
243 | @@ -734,19 +716,19 @@ int rpc_ping(const char *host, long seconds, long micros, unsigned int option) | ||
244 | unsigned long vers2 = NFS2_VERSION; | ||
245 | unsigned int status; | ||
246 | |||
247 | - status = __rpc_ping(host, vers2, "udp", seconds, micros, option); | ||
248 | + status = __rpc_ping(host, vers2, IPPROTO_UDP, seconds, micros, option); | ||
249 | if (status > 0) | ||
250 | return RPC_PING_V2 | RPC_PING_UDP; | ||
251 | |||
252 | - status = __rpc_ping(host, vers3, "udp", seconds, micros, option); | ||
253 | + status = __rpc_ping(host, vers3, IPPROTO_UDP, seconds, micros, option); | ||
254 | if (status > 0) | ||
255 | return RPC_PING_V3 | RPC_PING_UDP; | ||
256 | |||
257 | - status = __rpc_ping(host, vers2, "tcp", seconds, micros, option); | ||
258 | + status = __rpc_ping(host, vers2, IPPROTO_TCP, seconds, micros, option); | ||
259 | if (status > 0) | ||
260 | return RPC_PING_V2 | RPC_PING_TCP; | ||
261 | |||
262 | - status = __rpc_ping(host, vers3, "tcp", seconds, micros, option); | ||
263 | + status = __rpc_ping(host, vers3, IPPROTO_TCP, seconds, micros, option); | ||
264 | if (status > 0) | ||
265 | return RPC_PING_V3 | RPC_PING_TCP; | ||
266 | |||
267 | @@ -769,7 +751,7 @@ int rpc_time(const char *host, | ||
268 | double taken; | ||
269 | struct timeval start, end; | ||
270 | struct timezone tz; | ||
271 | - char *proto = (ping_proto & RPC_PING_UDP) ? "udp" : "tcp"; | ||
272 | + int proto = (ping_proto & RPC_PING_UDP) ? IPPROTO_UDP : IPPROTO_TCP; | ||
273 | unsigned long vers = ping_vers; | ||
274 | |||
275 | gettimeofday(&start, &tz); | ||
276 | @@ -791,12 +773,12 @@ static int rpc_get_exports_proto(struct conn_info *info, exports *exp) | ||
277 | { | ||
278 | CLIENT *client; | ||
279 | enum clnt_stat status; | ||
280 | - int proto = info->proto->p_proto; | ||
281 | + int proto = info->proto; | ||
282 | unsigned int option = info->close_option; | ||
283 | int vers_entry; | ||
284 | int ret; | ||
285 | |||
286 | - if (info->proto->p_proto == IPPROTO_UDP) { | ||
287 | + if (info->proto == IPPROTO_UDP) { | ||
288 | info->send_sz = UDPMSGSIZE; | ||
289 | info->recv_sz = UDPMSGSIZE; | ||
290 | } | ||
291 | @@ -903,11 +885,9 @@ exports rpc_get_exports(const char *host, long seconds, long micros, unsigned in | ||
292 | parms.pm_port = 0; | ||
293 | |||
294 | /* Try UDP first */ | ||
295 | - info.proto = getprotobyname("udp"); | ||
296 | - if (!info.proto) | ||
297 | - goto try_tcp; | ||
298 | + info.proto = IPPROTO_UDP; | ||
299 | |||
300 | - parms.pm_prot = info.proto->p_proto; | ||
301 | + parms.pm_prot = info.proto; | ||
302 | |||
303 | status = rpc_portmap_getport(&info, &parms, &info.port); | ||
304 | if (status < 0) | ||
305 | @@ -920,11 +900,9 @@ exports rpc_get_exports(const char *host, long seconds, long micros, unsigned in | ||
306 | return exportlist; | ||
307 | |||
308 | try_tcp: | ||
309 | - info.proto = getprotobyname("tcp"); | ||
310 | - if (!info.proto) | ||
311 | - return NULL; | ||
312 | + info.proto = IPPROTO_TCP; | ||
313 | |||
314 | - parms.pm_prot = info.proto->p_proto; | ||
315 | + parms.pm_prot = info.proto; | ||
316 | |||
317 | status = rpc_portmap_getport(&info, &parms, &info.port); | ||
318 | if (status < 0) | ||
319 | diff --git a/modules/replicated.c b/modules/replicated.c | ||
320 | index 6b96320..dbd5513 100644 | ||
321 | --- a/modules/replicated.c | ||
322 | +++ b/modules/replicated.c | ||
323 | @@ -419,7 +419,7 @@ void free_host_list(struct host **list) | ||
324 | |||
325 | static unsigned int get_nfs_info(unsigned logopt, struct host *host, | ||
326 | struct conn_info *pm_info, struct conn_info *rpc_info, | ||
327 | - const char *proto, unsigned int version, int port) | ||
328 | + int proto, unsigned int version, int port) | ||
329 | { | ||
330 | unsigned int random_selection = host->options & MOUNT_FLAG_RANDOM_SELECT; | ||
331 | unsigned int use_weight_only = host->options & MOUNT_FLAG_USE_WEIGHT_ONLY; | ||
332 | @@ -433,22 +433,18 @@ static unsigned int get_nfs_info(unsigned logopt, struct host *host, | ||
333 | int status, count = 0; | ||
334 | |||
335 | if (host->addr) | ||
336 | - debug(logopt, "called with host %s(%s) proto %s version 0x%x", | ||
337 | + debug(logopt, "called with host %s(%s) proto %d version 0x%x", | ||
338 | host->name, get_addr_string(host->addr, buf, len), | ||
339 | proto, version); | ||
340 | else | ||
341 | debug(logopt, | ||
342 | - "called for host %s proto %s version 0x%x", | ||
343 | + "called for host %s proto %d version 0x%x", | ||
344 | host->name, proto, version); | ||
345 | |||
346 | - rpc_info->proto = getprotobyname(proto); | ||
347 | - if (!rpc_info->proto) | ||
348 | - return 0; | ||
349 | - | ||
350 | + rpc_info->proto = proto; | ||
351 | memset(&parms, 0, sizeof(struct pmap)); | ||
352 | - | ||
353 | parms.pm_prog = NFS_PROGRAM; | ||
354 | - parms.pm_prot = rpc_info->proto->p_proto; | ||
355 | + parms.pm_prot = proto; | ||
356 | |||
357 | if (!(version & NFS4_REQUESTED)) | ||
358 | goto v3_ver; | ||
359 | @@ -479,7 +475,7 @@ static unsigned int get_nfs_info(unsigned logopt, struct host *host, | ||
360 | } | ||
361 | } | ||
362 | |||
363 | - if (rpc_info->proto->p_proto == IPPROTO_UDP) | ||
364 | + if (rpc_info->proto == IPPROTO_UDP) | ||
365 | status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS4_VERSION); | ||
366 | else | ||
367 | status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS4_VERSION); | ||
368 | @@ -540,7 +536,7 @@ v3_ver: | ||
369 | goto v2_ver; | ||
370 | } | ||
371 | |||
372 | - if (rpc_info->proto->p_proto == IPPROTO_UDP) | ||
373 | + if (rpc_info->proto == IPPROTO_UDP) | ||
374 | status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS3_VERSION); | ||
375 | else | ||
376 | status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS3_VERSION); | ||
377 | @@ -587,7 +583,7 @@ v2_ver: | ||
378 | goto done_ver; | ||
379 | } | ||
380 | |||
381 | - if (rpc_info->proto->p_proto == IPPROTO_UDP) | ||
382 | + if (rpc_info->proto == IPPROTO_UDP) | ||
383 | status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS2_VERSION); | ||
384 | else | ||
385 | status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS2_VERSION); | ||
386 | @@ -618,7 +614,7 @@ v2_ver: | ||
387 | } | ||
388 | |||
389 | done_ver: | ||
390 | - if (rpc_info->proto->p_proto == IPPROTO_UDP) { | ||
391 | + if (rpc_info->proto == IPPROTO_UDP) { | ||
392 | rpc_destroy_udp_client(rpc_info); | ||
393 | rpc_destroy_udp_client(pm_info); | ||
394 | } else { | ||
395 | @@ -675,7 +671,7 @@ static int get_vers_and_cost(unsigned logopt, struct host *host, | ||
396 | |||
397 | if (version & TCP_REQUESTED) { | ||
398 | supported = get_nfs_info(logopt, host, | ||
399 | - &pm_info, &rpc_info, "tcp", vers, port); | ||
400 | + &pm_info, &rpc_info, IPPROTO_TCP, vers, port); | ||
401 | if (IS_ERR(supported)) { | ||
402 | if (ERR(supported) == EHOSTUNREACH || | ||
403 | ERR(supported) == ETIMEDOUT) | ||
404 | @@ -688,7 +684,7 @@ static int get_vers_and_cost(unsigned logopt, struct host *host, | ||
405 | |||
406 | if (version & UDP_REQUESTED) { | ||
407 | supported = get_nfs_info(logopt, host, | ||
408 | - &pm_info, &rpc_info, "udp", vers, port); | ||
409 | + &pm_info, &rpc_info, IPPROTO_UDP, vers, port); | ||
410 | if (IS_ERR(supported)) { | ||
411 | if (!ret && ERR(supported) == ETIMEDOUT) | ||
412 | return ret; | ||
413 | @@ -709,7 +705,7 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, | ||
414 | socklen_t len = INET6_ADDRSTRLEN; | ||
415 | char buf[len + 1]; | ||
416 | struct conn_info pm_info, rpc_info; | ||
417 | - const char *proto; | ||
418 | + int proto; | ||
419 | unsigned int vers; | ||
420 | struct timeval start, end; | ||
421 | struct timezone tz; | ||
422 | @@ -748,10 +744,10 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, | ||
423 | * So, we do the conversion here. | ||
424 | */ | ||
425 | if (version & UDP_SELECTED_MASK) { | ||
426 | - proto = "udp"; | ||
427 | + proto = IPPROTO_UDP; | ||
428 | version >>= 8; | ||
429 | } else | ||
430 | - proto = "tcp"; | ||
431 | + proto = IPPROTO_TCP; | ||
432 | |||
433 | switch (version) { | ||
434 | case NFS2_SUPPORTED: | ||
435 | @@ -768,9 +764,7 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, | ||
436 | return 0; | ||
437 | } | ||
438 | |||
439 | - rpc_info.proto = getprotobyname(proto); | ||
440 | - if (!rpc_info.proto) | ||
441 | - return 0; | ||
442 | + rpc_info.proto = proto; | ||
443 | |||
444 | if (port > 0) | ||
445 | rpc_info.port = port; | ||
446 | @@ -786,14 +780,14 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, | ||
447 | |||
448 | memset(&parms, 0, sizeof(struct pmap)); | ||
449 | parms.pm_prog = NFS_PROGRAM; | ||
450 | - parms.pm_prot = rpc_info.proto->p_proto; | ||
451 | + parms.pm_prot = rpc_info.proto; | ||
452 | parms.pm_vers = vers; | ||
453 | ret = rpc_portmap_getport(&pm_info, &parms, &rpc_info.port); | ||
454 | if (ret < 0) | ||
455 | goto done; | ||
456 | } | ||
457 | |||
458 | - if (rpc_info.proto->p_proto == IPPROTO_UDP) | ||
459 | + if (rpc_info.proto == IPPROTO_UDP) | ||
460 | status = rpc_udp_getclient(&rpc_info, NFS_PROGRAM, vers); | ||
461 | else | ||
462 | status = rpc_tcp_getclient(&rpc_info, NFS_PROGRAM, vers); | ||
463 | @@ -815,7 +809,7 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, | ||
464 | } | ||
465 | } | ||
466 | done: | ||
467 | - if (rpc_info.proto->p_proto == IPPROTO_UDP) { | ||
468 | + if (rpc_info.proto == IPPROTO_UDP) { | ||
469 | rpc_destroy_udp_client(&rpc_info); | ||
470 | rpc_destroy_udp_client(&pm_info); | ||
471 | } else { | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch new file mode 100644 index 0000000000..6a1a49e62c --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch | |||
@@ -0,0 +1,149 @@ | |||
1 | autofs-5.0.7 - workaround missing GNU versionsort extension | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | alphasort() and scandir() are specified in POSIX.1-2008, versionsort() | ||
6 | is a GNU extension. When versionsort isn't available fallback to using | ||
7 | alphasort. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 + | ||
11 | configure | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
12 | configure.in | 6 +++++ | ||
13 | include/config.h.in | 3 ++ | ||
14 | modules/lookup_dir.c | 5 ++++ | ||
15 | 5 files changed, 77 insertions(+), 0 deletions(-) | ||
16 | |||
17 | |||
18 | diff --git a/CHANGELOG b/CHANGELOG | ||
19 | index 4eaa9f9..39388a5 100644 | ||
20 | --- a/CHANGELOG | ||
21 | +++ b/CHANGELOG | ||
22 | @@ -27,6 +27,7 @@ | ||
23 | - lib/defaults.c: use WITH_LDAP conditional around LDAP types. | ||
24 | - make yellow pages support optional. | ||
25 | - modules/replicated.c: use sin6_addr.s6_addr32. | ||
26 | +- workaround missing GNU versionsort extension. | ||
27 | |||
28 | 25/07/2012 autofs-5.0.7 | ||
29 | ======================= | ||
30 | diff --git a/configure b/configure | ||
31 | index cf6428c..c1423d8 100755 | ||
32 | --- a/configure | ||
33 | +++ b/configure | ||
34 | @@ -4010,6 +4010,68 @@ $as_echo "yes" >&6; } | ||
35 | KRB5_FLAGS=`$KRB5_CONFIG --cflags` | ||
36 | fi | ||
37 | |||
38 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing versionsort" >&5 | ||
39 | +$as_echo_n "checking for library containing versionsort... " >&6; } | ||
40 | +if ${ac_cv_search_versionsort+:} false; then : | ||
41 | + $as_echo_n "(cached) " >&6 | ||
42 | +else | ||
43 | + ac_func_search_save_LIBS=$LIBS | ||
44 | +cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
45 | +/* end confdefs.h. */ | ||
46 | + | ||
47 | +/* Override any GCC internal prototype to avoid an error. | ||
48 | + Use char because int might match the return type of a GCC | ||
49 | + builtin and then its argument prototype would still apply. */ | ||
50 | +#ifdef __cplusplus | ||
51 | +extern "C" | ||
52 | +#endif | ||
53 | +char versionsort (); | ||
54 | +int | ||
55 | +main () | ||
56 | +{ | ||
57 | +return versionsort (); | ||
58 | + ; | ||
59 | + return 0; | ||
60 | +} | ||
61 | +_ACEOF | ||
62 | +for ac_lib in '' ; do | ||
63 | + if test -z "$ac_lib"; then | ||
64 | + ac_res="none required" | ||
65 | + else | ||
66 | + ac_res=-l$ac_lib | ||
67 | + LIBS="-l$ac_lib $ac_func_search_save_LIBS" | ||
68 | + fi | ||
69 | + if ac_fn_c_try_link "$LINENO"; then : | ||
70 | + ac_cv_search_versionsort=$ac_res | ||
71 | +fi | ||
72 | +rm -f core conftest.err conftest.$ac_objext \ | ||
73 | + conftest$ac_exeext | ||
74 | + if ${ac_cv_search_versionsort+:} false; then : | ||
75 | + break | ||
76 | +fi | ||
77 | +done | ||
78 | +if ${ac_cv_search_versionsort+:} false; then : | ||
79 | + | ||
80 | +else | ||
81 | + ac_cv_search_versionsort=no | ||
82 | +fi | ||
83 | +rm conftest.$ac_ext | ||
84 | +LIBS=$ac_func_search_save_LIBS | ||
85 | +fi | ||
86 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_versionsort" >&5 | ||
87 | +$as_echo "$ac_cv_search_versionsort" >&6; } | ||
88 | +ac_res=$ac_cv_search_versionsort | ||
89 | +if test "$ac_res" != no; then : | ||
90 | + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | ||
91 | + | ||
92 | +fi | ||
93 | + | ||
94 | +if test "$ac_cv_search_versionsort" = "no"; then | ||
95 | + | ||
96 | +$as_echo "#define WITHOUT_VERSIONSORT 1" >>confdefs.h | ||
97 | + | ||
98 | +fi | ||
99 | + | ||
100 | # | ||
101 | # glibc/libc 6 new libraries | ||
102 | # | ||
103 | diff --git a/configure.in b/configure.in | ||
104 | index 363c376..4029375 100644 | ||
105 | --- a/configure.in | ||
106 | +++ b/configure.in | ||
107 | @@ -163,6 +163,12 @@ AF_SLOPPY_MOUNT() | ||
108 | AF_CHECK_LIBXML() | ||
109 | AF_CHECK_KRB5() | ||
110 | |||
111 | +AC_SEARCH_LIBS([versionsort],[]) | ||
112 | +if test "$ac_cv_search_versionsort" = "no"; then | ||
113 | + AC_DEFINE(WITHOUT_VERSIONSORT, 1, | ||
114 | + [Define if your C library does not provide versionsort]) | ||
115 | +fi | ||
116 | + | ||
117 | # | ||
118 | # glibc/libc 6 new libraries | ||
119 | # | ||
120 | diff --git a/include/config.h.in b/include/config.h.in | ||
121 | index 7f1c5b5..a2a05a8 100644 | ||
122 | --- a/include/config.h.in | ||
123 | +++ b/include/config.h.in | ||
124 | @@ -135,6 +135,9 @@ | ||
125 | /* Define to 1 to use the libtirpc tsd usage workaround */ | ||
126 | #undef TIRPC_WORKAROUND | ||
127 | |||
128 | +/* Define if your C library does not provide versionsort */ | ||
129 | +#undef WITHOUT_VERSIONSORT | ||
130 | + | ||
131 | /* Define if using the dmalloc debugging malloc package */ | ||
132 | #undef WITH_DMALLOC | ||
133 | |||
134 | diff --git a/modules/lookup_dir.c b/modules/lookup_dir.c | ||
135 | index 33901c0..07471b7 100644 | ||
136 | --- a/modules/lookup_dir.c | ||
137 | +++ b/modules/lookup_dir.c | ||
138 | @@ -39,6 +39,11 @@ | ||
139 | #define AUTOFS_DIR_EXT ".autofs" | ||
140 | #define AUTOFS_DIR_EXTSIZ (sizeof(AUTOFS_DIR_EXT) - 1) | ||
141 | |||
142 | +/* Work around non-GNU systems that don't provide versionsort */ | ||
143 | +#ifdef WITHOUT_VERSIONSORT | ||
144 | +#define versionsort alphasort | ||
145 | +#endif | ||
146 | + | ||
147 | struct lookup_context { | ||
148 | const char *mapname; | ||
149 | }; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-additional-distros.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-additional-distros.patch new file mode 100644 index 0000000000..6a35843cea --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-additional-distros.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | --- autofs-4.1.4/samples/rc.autofs.in~ 2005-04-11 06:30:54.000000000 -0500 | ||
2 | +++ autofs-4.1.4/samples/rc.autofs.in 2007-04-07 13:18:44.000000000 -0500 | ||
3 | @@ -43,6 +43,9 @@ | ||
4 | system=debian | ||
5 | elif [ -f /etc/redhat-release ]; then | ||
6 | system=redhat | ||
7 | +elif [ -f /etc/issue ] && grep -q "^SlugOS\|Yocto" /etc/issue ; then | ||
8 | + # SlugOS and Yocto behave like Debian, at least for autofs purposes. | ||
9 | + system=debian | ||
10 | else | ||
11 | echo "$0: Unknown system, please port and contact autofs@linux.kernel.org" 1>&2 | ||
12 | exit 1 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/cross.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/cross.patch new file mode 100644 index 0000000000..8f1af625f0 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/cross.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | Index: autofs-5.0.7/aclocal.m4 | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/aclocal.m4 2012-10-28 04:45:07.000000000 -0700 | ||
4 | +++ autofs-5.0.7/aclocal.m4 2012-10-28 10:47:53.263996910 -0700 | ||
5 | @@ -7,6 +7,8 @@ | ||
6 | AC_DEFUN(AF_PATH_INCLUDE, | ||
7 | [AC_PATH_PROGS($1,$2,$3,$4) | ||
8 | if test -n "$$1"; then | ||
9 | + AH_TEMPLATE([HAVE_$1], [Have $2]) | ||
10 | + AH_TEMPLATE([PATH_$1], [Have $2]) | ||
11 | AC_DEFINE(HAVE_$1,1,[define if you have $1]) | ||
12 | AC_DEFINE_UNQUOTED(PATH_$1, "$$1", [define if you have $1]) | ||
13 | HAVE_$1=1 | ||
14 | Index: autofs-5.0.7/configure.in | ||
15 | =================================================================== | ||
16 | --- autofs-5.0.7.orig/configure.in 2012-10-28 04:45:06.000000000 -0700 | ||
17 | +++ autofs-5.0.7/configure.in 2012-10-28 10:50:07.580000628 -0700 | ||
18 | @@ -301,13 +301,15 @@ | ||
19 | cat > pietest.c <<EOF | ||
20 | int main(void) { return 0; } | ||
21 | EOF | ||
22 | +AF_tmp_ldflags="$LDFLAGS" | ||
23 | +AF_tmp_cflags="$CFLAGS" | ||
24 | CFLAGS=-fPIE | ||
25 | LDFLAGS=-pie | ||
26 | DAEMON_CFLAGS= | ||
27 | DAEMON_LDFLAGS= | ||
28 | AC_MSG_CHECKING([whether gcc -fPIE works]) | ||
29 | -AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])], | ||
30 | - [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no]) | ||
31 | +AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])], | ||
32 | + [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no]) | ||
33 | AC_MSG_RESULT([$gcc_supports_pie]) | ||
34 | if test $gcc_supports_pie = yes ; then | ||
35 | DAEMON_CFLAGS="-fPIE" | ||
36 | @@ -316,6 +318,8 @@ | ||
37 | rm -f pietest.c | ||
38 | AC_SUBST(DAEMON_CFLAGS) | ||
39 | AC_SUBST(DAEMON_LDFLAGS) | ||
40 | +CFLAGS="${AF_tmp_cflags}" | ||
41 | +LDFLAGS="${AF_tmp_ldflags}" | ||
42 | |||
43 | # | ||
44 | # Enable ability to access value in external env variable | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/fix_disable_ldap.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/fix_disable_ldap.patch new file mode 100644 index 0000000000..31c8510a69 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/fix_disable_ldap.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | autofs: fails to compile with openldap disabled | ||
2 | |||
3 | As of 5.0.6, it appears that changes were introduced so that | ||
4 | if you compile with openldap disabled and openldap headers are not | ||
5 | available, then autofs fails to build. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Amy Fong <amy.fong@windriver.com> | ||
10 | -- | ||
11 | lookup_ldap.h | 4 ++++ | ||
12 | 1 file changed, 4 insertions(+) | ||
13 | |||
14 | --- | ||
15 | include/lookup_ldap.h | 4 ++++ | ||
16 | 1 file changed, 4 insertions(+) | ||
17 | |||
18 | --- a/include/lookup_ldap.h | ||
19 | +++ b/include/lookup_ldap.h | ||
20 | @@ -1,7 +1,9 @@ | ||
21 | #ifndef LOOKUP_LDAP_H | ||
22 | #define LOOKUP_LDAP_H | ||
23 | |||
24 | +#ifdef WITH_LDAP | ||
25 | #include <ldap.h> | ||
26 | +#endif | ||
27 | |||
28 | #ifdef WITH_SASL | ||
29 | #include <openssl/ssl.h> | ||
30 | @@ -109,10 +111,12 @@ | ||
31 | |||
32 | #define LDAP_AUTH_USESIMPLE 0x0008 | ||
33 | |||
34 | +#ifdef WITH_LDAP | ||
35 | /* lookup_ldap.c */ | ||
36 | LDAP *init_ldap_connection(unsigned logopt, const char *uri, struct lookup_context *ctxt); | ||
37 | int unbind_ldap_connection(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt); | ||
38 | int authtype_requires_creds(const char *authtype); | ||
39 | +#endif | ||
40 | |||
41 | #ifdef WITH_SASL | ||
42 | /* cyrus-sasl.c */ | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc-name-clash-backout.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc-name-clash-backout.patch new file mode 100644 index 0000000000..104724014d --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc-name-clash-backout.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Index: autofs-5.0.7/lib/rpc_subs.c | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/lib/rpc_subs.c 2012-07-24 23:05:26.000000000 -0700 | ||
4 | +++ autofs-5.0.7/lib/rpc_subs.c 2012-10-28 14:47:49.008382116 -0700 | ||
5 | @@ -34,16 +34,6 @@ | ||
6 | #include <pthread.h> | ||
7 | #include <poll.h> | ||
8 | |||
9 | -#ifdef WITH_LIBTIRPC | ||
10 | -#undef auth_destroy | ||
11 | -#define auth_destroy(auth) \ | ||
12 | - do { \ | ||
13 | - int refs; \ | ||
14 | - if ((refs = auth_put((auth))) == 0) \ | ||
15 | - ((*((auth)->ah_ops->ah_destroy))(auth));\ | ||
16 | - } while (0) | ||
17 | -#endif | ||
18 | - | ||
19 | #include "mount.h" | ||
20 | #include "rpc_subs.h" | ||
21 | #include "automount.h" | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc.patch new file mode 100644 index 0000000000..04f52c6f0e --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Index: autofs-5.0.7/aclocal.m4 | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/aclocal.m4 2012-10-28 13:17:45.504237027 -0700 | ||
4 | +++ autofs-5.0.7/aclocal.m4 2012-10-28 13:20:50.108242739 -0700 | ||
5 | @@ -403,7 +403,7 @@ | ||
6 | # save current flags | ||
7 | af_check_libtirpc_save_cflags="$CFLAGS" | ||
8 | af_check_libtirpc_save_ldflags="$LDFLAGS" | ||
9 | -CFLAGS="$CFLAGS -I/usr/include/tirpc" | ||
10 | +CFLAGS="$CFLAGS -I=/usr/include/tirpc" | ||
11 | LDFLAGS="$LDFLAGS -ltirpc" | ||
12 | |||
13 | AC_TRY_LINK( | ||
14 | Index: autofs-5.0.7/Makefile.rules | ||
15 | =================================================================== | ||
16 | --- autofs-5.0.7.orig/Makefile.rules 2012-10-28 13:17:45.308237022 -0700 | ||
17 | +++ autofs-5.0.7/Makefile.rules 2012-10-28 13:21:25.720242803 -0700 | ||
18 | @@ -48,7 +48,7 @@ | ||
19 | LDFLAGS += -lpthread | ||
20 | |||
21 | ifdef TIRPCLIB | ||
22 | -CFLAGS += -I/usr/include/tirpc | ||
23 | +CFLAGS += -I=/usr/include/tirpc | ||
24 | LDFLAGS += $(TIRPCLIB) | ||
25 | endif | ||
26 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/no-bash.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/no-bash.patch new file mode 100644 index 0000000000..cf03635270 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/no-bash.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Index: autofs-5.0.7/samples/auto.net | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/samples/auto.net 2012-07-24 23:05:26.000000000 -0700 | ||
4 | +++ autofs-5.0.7/samples/auto.net 2012-10-28 10:44:25.035991715 -0700 | ||
5 | @@ -1,4 +1,4 @@ | ||
6 | -#!/bin/bash | ||
7 | +#!/bin/sh | ||
8 | |||
9 | # This file must be executable to work! chmod 755! | ||
10 | |||
11 | Index: autofs-5.0.7/samples/auto.smb | ||
12 | =================================================================== | ||
13 | --- autofs-5.0.7.orig/samples/auto.smb 2012-07-24 23:05:26.000000000 -0700 | ||
14 | +++ autofs-5.0.7/samples/auto.smb 2012-10-28 10:44:25.035991715 -0700 | ||
15 | @@ -1,4 +1,4 @@ | ||
16 | -#!/bin/bash | ||
17 | +#!/bin/sh | ||
18 | |||
19 | # This file must be executable to work! chmod 755! | ||
20 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs_5.0.7.bb b/meta-networking/recipes-daemons/autofs/autofs_5.0.7.bb new file mode 100644 index 0000000000..501e40acdd --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs_5.0.7.bb | |||
@@ -0,0 +1,112 @@ | |||
1 | SUMMARY = "Kernel based automounter for linux" | ||
2 | SECTION = "base" | ||
3 | LICENSE = "GPL-2.0" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" | ||
5 | |||
6 | PR = "r6" | ||
7 | |||
8 | DEPENDS += "libtirpc flex-native bison-native" | ||
9 | |||
10 | inherit autotools systemd | ||
11 | |||
12 | SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.bz2 \ | ||
13 | file://autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch \ | ||
14 | file://autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch \ | ||
15 | file://autofs-5.0.7-fix-ipv6-proximity-calculation.patch \ | ||
16 | file://autofs-5.0.7-fix-parse-buffer-initialization.patch \ | ||
17 | file://autofs-5.0.7-fix-typo-in-automount-8.patch \ | ||
18 | file://autofs-5.0.7-include-usage-in-usage-message.patch \ | ||
19 | file://autofs-5.0.7-dont-wait-forever-to-restart.patch \ | ||
20 | file://autofs-5.0.7-add-timeout-option-description-to-man-page.patch \ | ||
21 | file://autofs-5.0.7-fix-null-map-entry-order-handling.patch \ | ||
22 | file://autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch \ | ||
23 | file://autofs-5.0.7-configure-in-allow-cross-compilation.patch \ | ||
24 | file://autofs-5.0.7-README-update-mailing-list-subscription-info.patch \ | ||
25 | file://autofs-5.0.7-allow-non-root-user-to-check-status.patch \ | ||
26 | file://autofs-5.0.7-configure-allow-cross-compilation-update.patch \ | ||
27 | file://autofs-5.0.6-fix-recursive-mount-deadlock.patch \ | ||
28 | file://autofs-5.0.6-increase-file-map-read-buffer-size.patch \ | ||
29 | file://autofs-5.0.7-handle-new-location-of-systemd.patch \ | ||
30 | file://autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch \ | ||
31 | file://autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch \ | ||
32 | file://autofs-5.0.7-fix-nobind-man-page-description.patch \ | ||
33 | file://autofs-5.0.7-fix-submount-offset-delete.patch \ | ||
34 | file://autofs-5.0.7-fix-init-script-status-return.patch \ | ||
35 | file://autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch \ | ||
36 | file://autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch \ | ||
37 | file://autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch \ | ||
38 | file://autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch \ | ||
39 | file://autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch \ | ||
40 | file://autofs-5.0.7-make-yellow-pages-support-optional.patch \ | ||
41 | file://autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch \ | ||
42 | file://autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch \ | ||
43 | file://autofs-5.0.7-dont-fail-on-master-map-self-include.patch \ | ||
44 | file://autofs-5.0.7-fix-wildcard-multi-map-regression.patch \ | ||
45 | file://autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch \ | ||
46 | file://autofs-5.0.7-depricate-nosymlink-pseudo-option.patch \ | ||
47 | file://autofs-5.0.7-add-symlink-pseudo-option.patch \ | ||
48 | file://autofs-5.0.7-update-kernel-include-files.patch \ | ||
49 | file://autofs-5.0.7-fix-requires-in-spec-file.patch \ | ||
50 | file://autofs-5.0.7-fix-libtirpc-build-option.patch \ | ||
51 | file://autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch \ | ||
52 | file://autofs-5.0.7-document-browse-option-in-man-page.patch \ | ||
53 | file://autofs-5.0.7-fix-automounter-support-on-parisc.patch \ | ||
54 | file://autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch \ | ||
55 | file://Makefile.rules-cross.patch \ | ||
56 | file://no-bash.patch \ | ||
57 | file://cross.patch \ | ||
58 | file://libtirpc.patch \ | ||
59 | file://libtirpc-name-clash-backout.patch \ | ||
60 | file://autofs-5.0.7-do-not-check-for-modprobe.patch \ | ||
61 | file://fix_disable_ldap.patch \ | ||
62 | file://autofs-5.0.7-fix-lib-deps.patch \ | ||
63 | file://0001-systemd-allow-with-systemd-to-take-a-path-arg.patch \ | ||
64 | " | ||
65 | |||
66 | SRC_URI[md5sum] = "bc46838dece83c02d800ff144ed9f431" | ||
67 | SRC_URI[sha256sum] = "08c4304d8076dc80c14df559bc5fd821b67ef3457b245f61068bd053d8f94ccc" | ||
68 | |||
69 | inherit update-rc.d pkgconfig | ||
70 | |||
71 | INITSCRIPT_NAME = "autofs" | ||
72 | INITSCRIPT_PARAMS = "defaults" | ||
73 | |||
74 | # FIXME: modules/Makefile has crappy rules that don't obey LDFLAGS | ||
75 | CFLAGS += "${LDFLAGS}" | ||
76 | |||
77 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd,systemd" | ||
78 | |||
79 | PACKAGECONFIG ?= "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" | ||
80 | |||
81 | EXTRA_OEMAKE = "DONTSTRIP=1" | ||
82 | EXTRA_OECONF += "--disable-mount-locking \ | ||
83 | --enable-ignore-busy --with-openldap=no \ | ||
84 | --with-sasl=no --with-libtirpc=yes \ | ||
85 | --with-path=${STAGING_BINDIR_NATIVE} \ | ||
86 | " | ||
87 | CACHED_CONFIGUREVARS = "ac_cv_path_RANLIB=${RANLIB} \ | ||
88 | ac_cv_path_RPCGEN=rpcgen \ | ||
89 | " | ||
90 | |||
91 | do_configure_prepend () { | ||
92 | sed -e "s:filagdir:flagdir:" -i configure.in | ||
93 | if [ ! -e acinclude.m4 ]; then | ||
94 | cp aclocal.m4 acinclude.m4 | ||
95 | fi | ||
96 | } | ||
97 | |||
98 | do_install_append () { | ||
99 | if [ -d ${D}/run ]; then | ||
100 | rmdir ${D}/run | ||
101 | fi | ||
102 | if [ -d ${D}${localstatedir}/run ]; then | ||
103 | rmdir ${D}${localstatedir}/run | ||
104 | fi | ||
105 | } | ||
106 | |||
107 | INSANE_SKIP_${PN} = "dev-so" | ||
108 | |||
109 | RPROVIDES_${PN} += "${PN}-systemd" | ||
110 | RREPLACES_${PN} += "${PN}-systemd" | ||
111 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
112 | SYSTEMD_SERVICE_${PN} = "autofs.service" | ||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch new file mode 100644 index 0000000000..3fa8431c34 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Fix hardcoded libdir. | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | plugins/Makefile.am | 2 +- | ||
8 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/plugins/Makefile.am b/plugins/Makefile.am | ||
11 | index b00915f..25262a1 100644 | ||
12 | --- a/plugins/Makefile.am | ||
13 | +++ b/plugins/Makefile.am | ||
14 | @@ -62,7 +62,7 @@ plugindir = @plugindir@ | ||
15 | |||
16 | common_sources = plugin_common.c plugin_common.h | ||
17 | |||
18 | -sasldir = $(prefix)/lib/sasl2 | ||
19 | +sasldir = $(libdir)/sasl2 | ||
20 | sasl_LTLIBRARIES = @SASL_MECHS@ | ||
21 | EXTRA_LTLIBRARIES = libplain.la libanonymous.la libkerberos4.la libcrammd5.la \ | ||
22 | libgs2.la libgssapiv2.la libdigestmd5.la liblogin.la libsrp.la libotp.la \ | ||
23 | -- | ||
24 | 1.7.4.1 | ||
25 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch new file mode 100644 index 0000000000..6407721ae3 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | Avoid to call AC_TRY_RUN | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Avoid to call AC_TRY_RUN to check if GSSAPI libraries support SPNEGO | ||
6 | on cross-compile environment by definition AC_ARG_ENABLE enable-spnego | ||
7 | |||
8 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
9 | --- | ||
10 | cmulocal/sasl2.m4 | 13 ++++++++++++- | ||
11 | 1 file changed, 12 insertions(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/cmulocal/sasl2.m4 b/cmulocal/sasl2.m4 | ||
14 | index 3c2841a..a5ecf81 100644 | ||
15 | --- a/cmulocal/sasl2.m4 | ||
16 | +++ b/cmulocal/sasl2.m4 | ||
17 | @@ -281,6 +281,17 @@ if test "$gssapi" != no; then | ||
18 | |||
19 | cmu_save_LIBS="$LIBS" | ||
20 | LIBS="$LIBS $GSSAPIBASE_LIBS" | ||
21 | + AC_ARG_ENABLE([spnego], | ||
22 | + [AC_HELP_STRING([--enable-spnego=<DIR>], | ||
23 | + [enable SPNEGO support in GSSAPI libraries [no]])], | ||
24 | + [spnego=$enableval], | ||
25 | + [spnego=no]) | ||
26 | + | ||
27 | + if test "$spnego" = no; then | ||
28 | + echo "no" | ||
29 | + elif test "$spnego" = yes; then | ||
30 | + AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO]) | ||
31 | + else | ||
32 | AC_MSG_CHECKING([for SPNEGO support in GSSAPI libraries]) | ||
33 | AC_TRY_RUN([ | ||
34 | #ifdef HAVE_GSSAPI_H | ||
35 | @@ -308,7 +319,7 @@ int main(void) | ||
36 | AC_MSG_RESULT(yes) ], | ||
37 | AC_MSG_RESULT(no)) | ||
38 | LIBS="$cmu_save_LIBS" | ||
39 | - | ||
40 | + fi | ||
41 | else | ||
42 | AC_MSG_RESULT([disabled]) | ||
43 | fi | ||
44 | -- | ||
45 | 1.7.10.4 | ||
46 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff new file mode 100644 index 0000000000..8eff5a8bdd --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff | |||
@@ -0,0 +1,14 @@ | |||
1 | Author: Fabian Fagerholm <fabbe@debian.org> | ||
2 | Description: Fix linking with libsasldb.a when saslauthd is built with sasldb | ||
3 | support. | ||
4 | --- a/saslauthd/configure.in | ||
5 | +++ b/saslauthd/configure.in | ||
6 | @@ -77,7 +77,7 @@ if test "$authsasldb" != no; then | ||
7 | AC_DEFINE(AUTH_SASLDB,[],[Include SASLdb Support]) | ||
8 | SASL_DB_PATH_CHECK() | ||
9 | SASL_DB_CHECK() | ||
10 | - SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.al" | ||
11 | + SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.a" | ||
12 | fi | ||
13 | |||
14 | AC_ARG_ENABLE(httpform, [ --enable-httpform enable HTTP form authentication [[no]] ], | ||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff new file mode 100644 index 0000000000..2e5b1750d0 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff | |||
@@ -0,0 +1,27 @@ | |||
1 | Author: Fabian Fagerholm <fabbe@debian.org> | ||
2 | Description: This patch makes sure the non-PIC version of libsasldb.a, which | ||
3 | is created out of non-PIC objects, is not going to overwrite the PIC version, | ||
4 | which is created out of PIC objects. The PIC version is placed in .libs, and | ||
5 | the non-PIC version in the current directory. This ensures that both non-PIC | ||
6 | and PIC versions are available in the correct locations. | ||
7 | --- a/lib/Makefile.am | ||
8 | +++ b/lib/Makefile.am | ||
9 | @@ -78,7 +78,7 @@ endif | ||
10 | |||
11 | libsasl2.a: libsasl2.la $(SASL_STATIC_OBJS) | ||
12 | @echo adding static plugins and dependencies | ||
13 | - $(AR) cru .libs/$@ $(SASL_STATIC_OBJS) | ||
14 | + $(AR) cru $@ $(SASL_STATIC_OBJS) | ||
15 | @for i in ./libsasl2.la ../sasldb/libsasldb.la ../plugins/lib*.la; do \ | ||
16 | if test ! -f $$i; then continue; fi; . $$i; \ | ||
17 | for j in $$dependency_libs foo; do \ | ||
18 | --- a/sasldb/Makefile.am | ||
19 | +++ b/sasldb/Makefile.am | ||
20 | @@ -63,6 +63,6 @@ libsasldb_a_SOURCES = | ||
21 | EXTRA_libsasldb_a_SOURCES = | ||
22 | |||
23 | libsasldb.a: libsasldb.la $(SASL_DB_BACKEND_STATIC) | ||
24 | - $(AR) cru .libs/$@ $(SASL_DB_BACKEND_STATIC) | ||
25 | + $(AR) cru $@ $(SASL_DB_BACKEND_STATIC) | ||
26 | |||
27 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch new file mode 100644 index 0000000000..ecbab845d0 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 92d72789c811b0d55f624a8bac5ccc4412f5996e Mon Sep 17 00:00:00 2001 | ||
2 | From: Ken Murchison <murch@andrew.cmu.edu> | ||
3 | Date: Thu, 20 Dec 2012 18:14:50 -0500 | ||
4 | Subject: [PATCH] sasl.h: #include <stddef.h> for size_t on NetBSD | ||
5 | |||
6 | This patch was imported from git://git.cyrusimap.org/cyrus-sasl | ||
7 | commit 67a188693796a14e3a76ac603104807fbbfddfc4 | ||
8 | |||
9 | Upstream-Status: Backport | ||
10 | |||
11 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | ||
12 | --- | ||
13 | include/sasl.h | 2 ++ | ||
14 | 1 file changed, 2 insertions(+) | ||
15 | |||
16 | diff --git a/include/sasl.h b/include/sasl.h | ||
17 | index fef4d51..8b8a63f 100755 | ||
18 | --- a/include/sasl.h | ||
19 | +++ b/include/sasl.h | ||
20 | @@ -121,6 +121,8 @@ | ||
21 | #ifndef SASL_H | ||
22 | #define SASL_H 1 | ||
23 | |||
24 | +#include <stddef.h> /* For size_t */ | ||
25 | + | ||
26 | /* Keep in sync with win32/common.mak */ | ||
27 | #define SASL_VERSION_MAJOR 2 | ||
28 | #define SASL_VERSION_MINOR 1 | ||
29 | -- | ||
30 | 1.8.3.2 | ||
31 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb new file mode 100644 index 0000000000..e3ff56d821 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb | |||
@@ -0,0 +1,69 @@ | |||
1 | SUMMARY = "Generic client/server library for SASL authentication" | ||
2 | SECTION = "console/network" | ||
3 | DEPENDS = "openssl virtual/db" | ||
4 | LICENSE = "BSD" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=3f55e0974e3d6db00ca6f57f2d206396" | ||
6 | |||
7 | SRC_URI = "ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-${PV}.tar.gz \ | ||
8 | file://avoid-to-call-AC_TRY_RUN.patch \ | ||
9 | file://Fix-hardcoded-libdir.patch \ | ||
10 | file://debian_patches_0009_sasldb_al.diff \ | ||
11 | file://debian_patches_0014_avoid_pic_overwrite.diff \ | ||
12 | file://sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch \ | ||
13 | " | ||
14 | |||
15 | inherit autotools pkgconfig useradd | ||
16 | |||
17 | EXTRA_OECONF += "--with-dblib=berkeley \ | ||
18 | --with-bdb-libdir=${STAGING_LIBDIR} \ | ||
19 | --with-bdb-incdir=${STAGING_INCDIR} \ | ||
20 | --with-bdb=db-5.3 \ | ||
21 | --with-plugindir="${libdir}/sasl2/" \ | ||
22 | andrew_cv_runpath_switch=none" | ||
23 | |||
24 | PACKAGECONFIG ??= "ntlm \ | ||
25 | ${@base_contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \ | ||
26 | ${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ | ||
27 | " | ||
28 | PACKAGECONFIG[gssapi] = "--enable-gssapi=yes,--enable-gssapi=no,krb5," | ||
29 | PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam," | ||
30 | PACKAGECONFIG[opie] = "--with-opie,--without-opie,opie," | ||
31 | PACKAGECONFIG[des] = "--with-des,--without-des,," | ||
32 | PACKAGECONFIG[ldap] = "--with-ldap=${STAGING_LIBDIR} --enable-ldapdb,--without-ldap --disable-ldapdb,openldap," | ||
33 | PACKAGECONFIG[ntlm] = "--with-ntlm,--without-ntlm,," | ||
34 | |||
35 | CFLAGS += "-fPIC" | ||
36 | |||
37 | do_configure_prepend () { | ||
38 | rm -f acinclude.m4 config/libtool.m4 | ||
39 | |||
40 | # make it be able to work with db 5.0 version | ||
41 | local sed_files="sasldb/db_berkeley.c utils/dbconverter-2.c" | ||
42 | for sed_file in $sed_files; do | ||
43 | sed -i 's#DB_VERSION_MAJOR == 4.*#(&) || DB_VERSION_MAJOR == 5#' $sed_file | ||
44 | done | ||
45 | } | ||
46 | |||
47 | do_compile_prepend () { | ||
48 | cd include | ||
49 | ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} makemd5.c -o makemd5 | ||
50 | touch makemd5.o makemd5.lo makemd5 | ||
51 | cd .. | ||
52 | } | ||
53 | |||
54 | USERADD_PACKAGES = "${PN}-bin" | ||
55 | GROUPADD_PARAM_${PN}-bin = "--system mail" | ||
56 | USERADD_PARAM_${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus" | ||
57 | |||
58 | SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425" | ||
59 | SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3" | ||
60 | |||
61 | PACKAGES =+ "${PN}-bin" | ||
62 | |||
63 | FILES_${PN} += "${libdir}/sasl2/*.so*" | ||
64 | FILES_${PN}-bin += "${bindir}" | ||
65 | FILES_${PN}-dev += "${libdir}/sasl2/*.la" | ||
66 | FILES_${PN}-dbg += "${libdir}/sasl2/.debug" | ||
67 | FILES_${PN}-staticdev += "${libdir}/sasl2/*.a" | ||
68 | |||
69 | INSANE_SKIP_${PN} += "dev-so" | ||
diff --git a/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch b/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch new file mode 100644 index 0000000000..4967bed1e7 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | proftpd tries to get the IP address from the hostname. | ||
4 | Unluckily now the hostname is not properly configured in /etc/hosts. | ||
5 | We can use this patch as a workaround. | ||
6 | |||
7 | Author: Dexuan Cui <dexuan.cui@intel.com> | ||
8 | Tue Oct 25 12:59:27 CST 2011 | ||
9 | |||
10 | --- proftpd-1.3.3c.orig/sample-configurations/basic.conf | ||
11 | +++ proftpd-1.3.3c/sample-configurations/basic.conf | ||
12 | @@ -7,6 +7,9 @@ | ||
13 | ServerType standalone | ||
14 | DefaultServer on | ||
15 | |||
16 | +#By default we bind to all interfaces. | ||
17 | +DefaultAddress 0.0.0.0 | ||
18 | + | ||
19 | # Port 21 is the standard FTP port. | ||
20 | Port 21 | ||
21 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch b/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch new file mode 100644 index 0000000000..c64535cac8 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | close RequireValidShell check | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | close RequireValidShell check since we like to make /bin/false as shell | ||
6 | for ftp user | ||
7 | |||
8 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
9 | --- | ||
10 | sample-configurations/basic.conf | 1 + | ||
11 | 1 file changed, 1 insertion(+) | ||
12 | |||
13 | diff --git a/sample-configurations/basic.conf b/sample-configurations/basic.conf | ||
14 | index 314eb79..abcb284 100644 | ||
15 | --- a/sample-configurations/basic.conf | ||
16 | +++ b/sample-configurations/basic.conf | ||
17 | @@ -53,6 +53,7 @@ AllowOverwrite on | ||
18 | # We want clients to be able to login with "anonymous" as well as "ftp" | ||
19 | UserAlias anonymous ftp | ||
20 | |||
21 | + RequireValidShell off | ||
22 | # Limit the maximum number of anonymous logins | ||
23 | MaxClients 10 | ||
24 | |||
25 | -- | ||
26 | 1.7.10.4 | ||
27 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/contrib.patch b/meta-networking/recipes-daemons/proftpd/files/contrib.patch new file mode 100644 index 0000000000..7e2a8e3ce0 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/contrib.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | The contrib directory now contains its own Makefile which is | ||
2 | used during installation. It was required to pass DESTDIR through | ||
3 | when it gets called from the base Makefile. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com> | ||
8 | --- | ||
9 | Makefile.in | 2 +- | ||
10 | contrib/Makefile.in | 6 +++--- | ||
11 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
12 | |||
13 | diff --git a/Makefile.in b/Makefile.in | ||
14 | index 5b2e683..ee72fe1 100644 | ||
15 | --- a/Makefile.in | ||
16 | +++ b/Makefile.in | ||
17 | @@ -120,7 +120,7 @@ install-modules: $(DESTDIR)$(libexecdir) $(DESTDIR)$(sysconfdir) | ||
18 | test -z "$(SHARED_MODULE_OBJS)" -a -z "$(SHARED_MODULE_DIRS)" -a -z "$(STATIC_MODULE_DIRS)" || (cd modules/ && $(MAKE) install) | ||
19 | |||
20 | install-utils: $(DESTDIR)$(sbindir) $(DESTDIR)$(bindir) | ||
21 | - cd contrib/ && $(MAKE) install-utils | ||
22 | + cd contrib/ && $(MAKE) DESTDIR=${DESTDIR} install-utils | ||
23 | $(INSTALL_BIN) ftpcount $(DESTDIR)$(bindir)/ftpcount | ||
24 | $(INSTALL_BIN) ftpdctl $(DESTDIR)$(bindir)/ftpdctl | ||
25 | $(INSTALL_SBIN) ftpscrub $(DESTDIR)$(sbindir)/ftpscrub | ||
26 | diff --git a/contrib/Makefile.in b/contrib/Makefile.in | ||
27 | index 5bcc038..51d248c 100644 | ||
28 | --- a/contrib/Makefile.in | ||
29 | +++ b/contrib/Makefile.in | ||
30 | @@ -18,6 +18,6 @@ Makefile: Makefile.in ../config.status | ||
31 | cd ../ && ./config.status | ||
32 | |||
33 | install-utils: | ||
34 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd | ||
35 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail | ||
36 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota | ||
37 | + $(INSTALL) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd | ||
38 | + $(INSTALL) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail | ||
39 | + $(INSTALL) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota | ||
40 | -- | ||
41 | 1.7.9.5 | ||
42 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/default b/meta-networking/recipes-daemons/proftpd/files/default new file mode 100644 index 0000000000..b31f36ce25 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/default | |||
@@ -0,0 +1,9 @@ | |||
1 | # Defaults for proftpd initscript | ||
2 | |||
3 | # Master system-wide proftpd switch. The initscript | ||
4 | # will not run if it is not set to yes. | ||
5 | RUN="yes" | ||
6 | |||
7 | # Default options. | ||
8 | # For more exhaustive logging, try "-d 3". | ||
9 | OPTIONS="" | ||
diff --git a/meta-networking/recipes-daemons/proftpd/files/make.patch b/meta-networking/recipes-daemons/proftpd/files/make.patch new file mode 100644 index 0000000000..c5ff0136da --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/make.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | Index: proftpd-1.3.2/Makefile.in | ||
4 | =================================================================== | ||
5 | --- proftpd-1.3.2.orig/Makefile.in | ||
6 | +++ proftpd-1.3.2/Makefile.in | ||
7 | @@ -76,7 +76,6 @@ check: proftpd$(EXEEXT) | ||
8 | $(DESTDIR)$(localedir) $(DESTDIR)$(includedir) $(DESTDIR)$(includedir)/proftpd $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir) $(DESTDIR)$(libdir)/proftpd $(DESTDIR)$(libexecdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir) $(DESTDIR)$(rundir) $(DESTDIR)$(bindir) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man8: | ||
9 | @if [ ! -d $@ ]; then \ | ||
10 | mkdir -p $@; \ | ||
11 | - chown $(INSTALL_USER):$(INSTALL_GROUP) $@; \ | ||
12 | chmod 0755 $@; \ | ||
13 | fi | ||
14 | |||
15 | @@ -86,7 +85,6 @@ install-proftpd: proftpd $(DESTDIR)$(inc | ||
16 | rm -f $(DESTDIR)$(sbindir)/in.proftpd ; \ | ||
17 | fi | ||
18 | ln -s proftpd $(DESTDIR)$(sbindir)/in.proftpd | ||
19 | - -chown -h $(INSTALL_USER):$(INSTALL_GROUP) $(DESTDIR)$(sbindir)/in.proftpd | ||
20 | |||
21 | install-libs: $(DESTDIR)$(libdir)/proftpd | ||
22 | cd lib/ && $(MAKE) install | ||
23 | @@ -121,11 +119,11 @@ install-utils: $(DESTDIR)$(sbindir) $(DE | ||
24 | $(INSTALL_SBIN) ftpshut $(DESTDIR)$(sbindir)/ftpshut | ||
25 | $(INSTALL_BIN) ftptop $(DESTDIR)$(bindir)/ftptop | ||
26 | $(INSTALL_BIN) ftpwho $(DESTDIR)$(bindir)/ftpwho | ||
27 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs | ||
28 | + $(INSTALL) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs | ||
29 | |||
30 | install-conf: $(DESTDIR)$(sysconfdir) | ||
31 | if [ ! -f $(DESTDIR)$(sysconfdir)/proftpd.conf ] ; then \ | ||
32 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644 \ | ||
33 | + $(INSTALL) -m 0644 \ | ||
34 | $(top_srcdir)/sample-configurations/basic.conf \ | ||
35 | $(DESTDIR)$(sysconfdir)/proftpd.conf ; \ | ||
36 | fi | ||
37 | Index: proftpd-1.3.2/Make.rules.in | ||
38 | =================================================================== | ||
39 | --- proftpd-1.3.2.orig/Make.rules.in | ||
40 | +++ proftpd-1.3.2/Make.rules.in | ||
41 | @@ -29,9 +29,9 @@ UTILS_LIBS=@UTILS_LIBS@ @LIBS@ | ||
42 | INSTALL=@INSTALL@ | ||
43 | INSTALL_USER=@install_user@ | ||
44 | INSTALL_GROUP=@install_group@ | ||
45 | -INSTALL_BIN=$(INSTALL) @INSTALL_STRIP@ -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 | ||
46 | -INSTALL_SBIN=$(INSTALL) @INSTALL_STRIP@ -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 | ||
47 | -INSTALL_MAN=$(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644 | ||
48 | +INSTALL_BIN=$(INSTALL) -m 0755 | ||
49 | +INSTALL_SBIN=$(INSTALL) -m 0755 | ||
50 | +INSTALL_MAN=$(INSTALL) -m 0644 | ||
51 | |||
52 | RM=rm -f | ||
53 | SHELL=/bin/sh | ||
54 | Index: proftpd-1.3.2/lib/libcap/Makefile | ||
55 | =================================================================== | ||
56 | --- proftpd-1.3.2.orig/lib/libcap/Makefile | ||
57 | +++ proftpd-1.3.2/lib/libcap/Makefile | ||
58 | @@ -26,7 +26,7 @@ OBJS=$(addsuffix .o, $(FILES)) | ||
59 | all: $(LIBNAME) | ||
60 | |||
61 | _makenames: _makenames.c cap_names.sed | ||
62 | - $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ | ||
63 | + $(BUILD_CC) $(CFLAGS) $(LDFLAGS) $< -o $@ | ||
64 | |||
65 | cap_names.h: _makenames | ||
66 | ./_makenames > cap_names.h | ||
diff --git a/meta-networking/recipes-daemons/proftpd/files/move-pidfile-to-var-run.patch b/meta-networking/recipes-daemons/proftpd/files/move-pidfile-to-var-run.patch new file mode 100644 index 0000000000..953bbddef0 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/move-pidfile-to-var-run.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | move pidfile to /var/run | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | configure | 2 +- | ||
8 | configure.in | 2 +- | ||
9 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/configure b/configure | ||
12 | index e6268f5..ebed38e 100755 | ||
13 | --- a/configure | ||
14 | +++ b/configure | ||
15 | @@ -33587,7 +33587,7 @@ cat >>confdefs.h <<_ACEOF | ||
16 | _ACEOF | ||
17 | |||
18 | cat >>confdefs.h <<_ACEOF | ||
19 | -#define PR_PID_FILE_PATH "`eval echo "${localstatedir}/proftpd.pid"`" | ||
20 | +#define PR_PID_FILE_PATH "`eval echo "${localstatedir}/run/proftpd.pid"`" | ||
21 | _ACEOF | ||
22 | |||
23 | |||
24 | diff --git a/configure.in b/configure.in | ||
25 | index df9186a..e2ae868 100644 | ||
26 | --- a/configure.in | ||
27 | +++ b/configure.in | ||
28 | @@ -2790,7 +2790,7 @@ AC_DEFINE_UNQUOTED(PR_LOCALE_DIR, "`eval echo "${locale_dir}"`") | ||
29 | |||
30 | AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`") | ||
31 | AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/proftpd.conf"`") | ||
32 | -AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/proftpd.pid"`") | ||
33 | +AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/run/proftpd.pid"`") | ||
34 | |||
35 | prefix="$pr_saved_prefix" | ||
36 | exec_prefix="$pr_saved_exec_prefix" | ||
37 | -- | ||
38 | 1.7.10.4 | ||
39 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/move-runfile-to-var-run.patch b/meta-networking/recipes-daemons/proftpd/files/move-runfile-to-var-run.patch new file mode 100644 index 0000000000..1561ed80e3 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/move-runfile-to-var-run.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | redefine PR_RUN_DIR as ${localstatedir}/run | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | configure | 2 +- | ||
8 | configure.in | 2 +- | ||
9 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/configure b/configure | ||
12 | index ebed38e..445d5bc 100755 | ||
13 | --- a/configure | ||
14 | +++ b/configure | ||
15 | @@ -33579,7 +33579,7 @@ _ACEOF | ||
16 | |||
17 | |||
18 | cat >>confdefs.h <<_ACEOF | ||
19 | -#define PR_RUN_DIR "`eval echo "${localstatedir}"`" | ||
20 | +#define PR_RUN_DIR "`eval echo "${localstatedir}"/run/`" | ||
21 | _ACEOF | ||
22 | |||
23 | cat >>confdefs.h <<_ACEOF | ||
24 | diff --git a/configure.in b/configure.in | ||
25 | index c17929c..df9186a 100644 | ||
26 | --- a/configure.in | ||
27 | +++ b/configure.in | ||
28 | @@ -2788,7 +2788,7 @@ locale_dir="`eval echo ${localedir}`" | ||
29 | locale_dir="`eval echo ${locale_dir}`" | ||
30 | AC_DEFINE_UNQUOTED(PR_LOCALE_DIR, "`eval echo "${locale_dir}"`") | ||
31 | |||
32 | -AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`") | ||
33 | +AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}/run"`") | ||
34 | AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/proftpd.conf"`") | ||
35 | AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/run/proftpd.pid"`") | ||
36 | |||
37 | -- | ||
38 | 1.7.10.4 | ||
39 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init b/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init new file mode 100644 index 0000000000..01c998c924 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init | |||
@@ -0,0 +1,220 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: proftpd | ||
5 | # Required-Start: $remote_fs $syslog $local_fs $network | ||
6 | # Required-Stop: $remote_fs $syslog $local_fs $network | ||
7 | # Should-Start: $named | ||
8 | # Should-Stop: $named | ||
9 | # Default-Start: 2 3 4 5 | ||
10 | # Default-Stop: 0 1 6 | ||
11 | # Short-Description: Starts ProFTPD daemon | ||
12 | # Description: This script runs the FTP service offered | ||
13 | # by the ProFTPD daemon | ||
14 | ### END INIT INFO | ||
15 | |||
16 | # Start the proftpd FTP daemon. | ||
17 | |||
18 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
19 | DAEMON=/usr/sbin/proftpd | ||
20 | NAME=proftpd | ||
21 | |||
22 | # Defaults | ||
23 | RUN="no" | ||
24 | OPTIONS="" | ||
25 | CONFIG_FILE=/etc/proftpd.conf | ||
26 | |||
27 | PIDFILE=`grep -i '^pidfile' $CONFIG_FILE|awk '{ print $2 }'` | ||
28 | if [ "x$PIDFILE" = "x" ]; | ||
29 | then | ||
30 | PIDFILE=/var/run/proftpd.pid | ||
31 | fi | ||
32 | |||
33 | # Read config (will override defaults) | ||
34 | [ -r /etc/default/proftpd ] && . /etc/default/proftpd | ||
35 | |||
36 | trap "" 1 | ||
37 | trap "" 15 | ||
38 | |||
39 | test -f $DAEMON || exit 0 | ||
40 | |||
41 | . /etc/init.d/functions | ||
42 | |||
43 | # | ||
44 | # Servertype could be inetd|standalone|none. | ||
45 | # In all cases check against inetd and xinetd support. | ||
46 | # | ||
47 | if ! egrep -qi "^[[:space:]]*ServerType.*standalone" $CONFIG_FILE | ||
48 | then | ||
49 | if egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.conf 2>/dev/null || \ | ||
50 | egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.d/* 2>/dev/null || \ | ||
51 | egrep -qi "^ftp.*/usr/sbin/proftpd" /etc/inetd.conf 2>/dev/null | ||
52 | then | ||
53 | RUN="no" | ||
54 | INETD="yes" | ||
55 | else | ||
56 | if ! egrep -qi "^[[:space:]]*ServerType.*inetd" $CONFIG_FILE | ||
57 | then | ||
58 | RUN="yes" | ||
59 | INETD="no" | ||
60 | else | ||
61 | RUN="no" | ||
62 | INETD="no" | ||
63 | fi | ||
64 | fi | ||
65 | fi | ||
66 | |||
67 | # /var/run could be on a tmpfs | ||
68 | |||
69 | [ ! -d /var/run/proftpd ] && mkdir /var/run/proftpd | ||
70 | |||
71 | inetd_check() | ||
72 | { | ||
73 | if [ ! -x /usr/sbin/inetd -a ! -x /usr/sbin/xinetd ]; then | ||
74 | echo "Neither inetd nor xinetd appears installed: check your configuration." | ||
75 | fi | ||
76 | } | ||
77 | |||
78 | start() | ||
79 | { | ||
80 | set -e | ||
81 | echo -n "Starting ftp server $NAME... " | ||
82 | start-stop-daemon --start --quiet --pidfile "$PIDFILE" --oknodo --exec $DAEMON -- -c $CONFIG_FILE $OPTIONS | ||
83 | echo "done." | ||
84 | } | ||
85 | |||
86 | signal() | ||
87 | { | ||
88 | |||
89 | if [ "$1" = "stop" ]; then | ||
90 | SIGNAL="TERM" | ||
91 | echo -n "Stopping ftp server $NAME... " | ||
92 | else | ||
93 | if [ "$1" = "reload" ]; then | ||
94 | SIGNAL="HUP" | ||
95 | echo -n "Reloading ftp server $NAME... " | ||
96 | else | ||
97 | echo "ERR: wrong parameter given to signal()" | ||
98 | exit 1 | ||
99 | fi | ||
100 | fi | ||
101 | if [ -f "$PIDFILE" ]; then | ||
102 | start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE" | ||
103 | if [ $? = 0 ]; then | ||
104 | echo "done." | ||
105 | return | ||
106 | else | ||
107 | SIGNAL="KILL" | ||
108 | start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE" | ||
109 | if [ $? != 0 ]; then | ||
110 | echo | ||
111 | [ $2 != 0 ] || exit 0 | ||
112 | else | ||
113 | echo "done." | ||
114 | return | ||
115 | fi | ||
116 | fi | ||
117 | if [ "$SIGNAL" = "KILL" ]; then | ||
118 | rm -f "$PIDFILE" | ||
119 | fi | ||
120 | else | ||
121 | echo "done." | ||
122 | return | ||
123 | fi | ||
124 | } | ||
125 | |||
126 | case "$1" in | ||
127 | start) | ||
128 | if [ "x$RUN" = "xyes" ] ; then | ||
129 | start | ||
130 | else | ||
131 | if [ "x$INETD" = "xyes" ] ; then | ||
132 | echo "ProFTPD is started from inetd/xinetd." | ||
133 | inetd_check | ||
134 | else | ||
135 | echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration." | ||
136 | fi | ||
137 | fi | ||
138 | ;; | ||
139 | |||
140 | force-start) | ||
141 | if [ "x$INETD" = "xyes" ] ; then | ||
142 | echo "Warning: ProFTPD is started from inetd/xinetd (trying to start anyway)." | ||
143 | inetd_check | ||
144 | fi | ||
145 | start | ||
146 | ;; | ||
147 | |||
148 | stop) | ||
149 | if [ "x$RUN" = "xyes" ] ; then | ||
150 | signal stop 0 | ||
151 | else | ||
152 | if [ "x$INETD" = "xyes" ] ; then | ||
153 | echo "ProFTPD is started from inetd/xinetd." | ||
154 | inetd_check | ||
155 | else | ||
156 | echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration." | ||
157 | fi | ||
158 | fi | ||
159 | ;; | ||
160 | |||
161 | force-stop) | ||
162 | if [ "x$INETD" = "xyes" ] ; then | ||
163 | echo "Warning: ProFTPD is started from inetd/xinetd (trying to kill anyway)." | ||
164 | inetd_check | ||
165 | fi | ||
166 | signal stop 0 | ||
167 | ;; | ||
168 | |||
169 | reload) | ||
170 | signal reload 0 | ||
171 | ;; | ||
172 | |||
173 | force-reload|restart) | ||
174 | if [ "x$RUN" = "xyes" ] ; then | ||
175 | signal stop 1 | ||
176 | sleep 2 | ||
177 | start | ||
178 | else | ||
179 | if [ "x$INETD" = "xyes" ] ; then | ||
180 | echo "ProFTPD is started from inetd/xinetd." | ||
181 | inetd_check | ||
182 | else | ||
183 | echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration." | ||
184 | fi | ||
185 | fi | ||
186 | ;; | ||
187 | |||
188 | status) | ||
189 | if [ "x$INETD" = "xyes" ] ; then | ||
190 | echo "ProFTPD is started from inetd/xinetd." | ||
191 | inetd_check | ||
192 | exit 0 | ||
193 | else | ||
194 | if [ -f "$PIDFILE" ]; then | ||
195 | pid=$(cat $PIDFILE) | ||
196 | else | ||
197 | pid="x" | ||
198 | fi | ||
199 | if [ `pidof proftpd|grep "$pid"|wc -l` -ne 0 ] ; then | ||
200 | echo "ProFTPD is started in standalone mode, currently running." | ||
201 | exit 0 | ||
202 | else | ||
203 | echo "ProFTPD is started in standalone mode, currently not running." | ||
204 | exit 3 | ||
205 | fi | ||
206 | fi | ||
207 | ;; | ||
208 | |||
209 | check-config) | ||
210 | $DAEMON -t >/dev/null && echo "ProFTPD configuration OK" && exit 0 | ||
211 | exit 1 | ||
212 | ;; | ||
213 | |||
214 | *) | ||
215 | echo "Usage: /etc/init.d/$NAME {start|status|force-start|stop|force-stop|reload|restart|force-reload|check-config}" | ||
216 | exit 1 | ||
217 | ;; | ||
218 | esac | ||
219 | |||
220 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb new file mode 100644 index 0000000000..cfbadfb089 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb | |||
@@ -0,0 +1,70 @@ | |||
1 | SUMMARY = "Secure and configurable FTP server" | ||
2 | SECTION = "console/network" | ||
3 | HOMEPAGE = "http://www.proftpd.org" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=fb0d1484d11915fa88a6a7702f1dc184" | ||
6 | |||
7 | PR = "r3" | ||
8 | |||
9 | SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${BPN}-${PV}.tar.gz \ | ||
10 | file://make.patch \ | ||
11 | file://basic.conf.patch \ | ||
12 | file://contrib.patch \ | ||
13 | file://proftpd-basic.init \ | ||
14 | file://default \ | ||
15 | file://move-pidfile-to-var-run.patch \ | ||
16 | file://close-RequireValidShell-check.patch \ | ||
17 | file://move-runfile-to-var-run.patch \ | ||
18 | " | ||
19 | |||
20 | SRC_URI[md5sum] = "0871e0b93c9c3c88ca950b6d9a04aed2" | ||
21 | SRC_URI[sha256sum] = "9f659585cea90fc6af34a0ffae4a90e4ed37abe92dbd9b6c311f95a436c961cb" | ||
22 | |||
23 | inherit autotools useradd update-rc.d | ||
24 | |||
25 | PACKAGECONFIG ??= "" | ||
26 | PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses,--disable-curses --disable-ncurses,ncurses" | ||
27 | |||
28 | EXTRA_OECONF = "--disable-cap \ | ||
29 | --disable-auth-pam \ | ||
30 | " | ||
31 | |||
32 | # proftpd uses libltdl which currently makes configuring using | ||
33 | # autotools.bbclass a pain... | ||
34 | do_configure () { | ||
35 | oe_runconf | ||
36 | } | ||
37 | |||
38 | FTPUSER = "ftp" | ||
39 | FTPGROUP = "ftp" | ||
40 | |||
41 | do_install () { | ||
42 | oe_runmake DESTDIR=${D} install | ||
43 | rmdir ${D}${libdir}/proftpd ${D}${datadir}/locale | ||
44 | [ -d ${D}${libexecdir} ] && rmdir ${D}${libexecdir} | ||
45 | sed -i '/ *User[ \t]*/s/ftp/${FTPUSER}/' ${D}${sysconfdir}/proftpd.conf | ||
46 | sed -i '/ *Group[ \t]*/s/ftp/${FTPGROUP}/' ${D}${sysconfdir}/proftpd.conf | ||
47 | install -d ${D}${sysconfdir}/init.d | ||
48 | install -m 0755 ${WORKDIR}/proftpd-basic.init ${D}${sysconfdir}/init.d/proftpd | ||
49 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
50 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
51 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
52 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/proftpd | ||
53 | |||
54 | install -d ${D}${sysconfdir}/default | ||
55 | install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/proftpd | ||
56 | |||
57 | # create the pub directory | ||
58 | mkdir -p ${D}/home/${FTPUSER}/pub/ | ||
59 | chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub | ||
60 | } | ||
61 | |||
62 | INITSCRIPT_NAME = "proftpd" | ||
63 | INITSCRIPT_PARAM = "defaults 85 15" | ||
64 | |||
65 | USERADD_PACKAGES = "${PN}" | ||
66 | GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}" | ||
67 | USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \ | ||
68 | --shell /bin/false ${FTPUSER}" | ||
69 | |||
70 | FILES_${PN} += "/home/${FTPUSER}" | ||
diff --git a/meta-networking/recipes-daemons/ptpd/ptpd-2.2.0/ld-as-needed.patch b/meta-networking/recipes-daemons/ptpd/ptpd-2.2.0/ld-as-needed.patch new file mode 100644 index 0000000000..7d5251be3d --- /dev/null +++ b/meta-networking/recipes-daemons/ptpd/ptpd-2.2.0/ld-as-needed.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | Patch from http://patch-tracker.debian.org/package/ptpd | ||
2 | |||
3 | Description: Fix ld --as-needed | ||
4 | This patch fixes the order of gcc arguments to fix ld --as-needed | ||
5 | Author: Roland Stigge <stigge@antcom.de> | ||
6 | Bug-Debian: http://bugs.debian.org/607583 | ||
7 | |||
8 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
9 | --- | ||
10 | src/Makefile | 4 ++-- | ||
11 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/src/Makefile b/src/Makefile | ||
14 | index a672625..88a2fc8 100644 | ||
15 | --- a/src/Makefile | ||
16 | +++ b/src/Makefile | ||
17 | @@ -40,7 +40,7 @@ CFLAGS += -DDBG_SIGUSR2_CHANGE_DEBUG | ||
18 | |||
19 | CFLAGS += -DPTP_EXPERIMENTAL | ||
20 | |||
21 | -LDFLAGS+= -lm -lrt | ||
22 | +LIBS += -lm -lrt | ||
23 | |||
24 | PROG = ptpd | ||
25 | SRCS = ptpd.c arith.c bmc.c protocol.c display.c\ | ||
26 | @@ -63,7 +63,7 @@ TAGFILES = GPATH GRTAGS GSYMS GTAGS cscope.in.out cscope.out cscope.po.out | ||
27 | all: $(PROG) | ||
28 | |||
29 | $(PROG): $(OBJS) | ||
30 | - $(CC) -o $@ $(OBJS) $(LDFLAGS) | ||
31 | + $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) | ||
32 | |||
33 | $(OBJS): $(HDRS) | ||
34 | |||
35 | -- | ||
36 | 1.7.4 | ||
37 | |||
diff --git a/meta-networking/recipes-daemons/ptpd/ptpd_2.2.0.bb b/meta-networking/recipes-daemons/ptpd/ptpd_2.2.0.bb new file mode 100644 index 0000000000..f2e895d1ca --- /dev/null +++ b/meta-networking/recipes-daemons/ptpd/ptpd_2.2.0.bb | |||
@@ -0,0 +1,28 @@ | |||
1 | SUMMARY = "The PTP daemon (PTPd)" | ||
2 | DESCRIPTION = "The PTP daemon (PTPd) implements the Precision Time protocol (PTP) as \ | ||
3 | defined by the relevant IEEE 1588 standard. PTP Version 1 implements IEEE-1588-2002, \ | ||
4 | and PTP Version 2 implements IEEE-1588-2008. PTP was developed to provide very precise \ | ||
5 | time coordination of LAN connected computers." | ||
6 | HOMEPAGE = "http://sourceforge.net/projects/ptpd" | ||
7 | SECTION = "network" | ||
8 | LICENSE = "BSD" | ||
9 | LIC_FILES_CHKSUM = "file://../COPYRIGHT;md5=3d8ac2c46c116bce2d2ad838b6cf3491" | ||
10 | |||
11 | PR = "r1" | ||
12 | |||
13 | SRC_URI = "http://downloads.sourceforge.net/project/ptpd/ptpd/${PV}/ptpd-${PV}.tar.gz \ | ||
14 | file://ld-as-needed.patch;striplevel=2 \ | ||
15 | " | ||
16 | |||
17 | SRC_URI[md5sum] = "c63a3a149d30c710773ccb02df5782a3" | ||
18 | SRC_URI[sha256sum] = "f2266a22db84318d8b9ce266ea83772c03438c31f4993fa9643fa675a07c26b4" | ||
19 | |||
20 | S = "${WORKDIR}/ptpd-${PV}/src" | ||
21 | |||
22 | EXTRA_OEMAKE = "" | ||
23 | |||
24 | do_install() { | ||
25 | install -d ${D}${bindir} ${D}${mandir}/man8 | ||
26 | install -m 0755 ptpd2 ${D}${bindir} | ||
27 | install -m 0644 ptpd2.8 ${D}${mandir}/man8 | ||
28 | } | ||
diff --git a/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch new file mode 100644 index 0000000000..54088b0447 --- /dev/null +++ b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From cffca7cb7c055f82ced316ddee90bb701b85b92d Mon Sep 17 00:00:00 2001 | ||
2 | From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> | ||
3 | Date: Tue, 10 Jan 2012 19:15:25 +0300 | ||
4 | Subject: [PATCH] Remove hardcoded /usr/local includes from configure.ac | ||
5 | |||
6 | Upstream-Status: Inappropriate [config] | ||
7 | |||
8 | Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> | ||
9 | --- | ||
10 | configure.ac | 12 ------------ | ||
11 | 1 files changed, 0 insertions(+), 12 deletions(-) | ||
12 | |||
13 | diff --git a/configure.ac b/configure.ac | ||
14 | index ae00c08..9ba6d8d 100644 | ||
15 | --- a/configure.ac | ||
16 | +++ b/configure.ac | ||
17 | @@ -67,18 +67,6 @@ AC_ARG_VAR(PYTHON,local path to the python interpreter) | ||
18 | python_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/python/bin:/opt/python/usr/bin:/opt/python/usr/local/bin" | ||
19 | AC_PATH_PROG(PYTHON,python,/usr/bin/env python,$python_possible_path) | ||
20 | |||
21 | -if test -d /usr/local/include; then | ||
22 | - CPPFLAGS="$CPPFLAGS -I/usr/local/include" | ||
23 | -fi | ||
24 | - | ||
25 | -if test -d /usr/kerberos/include; then | ||
26 | - CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" | ||
27 | -fi | ||
28 | - | ||
29 | -if test -d /usr/local/lib; then | ||
30 | - LDFLAGS="$LDFLAGS -L/usr/local/lib" | ||
31 | -fi | ||
32 | - | ||
33 | if uname | fgrep SunOS > /dev/null 2> /dev/null ; then | ||
34 | CPPFLAGS="$CPPFLAGS -D_XPG4_2=1" | ||
35 | fi | ||
36 | -- | ||
37 | 1.7.7.3 | ||
38 | |||
diff --git a/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch new file mode 100644 index 0000000000..5cbbc5fa7b --- /dev/null +++ b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 45eb89d1a6fde65caaf2d6e1a5d527f1ae7beb9c Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Mon, 3 Dec 2012 17:12:11 +0000 | ||
4 | Subject: [PATCH] Don't mess with CFLAGS and LDFLAGS when --with-minimal is specified | ||
5 | |||
6 | We especially don't want stripping enabled. | ||
7 | |||
8 | Upstream-Status: Inappropriate [config] | ||
9 | |||
10 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
11 | --- | ||
12 | configure.ac | 2 -- | ||
13 | 1 files changed, 0 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/configure.ac b/configure.ac | ||
16 | index 3d59409..6836c0e 100644 | ||
17 | --- a/configure.ac | ||
18 | +++ b/configure.ac | ||
19 | @@ -413,8 +413,6 @@ AC_ARG_WITH(minimal, | ||
20 | AC_DEFINE(NO_FTP_USERS) | ||
21 | AC_DEFINE(WITHOUT_ASCII) | ||
22 | AC_DEFINE(BORING_MODE) | ||
23 | - CFLAGS="$CFLAGS -Os -fomit-frame-pointer -fgcse -falign-functions=2 -falign-jumps=2 -fno-unroll-loops " | ||
24 | - LDFLAGS="$LDFLAGS -s " | ||
25 | fi ]) | ||
26 | |||
27 | AC_ARG_WITH(paranoidmsg, | ||
28 | -- | ||
29 | 1.7.1 | ||
30 | |||
diff --git a/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.36.bb b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.36.bb new file mode 100644 index 0000000000..974e6b74b7 --- /dev/null +++ b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.36.bb | |||
@@ -0,0 +1,19 @@ | |||
1 | SUMMARY = "FTP Server with a strong focus on software security" | ||
2 | DESCRIPTION = "Pure-FTPd is a free (BSD license), secure, production-quality and standard-conformant FTP server." | ||
3 | HOMEPAGE = "http://www.pureftpd.org/project/pure-ftpd" | ||
4 | LICENSE = "BSD" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=ae9e161311a5a0768c333b537a40e332" | ||
6 | |||
7 | DEPENDS = "libcap" | ||
8 | |||
9 | |||
10 | SRC_URI = "http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-${PV}.tar.gz \ | ||
11 | file://0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch \ | ||
12 | file://nostrip.patch \ | ||
13 | " | ||
14 | SRC_URI[md5sum] = "bbcb48e8aa6ec1abff9775b89f84af91" | ||
15 | SRC_URI[sha256sum] = "90fb63b1a9d448076aa9f3e3c74b298965f98e03c824e9a4d241fffe8eb3a130" | ||
16 | |||
17 | inherit autotools | ||
18 | |||
19 | EXTRA_OECONF = "--with-minimal" | ||
diff --git a/meta-networking/recipes-daemons/radvd/files/radvd.init b/meta-networking/recipes-daemons/radvd/files/radvd.init new file mode 100755 index 0000000000..8b26317ee6 --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/files/radvd.init | |||
@@ -0,0 +1,135 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: radvd | ||
5 | # Required-Start: $remote_fs $named $syslog | ||
6 | # Required-Stop: $remote_fs $named $syslog | ||
7 | # Default-Start: 3 5 | ||
8 | # Default-Stop: 0 1 2 6 | ||
9 | # Description: router advertisement daemon | ||
10 | ### END INIT INFO | ||
11 | |||
12 | # Source function library. | ||
13 | . /etc/init.d/functions | ||
14 | |||
15 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
16 | DAEMON=/usr/sbin/radvd | ||
17 | NAME=radvd | ||
18 | DESC=radvd | ||
19 | CONFIG=/etc/radvd.conf | ||
20 | SAVED_SETTINGS=/var/run/radvd/saved-settings | ||
21 | PIDFILE=/var/run/radvd/radvd.pid | ||
22 | OPTIONS="-u radvd -p $PIDFILE" | ||
23 | |||
24 | test -x $DAEMON || exit 0 | ||
25 | |||
26 | set -e | ||
27 | |||
28 | # Check for IPv6 support in kernel | ||
29 | if test \! -e /proc/sys/net/ipv6; then | ||
30 | echo "IPv6 support must be enabled in the kernel for $DESC to work." | ||
31 | exit | ||
32 | fi | ||
33 | |||
34 | save_settings() | ||
35 | { | ||
36 | local file=$1 | ||
37 | |||
38 | rm -f $file | ||
39 | for if_conf in /proc/sys/net/ipv6/conf/*; do | ||
40 | echo -e "$if_conf/forwarding\t `cat $if_conf/forwarding`" >> $file | ||
41 | done | ||
42 | return 0 | ||
43 | } | ||
44 | |||
45 | restore_settings() | ||
46 | { | ||
47 | file=$1 | ||
48 | |||
49 | if [ ! -f $file ]; then | ||
50 | echo "$0: warning: cannot restore settings" | ||
51 | return | ||
52 | fi | ||
53 | |||
54 | ( | ||
55 | while read f value; do | ||
56 | if [ -w $f ]; then | ||
57 | echo $value > $f | ||
58 | fi | ||
59 | done | ||
60 | ) < $file | ||
61 | } | ||
62 | |||
63 | chkconfig() { | ||
64 | if [ ! -e $CONFIG -o ! -s $CONFIG ]; then | ||
65 | echo "" | ||
66 | echo "* $CONFIG does not exist or is empty." | ||
67 | echo "* See /usr/share/doc/radvd/radvd.conf.example for a simple" | ||
68 | echo "* configuration suitable for most systems, and radvd.conf(5)" | ||
69 | echo "* for configuration file syntax. radvd will *not* be started." | ||
70 | exit 0 | ||
71 | fi | ||
72 | } | ||
73 | |||
74 | case "$1" in | ||
75 | start) | ||
76 | echo -n "Starting $DESC: " | ||
77 | chkconfig | ||
78 | save_settings $SAVED_SETTINGS | ||
79 | |||
80 | # We must enable IPv6 forwarding for radvd to work | ||
81 | echo 1 > /proc/sys/net/ipv6/conf/all/forwarding | ||
82 | |||
83 | # Check for stale pidfile; radvd won't start if one is lying around | ||
84 | if [ -f $PIDFILE ] && ! ps `cat $PIDFILE` > /dev/null; then | ||
85 | rm -f $PIDFILE | ||
86 | fi | ||
87 | if ! start-stop-daemon --oknodo --start --pidfile $PIDFILE \ | ||
88 | --exec $DAEMON -- $OPTIONS; then | ||
89 | echo "failed." && exit 1 | ||
90 | fi | ||
91 | echo "$NAME." | ||
92 | ;; | ||
93 | stop) | ||
94 | echo -n "Stopping $DESC: " | ||
95 | if ! [ -f $PIDFILE ] ; then | ||
96 | echo "not running." | ||
97 | exit 0 | ||
98 | fi | ||
99 | start-stop-daemon --oknodo --stop --pidfile $PIDFILE \ | ||
100 | --exec $DAEMON | ||
101 | restore_settings $SAVED_SETTINGS | ||
102 | rm -f $SAVED_SETTINGS | ||
103 | echo "$NAME." | ||
104 | ;; | ||
105 | status) | ||
106 | status $DAEMON; | ||
107 | exit $? | ||
108 | ;; | ||
109 | reload|force-reload) | ||
110 | echo "Reloading $DESC configuration files." | ||
111 | start-stop-daemon --stop --signal HUP --quiet --pidfile \ | ||
112 | $PIDFILE --exec $DAEMON | ||
113 | ;; | ||
114 | restart) | ||
115 | chkconfig | ||
116 | echo -n "Restarting $DESC: " | ||
117 | if ! start-stop-daemon --stop --quiet --pidfile \ | ||
118 | $PIDFILE --exec $DAEMON; then | ||
119 | # stop failed, so we were not running | ||
120 | save_settings $SAVED_SETTINGS | ||
121 | echo 1 > /proc/sys/net/ipv6/conf/all/forwarding | ||
122 | fi | ||
123 | sleep 1 | ||
124 | start-stop-daemon --start --quiet --pidfile \ | ||
125 | $PIDFILE --exec $DAEMON -- $OPTIONS | ||
126 | echo "$NAME." | ||
127 | ;; | ||
128 | *) | ||
129 | N=/etc/init.d/$NAME | ||
130 | echo "Usage: $N {start|stop|status|restart|reload|force-reload}" >&2 | ||
131 | exit 1 | ||
132 | ;; | ||
133 | esac | ||
134 | |||
135 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd b/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd new file mode 100644 index 0000000000..89256a40e4 --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd | |||
@@ -0,0 +1,2 @@ | |||
1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
2 | d radvd root 0755 /var/run/radvd none | ||
diff --git a/meta-networking/recipes-daemons/radvd/radvd.inc b/meta-networking/recipes-daemons/radvd/radvd.inc new file mode 100644 index 0000000000..9e194012c0 --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/radvd.inc | |||
@@ -0,0 +1,51 @@ | |||
1 | SUMMARY = "IPv6 router advertisement daemon" | ||
2 | DESCRIPTION = "radvd is the router advertisement daemon for IPv6. It \ | ||
3 | listens to router solicitations and sends router \ | ||
4 | advertisements as described in RFC 2461, Neighbor \ | ||
5 | Discovery for IP Version 6 (IPv6). With these \ | ||
6 | advertisements hosts can automatically configure their \ | ||
7 | addresses and some other parameters. They also can \ | ||
8 | choose a default router based on these advertisements." | ||
9 | HOMEPAGE = "http://www.litech.org/radvd/" | ||
10 | SECTION = "console/network" | ||
11 | DEPENDS = "flex-native libdaemon" | ||
12 | |||
13 | # License is BSD-Style (with advertising clause) but also has an additional 0th clause | ||
14 | LICENSE = "radvd" | ||
15 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=73ebbf7182ae996e65e8fadc9a8c45db" | ||
16 | |||
17 | SRC_URI = "http://v6web.litech.org/radvd/dist/radvd-${PV}.tar.gz \ | ||
18 | file://radvd.init \ | ||
19 | file://volatiles.03_radvd" | ||
20 | |||
21 | inherit autotools update-rc.d useradd | ||
22 | |||
23 | do_install_append () { | ||
24 | install -m 0755 -d ${D}${sysconfdir}/init.d \ | ||
25 | ${D}${sysconfdir}/default/volatiles \ | ||
26 | ${D}${docdir}/radvd | ||
27 | # Install init script and volatiles | ||
28 | install -m 0755 ${WORKDIR}/radvd.init ${D}${sysconfdir}/init.d/radvd | ||
29 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
30 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
31 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
32 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/radvd | ||
33 | |||
34 | install -m 0644 ${WORKDIR}/volatiles.03_radvd ${D}${sysconfdir}/default/volatiles/volatiles.03_radvd | ||
35 | # Documentation | ||
36 | for i in radvd.conf.example README; do \ | ||
37 | install -m 0644 $i ${D}${docdir}/radvd; \ | ||
38 | done | ||
39 | } | ||
40 | |||
41 | INITSCRIPT_NAME = "radvd" | ||
42 | INITSCRIPT_PARAMS = "defaults 20 80" | ||
43 | |||
44 | USERADD_PACKAGES = "${PN}" | ||
45 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/radvd/ -M -g nogroup radvd" | ||
46 | |||
47 | pkg_postinst_${PN} () { | ||
48 | if [ -z "$D" -a -x /etc/init.d/populate-volatile.sh ]; then | ||
49 | /etc/init.d/populate-volatile.sh update | ||
50 | fi | ||
51 | } | ||
diff --git a/meta-networking/recipes-daemons/radvd/radvd_1.9.8.bb b/meta-networking/recipes-daemons/radvd/radvd_1.9.8.bb new file mode 100644 index 0000000000..407eb43d3b --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/radvd_1.9.8.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | PR = "r0" | ||
2 | |||
3 | require radvd.inc | ||
4 | |||
5 | SRC_URI[md5sum] = "7a96a38252c3964ee18bbc1fdeae25fa" | ||
6 | SRC_URI[sha256sum] = "645ccf1c9b16e769ff4179813712e580e2c8786d64a888d8afa1e296c057c1c1" | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/files/initscript b/meta-networking/recipes-daemons/syslog-ng/files/initscript new file mode 100644 index 0000000000..b95e8adc20 --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/files/initscript | |||
@@ -0,0 +1,45 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # This is an init script for openembedded | ||
4 | # Copy it to /etc/init.d/syslog-ng and type | ||
5 | # > update-rc.d syslog-ng defaults 5 | ||
6 | # | ||
7 | |||
8 | |||
9 | syslog_ng=/usr/sbin/syslog-ng | ||
10 | test -x "$syslog_ng" || exit 0 | ||
11 | |||
12 | case "$1" in | ||
13 | start) | ||
14 | echo -n "Starting syslog-ng:" | ||
15 | start-stop-daemon --start --quiet --exec $syslog_ng | ||
16 | echo "." | ||
17 | ;; | ||
18 | stop) | ||
19 | echo -n "Stopping syslog-ng:" | ||
20 | start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid | ||
21 | echo "." | ||
22 | ;; | ||
23 | reload|force-reload) | ||
24 | start-stop-daemon --stop --quiet --signal 1 --exec $syslog_ng | ||
25 | ;; | ||
26 | restart) | ||
27 | echo "Stopping syslog-ng:" | ||
28 | start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid | ||
29 | echo -n "Waiting for syslog-ng to die off" | ||
30 | for i in 1 2 3 ; | ||
31 | do | ||
32 | sleep 1 | ||
33 | echo -n "." | ||
34 | done | ||
35 | echo "" | ||
36 | echo -n "Starting syslog-ng:" | ||
37 | start-stop-daemon --start --quiet --exec $syslog_ng | ||
38 | echo "." | ||
39 | ;; | ||
40 | *) | ||
41 | echo "Usage: /etc/init.d/syslog-ng {start|stop|reload|restart|force-reload}" | ||
42 | exit 1 | ||
43 | esac | ||
44 | |||
45 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/files/syslog-ng.conf b/meta-networking/recipes-daemons/syslog-ng/files/syslog-ng.conf new file mode 100644 index 0000000000..96b631bf0f --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/files/syslog-ng.conf | |||
@@ -0,0 +1,155 @@ | |||
1 | @version: 3.2 | ||
2 | # | ||
3 | # Syslog-ng configuration file, compatible with default Debian syslogd | ||
4 | # installation. Originally written by anonymous (I can't find his name) | ||
5 | # Revised, and rewrited by me (SZALAY Attila <sasa@debian.org>) | ||
6 | |||
7 | # First, set some global options. | ||
8 | options { long_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); | ||
9 | owner("root"); group("adm"); perm(0640); stats_freq(0); | ||
10 | bad_hostname("^gconfd$"); | ||
11 | }; | ||
12 | |||
13 | ######################## | ||
14 | # Sources | ||
15 | ######################## | ||
16 | # This is the default behavior of sysklogd package | ||
17 | # Logs may come from unix stream, but not from another machine. | ||
18 | # | ||
19 | source s_src { unix-dgram("/dev/log"); internal(); | ||
20 | file("/proc/kmsg" program_override("kernel")); | ||
21 | }; | ||
22 | |||
23 | # If you wish to get logs from remote machine you should uncomment | ||
24 | # this and comment the above source line. | ||
25 | # | ||
26 | #source s_net { tcp(ip(127.0.0.1) port(1000) authentication(required) encrypt(allow)); }; | ||
27 | |||
28 | ######################## | ||
29 | # Destinations | ||
30 | ######################## | ||
31 | # First some standard logfile | ||
32 | # | ||
33 | destination d_auth { file("/var/log/auth.log"); }; | ||
34 | destination d_cron { file("/var/log/cron.log"); }; | ||
35 | destination d_daemon { file("/var/log/daemon.log"); }; | ||
36 | destination d_kern { file("/var/log/kern.log"); }; | ||
37 | destination d_lpr { file("/var/log/lpr.log"); }; | ||
38 | destination d_mail { file("/var/log/mail.log"); }; | ||
39 | destination d_syslog { file("/var/log/syslog"); }; | ||
40 | destination d_user { file("/var/log/user.log"); }; | ||
41 | destination d_uucp { file("/var/log/uucp.log"); }; | ||
42 | |||
43 | # This files are the log come from the mail subsystem. | ||
44 | # | ||
45 | destination d_mailinfo { file("/var/log/mail/mail.info"); }; | ||
46 | destination d_mailwarn { file("/var/log/mail/mail.warn"); }; | ||
47 | destination d_mailerr { file("/var/log/mail/mail.err"); }; | ||
48 | |||
49 | # Logging for INN news system | ||
50 | # | ||
51 | destination d_newscrit { file("/var/log/news/news.crit"); }; | ||
52 | destination d_newserr { file("/var/log/news/news.err"); }; | ||
53 | destination d_newsnotice { file("/var/log/news/news.notice"); }; | ||
54 | |||
55 | # Some `catch-all' logfiles. | ||
56 | # | ||
57 | destination d_debug { file("/var/log/debug"); }; | ||
58 | destination d_error { file("/var/log/error"); }; | ||
59 | destination d_messages { file("/var/log/messages"); }; | ||
60 | |||
61 | # The root's console. | ||
62 | # | ||
63 | destination d_console { usertty("root"); }; | ||
64 | |||
65 | # Virtual console. | ||
66 | # | ||
67 | destination d_console_all { file("/dev/tty10"); }; | ||
68 | |||
69 | # The named pipe /dev/xconsole is for the nsole' utility. To use it, | ||
70 | # you must invoke nsole' with the -file' option: | ||
71 | # | ||
72 | # $ xconsole -file /dev/xconsole [...] | ||
73 | # | ||
74 | destination d_xconsole { pipe("/dev/xconsole"); }; | ||
75 | |||
76 | # Send the messages to an other host | ||
77 | # | ||
78 | #destination d_net { tcp("127.0.0.1" port(1000) authentication(on) encrypt(on) log_fifo_size(1000)); }; | ||
79 | |||
80 | # Debian only | ||
81 | destination d_ppp { file("/var/log/ppp.log"); }; | ||
82 | |||
83 | ######################## | ||
84 | # Filters | ||
85 | ######################## | ||
86 | # Here's come the filter options. With this rules, we can set which | ||
87 | # message go where. | ||
88 | |||
89 | filter f_dbg { level(debug); }; | ||
90 | filter f_info { level(info); }; | ||
91 | filter f_notice { level(notice); }; | ||
92 | filter f_warn { level(warn); }; | ||
93 | filter f_err { level(err); }; | ||
94 | filter f_crit { level(crit .. emerg); }; | ||
95 | |||
96 | filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; | ||
97 | filter f_error { level(err .. emerg) ; }; | ||
98 | filter f_messages { level(info,notice,warn) and | ||
99 | not facility(auth,authpriv,cron,daemon,mail,news); }; | ||
100 | |||
101 | filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; | ||
102 | filter f_cron { facility(cron) and not filter(f_debug); }; | ||
103 | filter f_daemon { facility(daemon) and not filter(f_debug); }; | ||
104 | filter f_kern { facility(kern) and not filter(f_debug); }; | ||
105 | filter f_lpr { facility(lpr) and not filter(f_debug); }; | ||
106 | filter f_local { facility(local0, local1, local3, local4, local5, | ||
107 | local6, local7) and not filter(f_debug); }; | ||
108 | filter f_mail { facility(mail) and not filter(f_debug); }; | ||
109 | filter f_news { facility(news) and not filter(f_debug); }; | ||
110 | filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; | ||
111 | filter f_user { facility(user) and not filter(f_debug); }; | ||
112 | filter f_uucp { facility(uucp) and not filter(f_debug); }; | ||
113 | |||
114 | filter f_cnews { level(notice, err, crit) and facility(news); }; | ||
115 | filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; | ||
116 | |||
117 | filter f_ppp { facility(local2) and not filter(f_debug); }; | ||
118 | filter f_console { level(warn .. emerg); }; | ||
119 | |||
120 | ######################## | ||
121 | # Log paths | ||
122 | ######################## | ||
123 | log { source(s_src); filter(f_auth); destination(d_auth); }; | ||
124 | log { source(s_src); filter(f_cron); destination(d_cron); }; | ||
125 | log { source(s_src); filter(f_daemon); destination(d_daemon); }; | ||
126 | log { source(s_src); filter(f_kern); destination(d_kern); }; | ||
127 | log { source(s_src); filter(f_lpr); destination(d_lpr); }; | ||
128 | log { source(s_src); filter(f_syslog3); destination(d_syslog); }; | ||
129 | log { source(s_src); filter(f_user); destination(d_user); }; | ||
130 | log { source(s_src); filter(f_uucp); destination(d_uucp); }; | ||
131 | |||
132 | log { source(s_src); filter(f_mail); destination(d_mail); }; | ||
133 | #log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; | ||
134 | #log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; | ||
135 | #log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; | ||
136 | |||
137 | log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; | ||
138 | log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; | ||
139 | log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; | ||
140 | #log { source(s_src); filter(f_cnews); destination(d_console_all); }; | ||
141 | #log { source(s_src); filter(f_cother); destination(d_console_all); }; | ||
142 | |||
143 | #log { source(s_src); filter(f_ppp); destination(d_ppp); }; | ||
144 | |||
145 | log { source(s_src); filter(f_debug); destination(d_debug); }; | ||
146 | log { source(s_src); filter(f_error); destination(d_error); }; | ||
147 | log { source(s_src); filter(f_messages); destination(d_messages); }; | ||
148 | |||
149 | log { source(s_src); filter(f_console); destination(d_console_all); | ||
150 | destination(d_xconsole); }; | ||
151 | log { source(s_src); filter(f_crit); destination(d_console); }; | ||
152 | |||
153 | # All messages send to a remote site | ||
154 | # | ||
155 | #log { source(s_src); destination(d_net); }; | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc b/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc new file mode 100644 index 0000000000..ef183d7028 --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc | |||
@@ -0,0 +1,78 @@ | |||
1 | DESCRIPTION = "Alternative system logger daemon" | ||
2 | DEPENDS = "libol flex eventlog glib-2.0" | ||
3 | LICENSE = "GPL LGPL" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=e0e8658d9be248f01b7933df24dc1408" | ||
5 | |||
6 | # syslog initscript is handled explicitly because order of | ||
7 | # update-rc.d and update-alternatives is important | ||
8 | RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}" | ||
9 | |||
10 | INC_PR = "r6" | ||
11 | |||
12 | inherit autotools | ||
13 | |||
14 | SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${PN}_${PV}.tar.gz" | ||
15 | |||
16 | noipv6 = "${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6', d)}" | ||
17 | |||
18 | EXTRA_OECONF = " \ | ||
19 | --with-libnet=${STAGING_BINDIR_CROSS} \ | ||
20 | --enable-dynamic-linking \ | ||
21 | ${noipv6} \ | ||
22 | --enable-ssl \ | ||
23 | --disable-sub-streams \ | ||
24 | --disable-pacct \ | ||
25 | --disable-linux-caps \ | ||
26 | --disable-pcre \ | ||
27 | --disable-sql \ | ||
28 | " | ||
29 | |||
30 | do_configure_prepend() { | ||
31 | eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}" | ||
32 | } | ||
33 | |||
34 | do_install_append() { | ||
35 | install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${PN}.conf | ||
36 | install -d ${D}/${sysconfdir}/init.d | ||
37 | install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${PN} | ||
38 | } | ||
39 | |||
40 | CONFFILES_${PN} = "${sysconfdir}/${PN}.conf" | ||
41 | |||
42 | pkg_postinst_${PN} () { | ||
43 | /etc/init.d/syslog stop | ||
44 | update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 200 | ||
45 | |||
46 | if test "x$D" != "x"; then | ||
47 | OPT="-r $D" | ||
48 | else | ||
49 | OPT="-s" | ||
50 | fi | ||
51 | # remove all rc.d-links potentially created from alternative | ||
52 | # syslog packages before creating new ones | ||
53 | update-rc.d $OPT -f syslog remove | ||
54 | update-rc.d $OPT syslog start 20 2 3 4 5 . stop 90 0 1 6 . | ||
55 | } | ||
56 | |||
57 | pkg_prerm_${PN} () { | ||
58 | if test "x$D" = "x"; then | ||
59 | if test "$1" = "upgrade" -o "$1" = "remove"; then | ||
60 | /etc/init.d/syslog stop | ||
61 | fi | ||
62 | fi | ||
63 | |||
64 | update-alternatives --remove syslog-init syslog.${PN} | ||
65 | } | ||
66 | |||
67 | pkg_postrm_${PN} () { | ||
68 | if test "x$D" != "x"; then | ||
69 | OPT="-r $D" | ||
70 | else | ||
71 | OPT="" | ||
72 | fi | ||
73 | if test "$1" = "remove" -o "$1" = "purge"; then | ||
74 | if ! test -e "/etc/init.d/syslog"; then | ||
75 | update-rc.d $OPT syslog remove | ||
76 | fi | ||
77 | fi | ||
78 | } | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/syslog-ng_3.5.3.bb b/meta-networking/recipes-daemons/syslog-ng/syslog-ng_3.5.3.bb new file mode 100644 index 0000000000..ce10ecefe0 --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/syslog-ng_3.5.3.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | require syslog-ng.inc | ||
2 | PR = "${INC_PR}.1" | ||
3 | |||
4 | SRC_URI += " \ | ||
5 | file://syslog-ng.conf \ | ||
6 | file://initscript \ | ||
7 | " | ||
8 | |||
9 | SRC_URI[md5sum] = "4cc29efa55fc41e65c48ece9bc88f88b" | ||
10 | SRC_URI[sha256sum] = "a349a1baa272e7b07fa4b0d6a85512e71dd946476ae12bc8f9c9ad64311164d0" | ||
11 | |||
12 | INSANE_SKIP_${PN} += "dev-so" | ||
13 | |||
14 | FILES_${PN} += "/usr/share/" | ||
15 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch b/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch new file mode 100644 index 0000000000..d01c20d385 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | From bd5773947af5ca80ca546ad5625818fc912bdd60 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Roy.Li" <rongqing.li@windriver.com> | ||
3 | Date: Thu, 22 Aug 2013 08:56:09 +0800 | ||
4 | Subject: [PATCH] tftp-hpa: add error check for disk filled up | ||
5 | |||
6 | Upstream-status: Pending [Sent to http://www.syslinux.org/archives/2013-August/020765.html] | ||
7 | |||
8 | Add error check when the write-buffer is finally flushed to the file, | ||
9 | the caller can detect if the disk filled up (or had an i/o error) and | ||
10 | return a NOSAPCE nak to the other side. | ||
11 | |||
12 | Signed-off-by: Ming Liu <ming.liu@windriver.com> | ||
13 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
14 | --- | ||
15 | common/tftpsubs.c | 8 +++++--- | ||
16 | tftpd/tftpd.c | 12 ++++++++++-- | ||
17 | 2 files changed, 15 insertions(+), 5 deletions(-) | ||
18 | |||
19 | diff --git a/common/tftpsubs.c b/common/tftpsubs.c | ||
20 | index 8c999f6..b4d4ffe 100644 | ||
21 | --- a/common/tftpsubs.c | ||
22 | +++ b/common/tftpsubs.c | ||
23 | @@ -206,20 +206,22 @@ int write_behind(FILE * file, int convert) | ||
24 | |||
25 | p = buf; | ||
26 | ct = count; | ||
27 | + count = 0; | ||
28 | while (ct--) { /* loop over the buffer */ | ||
29 | c = *p++; /* pick up a character */ | ||
30 | if (prevchar == '\r') { /* if prev char was cr */ | ||
31 | if (c == '\n') /* if have cr,lf then just */ | ||
32 | - fseek(file, -1, 1); /* smash lf on top of the cr */ | ||
33 | + count = count - 1; | ||
34 | else if (c == '\0') /* if have cr,nul then */ | ||
35 | goto skipit; /* just skip over the putc */ | ||
36 | /* else just fall through and allow it */ | ||
37 | } | ||
38 | - putc(c, file); | ||
39 | + buf[count] = c; | ||
40 | + count ++; | ||
41 | skipit: | ||
42 | prevchar = c; | ||
43 | } | ||
44 | - return count; | ||
45 | + return write(fileno(file), buf, count); | ||
46 | } | ||
47 | |||
48 | /* When an error has occurred, it is possible that the two sides | ||
49 | diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c | ||
50 | index 1873e70..c2adbda 100644 | ||
51 | --- a/tftpd/tftpd.c | ||
52 | +++ b/tftpd/tftpd.c | ||
53 | @@ -1681,7 +1681,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac | ||
54 | syslog(LOG_WARNING, "tftpd: write(ack): %m"); | ||
55 | goto abort; | ||
56 | } | ||
57 | - write_behind(file, pf->f_convert); | ||
58 | + if(write_behind(file, pf->f_convert) < 0) { | ||
59 | + nak(ENOSPACE, NULL); | ||
60 | + (void)fclose(file); | ||
61 | + goto abort; | ||
62 | + } | ||
63 | for (;;) { | ||
64 | n = recv_time(peer, dp, PKTSIZE, 0, &r_timeout); | ||
65 | if (n < 0) { /* really? */ | ||
66 | @@ -1712,7 +1716,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac | ||
67 | goto abort; | ||
68 | } | ||
69 | } while (size == segsize); | ||
70 | - write_behind(file, pf->f_convert); | ||
71 | + if(write_behind(file, pf->f_convert) < 0) { | ||
72 | + nak(ENOSPACE, NULL); | ||
73 | + (void)fclose(file); | ||
74 | + goto abort; | ||
75 | + } | ||
76 | (void)fclose(file); /* close data file */ | ||
77 | |||
78 | ap->th_opcode = htons((u_short) ACK); /* send the "final" ack */ | ||
79 | -- | ||
80 | 1.7.10.4 | ||
81 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/default b/meta-networking/recipes-daemons/tftp-hpa/files/default new file mode 100644 index 0000000000..1dce7fdfeb --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/default | |||
@@ -0,0 +1,3 @@ | |||
1 | #Defaults for tftpd-hpa | ||
2 | RUN_DAEMON="yes" | ||
3 | OPTIONS="-l -s /var/lib/tftpboot" | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/init b/meta-networking/recipes-daemons/tftp-hpa/files/init new file mode 100644 index 0000000000..9e1843635c --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/init | |||
@@ -0,0 +1,105 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # Author: Jaakko Niemi <liiwi@iki.fi> | ||
4 | # Modified from skeleton file in sarge | ||
5 | |||
6 | ### BEGIN INIT INFO | ||
7 | # Provides: tftp-hpa | ||
8 | # Required-Start: $local_fs $remote_fs $syslog $network | ||
9 | # Required-Stop: $local_fs $remote_fs $syslog $network | ||
10 | # Default-Start: 2 3 4 5 | ||
11 | # Default-Stop: 1 | ||
12 | # Short-Description: HPA's tftp client | ||
13 | # Description: tftp server to allow booting clients which support | ||
14 | # the PXE protocol. | ||
15 | ### END INIT INFO | ||
16 | |||
17 | set -e | ||
18 | |||
19 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
20 | DESC="HPA's tftpd" | ||
21 | NAME=in.tftpd-hpa | ||
22 | SCRIPTNAME=/etc/init.d/tftpd-hpa | ||
23 | |||
24 | # Read config file if it is present. | ||
25 | if [ -r /etc/default/tftpd-hpa ] | ||
26 | then | ||
27 | . /etc/default/tftpd-hpa | ||
28 | fi | ||
29 | |||
30 | DAEMON=/usr/sbin/$NAME | ||
31 | PIDFILE=/var/run/$NAME.pid | ||
32 | |||
33 | # Gracefully exit if the package has been removed. | ||
34 | test -x $DAEMON || exit 0 | ||
35 | |||
36 | if [ "$RUN_DAEMON" != "yes" ] ; then | ||
37 | echo "tftpd-hpa disabled in /etc/default/tftpd-hpa" | ||
38 | exit 0 | ||
39 | fi | ||
40 | |||
41 | # | ||
42 | # Function that starts the daemon/service. | ||
43 | # | ||
44 | d_start() { | ||
45 | start-stop-daemon --start --quiet --exec $DAEMON -- $OPTIONS | ||
46 | } | ||
47 | |||
48 | # | ||
49 | # Function that stops the daemon/service. | ||
50 | # | ||
51 | d_stop() { | ||
52 | start-stop-daemon --stop --quiet --name $NAME | ||
53 | } | ||
54 | |||
55 | # | ||
56 | # Function that sends a SIGHUP to the daemon/service. | ||
57 | # | ||
58 | d_reload() { | ||
59 | start-stop-daemon --stop --quiet --name $NAME --signal 1 | ||
60 | } | ||
61 | |||
62 | case "$1" in | ||
63 | start) | ||
64 | echo "Starting $DESC: $NAME" | ||
65 | d_start | ||
66 | echo "." | ||
67 | ;; | ||
68 | stop) | ||
69 | echo "Stopping $DESC: $NAME" | ||
70 | d_stop | ||
71 | echo "." | ||
72 | ;; | ||
73 | #reload) | ||
74 | # | ||
75 | # If the daemon can reload its configuration without | ||
76 | # restarting (for example, when it is sent a SIGHUP), | ||
77 | # then implement that here. | ||
78 | # | ||
79 | # If the daemon responds to changes in its config file | ||
80 | # directly anyway, make this an "exit 0". | ||
81 | # | ||
82 | # echo -n "Reloading $DESC configuration..." | ||
83 | # d_reload | ||
84 | # echo "done." | ||
85 | #;; | ||
86 | restart|force-reload) | ||
87 | # | ||
88 | # If the "reload" option is implemented, move the "force-reload" | ||
89 | # option to the "reload" entry above. If not, "force-reload" is | ||
90 | # just the same as "restart". | ||
91 | # | ||
92 | echo "Restarting $DESC: $NAME" | ||
93 | d_stop | ||
94 | sleep 1 | ||
95 | d_start | ||
96 | echo "." | ||
97 | ;; | ||
98 | *) | ||
99 | # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 | ||
100 | echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 | ||
101 | exit 1 | ||
102 | ;; | ||
103 | esac | ||
104 | |||
105 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch new file mode 100644 index 0000000000..3f690609a6 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftpd/remap.c.zero tftp-hpa-0.49/tftpd/remap.c | ||
8 | --- tftp-hpa-0.49/tftpd/remap.c.zero 2008-10-20 18:08:31.000000000 -0400 | ||
9 | +++ tftp-hpa-0.49/tftpd/remap.c 2008-11-25 11:41:09.000000000 -0500 | ||
10 | @@ -286,6 +286,7 @@ struct rule *parserulefile(FILE * f) | ||
11 | int lineno = 0; | ||
12 | int err = 0; | ||
13 | |||
14 | + memset(this_rule, '\0', sizeof(struct rule)); | ||
15 | while (lineno++, fgets(line, MAXLINE, f)) { | ||
16 | rv = parseline(line, this_rule, lineno); | ||
17 | if (rv < 0) | ||
18 | @@ -294,6 +295,7 @@ struct rule *parserulefile(FILE * f) | ||
19 | *last_rule = this_rule; | ||
20 | last_rule = &this_rule->next; | ||
21 | this_rule = tfmalloc(sizeof(struct rule)); | ||
22 | + memset(this_rule, '\0', sizeof(struct rule)); | ||
23 | } | ||
24 | } | ||
25 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch new file mode 100644 index 0000000000..98a86b78b0 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.48/tftp-xinetd.tftpboot tftp-hpa-0.48/tftp-xinetd | ||
8 | --- tftp-hpa-0.48/tftp-xinetd.tftpboot 2007-01-31 00:51:05.000000000 +0100 | ||
9 | +++ tftp-hpa-0.48/tftp-xinetd 2008-05-20 12:05:53.000000000 +0200 | ||
10 | @@ -10,7 +10,7 @@ service tftp | ||
11 | wait = yes | ||
12 | user = root | ||
13 | server = /usr/sbin/in.tftpd | ||
14 | - server_args = -s /tftpboot | ||
15 | + server_args = -s /var/lib/tftpboot | ||
16 | disable = yes | ||
17 | per_source = 11 | ||
18 | cps = 100 2 | ||
19 | diff -up tftp-hpa-0.48/README.security.tftpboot tftp-hpa-0.48/README.security | ||
20 | --- tftp-hpa-0.48/README.security.tftpboot 2008-05-29 17:36:32.000000000 +0200 | ||
21 | +++ tftp-hpa-0.48/README.security 2008-05-29 17:37:21.000000000 +0200 | ||
22 | @@ -17,10 +17,10 @@ probably the following: | ||
23 | |||
24 | 1. Create a separate "tftpd" user and group only used for tftpd; | ||
25 | 2. Have all your boot files in a single directory tree (usually called | ||
26 | - /tftpboot). | ||
27 | -3. Specify "-p -u tftpd -s /tftpboot" on the tftpd command line; if | ||
28 | + /var/lib/tftpboot). | ||
29 | +3. Specify "-p -u tftpd -s /var/lib/tftpboot" on the tftpd command line; if | ||
30 | you want clients to be able to create files use | ||
31 | - "-p -c -U 002 -u tftpd -s /tftpboot" (replace 002 with whatever | ||
32 | + "-p -c -U 002 -u tftpd -s /var/lib/tftpboot" (replace 002 with whatever | ||
33 | umask is appropriate for your setup.) | ||
34 | |||
35 | ======================================= | ||
36 | @@ -40,12 +40,12 @@ directly. Thus, if your /etc/inetd.conf | ||
37 | line): | ||
38 | |||
39 | tftp dgram udp wait root /usr/sbin/tcpd | ||
40 | -/usr/sbin/in.tftpd -s /tftpboot -r blksize | ||
41 | +/usr/sbin/in.tftpd -s /var/lib/tftpboot -r blksize | ||
42 | |||
43 | ... it's better to change to ... | ||
44 | |||
45 | tftp dgram udp wait root /usr/sbin/in.tftpd | ||
46 | -in.tftpd -s /tftpboot -r blksize | ||
47 | +in.tftpd -s /var/lib/tftpboot -r blksize | ||
48 | |||
49 | You should make sure that you are using "wait" option in tftpd; you | ||
50 | also need to have tftpd spawned as root in order for chroot (-s) to | ||
51 | diff -up tftp-hpa-0.48/tftpd/sample.rules.tftpboot tftp-hpa-0.48/tftpd/sample.rules | ||
52 | --- tftp-hpa-0.48/tftpd/sample.rules.tftpboot 2008-05-29 17:38:46.000000000 +0200 | ||
53 | +++ tftp-hpa-0.48/tftpd/sample.rules 2008-05-29 17:38:05.000000000 +0200 | ||
54 | @@ -30,5 +30,5 @@ rg \\ / # Convert backslashes to slash | ||
55 | rg \# @ # Convert hash marks to @ signs | ||
56 | rg /../ /..no../ # Convert /../ to /..no../ | ||
57 | e ^ok/ # These are always ok | ||
58 | -r ^[^/] /tftpboot/\0 # Convert non-absolute files | ||
59 | +r ^[^/] /var/lib/tftpboot/\0 # Convert non-absolute files | ||
60 | a \.pvt$ # Reject requests for private files | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch new file mode 100644 index 0000000000..7ae1a87220 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes tftp-hpa-0.49/tftpd/tftpd.c | ||
8 | --- tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes 2009-01-15 15:28:50.000000000 +0100 | ||
9 | +++ tftp-hpa-0.49/tftpd/tftpd.c 2009-01-15 15:31:36.000000000 +0100 | ||
10 | @@ -932,7 +932,10 @@ int main(int argc, char **argv) | ||
11 | exit(EX_OSERR); | ||
12 | } | ||
13 | #ifdef __CYGWIN__ | ||
14 | - chdir("/"); /* Cygwin chroot() bug workaround */ | ||
15 | + if (chdir("/") < 0) { /* Cygwin chroot() bug workaround */ | ||
16 | + syslog(LOG_ERR, "chroot: %m"); | ||
17 | + exit(EX_OSERR); | ||
18 | + } | ||
19 | #endif | ||
20 | } | ||
21 | #ifdef HAVE_SETREGID | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch new file mode 100644 index 0000000000..6b8ceaaeba --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch | |||
@@ -0,0 +1,165 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/config.h.cmd_arg tftp-hpa-0.49/config.h | ||
8 | --- tftp-hpa-0.49/config.h.cmd_arg 2010-04-19 15:29:10.567331454 +0200 | ||
9 | +++ tftp-hpa-0.49/config.h 2010-04-20 07:33:03.133232772 +0200 | ||
10 | @@ -291,6 +291,7 @@ typedef int socklen_t; | ||
11 | /* Prototypes for libxtra functions */ | ||
12 | |||
13 | void *xmalloc(size_t); | ||
14 | +void *xrealloc(void *, size_t); | ||
15 | char *xstrdup(const char *); | ||
16 | |||
17 | #ifndef HAVE_BSD_SIGNAL | ||
18 | diff -up tftp-hpa-0.49/configure.in.cmd_arg tftp-hpa-0.49/configure.in | ||
19 | --- tftp-hpa-0.49/configure.in.cmd_arg 2008-10-21 00:08:31.000000000 +0200 | ||
20 | +++ tftp-hpa-0.49/configure.in 2010-04-19 11:05:12.387340698 +0200 | ||
21 | @@ -152,6 +152,7 @@ OBJROOT=`pwd` | ||
22 | |||
23 | XTRA=false | ||
24 | PA_SEARCH_LIBS_AND_ADD(xmalloc, iberty) | ||
25 | +PA_SEARCH_LIBS_AND_ADD(xrealloc, iberty) | ||
26 | PA_SEARCH_LIBS_AND_ADD(xstrdup, iberty) | ||
27 | PA_SEARCH_LIBS_AND_ADD(bsd_signal, bsd, bsdsignal) | ||
28 | PA_SEARCH_LIBS_AND_ADD(getopt_long, getopt, getopt_long) | ||
29 | diff -up tftp-hpa-0.49/lib/xrealloc.c.cmd_arg tftp-hpa-0.49/lib/xrealloc.c | ||
30 | --- tftp-hpa-0.49/lib/xrealloc.c.cmd_arg 2010-04-19 11:05:12.387340698 +0200 | ||
31 | +++ tftp-hpa-0.49/lib/xrealloc.c 2010-04-19 11:05:12.387340698 +0200 | ||
32 | @@ -0,0 +1,20 @@ | ||
33 | +/* | ||
34 | + * xrealloc.c | ||
35 | + * | ||
36 | + * Simple error-checking version of realloc() | ||
37 | + * | ||
38 | + */ | ||
39 | + | ||
40 | +#include "config.h" | ||
41 | + | ||
42 | +void *xrealloc(void *ptr, size_t size) | ||
43 | +{ | ||
44 | + void *p = realloc(ptr, size); | ||
45 | + | ||
46 | + if (!p) { | ||
47 | + fprintf(stderr, "Out of memory!\n"); | ||
48 | + exit(128); | ||
49 | + } | ||
50 | + | ||
51 | + return p; | ||
52 | +} | ||
53 | diff -up tftp-hpa-0.49/tftp/main.c.cmd_arg tftp-hpa-0.49/tftp/main.c | ||
54 | --- tftp-hpa-0.49/tftp/main.c.cmd_arg 2008-10-21 00:08:31.000000000 +0200 | ||
55 | +++ tftp-hpa-0.49/tftp/main.c 2010-04-19 11:05:12.389329337 +0200 | ||
56 | @@ -89,11 +89,14 @@ int connected; | ||
57 | const struct modes *mode; | ||
58 | #ifdef WITH_READLINE | ||
59 | char *line = NULL; | ||
60 | +char *remote_pth = NULL; | ||
61 | #else | ||
62 | char line[LBUFLEN]; | ||
63 | +char remote_pth[LBUFLEN]; | ||
64 | #endif | ||
65 | int margc; | ||
66 | -char *margv[20]; | ||
67 | +char **margv; | ||
68 | +int sizeof_margv=0; | ||
69 | const char *prompt = "tftp> "; | ||
70 | sigjmp_buf toplevel; | ||
71 | void intr(int); | ||
72 | @@ -379,6 +382,10 @@ static void getmoreargs(const char *part | ||
73 | free(line); | ||
74 | line = NULL; | ||
75 | } | ||
76 | + if (remote_pth) { | ||
77 | + free(remote_pth); | ||
78 | + remote_pth = NULL; | ||
79 | + } | ||
80 | line = xmalloc(len + elen + 1); | ||
81 | strcpy(line, partial); | ||
82 | strcpy(line + len, eline); | ||
83 | @@ -535,6 +542,7 @@ void put(int argc, char *argv[]) | ||
84 | int fd; | ||
85 | int n, err; | ||
86 | char *cp, *targ; | ||
87 | + long dirlen, namelen, lastlen=0; | ||
88 | |||
89 | if (argc < 2) { | ||
90 | getmoreargs("send ", "(file) "); | ||
91 | @@ -588,9 +596,22 @@ void put(int argc, char *argv[]) | ||
92 | } | ||
93 | /* this assumes the target is a directory */ | ||
94 | /* on a remote unix system. hmmmm. */ | ||
95 | - cp = strchr(targ, '\0'); | ||
96 | - *cp++ = '/'; | ||
97 | + dirlen = strlen(targ)+1; | ||
98 | +#ifdef WITH_READLINE | ||
99 | + remote_pth = xmalloc(dirlen+1); | ||
100 | +#endif | ||
101 | + strcpy(remote_pth, targ); | ||
102 | + remote_pth[dirlen-1] = '/'; | ||
103 | + cp = remote_pth + dirlen; | ||
104 | for (n = 1; n < argc - 1; n++) { | ||
105 | +#ifdef WITH_READLINE | ||
106 | + namelen = strlen(tail(argv[n])) + 1; | ||
107 | + if (namelen > lastlen) { | ||
108 | + remote_pth = xrealloc(remote_pth, dirlen + namelen + 1); | ||
109 | + cp = remote_pth + dirlen; | ||
110 | + lastlen = namelen; | ||
111 | + } | ||
112 | +#endif | ||
113 | strcpy(cp, tail(argv[n])); | ||
114 | fd = open(argv[n], O_RDONLY | mode->m_openflags); | ||
115 | if (fd < 0) { | ||
116 | @@ -600,9 +621,9 @@ void put(int argc, char *argv[]) | ||
117 | } | ||
118 | if (verbose) | ||
119 | printf("putting %s to %s:%s [%s]\n", | ||
120 | - argv[n], hostname, targ, mode->m_mode); | ||
121 | + argv[n], hostname, remote_pth, mode->m_mode); | ||
122 | sa_set_port(&peeraddr, port); | ||
123 | - tftp_sendfile(fd, targ, mode->m_mode); | ||
124 | + tftp_sendfile(fd, remote_pth, mode->m_mode); | ||
125 | } | ||
126 | } | ||
127 | |||
128 | @@ -801,6 +822,10 @@ static void command(void) | ||
129 | free(line); | ||
130 | line = NULL; | ||
131 | } | ||
132 | + if (remote_pth) { | ||
133 | + free(remote_pth); | ||
134 | + remote_pth = NULL; | ||
135 | + } | ||
136 | line = readline(prompt); | ||
137 | if (!line) | ||
138 | exit(0); /* EOF */ | ||
139 | @@ -872,7 +897,13 @@ struct cmd *getcmd(char *name) | ||
140 | static void makeargv(void) | ||
141 | { | ||
142 | char *cp; | ||
143 | - char **argp = margv; | ||
144 | + char **argp; | ||
145 | + | ||
146 | + if (!sizeof_margv) { | ||
147 | + sizeof_margv = 20; | ||
148 | + margv = xmalloc(sizeof_margv * sizeof(char *)); | ||
149 | + } | ||
150 | + argp = margv; | ||
151 | |||
152 | margc = 0; | ||
153 | for (cp = line; *cp;) { | ||
154 | @@ -882,6 +913,11 @@ static void makeargv(void) | ||
155 | break; | ||
156 | *argp++ = cp; | ||
157 | margc += 1; | ||
158 | + if (margc == sizeof_margv) { | ||
159 | + sizeof_margv += 20; | ||
160 | + margv = xrealloc(margv, sizeof_margv * sizeof(char *)); | ||
161 | + argp = margv + margc; | ||
162 | + } | ||
163 | while (*cp != '\0' && !isspace(*cp)) | ||
164 | cp++; | ||
165 | if (*cp == '\0') | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch new file mode 100644 index 0000000000..85110eb285 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftpd/tftpd.c.tzfix tftp-hpa-0.49/tftpd/tftpd.c | ||
8 | --- tftp-hpa-0.49/tftpd/tftpd.c.tzfix 2008-10-20 18:08:31.000000000 -0400 | ||
9 | +++ tftp-hpa-0.49/tftpd/tftpd.c 2008-11-25 11:45:27.000000000 -0500 | ||
10 | @@ -350,6 +350,14 @@ int main(int argc, char **argv) | ||
11 | const char *pidfile = NULL; | ||
12 | u_short tp_opcode; | ||
13 | |||
14 | + time_t my_time = 0; | ||
15 | + struct tm* p_tm; | ||
16 | + char envtz[10]; | ||
17 | + my_time = time(NULL); | ||
18 | + p_tm = localtime(&my_time); | ||
19 | + snprintf(envtz, sizeof(envtz) - 1, "UTC%+d", (p_tm->tm_gmtoff * -1)/3600); | ||
20 | + setenv("TZ", envtz, 0); | ||
21 | + | ||
22 | /* basename() is way too much of a pain from a portability standpoint */ | ||
23 | |||
24 | p = strrchr(argv[0], '/'); | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch new file mode 100644 index 0000000000..08d2b5b7d6 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -urN tftp-hpa-0.49.orig/tftp/tftp.c tftp-hpa-0.49/tftp/tftp.c | ||
8 | --- tftp-hpa-0.49.orig/tftp/tftp.c 2008-10-20 18:08:31.000000000 -0400 | ||
9 | +++ tftp-hpa-0.49/tftp/tftp.c 2009-08-05 09:47:18.072585848 -0400 | ||
10 | @@ -279,15 +279,16 @@ | ||
11 | struct tftphdr *tp, const char *mode) | ||
12 | { | ||
13 | char *cp; | ||
14 | + size_t len; | ||
15 | |||
16 | tp->th_opcode = htons((u_short) request); | ||
17 | cp = (char *)&(tp->th_stuff); | ||
18 | - strcpy(cp, name); | ||
19 | - cp += strlen(name); | ||
20 | - *cp++ = '\0'; | ||
21 | - strcpy(cp, mode); | ||
22 | - cp += strlen(mode); | ||
23 | - *cp++ = '\0'; | ||
24 | + len = strlen(name) + 1; | ||
25 | + memcpy(cp, name, len); | ||
26 | + cp += len; | ||
27 | + len = strlen(mode) + 1; | ||
28 | + memcpy(cp, mode, len); | ||
29 | + cp += len; | ||
30 | return (cp - (char *)tp); | ||
31 | } | ||
32 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch new file mode 100644 index 0000000000..720cd69dec --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftp/tftp.c.stats tftp-hpa-0.49/tftp/tftp.c | ||
8 | --- tftp-hpa-0.49/tftp/tftp.c.stats 2011-01-03 15:38:34.217918067 +0100 | ||
9 | +++ tftp-hpa-0.49/tftp/tftp.c 2011-01-03 15:38:37.498917014 +0100 | ||
10 | @@ -400,8 +400,8 @@ static void printstats(const char *direc | ||
11 | { | ||
12 | double delta; | ||
13 | |||
14 | - delta = (tstop.tv_sec + (tstop.tv_usec / 100000.0)) - | ||
15 | - (tstart.tv_sec + (tstart.tv_usec / 100000.0)); | ||
16 | + delta = (tstop.tv_sec + (tstop.tv_usec / 1000000.0)) - | ||
17 | + (tstart.tv_sec + (tstart.tv_usec / 1000000.0)); | ||
18 | if (verbose) { | ||
19 | printf("%s %lu bytes in %.1f seconds", direction, amount, delta); | ||
20 | printf(" [%.0f bit/s]", (amount * 8.) / delta); | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch new file mode 100644 index 0000000000..216349d26f --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-5.2/tftpd/recvfrom.c.test tftp-hpa-5.2/tftpd/recvfrom.c | ||
8 | --- tftp-hpa-5.2/tftpd/recvfrom.c.test 2011-12-11 23:13:52.000000000 +0100 | ||
9 | +++ tftp-hpa-5.2/tftpd/recvfrom.c 2012-01-04 10:05:17.852042256 +0100 | ||
10 | @@ -149,16 +149,16 @@ myrecvfrom(int s, void *buf, int len, un | ||
11 | |||
12 | /* Try to enable getting the return address */ | ||
13 | #ifdef IP_RECVDSTADDR | ||
14 | - if (from->sa_family == AF_INET) | ||
15 | + if (from->sa_family == AF_INET || !from->sa_family) | ||
16 | setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on)); | ||
17 | #endif | ||
18 | #ifdef IP_PKTINFO | ||
19 | - if (from->sa_family == AF_INET) | ||
20 | + if (from->sa_family == AF_INET || !from->sa_family) | ||
21 | setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on)); | ||
22 | #endif | ||
23 | #ifdef HAVE_IPV6 | ||
24 | #ifdef IPV6_RECVPKTINFO | ||
25 | - if (from->sa_family == AF_INET6) | ||
26 | + if (from->sa_family == AF_INET6 || !from->sa_family) | ||
27 | setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)); | ||
28 | #endif | ||
29 | #endif | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd new file mode 100644 index 0000000000..fe70163966 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd | |||
@@ -0,0 +1,18 @@ | |||
1 | # default: off | ||
2 | # description: The tftp server serves files using the trivial file transfer \ | ||
3 | # protocol. The tftp protocol is often used to boot diskless \ | ||
4 | # workstations, download configuration files to network-aware printers, \ | ||
5 | # and to start the installation process for some operating systems. | ||
6 | service tftp | ||
7 | { | ||
8 | socket_type = dgram | ||
9 | protocol = udp | ||
10 | wait = yes | ||
11 | user = root | ||
12 | server = /usr/sbin/in.tftpd-hpa | ||
13 | server_args = -s /var/lib/tftpboot | ||
14 | disable = yes | ||
15 | per_source = 11 | ||
16 | cps = 100 2 | ||
17 | flags = IPv6 | ||
18 | } | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb new file mode 100644 index 0000000000..6978e0669c --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb | |||
@@ -0,0 +1,72 @@ | |||
1 | SUMMARY = "Client for the Trivial File Transfer Protocol" | ||
2 | DESCRIPTION = \ | ||
3 | "The Trivial File Transfer Protocol (TFTP) is normally used only for \ | ||
4 | booting diskless workstations. The tftp package provides the user \ | ||
5 | interface for TFTP, which allows users to transfer files to and from a \ | ||
6 | remote machine. This program and TFTP provide very little security, \ | ||
7 | and should not be enabled unless it is expressly needed." | ||
8 | DEPENDS = "tcp-wrappers readline" | ||
9 | SECTION = "network" | ||
10 | LICENSE = "BSD-4-Clause" | ||
11 | LIC_FILES_CHKSUM = "file://MCONFIG.in;beginline=1;endline=9;md5=c28ba5adb43041fae4629db05c83cbdd \ | ||
12 | file://tftp/tftp.c;beginline=1;endline=32;md5=988c1cba99d70858a26cd877209857f4" | ||
13 | |||
14 | |||
15 | SRC_URI = "http://kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-${PV}.tar.bz2 \ | ||
16 | file://tftp-0.40-remap.patch \ | ||
17 | file://tftp-0.42-tftpboot.patch \ | ||
18 | file://tftp-0.49-chk_retcodes.patch \ | ||
19 | file://tftp-0.49-cmd_arg.patch \ | ||
20 | file://tftp-hpa-0.39-tzfix.patch \ | ||
21 | file://tftp-hpa-0.49-fortify-strcpy-crash.patch \ | ||
22 | file://tftp-hpa-0.49-stats.patch \ | ||
23 | file://tftp-hpa-5.2-pktinfo.patch \ | ||
24 | file://default \ | ||
25 | file://init \ | ||
26 | file://add-error-check-for-disk-filled-up.patch \ | ||
27 | " | ||
28 | |||
29 | SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" | ||
30 | SRC_URI[sha256sum] = "0a9f88d4c1c02687b4853b02ab5dd8779d4de4ffdb9b2e5c9332841304d1a269" | ||
31 | |||
32 | inherit autotools update-rc.d update-alternatives | ||
33 | |||
34 | EXTRA_OECONF += "--disable-option-checking" | ||
35 | |||
36 | # configure.in has errors | ||
37 | do_configure() { | ||
38 | oe_runconf | ||
39 | } | ||
40 | |||
41 | do_install() { | ||
42 | oe_runmake install INSTALLROOT=${D} | ||
43 | mv ${D}${bindir}/tftp ${D}${bindir}/tftp-hpa | ||
44 | mv ${D}${sbindir}/in.tftpd ${D}${sbindir}/in.tftpd-hpa | ||
45 | |||
46 | install -m 755 -d ${D}${localstatedir}/lib/tftpboot/ | ||
47 | install -d ${D}${sysconfdir}/init.d | ||
48 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/tftpd-hpa | ||
49 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
50 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
51 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
52 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
53 | |||
54 | install -d ${D}${sysconfdir}/default | ||
55 | install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa | ||
56 | } | ||
57 | |||
58 | FILES_${PN} = "${bindir}" | ||
59 | |||
60 | PACKAGES += "tftp-hpa-server" | ||
61 | SUMMARY_tftp-hpa-server = "Server for the Trivial File Transfer Protocol" | ||
62 | FILES_tftp-hpa-server = "${sbindir} ${sysconfdir} ${localstatedir}" | ||
63 | CONFFILES_tftp-hpa-server = "${sysconfdir}/default/tftpd-hpa" | ||
64 | |||
65 | INITSCRIPT_PACKAGES = "tftp-hpa-server" | ||
66 | INITSCRIPT_NAME = "tftpd-hpa" | ||
67 | INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 20 1 ." | ||
68 | |||
69 | ALTERNATIVE_${PN} = "tftp" | ||
70 | ALTERNATIVE_TARGET[tftp] = "${bindir}/tftp-hpa" | ||
71 | ALTERNATIVE_PRIORITY = "50" | ||
72 | |||
diff --git a/meta-networking/recipes-daemons/vblade/files/cross.patch b/meta-networking/recipes-daemons/vblade/files/cross.patch new file mode 100644 index 0000000000..d2eb156143 --- /dev/null +++ b/meta-networking/recipes-daemons/vblade/files/cross.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Remove CC and CFLAGS values, we set these ourselves | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | diff -urN vblade-19.old//makefile vblade-19//makefile | ||
6 | --- vblade-19.old//makefile 2008-10-08 22:07:40.000000000 +0100 | ||
7 | +++ vblade-19//makefile 2008-11-18 19:07:51.700365029 +0000 | ||
8 | @@ -9,8 +9,6 @@ | ||
9 | mandir = ${sharedir}/man | ||
10 | |||
11 | O=aoe.o bpf.o ${PLATFORM}.o ata.o | ||
12 | -CFLAGS += -Wall -g -O2 | ||
13 | -CC = gcc | ||
14 | |||
15 | vblade: $O | ||
16 | ${CC} -o vblade $O | ||
diff --git a/meta-networking/recipes-daemons/vblade/vblade_20.bb b/meta-networking/recipes-daemons/vblade/vblade_20.bb new file mode 100644 index 0000000000..5b7c167643 --- /dev/null +++ b/meta-networking/recipes-daemons/vblade/vblade_20.bb | |||
@@ -0,0 +1,20 @@ | |||
1 | SUMMARY = "Virtual EtherDrive blade AoE target" | ||
2 | SECTION = "console/network" | ||
3 | |||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | |||
7 | SRC_URI = "${SOURCEFORGE_MIRROR}/aoetools/${BPN}-${PV}.tgz \ | ||
8 | file://cross.patch" | ||
9 | |||
10 | SRC_URI[md5sum] = "3c80e4a6bc7d66ae0c235b88cb44bd59" | ||
11 | SRC_URI[sha256sum] = "c8fe2fc4f2fba8e07e5cfdf17335982584eef2cd5c78bf8b1db93f2b56e7121d" | ||
12 | |||
13 | inherit autotools | ||
14 | |||
15 | do_install() { | ||
16 | install -D -m 0755 ${S}/vblade ${D}/${sbindir}/vblade | ||
17 | install -D -m 0755 ${S}/vbladed ${D}/${sbindir}/vbladed | ||
18 | install -D -m 0644 ${S}/vblade.8 ${D}/${mandir}/man8/vblade.8 | ||
19 | } | ||
20 | |||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch b/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch new file mode 100644 index 0000000000..5f2860e846 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | vsftpd: change default value of secure_chroot_dir | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Change secure_chroot_dir pointing to a volatile directory. | ||
6 | |||
7 | Signed-off-by: Ming Liu <ming.liu@windriver.com> | ||
8 | --- | ||
9 | INSTALL | 6 +++--- | ||
10 | tunables.c | 2 +- | ||
11 | vsftpd.conf.5 | 2 +- | ||
12 | 3 files changed, 5 insertions(+), 5 deletions(-) | ||
13 | |||
14 | diff -urpN a/INSTALL b/INSTALL | ||
15 | --- a/INSTALL 2013-09-13 10:23:57.504972397 +0800 | ||
16 | +++ b/INSTALL 2013-09-13 10:25:25.664971779 +0800 | ||
17 | @@ -27,11 +27,11 @@ user in case it does not already exist. | ||
18 | [root@localhost root]# useradd nobody | ||
19 | useradd: user nobody exists | ||
20 | |||
21 | -2b) vsftpd needs the (empty) directory /usr/share/empty in the default | ||
22 | +2b) vsftpd needs the (empty) directory /var/run/vsftpd/empty in the default | ||
23 | configuration. Add this directory in case it does not already exist. e.g.: | ||
24 | |||
25 | -[root@localhost root]# mkdir /usr/share/empty/ | ||
26 | -mkdir: cannot create directory `/usr/share/empty': File exists | ||
27 | +[root@localhost root]# mkdir /var/run/vsftpd/empty/ | ||
28 | +mkdir: cannot create directory `/var/run/vsftpd/empty': File exists | ||
29 | |||
30 | 2c) For anonymous FTP, you will need the user "ftp" to exist, and have a | ||
31 | valid home directory (which is NOT owned or writable by the user "ftp"). | ||
32 | diff -urpN a/tunables.c b/tunables.c | ||
33 | --- a/tunables.c 2013-09-13 10:26:29.554972817 +0800 | ||
34 | +++ b/tunables.c 2013-09-13 10:27:18.104972210 +0800 | ||
35 | @@ -254,7 +254,7 @@ tunables_load_defaults() | ||
36 | /* -rw------- */ | ||
37 | tunable_chown_upload_mode = 0600; | ||
38 | |||
39 | - install_str_setting("/usr/share/empty", &tunable_secure_chroot_dir); | ||
40 | + install_str_setting("/var/run/vsftpd/empty", &tunable_secure_chroot_dir); | ||
41 | install_str_setting("ftp", &tunable_ftp_username); | ||
42 | install_str_setting("root", &tunable_chown_username); | ||
43 | install_str_setting("/var/log/xferlog", &tunable_xferlog_file); | ||
44 | diff -urpN a/vsftpd.conf.5 b/vsftpd.conf.5 | ||
45 | --- a/vsftpd.conf.5 2013-09-13 10:09:33.774972462 +0800 | ||
46 | +++ b/vsftpd.conf.5 2013-09-13 10:10:41.914971989 +0800 | ||
47 | @@ -969,7 +969,7 @@ This option should be the name of a dire | ||
48 | directory should not be writable by the ftp user. This directory is used | ||
49 | as a secure chroot() jail at times vsftpd does not require filesystem access. | ||
50 | |||
51 | -Default: /usr/share/empty | ||
52 | +Default: /var/run/vsftpd/empty | ||
53 | .TP | ||
54 | .B ssl_ciphers | ||
55 | This option can be used to select which SSL ciphers vsftpd will allow for | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/init b/meta-networking/recipes-daemons/vsftpd/files/init new file mode 100755 index 0000000000..d0ec010dc7 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/init | |||
@@ -0,0 +1,41 @@ | |||
1 | #!/bin/sh | ||
2 | DAEMON=/usr/sbin/vsftpd | ||
3 | NAME=vsftpd | ||
4 | DESC="FTP Server" | ||
5 | ARGS="" | ||
6 | FTPDIR=/var/lib/ftp | ||
7 | |||
8 | test -f $DAEMON || exit 0 | ||
9 | |||
10 | set -e | ||
11 | |||
12 | case "$1" in | ||
13 | start) | ||
14 | echo -n "* starting $DESC: $NAME... " | ||
15 | if ! test -d $FTPDIR; then | ||
16 | mkdir -p $FTPDIR/in | ||
17 | chown ftp $FTPDIR -R | ||
18 | chmod a-w $FTPDIR | ||
19 | chmod u+w $FTPDIR/in | ||
20 | fi | ||
21 | start-stop-daemon -S -b -x $DAEMON -- $ARGS | ||
22 | echo "done." | ||
23 | ;; | ||
24 | stop) | ||
25 | echo -n "* stopping $DESC: $NAME... " | ||
26 | start-stop-daemon -K -x $DAEMON | ||
27 | echo "done." | ||
28 | ;; | ||
29 | restart) | ||
30 | echo "* restarting $DESC: $NAME... " | ||
31 | $0 stop | ||
32 | $0 start | ||
33 | echo "done." | ||
34 | ;; | ||
35 | *) | ||
36 | echo "Usage: $0 {start|stop|restart}" | ||
37 | exit 1 | ||
38 | ;; | ||
39 | esac | ||
40 | |||
41 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd b/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd new file mode 100644 index 0000000000..8a602ba37d --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd | |||
@@ -0,0 +1 @@ | |||
d root root 0755 /var/run/vsftpd/empty none | |||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf new file mode 100644 index 0000000000..bb1929480d --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf | |||
@@ -0,0 +1,139 @@ | |||
1 | # Example config file /etc/vsftpd.conf | ||
2 | # | ||
3 | # The default compiled in settings are fairly paranoid. This sample file | ||
4 | # loosens things up a bit, to make the ftp daemon more usable. | ||
5 | # Please see vsftpd.conf.5 for all compiled in defaults. | ||
6 | # | ||
7 | # READ THIS: This example file is NOT an exhaustive list of vsftpd options. | ||
8 | # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's | ||
9 | # capabilities. | ||
10 | |||
11 | # run standalone | ||
12 | listen=YES | ||
13 | |||
14 | # Allow anonymous FTP? (Beware - allowed by default if you comment this out). | ||
15 | anonymous_enable=NO | ||
16 | # | ||
17 | # Uncomment this to allow local users to log in. | ||
18 | local_enable=YES | ||
19 | # | ||
20 | # Uncomment this to enable any form of FTP write command. | ||
21 | write_enable=YES | ||
22 | # | ||
23 | # Default umask for local users is 077. You may wish to change this to 022, | ||
24 | # if your users expect that (022 is used by most other ftpd's) | ||
25 | local_umask=022 | ||
26 | # | ||
27 | # Uncomment this to allow the anonymous FTP user to upload files. This only | ||
28 | # has an effect if the above global write enable is activated. Also, you will | ||
29 | # obviously need to create a directory writable by the FTP user. | ||
30 | #anon_upload_enable=YES | ||
31 | # | ||
32 | # Uncomment this if you want the anonymous FTP user to be able to create | ||
33 | # new directories. | ||
34 | #anon_mkdir_write_enable=YES | ||
35 | # | ||
36 | # Activate directory messages - messages given to remote users when they | ||
37 | # go into a certain directory. | ||
38 | dirmessage_enable=YES | ||
39 | # | ||
40 | # Activate logging of uploads/downloads. | ||
41 | xferlog_enable=YES | ||
42 | # | ||
43 | # Make sure PORT transfer connections originate from port 20 (ftp-data). | ||
44 | connect_from_port_20=YES | ||
45 | # | ||
46 | # If you want, you can arrange for uploaded anonymous files to be owned by | ||
47 | # a different user. Note! Using "root" for uploaded files is not | ||
48 | # recommended! | ||
49 | #chown_uploads=YES | ||
50 | #chown_username=whoever | ||
51 | # | ||
52 | # You may override where the log file goes if you like. The default is shown | ||
53 | # below. | ||
54 | #xferlog_file=/var/log/vsftpd.log | ||
55 | # | ||
56 | # If you want, you can have your log file in standard ftpd xferlog format | ||
57 | xferlog_std_format=YES | ||
58 | # | ||
59 | # You may change the default value for timing out an idle session. | ||
60 | #idle_session_timeout=600 | ||
61 | # | ||
62 | # You may change the default value for timing out a data connection. | ||
63 | #data_connection_timeout=120 | ||
64 | # | ||
65 | # It is recommended that you define on your system a unique user which the | ||
66 | # ftp server can use as a totally isolated and unprivileged user. | ||
67 | #nopriv_user=ftp | ||
68 | # | ||
69 | # Enable this and the server will recognise asynchronous ABOR requests. Not | ||
70 | # recommended for security (the code is non-trivial). Not enabling it, | ||
71 | # however, may confuse older FTP clients. | ||
72 | #async_abor_enable=YES | ||
73 | # | ||
74 | # By default the server will pretend to allow ASCII mode but in fact ignore | ||
75 | # the request. Turn on the below options to have the server actually do ASCII | ||
76 | # mangling on files when in ASCII mode. | ||
77 | # Beware that turning on ascii_download_enable enables malicious remote parties | ||
78 | # to consume your I/O resources, by issuing the command "SIZE /big/file" in | ||
79 | # ASCII mode. | ||
80 | # These ASCII options are split into upload and download because you may wish | ||
81 | # to enable ASCII uploads (to prevent uploaded scripts etc. from breaking), | ||
82 | # without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be | ||
83 | # on the client anyway.. | ||
84 | #ascii_upload_enable=YES | ||
85 | #ascii_download_enable=YES | ||
86 | # | ||
87 | # You may fully customise the login banner string: | ||
88 | #ftpd_banner=Welcome to blah FTP service. | ||
89 | # | ||
90 | # You may specify a file of disallowed anonymous e-mail addresses. Apparently | ||
91 | # useful for combatting certain DoS attacks. | ||
92 | #deny_email_enable=YES | ||
93 | # (default follows) | ||
94 | #banned_email_file=/etc/vsftpd.banned_emails | ||
95 | # | ||
96 | # You may specify an explicit list of local users to chroot() to their home | ||
97 | # directory. If chroot_local_user is YES, then this list becomes a list of | ||
98 | # users to NOT chroot(). | ||
99 | #chroot_list_enable=YES | ||
100 | # (default follows) | ||
101 | #chroot_list_file=/etc/vsftpd.chroot_list | ||
102 | # | ||
103 | # You may activate the "-R" option to the builtin ls. This is disabled by | ||
104 | # default to avoid remote users being able to cause excessive I/O on large | ||
105 | # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume | ||
106 | # the presence of the "-R" option, so there is a strong case for enabling it. | ||
107 | #ls_recurse_enable=YES | ||
108 | # | ||
109 | # This string is the name of the PAM service vsftpd will use. | ||
110 | pam_service_name=vsftpd | ||
111 | # | ||
112 | # This option is examined if userlist_enable is activated. If you set this | ||
113 | # setting to NO, then users will be denied login unless they are explicitly | ||
114 | # listed in the file specified by userlist_file. When login is denied, the | ||
115 | # denial is issued before the user is asked for a password. | ||
116 | userlist_deny=YES | ||
117 | # | ||
118 | # If enabled, vsftpd will load a list of usernames, from the filename given by | ||
119 | # userlist_file. If a user tries to log in using a name in this file, they | ||
120 | # will be denied before they are asked for a password. This may be useful in | ||
121 | # preventing cleartext passwords being transmitted. See also userlist_deny. | ||
122 | userlist_enable=YES | ||
123 | # | ||
124 | # If enabled, vsftpd will display directory listings with the time in your | ||
125 | # local time zone. The default is to display GMT. The times returned by the | ||
126 | # MDTM FTP command are also affected by this option. | ||
127 | use_localtime=YES | ||
128 | # | ||
129 | # If set to YES, local users will be (by default) placed in a chroot() jail in | ||
130 | # their home directory after login. Warning: This option has security | ||
131 | # implications, especially if the users have upload permission, or shell access. | ||
132 | # Only enable if you know what you are doing. Note that these security implications | ||
133 | # are not vsftpd specific. They apply to all FTP daemons which offer to put | ||
134 | # local users in chroot() jails. | ||
135 | chroot_local_user=YES | ||
136 | # | ||
137 | allow_writeable_chroot=YES | ||
138 | # | ||
139 | tcp_wrappers=YES | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers new file mode 100644 index 0000000000..096142f5df --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers | |||
@@ -0,0 +1,15 @@ | |||
1 | # Users that are not allowed to login via ftp | ||
2 | root | ||
3 | bin | ||
4 | daemon | ||
5 | adm | ||
6 | lp | ||
7 | sync | ||
8 | shutdown | ||
9 | halt | ||
10 | |||
11 | news | ||
12 | uucp | ||
13 | operator | ||
14 | games | ||
15 | nobody | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list new file mode 100644 index 0000000000..d283e3d260 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list | |||
@@ -0,0 +1,20 @@ | |||
1 | # vsftpd userlist | ||
2 | # If userlist_deny=NO, only allow users in this file | ||
3 | # If userlist_deny=YES (default), never allow users in this file, and | ||
4 | # do not even prompt for a password. | ||
5 | # Note that the default vsftpd pam config also checks /etc/vsftpd.ftpusers | ||
6 | # for users that are denied. | ||
7 | root | ||
8 | bin | ||
9 | daemon | ||
10 | adm | ||
11 | lp | ||
12 | sync | ||
13 | shutdown | ||
14 | halt | ||
15 | |||
16 | news | ||
17 | uucp | ||
18 | operator | ||
19 | games | ||
20 | nobody | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-destdir.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-destdir.patch new file mode 100644 index 0000000000..1980d09fd4 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-destdir.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | Use DESTDIR within install to allow installing under a prefix | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | |||
7 | diff --git a/Makefile b/Makefile | ||
8 | --- a/Makefile | ||
9 | +++ b/Makefile | ||
10 | @@ -24,21 +24,21 @@ | ||
11 | $(CC) -o vsftpd $(OBJS) $(LINK) $(LIBS) | ||
12 | |||
13 | install: | ||
14 | - if [ -x /usr/local/sbin ]; then \ | ||
15 | - $(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \ | ||
16 | + if [ -x ${DESTDIR}/usr/local/sbin ]; then \ | ||
17 | + $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/local/sbin/vsftpd; \ | ||
18 | else \ | ||
19 | - $(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi | ||
20 | - if [ -x /usr/local/man ]; then \ | ||
21 | - $(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \ | ||
22 | - $(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \ | ||
23 | - elif [ -x /usr/share/man ]; then \ | ||
24 | - $(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \ | ||
25 | - $(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \ | ||
26 | + $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/sbin/vsftpd; fi | ||
27 | + if [ -x ${DESTDIR}/usr/local/man ]; then \ | ||
28 | + $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/local/man/man8/vsftpd.8; \ | ||
29 | + $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/local/man/man5/vsftpd.conf.5; \ | ||
30 | + elif [ -x ${DESTDIR}/usr/share/man ]; then \ | ||
31 | + $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/share/man/man8/vsftpd.8; \ | ||
32 | + $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/share/man/man5/vsftpd.conf.5; \ | ||
33 | else \ | ||
34 | - $(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \ | ||
35 | - $(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi | ||
36 | - if [ -x /etc/xinetd.d ]; then \ | ||
37 | - $(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi | ||
38 | + $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/man/man8/vsftpd.8; \ | ||
39 | + $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/man/man5/vsftpd.conf.5; fi | ||
40 | + if [ -x ${DESTDIR}/etc/xinetd.d ]; then \ | ||
41 | + $(INSTALL) -m 644 xinetd.d/vsftpd ${DESTDIR}/etc/xinetd.d/vsftpd; fi | ||
42 | |||
43 | clean: | ||
44 | rm -f *.o *.swp vsftpd | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-libs.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-libs.patch new file mode 100644 index 0000000000..9a10f722f4 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-libs.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Hardcode LIBS instead of using a script to determine available libs | ||
2 | |||
3 | We want to avoid this dynamic detection so we have a deterministic | ||
4 | build. | ||
5 | |||
6 | Upstream-Status: Inappropriate [config] | ||
7 | |||
8 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
9 | |||
10 | diff --git a/Makefile b/Makefile | ||
11 | --- a/Makefile | ||
12 | +++ b/Makefile | ||
13 | @@ -5,7 +5,7 @@ | ||
14 | #CFLAGS = -g | ||
15 | CFLAGS = -O2 -Wall -W -Wshadow #-pedantic -Werror -Wconversion | ||
16 | |||
17 | -LIBS = `./vsf_findlibs.sh` | ||
18 | +LIBS = -lssl -lcrypto -lnsl -lresolv | ||
19 | LINK = -Wl,-s | ||
20 | |||
21 | OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-strip.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-strip.patch new file mode 100644 index 0000000000..fd3160037f --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-strip.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Disable stripping at link time | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | |||
7 | diff --git a/Makefile b/Makefile | ||
8 | --- a/Makefile | ||
9 | +++ b/Makefile | ||
10 | @@ -9,7 +9,6 @@ CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \ | ||
11 | #-pedantic -Wconversion | ||
12 | |||
13 | LIBS = -lssl -lcrypto -lnsl -lresolv | ||
14 | -LINK = -Wl,-s | ||
15 | LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now | ||
16 | |||
17 | OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam-with-tcp_wrappers.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam-with-tcp_wrappers.patch new file mode 100644 index 0000000000..fdcf3a02b6 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam-with-tcp_wrappers.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Disable PAM | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
6 | diff -ur vsftpd-2.0.1_org/builddefs.h vsftpd-2.0.1_patch/builddefs.h | ||
7 | --- vsftpd-2.0.1_org/builddefs.h 2004-07-02 16:36:59.000000000 +0200 | ||
8 | +++ vsftpd-2.0.1_patch/builddefs.h 2004-07-21 09:34:49.044900488 +0200 | ||
9 | @@ -2,7 +2,7 @@ | ||
10 | #define VSF_BUILDDEFS_H | ||
11 | |||
12 | #define VSF_BUILD_TCPWRAPPERS | ||
13 | -#define VSF_BUILD_PAM | ||
14 | +#undef VSF_BUILD_PAM | ||
15 | #undef VSF_BUILD_SSL | ||
16 | |||
17 | #endif /* VSF_BUILDDEFS_H */ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam.patch new file mode 100644 index 0000000000..cf0d68e272 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Disable PAM | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | diff -ur vsftpd-2.0.1_org/builddefs.h vsftpd-2.0.1_patch/builddefs.h | ||
6 | --- vsftpd-2.0.1_org/builddefs.h 2004-07-02 16:36:59.000000000 +0200 | ||
7 | +++ vsftpd-2.0.1_patch/builddefs.h 2004-07-21 09:34:49.044900488 +0200 | ||
8 | @@ -2,7 +2,7 @@ | ||
9 | #define VSF_BUILDDEFS_H | ||
10 | |||
11 | #undef VSF_BUILD_TCPWRAPPERS | ||
12 | -#define VSF_BUILD_PAM | ||
13 | +#undef VSF_BUILD_PAM | ||
14 | #undef VSF_BUILD_SSL | ||
15 | |||
16 | #endif /* VSF_BUILDDEFS_H */ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/vsftpd-tcp_wrappers-support.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/vsftpd-tcp_wrappers-support.patch new file mode 100644 index 0000000000..69745b3a10 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/vsftpd-tcp_wrappers-support.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Enable tcp_wrapper. | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | builddefs.h | 2 +- | ||
8 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/builddefs.h b/builddefs.h | ||
11 | index e908352..0106d1a 100644 | ||
12 | --- a/builddefs.h | ||
13 | +++ b/builddefs.h | ||
14 | @@ -1,7 +1,7 @@ | ||
15 | #ifndef VSF_BUILDDEFS_H | ||
16 | #define VSF_BUILDDEFS_H | ||
17 | |||
18 | -#undef VSF_BUILD_TCPWRAPPERS | ||
19 | +#define VSF_BUILD_TCPWRAPPERS | ||
20 | #define VSF_BUILD_PAM | ||
21 | #undef VSF_BUILD_SSL | ||
22 | |||
23 | -- | ||
24 | 1.7.1 | ||
25 | |||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.0.bb b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.0.bb new file mode 100644 index 0000000000..0698a63258 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.0.bb | |||
@@ -0,0 +1,84 @@ | |||
1 | SUMMARY = "Very Secure FTP server" | ||
2 | HOMEPAGE = "https://security.appspot.com/vsftpd.html" | ||
3 | SECTION = "network" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271" | ||
6 | |||
7 | DEPENDS = "libcap openssl" | ||
8 | |||
9 | SRC_URI = "https://security.appspot.com/downloads/vsftpd-${PV}.tar.gz \ | ||
10 | file://makefile-destdir.patch \ | ||
11 | file://makefile-libs.patch \ | ||
12 | file://makefile-strip.patch \ | ||
13 | file://init \ | ||
14 | file://vsftpd.conf \ | ||
15 | file://vsftpd.user_list \ | ||
16 | file://vsftpd.ftpusers \ | ||
17 | file://change-secure_chroot_dir.patch \ | ||
18 | file://volatiles.99_vsftpd \ | ||
19 | " | ||
20 | |||
21 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \ | ||
22 | file://COPYRIGHT;md5=04251b2eb0f298dae376d92454f6f72e \ | ||
23 | file://LICENSE;md5=654df2042d44b8cac8a5654fc5be63eb" | ||
24 | SRC_URI[md5sum] = "ad9fa952558c2c5b0426ccaccff0f972" | ||
25 | SRC_URI[sha256sum] = "ef70205dcd0c7f03b008b9578fb44c0cbe31e66daab8cfafb9904747c17fc2a8" | ||
26 | |||
27 | PACKAGECONFIG ??= "tcp-wrappers" | ||
28 | PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers" | ||
29 | SRC_URI +="${@base_contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)}" | ||
30 | |||
31 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
32 | RDEPENDS_${PN} += "${@base_contains('DISTRO_FEATURES', 'pam', 'pam-plugin-listfile', '', d)}" | ||
33 | PAMLIB = "${@base_contains('DISTRO_FEATURES', 'pam', '-L${STAGING_BASELIBDIR} -lpam', '', d)}" | ||
34 | NOPAM_SRC ="${@base_contains('PACKAGECONFIG', 'tcp-wrappers', 'file://nopam-with-tcp_wrappers.patch', 'file://nopam.patch', d)}" | ||
35 | SRC_URI += "${@base_contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)}" | ||
36 | |||
37 | inherit update-rc.d useradd | ||
38 | |||
39 | CONFFILES_${PN} = "${sysconfdir}/vsftpd.conf" | ||
40 | LDFLAGS_append =" -lcrypt -lcap" | ||
41 | |||
42 | do_configure() { | ||
43 | # Fix hardcoded /usr, /etc, /var mess. | ||
44 | cat tunables.c|sed s:\"/usr:\"${prefix}:g|sed s:\"/var:\"${localstatedir}:g \ | ||
45 | |sed s:\"/etc:\"${sysconfdir}:g > tunables.c.new | ||
46 | mv tunables.c.new tunables.c | ||
47 | } | ||
48 | |||
49 | do_compile() { | ||
50 | oe_runmake "LIBS=-L${STAGING_LIBDIR} -lcrypt -lcap ${PAMLIB} -lwrap" | ||
51 | } | ||
52 | |||
53 | do_install() { | ||
54 | install -d ${D}${sbindir} | ||
55 | install -d ${D}${mandir}/man8 | ||
56 | install -d ${D}${mandir}/man5 | ||
57 | oe_runmake 'DESTDIR=${D}' install | ||
58 | install -d ${D}${sysconfdir} | ||
59 | install -m 600 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}/vsftpd.conf | ||
60 | install -d ${D}${sysconfdir}/init.d/ | ||
61 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/vsftpd | ||
62 | install -d ${D}/${sysconfdir}/default/volatiles | ||
63 | install -m 644 ${WORKDIR}/volatiles.99_vsftpd ${D}/${sysconfdir}/default/volatiles/99_vsftpd | ||
64 | |||
65 | install -m 600 ${WORKDIR}/vsftpd.ftpusers ${D}${sysconfdir}/ | ||
66 | install -m 600 ${WORKDIR}/vsftpd.user_list ${D}${sysconfdir}/ | ||
67 | if ! test -z "${PAMLIB}" ; then | ||
68 | install -d ${D}${sysconfdir}/pam.d/ | ||
69 | cp ${S}/RedHat/vsftpd.pam ${D}${sysconfdir}/pam.d/vsftpd | ||
70 | sed -i "s:/lib/security:${base_libdir}/security:" ${D}${sysconfdir}/pam.d/vsftpd | ||
71 | sed -i "s:ftpusers:vsftpd.ftpusers:" ${D}${sysconfdir}/pam.d/vsftpd | ||
72 | fi | ||
73 | install -d ${D}${localstatedir}/run/vsftpd/empty | ||
74 | } | ||
75 | |||
76 | INITSCRIPT_PACKAGES = "${PN}" | ||
77 | INITSCRIPT_NAME_${PN} = "vsftpd" | ||
78 | INITSCRIPT_PARAMS_${PN} = "defaults 80" | ||
79 | |||
80 | USERADD_PACKAGES = "${PN}" | ||
81 | USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ftp --no-create-home -g ftp \ | ||
82 | --shell /bin/false ftp " | ||
83 | GROUPADD_PARAM_${PN} = "-r ftp" | ||
84 | |||