diff options
Diffstat (limited to 'meta-networking/recipes-daemons')
109 files changed, 5475 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 000000000..480bc702e --- /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 000000000..ee84f7725 --- /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 000000000..fc64291cd --- /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 000000000..280b570b2 --- /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 000000000..28fba6cf5 --- /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 000000000..161d97aca --- /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.1.0/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch new file mode 100644 index 000000000..742f25de1 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/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.1.0/Makefile.rules-cross.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/Makefile.rules-cross.patch new file mode 100644 index 000000000..7dc7096c2 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/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.1.0/add-the-needed-stdarg.h.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/add-the-needed-stdarg.h.patch new file mode 100644 index 000000000..fdb906b22 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/add-the-needed-stdarg.h.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | [PATCH] add the needed stdarg.h | ||
2 | |||
3 | Upstream-status: Pending | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | lib/defaults.c | 1 + | ||
8 | 1 file changed, 1 insertion(+) | ||
9 | |||
10 | diff --git a/lib/defaults.c b/lib/defaults.c | ||
11 | index 2b03ea2..5728e67 100644 | ||
12 | --- a/lib/defaults.c | ||
13 | +++ b/lib/defaults.c | ||
14 | @@ -16,6 +16,7 @@ | ||
15 | |||
16 | #include <stdlib.h> | ||
17 | #include <stdio.h> | ||
18 | +#include <stdarg.h> | ||
19 | #include <ctype.h> | ||
20 | #include <string.h> | ||
21 | #include <sys/utsname.h> | ||
22 | -- | ||
23 | 1.7.10.4 | ||
24 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-do-not-check-for-modprobe.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-do-not-check-for-modprobe.patch new file mode 100644 index 000000000..af5be6a83 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/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.1.0/autofs-5.0.7-fix-lib-deps.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-fix-lib-deps.patch new file mode 100644 index 000000000..09fea495d --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/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.1.0/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch new file mode 100644 index 000000000..3a878980a --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/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.1.0/autofs-additional-distros.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-additional-distros.patch new file mode 100644 index 000000000..6a35843ce --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/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.1.0/cross.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/cross.patch new file mode 100644 index 000000000..8f1af625f --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/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.1.0/fix_disable_ldap.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/fix_disable_ldap.patch new file mode 100644 index 000000000..31c8510a6 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/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.1.0/force-STRIP-to-emtpy.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/force-STRIP-to-emtpy.patch new file mode 100644 index 000000000..634005bd2 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/force-STRIP-to-emtpy.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | [PATCH] force STRIP to emtpy | ||
2 | |||
3 | otherwise the generate file will be stripped | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | Makefile.rules | 2 +- | ||
8 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
9 | |||
10 | diff --git a/Makefile.rules b/Makefile.rules | ||
11 | index 710a2c9..e4334db 100644 | ||
12 | --- a/Makefile.rules | ||
13 | +++ b/Makefile.rules | ||
14 | @@ -31,7 +31,7 @@ LDFLAGS ?= -s | ||
15 | endif | ||
16 | |||
17 | ifdef DONTSTRIP | ||
18 | -STRIP ?= : | ||
19 | +STRIP = : | ||
20 | else | ||
21 | STRIP ?= strip --strip-debug | ||
22 | endif | ||
23 | -- | ||
24 | 1.7.10.4 | ||
25 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/libtirpc-name-clash-backout.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/libtirpc-name-clash-backout.patch new file mode 100644 index 000000000..e93021d56 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/libtirpc-name-clash-backout.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | --- | ||
2 | lib/rpc_subs.c | 10 ---------- | ||
3 | 1 file changed, 10 deletions(-) | ||
4 | |||
5 | diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c | ||
6 | index 5d6ead0..c7177f2 100644 | ||
7 | --- a/lib/rpc_subs.c | ||
8 | +++ b/lib/rpc_subs.c | ||
9 | @@ -34,16 +34,6 @@ | ||
10 | #include <poll.h> | ||
11 | |||
12 | #ifdef WITH_LIBTIRPC | ||
13 | -#undef auth_destroy | ||
14 | -#define auth_destroy(auth) \ | ||
15 | - do { \ | ||
16 | - int refs; \ | ||
17 | - if ((refs = auth_put((auth))) == 0) \ | ||
18 | - ((*((auth)->ah_ops->ah_destroy))(auth));\ | ||
19 | - } while (0) | ||
20 | -#endif | ||
21 | - | ||
22 | -#ifdef WITH_LIBTIRPC | ||
23 | const rpcprog_t rpcb_prog = RPCBPROG; | ||
24 | const rpcvers_t rpcb_version = RPCBVERS; | ||
25 | #else | ||
26 | -- | ||
27 | 1.7.10.4 | ||
28 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/libtirpc.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/libtirpc.patch new file mode 100644 index 000000000..d68944b45 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/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 | LIBS += -lpthread | ||
20 | |||
21 | ifdef TIRPCLIB | ||
22 | -CFLAGS += -I/usr/include/tirpc | ||
23 | +CFLAGS += -I=/usr/include/tirpc | ||
24 | LIBS += $(TIRPCLIB) | ||
25 | endif | ||
26 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/no-bash.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/no-bash.patch new file mode 100644 index 000000000..cf0363527 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/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.1.0/remove-bashism.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/remove-bashism.patch new file mode 100644 index 000000000..282d6f0ad --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/remove-bashism.patch | |||
@@ -0,0 +1,120 @@ | |||
1 | From 79034f969bbd12215d65b4337dfd38a13d02d4ef Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Sat, 13 Sep 2014 20:19:28 -0700 | ||
4 | Subject: [PATCH] autofs.init.in: remove bashism | ||
5 | |||
6 | It can work without the bashism. | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> | ||
11 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
12 | --- | ||
13 | redhat/autofs.init.in | 12 ++++++------ | ||
14 | samples/rc.autofs.in | 10 +++++----- | ||
15 | 2 files changed, 11 insertions(+), 11 deletions(-) | ||
16 | |||
17 | diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in | ||
18 | index 9d008ff..4f1c0d8 100644 | ||
19 | --- a/redhat/autofs.init.in | ||
20 | +++ b/redhat/autofs.init.in | ||
21 | @@ -1,4 +1,4 @@ | ||
22 | -#!/bin/bash | ||
23 | +#!/bin/sh | ||
24 | # | ||
25 | # rc file for automount using a Sun-style "master map". | ||
26 | # | ||
27 | @@ -42,7 +42,7 @@ if [ -r $confdir/autofs ]; then | ||
28 | . $confdir/autofs | ||
29 | fi | ||
30 | |||
31 | -function start() { | ||
32 | +start() { | ||
33 | # Make sure autofs4 module is loaded | ||
34 | if ! grep -q autofs /proc/filesystems | ||
35 | then | ||
36 | @@ -102,7 +102,7 @@ function start() { | ||
37 | return $RETVAL | ||
38 | } | ||
39 | |||
40 | -function stop() { | ||
41 | +stop() { | ||
42 | echo -n $"Stopping $prog: " | ||
43 | count=0 | ||
44 | while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do | ||
45 | @@ -125,7 +125,7 @@ function stop() { | ||
46 | return $RETVAL | ||
47 | } | ||
48 | |||
49 | -function restart() { | ||
50 | +restart() { | ||
51 | status autofs > /dev/null 2>&1 | ||
52 | if [ $? -eq 0 ]; then | ||
53 | stop | ||
54 | @@ -143,7 +143,7 @@ function restart() { | ||
55 | start | ||
56 | } | ||
57 | |||
58 | -function reload() { | ||
59 | +reload() { | ||
60 | if [ ! -f /var/lock/subsys/autofs ]; then | ||
61 | echo $"$prog not running" | ||
62 | RETVAL=1 | ||
63 | @@ -161,7 +161,7 @@ function reload() { | ||
64 | return $RETVAL | ||
65 | } | ||
66 | |||
67 | -function usage_message() { | ||
68 | +usage_message() { | ||
69 | echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart|usage}" | ||
70 | } | ||
71 | |||
72 | diff --git a/samples/rc.autofs.in b/samples/rc.autofs.in | ||
73 | index 487669f..e96cde1 100644 | ||
74 | --- a/samples/rc.autofs.in | ||
75 | +++ b/samples/rc.autofs.in | ||
76 | @@ -1,4 +1,4 @@ | ||
77 | -#!/bin/bash | ||
78 | +#!/bin/sh | ||
79 | # | ||
80 | # rc file for automount using a Sun-style "master map". | ||
81 | # | ||
82 | @@ -36,7 +36,7 @@ if [ -r $confdir/autofs ]; then | ||
83 | . $confdir/autofs | ||
84 | fi | ||
85 | |||
86 | -function start() { | ||
87 | +start() { | ||
88 | echo -n "Starting $prog: " | ||
89 | |||
90 | # Make sure autofs4 module is loaded | ||
91 | @@ -85,7 +85,7 @@ function start() { | ||
92 | return $RETVAL | ||
93 | } | ||
94 | |||
95 | -function stop() { | ||
96 | +stop() { | ||
97 | echo -n $"Stopping $prog: " | ||
98 | count=0 | ||
99 | while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do | ||
100 | @@ -102,7 +102,7 @@ function stop() { | ||
101 | return $RETVAL | ||
102 | } | ||
103 | |||
104 | -function restart() { | ||
105 | +restart() { | ||
106 | stop | ||
107 | while [ -n "`pidof $prog`" ] ; do | ||
108 | sleep 5 | ||
109 | @@ -110,7 +110,7 @@ function restart() { | ||
110 | start | ||
111 | } | ||
112 | |||
113 | -function reload() { | ||
114 | +reload() { | ||
115 | pid=`pidof $prog` | ||
116 | if [ -z $pid ]; then | ||
117 | echo $"$prog not running" | ||
118 | -- | ||
119 | 1.7.9.5 | ||
120 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch new file mode 100644 index 000000000..93b76bd66 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | using pkg-config to detect libxml-2.0 and krb5 | ||
2 | |||
3 | Upstream-status: Pending | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | configure.in | 16 ++++++++++++++-- | ||
8 | 2 files changed, 14 insertions(+), 2 deletions(-) | ||
9 | |||
10 | diff --git a/configure.in b/configure.in | ||
11 | index 392d122..a3028aa 100644 | ||
12 | --- a/configure.in | ||
13 | +++ b/configure.in | ||
14 | @@ -162,8 +162,20 @@ if test x$enable_sloppy_mount = xyes; then | ||
15 | fi | ||
16 | |||
17 | # LDAP SASL auth needs libxml and Kerberos | ||
18 | -AF_CHECK_LIBXML() | ||
19 | -AF_CHECK_KRB5() | ||
20 | +PKG_CHECK_MODULES(XML, [libxml-2.0],HAVE_LIBXML=1,HAVE_LIBXML=0) | ||
21 | +AC_SUBST([HAVE_LIBXML]) | ||
22 | +XML_FLAGS=$XML_CFLAGS | ||
23 | + | ||
24 | +PKG_CHECK_MODULES(KRB5, [krb5],HAVE_KRB5=1,HAVE_KRB5=0) | ||
25 | +AC_SUBST([HAVE_KRB5]) | ||
26 | +if test "x$HAVE_KRB5" = "x1"; then | ||
27 | + SAVE_CFLAGS=$CFLAGS | ||
28 | + SAVE_LIBS=$LIBS | ||
29 | + CFLAGS="$CFLAGS $KRB5_FLAGS" | ||
30 | + LIBS="$LIBS $KRB5_LIBS" | ||
31 | + | ||
32 | + AC_CHECK_FUNCS([krb5_principal_get_realm]) | ||
33 | +fi | ||
34 | |||
35 | AC_SEARCH_LIBS([versionsort],[]) | ||
36 | if test "$ac_cv_search_versionsort" = "no"; then | ||
37 | -- | ||
38 | 1.7.10.4 | ||
39 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs_5.1.0.bb b/meta-networking/recipes-daemons/autofs/autofs_5.1.0.bb new file mode 100644 index 000000000..13af2fe45 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs_5.1.0.bb | |||
@@ -0,0 +1,71 @@ | |||
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 | DEPENDS += "libtirpc flex-native bison-native" | ||
7 | |||
8 | inherit autotools-brokensep systemd | ||
9 | |||
10 | SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \ | ||
11 | file://autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch \ | ||
12 | file://no-bash.patch \ | ||
13 | file://cross.patch \ | ||
14 | file://libtirpc.patch \ | ||
15 | file://libtirpc-name-clash-backout.patch \ | ||
16 | file://autofs-5.0.7-do-not-check-for-modprobe.patch \ | ||
17 | file://fix_disable_ldap.patch \ | ||
18 | file://autofs-5.0.7-fix-lib-deps.patch \ | ||
19 | file://add-the-needed-stdarg.h.patch \ | ||
20 | file://using-pkg-config-to-detect-libxml-2.0-and-krb5.patch \ | ||
21 | file://force-STRIP-to-emtpy.patch \ | ||
22 | file://remove-bashism.patch \ | ||
23 | " | ||
24 | |||
25 | SRC_URI[md5sum] = "b7724a9a55923f3c06933a8dfd1e79d3" | ||
26 | SRC_URI[sha256sum] = "794a28d178d2b21a2380ee71cbdb3b15b4be47c06f3de255b8c5c4351f046b26" | ||
27 | |||
28 | inherit update-rc.d pkgconfig | ||
29 | |||
30 | INITSCRIPT_NAME = "autofs" | ||
31 | INITSCRIPT_PARAMS = "defaults" | ||
32 | |||
33 | # FIXME: modules/Makefile has crappy rules that don't obey LDFLAGS | ||
34 | CFLAGS += "${LDFLAGS}" | ||
35 | |||
36 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd,systemd" | ||
37 | |||
38 | PACKAGECONFIG ?= "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" | ||
39 | |||
40 | EXTRA_OEMAKE = "DONTSTRIP=1" | ||
41 | EXTRA_OECONF += "--disable-mount-locking \ | ||
42 | --enable-ignore-busy --with-openldap=no \ | ||
43 | --with-sasl=no --with-libtirpc=yes \ | ||
44 | --with-path=${STAGING_BINDIR_NATIVE} \ | ||
45 | " | ||
46 | CACHED_CONFIGUREVARS = "ac_cv_path_RANLIB=${RANLIB} \ | ||
47 | ac_cv_path_RPCGEN=rpcgen \ | ||
48 | " | ||
49 | |||
50 | do_configure_prepend () { | ||
51 | sed -e "s:filagdir:flagdir:" -i configure.in | ||
52 | if [ ! -e acinclude.m4 ]; then | ||
53 | cp aclocal.m4 acinclude.m4 | ||
54 | fi | ||
55 | } | ||
56 | |||
57 | do_install_append () { | ||
58 | if [ -d ${D}/run ]; then | ||
59 | rmdir ${D}/run | ||
60 | fi | ||
61 | if [ -d ${D}${localstatedir}/run ]; then | ||
62 | rmdir ${D}${localstatedir}/run | ||
63 | fi | ||
64 | } | ||
65 | |||
66 | INSANE_SKIP_${PN} = "dev-so" | ||
67 | |||
68 | RPROVIDES_${PN} += "${PN}-systemd" | ||
69 | RREPLACES_${PN} += "${PN}-systemd" | ||
70 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
71 | 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 000000000..3fa8431c3 --- /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 000000000..6407721ae --- /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 000000000..8eff5a8bd --- /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 000000000..2e5b1750d --- /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 000000000..ecbab845d --- /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 000000000..ea9cd1c24 --- /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-brokensep 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/iscsi-initiator-utils/files/99_iscsi-initiator-utils b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils new file mode 100644 index 000000000..42fdd602f --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils | |||
@@ -0,0 +1,2 @@ | |||
1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
2 | d root root 0755 /var/lock/iscsi none | ||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian new file mode 100644 index 000000000..99a763861 --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian | |||
@@ -0,0 +1,119 @@ | |||
1 | #! /bin/sh | ||
2 | ### BEGIN INIT INFO | ||
3 | # Provides: | ||
4 | # Required-Start: | ||
5 | # Required-Stop: | ||
6 | # Default-Start: | ||
7 | # Default-Stop: | ||
8 | # Short-Description: Starts and stops the iSCSI initiator services and logins to default targets | ||
9 | ### END INIT INFO | ||
10 | #set -x | ||
11 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
12 | DAEMON=/usr/sbin/iscsid | ||
13 | ADM=/usr/sbin/iscsiadm | ||
14 | PIDFILE=/var/run/iscsid.pid | ||
15 | |||
16 | [ -x "$DAEMON" ] || exit 0 | ||
17 | |||
18 | if [ ! -d /sys/class/ ]; then | ||
19 | echo "Failure:" "iSCSI requires a mounted sysfs, not started." | ||
20 | exit 1 | ||
21 | fi | ||
22 | |||
23 | nodestartup_re='s/^node\.conn\[0]\.startup[ ]*=[ ]*//p' | ||
24 | |||
25 | RETVAL=0 | ||
26 | |||
27 | start() { | ||
28 | echo "Starting iSCSI initiator service" "iscsid" | ||
29 | modprobe -q iscsi_tcp 2>/dev/null || : | ||
30 | modprobe -q ib_iser 2>/dev/null || : | ||
31 | if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then | ||
32 | INITIATORNAME=$(iscsi-iname) | ||
33 | cat >/etc/iscsi/initiatorname.iscsi <<EOF | ||
34 | ## DO NOT EDIT OR REMOVE THIS FILE! | ||
35 | ## If you remove this file, the iSCSI daemon will not start. | ||
36 | ## If you change the InitiatorName, existing access control lists | ||
37 | ## may reject this initiator. The InitiatorName must be unique | ||
38 | ## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames. | ||
39 | InitiatorName=$INITIATORNAME | ||
40 | EOF | ||
41 | fi | ||
42 | start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON | ||
43 | RETVAL=$? | ||
44 | starttargets | ||
45 | } | ||
46 | |||
47 | starttargets() { | ||
48 | echo "Setting up iSCSI targets" | ||
49 | $ADM -m node --loginall=automatic | ||
50 | } | ||
51 | |||
52 | stoptargets() { | ||
53 | echo "Disconnecting iSCSI targets" | ||
54 | sync | ||
55 | $ADM -m node --logoutall=all | ||
56 | RETVAL=$? | ||
57 | #if RETVAL is 21, means no active sessions, consider ok | ||
58 | if [ "$RETVAL" = "21" ]; then | ||
59 | RETVAL=0 | ||
60 | fi | ||
61 | } | ||
62 | |||
63 | stop() { | ||
64 | stoptargets | ||
65 | if [ $RETVAL -ne 0 ]; then | ||
66 | echo "Failure:" "Could not stop all targets, try again later" | ||
67 | return $RETVAL | ||
68 | fi | ||
69 | |||
70 | echo "Stopping iSCSI initiator service" | ||
71 | start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON | ||
72 | rm -f $PIDFILE | ||
73 | status=0 | ||
74 | modprobe -r ib_iser 2>/dev/null | ||
75 | if [ "$?" -ne "0" -a "$?" -ne "1" ]; then | ||
76 | status=1 | ||
77 | fi | ||
78 | modprobe -r iscsi_tcp 2>/dev/null | ||
79 | if [ "$?" -ne "0" -a "$?" -ne "1" ]; then | ||
80 | status=1 | ||
81 | fi | ||
82 | } | ||
83 | |||
84 | restart() { | ||
85 | stop | ||
86 | if [ $RETVAL -ne 0 ]; then | ||
87 | echo "Failure:" "Stopping iSCSI initiator service failed, not starting" | ||
88 | return $RETVAL | ||
89 | fi | ||
90 | start | ||
91 | } | ||
92 | |||
93 | restarttargets() { | ||
94 | stoptargets | ||
95 | if [ $RETVAL -ne 0 ]; then | ||
96 | echo "Failure:" "Could not stop all targets, try again later" | ||
97 | return $RETVAL | ||
98 | fi | ||
99 | starttargets | ||
100 | } | ||
101 | |||
102 | status() { | ||
103 | #XXX FIXME: what to do here? | ||
104 | #status iscsid | ||
105 | # list active sessions | ||
106 | echo Current active iSCSI sessions: | ||
107 | $ADM -m session | ||
108 | } | ||
109 | |||
110 | case "$1" in | ||
111 | start|starttargets|stop|stoptargets|restart|restarttargets|status) | ||
112 | $1 | ||
113 | ;; | ||
114 | *) | ||
115 | echo "Usage: $0 {start|stop|restart|status}" | ||
116 | exit 1 | ||
117 | ;; | ||
118 | esac | ||
119 | exit $RETVAL | ||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator new file mode 100644 index 000000000..7fa49a2d6 --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator | |||
@@ -0,0 +1,4 @@ | |||
1 | # default command line settings for open-iscsi's iscsid | ||
2 | |||
3 | OPTS_ISCSID="" | ||
4 | OPTS_ISCSIADM="" | ||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service new file mode 100644 index 000000000..564b2d21d --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service | |||
@@ -0,0 +1,15 @@ | |||
1 | [Unit] | ||
2 | Description=Open-iSCSI initiator (i.e. client) target bindings | ||
3 | After=iscsi-initiator.service | ||
4 | Requires=iscsi-initiator.service | ||
5 | |||
6 | [Service] | ||
7 | Type=oneshot | ||
8 | EnvironmentFile=/etc/default/iscsi-initiator | ||
9 | ExecStart=/usr/sbin/iscsiadm -m node --loginall=automatic $OPTS_ISCSIADM | ||
10 | ExecStop=/usr/sbin/iscsiadm -m node --logoutall=all $OPTS_ISCSIADM | ||
11 | RemainAfterExit=yes | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
15 | |||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-dont-use-static.patch b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-dont-use-static.patch new file mode 100644 index 000000000..ce48e2bb3 --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-dont-use-static.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | iscsi-initiator-utils not to use static | ||
2 | |||
3 | Upstream-status: Backport | ||
4 | This patch is from fedora17. | ||
5 | |||
6 | Signed-off-by: Yao Zhao <yao.zhao@windriver.com> | ||
7 | Signed-off-by: Vu Tran <vu.tran@windriver.com> | ||
8 | |||
9 | diff --git a/usr/Makefile b/usr/Makefile | ||
10 | index 673b7f1..fd14a10 100644 | ||
11 | --- a/usr/Makefile | ||
12 | +++ b/usr/Makefile | ||
13 | @@ -61,7 +61,7 @@ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o | ||
14 | |||
15 | iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \ | ||
16 | iscsistart.o statics.o | ||
17 | - $(CC) $(CFLAGS) -static $^ -o $@ | ||
18 | + $(CC) $(CFLAGS) $^ -o $@ | ||
19 | clean: | ||
20 | rm -f *.o $(PROGRAMS) .depend $(LIBSYS) | ||
21 | |||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-use-var-for-config.patch b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-use-var-for-config.patch new file mode 100644 index 000000000..50227a774 --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-use-var-for-config.patch | |||
@@ -0,0 +1,240 @@ | |||
1 | iscsi-initiator-utils to use var for config | ||
2 | |||
3 | Upstream-status: Backport | ||
4 | This patch is from fedora. | ||
5 | |||
6 | Use /var/lib/iscsi/ instead of /etc/iscsi/ for holding | ||
7 | state files. | ||
8 | |||
9 | Signed-off-by: Yao Zhao <yao.zhao@windriver.com> | ||
10 | Signed-off-by: Vu Tran <vu.tran@windriver.com> | ||
11 | |||
12 | diff --git a/README b/README | ||
13 | index 7364b2d..5e8bff8 100644 | ||
14 | --- a/README | ||
15 | +++ b/README | ||
16 | @@ -164,10 +164,10 @@ available on all Linux installations. | ||
17 | |||
18 | The database contains two tables: | ||
19 | |||
20 | -- Discovery table (/etc/iscsi/send_targets); | ||
21 | -- Node table (/etc/iscsi/nodes). | ||
22 | +- Discovery table (/var/lib/iscsi/send_targets); | ||
23 | +- Node table (/var/lib/iscsi/nodes). | ||
24 | |||
25 | -The regular place for iSCSI database files: /etc/iscsi/nodes | ||
26 | +The regular place for iSCSI database files: /var/lib/iscsi/nodes | ||
27 | |||
28 | The iscsiadm utility is a command-line tool to manage (update, delete, | ||
29 | insert, query) the persistent database. | ||
30 | @@ -444,7 +444,7 @@ a scsi_host per HBA port). | ||
31 | To manage both types of initiator stacks, iscsiadm uses the interface (iface) | ||
32 | structure. For each HBA port or for software iscsi for each network | ||
33 | device (ethX) or NIC, that you wish to bind sessions to you must create | ||
34 | -a iface config /etc/iscsi/ifaces. | ||
35 | +a iface config /var/lib/iscsi/ifaces. | ||
36 | |||
37 | Prep: | ||
38 | |||
39 | @@ -478,29 +478,29 @@ Running: | ||
40 | iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax | ||
41 | iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax | ||
42 | |||
43 | -Will report iface configurations that are setup in /etc/iscsi/ifaces. | ||
44 | +Will report iface configurations that are setup in /var/lib/iscsi/ifaces. | ||
45 | The format is: | ||
46 | |||
47 | iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname | ||
48 | |||
49 | For software iscsi, you can create the iface configs by hand, but it is | ||
50 | reccomended that you use iscsiadm's iface mode. There is a iface.example in | ||
51 | -/etc/iscsi/ifaces which can be used as a template for the daring. | ||
52 | +/var/lib/iscsi/ifaces which can be used as a template for the daring. | ||
53 | |||
54 | For each network object you wish to bind a session to you must create | ||
55 | -a seperate iface config in /etc/iscsi/ifaces and each iface config file | ||
56 | +a seperate iface config in /var/lib/iscsi/ifaces and each iface config file | ||
57 | must have a unique name which is less than or equal to 64 characters. | ||
58 | |||
59 | Example: | ||
60 | |||
61 | If you have NIC1 with MAC address 00:0F:1F:92:6B:BF and NIC2 with | ||
62 | MAC address 00:C0:DD:08:63:E7 and you wanted to do software iscsi over | ||
63 | -TCP/IP. Then in /etc/iscsi/ifaces/iface0 you would enter: | ||
64 | +TCP/IP. Then in /var/lib/iscsi/ifaces/iface0 you would enter: | ||
65 | |||
66 | iface.transport_name = tcp | ||
67 | iface.hwaddress = 00:0F:1F:92:6B:BF | ||
68 | |||
69 | -and in /etc/iscsi/ifaces/iface1 you would enter: | ||
70 | +and in /var/lib/iscsi/ifaces/iface1 you would enter: | ||
71 | |||
72 | iface.transport_name = tcp | ||
73 | iface.hwaddress = 00:C0:DD:08:63:E7 | ||
74 | @@ -550,7 +550,7 @@ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty> | ||
75 | qla4xxx.00:0e:1e:04:8b:2e qla4xxx,00:0e:1e:04:8b:2e,<empty>,<empty>,<empty> | ||
76 | |||
77 | |||
78 | -Will report iface configurations that are setup in /etc/iscsi/ifaces. | ||
79 | +Will report iface configurations that are setup in /var/lib/iscsi/ifaces. | ||
80 | The format is: | ||
81 | |||
82 | iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname | ||
83 | @@ -636,7 +636,7 @@ need a seperate network connection to the target for discovery purposes. | ||
84 | *This will be fixed in the next version of open-iscsi* | ||
85 | |||
86 | For compatibility reasons, when you run iscsiadm to do discovery, it | ||
87 | -will check for interfaces in /etc/iscsi/iscsi/ifaces that are using | ||
88 | +will check for interfaces in /var/lib/iscsi/iscsi/ifaces that are using | ||
89 | tcp for the iface.transport and it will bind the portals that are discovered | ||
90 | so that they will be logged in through those ifaces. This behavior can also | ||
91 | be overriden by passing in the interfaces you want to use. For the case | ||
92 | @@ -654,7 +654,7 @@ we do not bind a session to a iface, then you can use the special iface | ||
93 | |||
94 | iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1 | ||
95 | |||
96 | -And if you did not define any interfaces in /etc/iscsi/ifaces and do | ||
97 | +And if you did not define any interfaces in /var/lib/iscsi/ifaces and do | ||
98 | not pass anything into iscsiadm, running iscsiadm will do the default | ||
99 | behavior, where we allow the network subsystem to decide which | ||
100 | device to use. | ||
101 | @@ -696,7 +696,7 @@ To now log into targets it is the same as with sofware iscsi. See section | ||
102 | |||
103 | ./iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover | ||
104 | |||
105 | - This will search /etc/iscsi/send_targets for a record with the | ||
106 | + This will search /var/lib/iscsi/send_targets for a record with the | ||
107 | ID [portal = 192.168.1.1:3260 and type = sendtargets. If found it | ||
108 | will perform discovery using the settings stored in the record. | ||
109 | If a record does not exist, it will be created using the iscsid.conf | ||
110 | @@ -705,7 +705,7 @@ To now log into targets it is the same as with sofware iscsi. See section | ||
111 | The argument to -p may also be a hostname instead of an address. | ||
112 | ./iscsiadm -m discoverydb -t st -p smoehost --discover | ||
113 | |||
114 | - For the ifaces, iscsiadm will first search /etc/iscsi/ifaces for | ||
115 | + For the ifaces, iscsiadm will first search /var/lib/iscsi/ifaces for | ||
116 | interfaces using software iscsi. If any are found then nodes found | ||
117 | during discovery will be setup so that they can logged in through | ||
118 | those interfaces. To specify a specific iface, pass the | ||
119 | @@ -761,7 +761,7 @@ To now log into targets it is the same as with sofware iscsi. See section | ||
120 | This command will perform discovery, but not manipulate the node DB. | ||
121 | |||
122 | - SendTargets iSCSI Discovery with a specific interface. If you | ||
123 | - wish to only use a subset of the interfaces in /etc/iscsi/ifaces | ||
124 | + wish to only use a subset of the interfaces in /var/lib/iscsi/ifaces | ||
125 | then you can pass them in during discovery: | ||
126 | |||
127 | ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \ | ||
128 | @@ -1072,8 +1072,8 @@ where targetname is the name of the target and ip_address:port is the address | ||
129 | and port of the portal. tpgt, is the portal group tag of | ||
130 | the portal, and is not used in iscsiadm commands except for static | ||
131 | record creation. And iface name is the name of the iscsi interface | ||
132 | -defined in /etc/iscsi/ifaces. If no interface was defined in | ||
133 | -/etc/iscsi/ifaces or passed in, the default behavior is used. | ||
134 | +defined in /var/lib/iscsi/ifaces. If no interface was defined in | ||
135 | +/var/lib/iscsi/ifaces or passed in, the default behavior is used. | ||
136 | Default here is iscsi_tcp/tcp to be used over which ever NIC the | ||
137 | network layer decides is best. | ||
138 | |||
139 | @@ -1188,7 +1188,7 @@ If set, iscsid will perform discovery to the address every | ||
140 | discovery.isns.discoveryd_poll_inval or | ||
141 | discovery.sendtargets.discoveryd_poll_inval seconds, | ||
142 | and it will log into any portals found from the discovery source using | ||
143 | -the ifaces in /etc/iscsi/ifaces. | ||
144 | +the ifaces in /var/lib/iscsi/ifaces. | ||
145 | |||
146 | Note that for iSNS the poll_interval does not have to be set. If not set, | ||
147 | iscsid will only perform rediscovery when it gets a SCN from the server. | ||
148 | diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8 | ||
149 | index 7c209f6..e94cca0 100644 | ||
150 | --- a/doc/iscsiadm.8 | ||
151 | +++ b/doc/iscsiadm.8 | ||
152 | @@ -89,7 +89,7 @@ This option is only valid for ping submode. | ||
153 | .TP | ||
154 | \fB\-I\fR, \fB\-\-interface=\fI[iface]\fR | ||
155 | The interface argument specifies the iSCSI interface to use for the operation. | ||
156 | -iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware | ||
157 | +iSCSI interfaces (iface) are defined in /var/lib/iscsi/ifaces. For hardware | ||
158 | iSCSI (qla4xxx) the iface config must have the hardware address | ||
159 | (iface.hwaddress = port's MAC address) | ||
160 | and the driver/transport_name (iface.transport_name). The iface's name is | ||
161 | @@ -166,7 +166,7 @@ If no other options are specified: for \fIdiscoverydb\fR and \fInode\fR, all | ||
162 | of their respective records are displayed; for \fIsession\fR, all active | ||
163 | sessions and connections are displayed; for \fIfw\fR, all boot firmware | ||
164 | values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and | ||
165 | -for \fIiface\fR, all ifaces setup in /etc/iscsi/ifaces are displayed. | ||
166 | +for \fIiface\fR, all ifaces setup in /var/lib/iscsi/ifaces are displayed. | ||
167 | |||
168 | .TP | ||
169 | \fB\-n\fR, \fB\-\-name=\fIname\fR | ||
170 | @@ -535,10 +535,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup. | ||
171 | The file containing the iSCSI InitiatorName and InitiatorAlias read by | ||
172 | \fBiscsid\fR and \fBiscsiadm\fR on startup. | ||
173 | .TP | ||
174 | -/etc/iscsi/nodes/ | ||
175 | +/var/lib/iscsi/nodes/ | ||
176 | This directory contains the nodes with their targets. | ||
177 | .TP | ||
178 | -/etc/iscsi/send_targets | ||
179 | +/var/lib/iscsi/send_targets | ||
180 | This directory contains the portals. | ||
181 | |||
182 | .SH "SEE ALSO" | ||
183 | diff --git a/usr/idbm.c b/usr/idbm.c | ||
184 | index 4d30aa9..316e54f 100644 | ||
185 | --- a/usr/idbm.c | ||
186 | +++ b/usr/idbm.c | ||
187 | @@ -2468,9 +2468,9 @@ free_info: | ||
188 | int idbm_init(idbm_get_config_file_fn *fn) | ||
189 | { | ||
190 | /* make sure root db dir is there */ | ||
191 | - if (access(ISCSI_CONFIG_ROOT, F_OK) != 0) { | ||
192 | - if (mkdir(ISCSI_CONFIG_ROOT, 0660) != 0) { | ||
193 | - log_error("Could not make %s %d\n", ISCSI_CONFIG_ROOT, | ||
194 | + if (access(ISCSIVAR, F_OK) != 0) { | ||
195 | + if (mkdir(ISCSIVAR, 0660) != 0) { | ||
196 | + log_error("Could not make %s %d\n", ISCSIVAR, | ||
197 | errno); | ||
198 | return errno; | ||
199 | } | ||
200 | diff --git a/usr/idbm.h b/usr/idbm.h | ||
201 | index 245f046..f45e86e 100644 | ||
202 | --- a/usr/idbm.h | ||
203 | +++ b/usr/idbm.h | ||
204 | @@ -28,12 +28,16 @@ | ||
205 | #include "config.h" | ||
206 | #include "list.h" | ||
207 | |||
208 | -#define NODE_CONFIG_DIR ISCSI_CONFIG_ROOT"nodes" | ||
209 | -#define SLP_CONFIG_DIR ISCSI_CONFIG_ROOT"slp" | ||
210 | -#define ISNS_CONFIG_DIR ISCSI_CONFIG_ROOT"isns" | ||
211 | -#define STATIC_CONFIG_DIR ISCSI_CONFIG_ROOT"static" | ||
212 | -#define FW_CONFIG_DIR ISCSI_CONFIG_ROOT"fw" | ||
213 | -#define ST_CONFIG_DIR ISCSI_CONFIG_ROOT"send_targets" | ||
214 | +#define ISCSIVAR "/var/lib/iscsi/" | ||
215 | + | ||
216 | +#define NODE_CONFIG_DIR ISCSIVAR"nodes" | ||
217 | +#define SLP_CONFIG_DIR ISCSIVAR"slp" | ||
218 | +#define ISNS_CONFIG_DIR ISCSIVAR"isns" | ||
219 | +#define STATIC_CONFIG_DIR ISCSIVAR"static" | ||
220 | +#define FW_CONFIG_DIR ISCSIVAR"fw" | ||
221 | +#define ST_CONFIG_DIR ISCSIVAR"send_targets" | ||
222 | + | ||
223 | + | ||
224 | #define ST_CONFIG_NAME "st_config" | ||
225 | #define ISNS_CONFIG_NAME "isns_config" | ||
226 | |||
227 | diff --git a/usr/iface.h b/usr/iface.h | ||
228 | index 01f7074..2c6ef72 100644 | ||
229 | --- a/usr/iface.h | ||
230 | +++ b/usr/iface.h | ||
231 | @@ -20,7 +20,8 @@ | ||
232 | #ifndef ISCSI_IFACE_H | ||
233 | #define ISCSI_IFACE_H | ||
234 | |||
235 | -#define IFACE_CONFIG_DIR ISCSI_CONFIG_ROOT"ifaces" | ||
236 | +#include "idbm.h" | ||
237 | +#define IFACE_CONFIG_DIR ISCSIVAR"ifaces" | ||
238 | |||
239 | struct iface_rec; | ||
240 | struct list_head; | ||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service new file mode 100644 index 000000000..b1397513b --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service | |||
@@ -0,0 +1,12 @@ | |||
1 | [Unit] | ||
2 | Description=Open-iSCSI initiator (i.e. client) service | ||
3 | After=syslog.target | ||
4 | |||
5 | [Service] | ||
6 | EnvironmentFile=/etc/default/iscsi-initiator | ||
7 | ExecStartPre=/sbin/modprobe iscsi_tcp | ||
8 | ExecStart=/usr/sbin/iscsid -f $OPTS_ISCSID | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
12 | |||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0-873.bb b/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0-873.bb new file mode 100644 index 000000000..d48cf24eb --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0-873.bb | |||
@@ -0,0 +1,111 @@ | |||
1 | SUMMARY = "iSCSI daemon and utility programs" | ||
2 | DESCRIPTION = "Open-iSCSI project is a high performance, transport \ | ||
3 | independent, multi-platform implementation of RFC3720. The iscsi package \ | ||
4 | provides the server daemon for the iSCSI protocol, as well as the utility \ | ||
5 | programs used to manage it. iSCSI is a protocol for distributed \ | ||
6 | disk access using SCSI commands sent over Internet Protocol networks." | ||
7 | HOMEPAGE = "http://www.open-iscsi.org/" | ||
8 | LICENSE = "GPLv2 & LGPLv2.1" | ||
9 | SECTION = "console/network" | ||
10 | DEPENDS = "openssl flex-native bison-native" | ||
11 | |||
12 | LIC_FILES_CHKSUM = \ | ||
13 | "file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \ | ||
14 | file://utils/open-isns/COPYING;md5=7fbc338309ac38fefcd64b04bb903e34" | ||
15 | |||
16 | SRC_URI = "http://www.open-iscsi.org/bits/open-iscsi-${PV}.tar.gz \ | ||
17 | file://iscsi-initiator-utils-use-var-for-config.patch \ | ||
18 | file://iscsi-initiator-utils-dont-use-static.patch \ | ||
19 | file://initd.debian \ | ||
20 | file://99_iscsi-initiator-utils \ | ||
21 | file://iscsi-initiator \ | ||
22 | file://iscsi-initiator.service \ | ||
23 | file://iscsi-initiator-targets.service \ | ||
24 | " | ||
25 | SRC_URI[md5sum] = "8b8316d7c9469149a6cc6234478347f7" | ||
26 | SRC_URI[sha256sum] = "7dd9f2f97da417560349a8da44ea4fcfe98bfd5ef284240a2cc4ff8e88ac7cd9" | ||
27 | |||
28 | S = "${WORKDIR}/open-iscsi-${PV}" | ||
29 | |||
30 | inherit update-rc.d systemd | ||
31 | |||
32 | TARGET_CC_ARCH += "${LDFLAGS}" | ||
33 | do_configure () { | ||
34 | #need to support cross-compiling in open-isns only | ||
35 | (cd utils/open-isns; gnu-configize; \ | ||
36 | ./configure --host=${TARGET_SYS} --build=${BUILD_SYS} --with-security=no ) | ||
37 | } | ||
38 | |||
39 | do_compile () { | ||
40 | #make iscsistart one of PROGRAMS if install_user in do_install | ||
41 | #sed -i -e '/^PROGRAMS = /s;$; usr/iscsistart;' Makefile | ||
42 | |||
43 | #fix the ar used in open-isns | ||
44 | sed -i -e 's:ar cr :$(AR) cr :' ${S}/utils/open-isns/Makefile | ||
45 | oe_runmake user | ||
46 | } | ||
47 | |||
48 | do_install () { | ||
49 | #completely override the install_user as bugs in Makefile | ||
50 | #oe_runmake DESTDIR="${D}" install_user | ||
51 | |||
52 | #install necessary directories | ||
53 | install -d ${D}${sbindir} \ | ||
54 | ${D}${sysconfdir}/init.d \ | ||
55 | ${D}${sysconfdir}/iscsi \ | ||
56 | ${D}${localstatedir}/lib/iscsi/nodes \ | ||
57 | ${D}${localstatedir}/lib/iscsi/send_targets \ | ||
58 | ${D}${localstatedir}/lib/iscsi/static \ | ||
59 | ${D}${localstatedir}/lib/iscsi/isns \ | ||
60 | ${D}${localstatedir}/lib/iscsi/slp \ | ||
61 | ${D}${localstatedir}/lib/iscsi/ifaces \ | ||
62 | ${D}/${mandir}/man8 | ||
63 | |||
64 | install -p -m 755 ${S}/usr/iscsid ${S}/usr/iscsiadm \ | ||
65 | ${S}/utils/iscsi-iname \ | ||
66 | ${S}/usr/iscsistart ${D}/${sbindir} | ||
67 | |||
68 | install -p -m 644 ${S}/doc/iscsiadm.8 ${S}/doc/iscsid.8 ${D}/${mandir}/man8 | ||
69 | install -p -m 644 ${S}/etc/iscsid.conf ${D}${sysconfdir}/iscsi | ||
70 | install -p -m 755 ${WORKDIR}/initd.debian ${D}${sysconfdir}/init.d/iscsid | ||
71 | |||
72 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
73 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
74 | echo "d /run/${BPN}/lock - - - -" \ | ||
75 | > ${D}${sysconfdir}/tmpfiles.d/iscsi.conf | ||
76 | install -d ${D}/etc/default/ | ||
77 | install -p -m 755 ${WORKDIR}/iscsi-initiator ${D}${sysconfdir}/default/ | ||
78 | |||
79 | install -d ${D}${systemd_unitdir}/system/ | ||
80 | install -m 0644 ${WORKDIR}/iscsi-initiator.service \ | ||
81 | ${WORKDIR}/iscsi-initiator-targets.service \ | ||
82 | ${D}${systemd_unitdir}/system/ | ||
83 | else | ||
84 | install -d ${D}/etc/default/volatiles | ||
85 | install -m 0644 ${WORKDIR}/99_iscsi-initiator-utils ${D}/etc/default/volatiles | ||
86 | fi | ||
87 | } | ||
88 | |||
89 | pkg_postinst_${PN}() { | ||
90 | #default there is no initiatorname.iscsi installed | ||
91 | #but it is needed or iscsid will fail | ||
92 | |||
93 | #will run only when postinst on target | ||
94 | if [ "x$D" != "x" ]; then | ||
95 | exit 1 | ||
96 | fi | ||
97 | if [ ! -f ${sysconfdir}/iscsi/initiatorname.iscsi ]; then | ||
98 | echo "InitiatorName=$(${sbindir}/iscsi-iname)" > \ | ||
99 | ${sysconfdir}/iscsi/initiatorname.iscsi | ||
100 | fi | ||
101 | |||
102 | if [ -e /etc/init.d/populate-volatile.sh ]; then | ||
103 | /etc/init.d/populate-volatile.sh update | ||
104 | elif command -v systemd-tmpfiles >/dev/null; then | ||
105 | systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/iscsi.conf | ||
106 | fi | ||
107 | } | ||
108 | |||
109 | SYSTEMD_SERVICE = " iscsi-initiator.service iscsi-initiator-targets.service " | ||
110 | INITSCRIPT_NAME = "iscsid" | ||
111 | INITSCRIPT_PARAMS = "start 30 1 2 3 4 5 . stop 70 0 1 2 3 4 5 6 ." | ||
diff --git a/meta-networking/recipes-daemons/postfix/files/install.patch b/meta-networking/recipes-daemons/postfix/files/install.patch new file mode 100644 index 000000000..a3fe089c2 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/install.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | Change fixed postconf to a variable for cross-compiling | ||
2 | |||
3 | Upstreamstatus: Inappropriate [embedded specific] | ||
4 | |||
5 | Signed-off-by: Yao Zhao <yao.zhao@windriver.com> | ||
6 | --- | ||
7 | diff --git a/postfix-install b/postfix-install | ||
8 | index 49225ac..2e4c292 100644 | ||
9 | --- a/postfix-install | ||
10 | +++ b/postfix-install | ||
11 | @@ -201,8 +201,8 @@ test -z "$non_interactive" -a ! -t 0 && { | ||
12 | exit 1 | ||
13 | } | ||
14 | |||
15 | -test -x bin/postconf || { | ||
16 | - echo $0: Error: no bin/postconf file. Did you forget to run \"make\"? 1>&2 | ||
17 | +test -x "$POSTCONF" || { | ||
18 | + echo $0: Error: no $POSTCONF file. Did you forget to run \"make\"? 1>&2 | ||
19 | exit 1 | ||
20 | } | ||
21 | |||
22 | @@ -363,7 +363,7 @@ HTML files. Specify \"no\" if you do not want to install these files." | ||
23 | |||
24 | : ${install_root=/} | ||
25 | : ${tempdir=`pwd`} | ||
26 | -: ${config_directory=`bin/postconf -c conf -h -d config_directory`} | ||
27 | +: ${config_directory=`$POSTCONF -c conf -h -d config_directory`} | ||
28 | |||
29 | # Find out the location of installed configuration files. | ||
30 | |||
31 | @@ -433,7 +433,7 @@ test -f $CONFIG_DIRECTORY/main.cf && { | ||
32 | case "$junk" in | ||
33 | "") eval unset $name;; | ||
34 | esac | ||
35 | - eval : \${$name=\`bin/postconf -c $CONFIG_DIRECTORY -h $name\`} || | ||
36 | + eval : \${$name=\`$POSTCONF -c $CONFIG_DIRECTORY -h $name\`} || | ||
37 | exit 1 | ||
38 | done | ||
39 | } | ||
40 | @@ -446,7 +446,7 @@ do | ||
41 | case "$junk" in | ||
42 | "") eval unset $name;; | ||
43 | esac | ||
44 | - eval : \${$name=\`bin/postconf -c conf -d -h $name\`} || exit 1 | ||
45 | + eval : \${$name=\`$POSTCONF -c conf -d -h $name\`} || exit 1 | ||
46 | done | ||
47 | |||
48 | # Override settings manually. | ||
49 | @@ -565,6 +565,8 @@ HTML_DIRECTORY=$install_root$html_directory | ||
50 | MANPAGE_DIRECTORY=$install_root$manpage_directory | ||
51 | README_DIRECTORY=$install_root$readme_directory | ||
52 | |||
53 | +test "x$POSTCONF" != "x" || POSTCONF="bin/postconf" | ||
54 | + | ||
55 | # Avoid repeated tests for existence of these; default permissions suffice. | ||
56 | |||
57 | test -d $DAEMON_DIRECTORY || mkdir -p $DAEMON_DIRECTORY || exit 1 | ||
58 | @@ -724,7 +726,7 @@ do | ||
59 | # Postfix releases, and software should not suddenly be installed in | ||
60 | # the wrong place when Postfix is being upgraded. | ||
61 | |||
62 | -bin/postconf -c $CONFIG_DIRECTORY -e \ | ||
63 | +"$POSTCONF" -c $CONFIG_DIRECTORY -e \ | ||
64 | "daemon_directory = $daemon_directory" \ | ||
65 | "data_directory = $data_directory" \ | ||
66 | "command_directory = $command_directory" \ | ||
diff --git a/meta-networking/recipes-daemons/postfix/files/internal_recipient b/meta-networking/recipes-daemons/postfix/files/internal_recipient new file mode 100644 index 000000000..6a8f2681b --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/internal_recipient | |||
@@ -0,0 +1 @@ | |||
root@ permit_mynetworks,reject | |||
diff --git a/meta-networking/recipes-daemons/postfix/files/main.cf_2.0 b/meta-networking/recipes-daemons/postfix/files/main.cf_2.0 new file mode 100644 index 000000000..bb314513b --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/main.cf_2.0 | |||
@@ -0,0 +1,102 @@ | |||
1 | # Configure your domain and accounts | ||
2 | #mydomain=sample.com | ||
3 | #FQDN from gethostname | ||
4 | #myhostname = | ||
5 | mydomain=localdomain | ||
6 | mydestination = $myhostname, localhost.localdomain localhost | ||
7 | mynetworks = 127.0.0.1/8 | ||
8 | inet_interfaces = 127.0.0.1 | ||
9 | |||
10 | virtual_mailbox_domains = sample.com, other.net | ||
11 | virtual_mailbox_maps = hash:/etc/postfix/virtual | ||
12 | virtual_alias_maps = hash:/etc/postfix/virtual_alias | ||
13 | |||
14 | alias_maps = hash:/etc/aliases | ||
15 | |||
16 | # You'll start with the following lines for maildir storage | ||
17 | virtual_mailbox_base = /var/spool/vmail | ||
18 | virtual_uid_maps = static:`grep vmail /etc/passwd | cut -d ":" -f 3` | ||
19 | virtual_gid_maps = static:`grep vmail /etc/passwd | cut -d ":" -f 4` | ||
20 | |||
21 | |||
22 | # You'll start with the following lines for IMAP storage | ||
23 | #virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp | ||
24 | |||
25 | |||
26 | # General stuff here again | ||
27 | #config_directory = /etc/postfix | ||
28 | sample_directory = /etc/postfix | ||
29 | queue_directory = /var/spool/postfix | ||
30 | mail_spool_directory = /var/spool/mail | ||
31 | readme_directory = no | ||
32 | command_directory = /usr/sbin | ||
33 | daemon_directory = /usr/libexec/postfix | ||
34 | mail_owner = postfix | ||
35 | setgid_group = postdrop | ||
36 | unknown_local_recipient_reject_code = 450 | ||
37 | mynetworks_style = host | ||
38 | debug_peer_level = 2 | ||
39 | sendmail_path = /usr/sbin/sendmail | ||
40 | newaliases_path = /usr/bin/newaliases | ||
41 | mailq_path = /usr/bin/mailq | ||
42 | |||
43 | smtpd_data_restrictions = | ||
44 | permit_mynetworks, | ||
45 | reject_unauth_pipelining, | ||
46 | permit | ||
47 | |||
48 | smtpd_client_restrictions = | ||
49 | permit_mynetworks, | ||
50 | # reject_unknown_client, # This can cause a lot of false rejects. | ||
51 | reject_invalid_hostname, | ||
52 | reject_rbl_client list.dsbl.org, | ||
53 | reject_rbl_client sbl.spamhaus.org, | ||
54 | reject_rbl_client cbl.abuseat.org, | ||
55 | reject_rbl_client dul.dnsbl.sorbs.net, | ||
56 | permit | ||
57 | |||
58 | smtpd_helo_required = yes | ||
59 | smtpd_helo_restrictions = | ||
60 | permit_mynetworks, | ||
61 | reject_unauth_pipelining, | ||
62 | # reject_non_fqdn_hostname, # This can cause a lot of false rejects. | ||
63 | # reject_unknown_hostname, # This can cause a lot of false rejects. | ||
64 | reject_invalid_hostname, | ||
65 | permit | ||
66 | |||
67 | smtpd_sender_restrictions = | ||
68 | permit_mynetworks, | ||
69 | reject_non_fqdn_sender, | ||
70 | # check_sender_access hash:/etc/postfix/access_domains, | ||
71 | reject_unknown_sender_domain, | ||
72 | permit | ||
73 | |||
74 | smtpd_recipient_restrictions = | ||
75 | permit_mynetworks, | ||
76 | permit_sasl_authenticated, | ||
77 | reject_unauth_destination, | ||
78 | |||
79 | # check_recipient_access pcre:/etc/postfix/recipient_checks.pcre, | ||
80 | # check_helo_access pcre:/etc/postfix/helo_checks.pcre, | ||
81 | |||
82 | # check_client_access hash:/etc/postfix/maps/access_client, | ||
83 | # check_client_access hash:/etc/postfix/maps/exceptions_client, | ||
84 | # check_helo_access hash:/etc/postfix/maps/access_helo, | ||
85 | # check_helo_access hash:/etc/postfix/maps/verify_helo, | ||
86 | # check_sender_access hash:/etc/postfix/maps/access_sender, | ||
87 | # check_sender_access hash:/etc/postfix/maps/verify_sender, | ||
88 | # check_recipient_access hash:/etc/postfix/maps/access_recipient, | ||
89 | |||
90 | # reject_multi_recipient_bounce, | ||
91 | reject_non_fqdn_recipient, | ||
92 | reject_unknown_recipient_domain, | ||
93 | # reject_unlisted_recipient, | ||
94 | #check_policy_service unix:private/policy, | ||
95 | |||
96 | # check_sender_access hash:/etc/postfix/maps/no_verify_sender, | ||
97 | # check_sender_access hash:/etc/postfix/access_domains, | ||
98 | # reject_unverified_sender, | ||
99 | # reject_unverified_recipient | ||
100 | check_recipient_access hash:/etc/postfix/internal_recipient | ||
101 | |||
102 | disable_vrfy_command = yes | ||
diff --git a/meta-networking/recipes-daemons/postfix/files/makedefs.patch b/meta-networking/recipes-daemons/postfix/files/makedefs.patch new file mode 100644 index 000000000..32c31b024 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/makedefs.patch | |||
@@ -0,0 +1,116 @@ | |||
1 | 1)remove RANLIB, SYSLIBS, AR and get them from env. | ||
2 | |||
3 | 2)reference sysroot when searching header files | ||
4 | 3)include sysroot path instead of absolute include path | ||
5 | for Linux2 and Linux3 systems. | ||
6 | 4)for non-native build, search STAGING_BASELIBDIR/LIBDIR | ||
7 | native build, search host library path for nsl and resolv library | ||
8 | which comes from libc | ||
9 | |||
10 | Upstreamstatus: Inappropriate [embedded specific] | ||
11 | |||
12 | Signed-off-by: Yao Zhao <yao.zhao@windriver.com> | ||
13 | --- | ||
14 | makedefs | 27 +++++++++++---------------- | ||
15 | 1 files changed, 11 insertions(+), 16 deletions(-) | ||
16 | |||
17 | diff --git a/makedefs b/makedefs | ||
18 | index dd5f256..e6fb795 100644 | ||
19 | --- a/makedefs | ||
20 | +++ b/makedefs | ||
21 | @@ -87,9 +87,6 @@ | ||
22 | |||
23 | # Defaults for most sane systems | ||
24 | |||
25 | -RANLIB=ranlib | ||
26 | -SYSLIBS= | ||
27 | -AR=ar | ||
28 | ARFL=rv | ||
29 | |||
30 | # Ugly function to make our error message more visible among the | ||
31 | @@ -293,12 +290,12 @@ case "$SYSTEM.$RELEASE" in | ||
32 | case "$CCARGS" in | ||
33 | *-DNO_DB*) ;; | ||
34 | *-DHAS_DB*) ;; | ||
35 | - *) if [ -f /usr/include/db.h ] | ||
36 | + *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ] | ||
37 | then | ||
38 | : we are all set | ||
39 | - elif [ -f /usr/include/db/db.h ] | ||
40 | + elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ] | ||
41 | then | ||
42 | - CCARGS="$CCARGS -I/usr/include/db" | ||
43 | + CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db" | ||
44 | else | ||
45 | # No, we're not going to try db1 db2 db3 etc. | ||
46 | # On a properly installed system, Postfix builds | ||
47 | @@ -307,12 +304,12 @@ case "$SYSTEM.$RELEASE" in | ||
48 | echo "Install the appropriate db*-devel package first." 1>&2 | ||
49 | exit 1 | ||
50 | fi | ||
51 | - SYSLIBS="-ldb" | ||
52 | + SYSLIBS="$SYSLIBS -ldb" | ||
53 | ;; | ||
54 | esac | ||
55 | for name in nsl resolv $GDBM_LIBS | ||
56 | do | ||
57 | - for lib in /usr/lib64 /lib64 /usr/lib /lib | ||
58 | + for lib in $BUILD_SYSROOT_NSL_PATH | ||
59 | do | ||
60 | test -e $lib/lib$name.a -o -e $lib/lib$name.so && { | ||
61 | SYSLIBS="$SYSLIBS -l$name" | ||
62 | @@ -332,7 +329,7 @@ case "$SYSTEM.$RELEASE" in | ||
63 | if [ `expr "X$CCARGS" : "X.*-DNO_EPOLL"` -gt 0 ] | ||
64 | then | ||
65 | : | ||
66 | - elif [ ! -e /usr/include/sys/epoll.h ] | ||
67 | + elif [ ! -e "$BUILD_SYSROOT"/usr/include/sys/epoll.h ] | ||
68 | then | ||
69 | echo CCARGS="$CCARGS -DNO_EPOLL" | ||
70 | else | ||
71 | @@ -356,8 +353,6 @@ int main(int argc, char **argv) | ||
72 | } | ||
73 | EOF | ||
74 | ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1 | ||
75 | - ./makedefs.test 2>/dev/null || | ||
76 | - CCARGS="$CCARGS -DNO_EPOLL" | ||
77 | rm -f makedefs.test makedefs.test.[co] | ||
78 | fi;; | ||
79 | esac | ||
80 | @@ -366,12 +361,12 @@ EOF | ||
81 | case "$CCARGS" in | ||
82 | *-DNO_DB*) ;; | ||
83 | *-DHAS_DB*) ;; | ||
84 | - *) if [ -f /usr/include/db.h ] | ||
85 | + *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ] | ||
86 | then | ||
87 | : we are all set | ||
88 | - elif [ -f /usr/include/db/db.h ] | ||
89 | + elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ] | ||
90 | then | ||
91 | - CCARGS="$CCARGS -I/usr/include/db" | ||
92 | + CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db" | ||
93 | else | ||
94 | # On a properly installed system, Postfix builds | ||
95 | # by including <db.h> and by linking with -ldb | ||
96 | @@ -379,7 +374,7 @@ EOF | ||
97 | echo "Install the appropriate db*-devel package first." 1>&2 | ||
98 | exit 1 | ||
99 | fi | ||
100 | - SYSLIBS="-ldb" | ||
101 | + SYSLIBS="$SYSLIBS -ldb" | ||
102 | ;; | ||
103 | esac | ||
104 | for name in nsl resolv | ||
105 | @@ -415,7 +410,7 @@ EOF | ||
106 | esac | ||
107 | for name in nsl resolv | ||
108 | do | ||
109 | - for lib in /usr/lib64 /lib64 /usr/lib /lib | ||
110 | + for lib in $BUILD_SYSROOT_NSL_PATH | ||
111 | do | ||
112 | test -e $lib/lib$name.a -o -e $lib/lib$name.so && { | ||
113 | SYSLIBS="$SYSLIBS -l$name" | ||
114 | -- | ||
115 | 1.7.1 | ||
116 | |||
diff --git a/meta-networking/recipes-daemons/postfix/files/postfix b/meta-networking/recipes-daemons/postfix/files/postfix new file mode 100755 index 000000000..7bcc81625 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/postfix | |||
@@ -0,0 +1,85 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | success() { | ||
4 | echo " Successful" | ||
5 | exit 0 | ||
6 | } | ||
7 | |||
8 | fail() { | ||
9 | echo " Failed" | ||
10 | exit 1 | ||
11 | |||
12 | } | ||
13 | |||
14 | check_return () { | ||
15 | local ret="$1" | ||
16 | |||
17 | if [ "$ret" = "0" ]; then | ||
18 | success | ||
19 | else | ||
20 | fail | ||
21 | fi | ||
22 | } | ||
23 | |||
24 | PIDFile=/var/spool/postfix/pid/master.pid | ||
25 | case "$1" in | ||
26 | |||
27 | start) | ||
28 | echo -n "Starting Postfix..." | ||
29 | if [ ! -e /etc/aliases.db ]; then | ||
30 | # The alias database is necessary for postfix to work correctly. | ||
31 | echo "Creating aliases database ..." | ||
32 | newaliases | ||
33 | fi | ||
34 | if ! postfix status >/dev/null 2>&1; then | ||
35 | postfix start | ||
36 | check_return $? | ||
37 | else | ||
38 | success | ||
39 | fi | ||
40 | ;; | ||
41 | |||
42 | stop) | ||
43 | echo -n "Stopping Postfix..." | ||
44 | if postfix status >/dev/null 2>&1; then | ||
45 | postfix stop | ||
46 | check_return $? | ||
47 | else | ||
48 | success | ||
49 | fi | ||
50 | ;; | ||
51 | |||
52 | reload) | ||
53 | echo -n "Reloading Postfix..." | ||
54 | if postfix status >/dev/null 2>&1; then | ||
55 | postfix reload | ||
56 | check_return $? | ||
57 | else | ||
58 | postfix start | ||
59 | check_return $? | ||
60 | fi | ||
61 | ;; | ||
62 | |||
63 | restart) | ||
64 | $0 stop | ||
65 | sleep 1 | ||
66 | $0 start | ||
67 | ;; | ||
68 | |||
69 | status) | ||
70 | if postfix status >/dev/null 2>&1; then | ||
71 | pid=`sed -e 's/\s//g' $PIDFile` | ||
72 | echo "The Postfix mail system is running (PID: $pid)" | ||
73 | exit 0 | ||
74 | else | ||
75 | echo "The Postfix mail system is not running" | ||
76 | exit 1 | ||
77 | fi | ||
78 | ;; | ||
79 | |||
80 | *) | ||
81 | echo "Usage: $0 {start|stop|status|reload|restart}" | ||
82 | exit 1 | ||
83 | ;; | ||
84 | esac | ||
85 | |||
diff --git a/meta-networking/recipes-daemons/postfix/files/postfix-add-db6-support.patch b/meta-networking/recipes-daemons/postfix/files/postfix-add-db6-support.patch new file mode 100644 index 000000000..e3e28c843 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/postfix-add-db6-support.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Subject: [PATCH] add db6 support db6 | ||
2 | |||
3 | Upstream-Status: Backport | ||
4 | |||
5 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
6 | --- | ||
7 | src/util/dict_db.c | 3 ++- | ||
8 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/src/util/dict_db.c b/src/util/dict_db.c | ||
11 | index 93ee480..f1ae66b 100644 | ||
12 | --- a/src/util/dict_db.c | ||
13 | +++ b/src/util/dict_db.c | ||
14 | @@ -693,7 +693,8 @@ static DICT *dict_db_open(const char *class, const char *path, int open_flags, | ||
15 | msg_fatal("set DB cache size %d: %m", dict_db_cache_size); | ||
16 | if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0) | ||
17 | msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM); | ||
18 | -#if DB_VERSION_MAJOR == 5 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) | ||
19 | +#if DB_VERSION_MAJOR == 6 || DB_VERSION_MAJOR == 5 || \ | ||
20 | + (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) | ||
21 | if ((errno = db->open(db, 0, db_path, 0, type, db_flags, 0644)) != 0) | ||
22 | FREE_RETURN(dict_surrogate(class, path, open_flags, dict_flags, | ||
23 | "open database %s: %m", db_path)); | ||
24 | -- | ||
25 | 1.7.1 | ||
26 | |||
diff --git a/meta-networking/recipes-daemons/postfix/files/postfix.service b/meta-networking/recipes-daemons/postfix/files/postfix.service new file mode 100644 index 000000000..6ea921478 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/postfix.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=Postfix Mail Transport Agent | ||
3 | After=syslog.target network.target | ||
4 | Conflicts=sendmail.service exim.service | ||
5 | |||
6 | [Service] | ||
7 | Type=forking | ||
8 | PIDFile=/var/spool/postfix/pid/master.pid | ||
9 | ExecStart=/usr/sbin/postfix start | ||
10 | ExecReload=/usr/sbin/postfix reload | ||
11 | ExecStop=/usr/sbin/postfix stop | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-networking/recipes-daemons/postfix/postfix.inc new file mode 100644 index 000000000..63de2a024 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/postfix.inc | |||
@@ -0,0 +1,235 @@ | |||
1 | SUMMARY = "Postfix Mail Transport Agent" | ||
2 | DESCRIPTION = "Postfix is Wietse Venema's mail server that started life at \ | ||
3 | IBM research as an alternative to the widely-used Sendmail program. \ | ||
4 | Postfix attempts to be fast, easy to administer, and secure. The outsidei \ | ||
5 | has a definite Sendmail-ish flavor, but the inside is completely different." | ||
6 | |||
7 | HOMEPAGE= "http://www.postfix.org" | ||
8 | SECTION = "console/network" | ||
9 | DEPENDS = "virtual/db libpcre openssl postfix-native \ | ||
10 | ${@base_contains('DISTRO_FEATURES', 'ldap', 'openldap', '', d)} \ | ||
11 | ${@base_contains('DISTRO_FEATURES', 'sasl', 'cyrus-sasl', '', d)} \ | ||
12 | " | ||
13 | DEPENDS_virtclass-native = "virtual/db-native openssl-native libpcre-native" | ||
14 | |||
15 | LICENSE = "IPL-1.0" | ||
16 | LIC_FILES_CHKSUM = "file://LICENSE;md5=64375f37431336ea1b1b3005fe3fa354" | ||
17 | |||
18 | SRC_URI = "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \ | ||
19 | file://makedefs.patch \ | ||
20 | file://install.patch \ | ||
21 | file://main.cf_2.0 \ | ||
22 | file://postfix \ | ||
23 | file://internal_recipient \ | ||
24 | file://postfix.service \ | ||
25 | " | ||
26 | |||
27 | S = "${WORKDIR}/postfix-${PV}" | ||
28 | |||
29 | BBCLASSEXTEND = "native" | ||
30 | |||
31 | inherit update-rc.d useradd update-alternatives systemd | ||
32 | |||
33 | INITSCRIPT_NAME = "postfix" | ||
34 | INITSCRIPT_PARAMS = "start 58 3 4 5 . stop 13 0 1 6 ." | ||
35 | USERADD_PACKAGES = "${PN}" | ||
36 | USERADD_PARAM_${PN} = \ | ||
37 | "-d /var/spool/postfix -r -g postfix --shell /bin/false postfix; \ | ||
38 | -d /var/spool/vmail -r -u 5000 -g vmail --shell /bin/false vmail \ | ||
39 | " | ||
40 | GROUPADD_PARAM_${PN} = "--system postfix;--system postdrop;-g 5000 --system vmail" | ||
41 | |||
42 | export SYSLIBS = "${LDFLAGS}" | ||
43 | |||
44 | # CCARGS specifies includes, defines | ||
45 | # AUXLIBS specifies libraries | ||
46 | # Linux2/Linux3 has HAS_DB defined | ||
47 | # makedefs will make CC to be CC+CCARGS | ||
48 | |||
49 | # ldap support | ||
50 | export CCARGS-ldap = "\ | ||
51 | ${@base_contains('DISTRO_FEATURES', 'ldap', '-DHAS_LDAP', '', d)}" | ||
52 | export AUXLIBS-ldap = "\ | ||
53 | ${@base_contains('DISTRO_FEATURES', 'ldap', '-lldap -llber', '', d)}" | ||
54 | |||
55 | # no native openldap | ||
56 | export CCARGS-ldap_virtclass-native = "" | ||
57 | export AUXLIBS-ldap_virtclass-native = "" | ||
58 | |||
59 | # SASL support -DUSE_LDAP_SASL -DUSE_SASL_AUTH | ||
60 | # current openldap didn't enable SASL | ||
61 | export CCARGS-sasl = "\ | ||
62 | ${@base_contains('DISTRO_FEATURES', 'sasl', '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I=/usr/include/sasl', '', d)}" | ||
63 | export AUXLIBS-sasl = "\ | ||
64 | ${@base_contains('DISTRO_FEATURES', 'sasl', '-lsasl2', '', d)}" | ||
65 | export CCARGS-sasl_virtclass-native = "" | ||
66 | export AUXLIBS-sasl_virtclass-native = "" | ||
67 | |||
68 | # PCRE, TLS support default | ||
69 | export CCARGS = "${CFLAGS} -DHAS_PCRE -DUSE_TLS ${CCARGS-ldap} ${CCARGS-sasl}" | ||
70 | export AUXLIBS = "-lpcre -lssl -lcrypto ${AUXLIBS-sasl} ${AUXLIBS-ldap}" | ||
71 | export POSTCONF = "${STAGING_DIR_NATIVE}${sbindir_native}/postconf" | ||
72 | |||
73 | # OPT,DEBUG is aready in CFLAGS | ||
74 | # ignore the OPTS="CC=$CC" in Makefile it will not use the CC=$CC $CCARGS | ||
75 | EXTRA_OEMAKE += "OPT= DEBUG= OPTS= " | ||
76 | |||
77 | do_compile () { | ||
78 | unset CFLAGS CPPFLAGS CXXFLAGS | ||
79 | local native_build | ||
80 | |||
81 | native_build="${@['0', '1'][bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d)]}" | ||
82 | |||
83 | # if not native build, then pass SYSTEM and RELEASE to makedefs | ||
84 | if [ "${native_build}" != "1" ]; then | ||
85 | # uname -s for target | ||
86 | SYSTEM="Linux" | ||
87 | |||
88 | # uname -r, use 2.6 as bottomline, even target kernel ver > 2.6 | ||
89 | RELEASE="2.6.34" | ||
90 | sed -i -e \ | ||
91 | "s:\$(SHELL) makedefs):\$(SHELL) makedefs $SYSTEM $RELEASE):" \ | ||
92 | ${S}/Makefile.in | ||
93 | export BUILD_SYSROOT="${STAGING_DIR_HOST}" | ||
94 | export BUILD_SYSROOT_NSL_PATH="${STAGING_BASELIBDIR} \ | ||
95 | ${STAGING_LIBDIR}" | ||
96 | else | ||
97 | # native build | ||
98 | export BUILD_SYSROOT="${STAGING_DIR_NATIVE}" | ||
99 | |||
100 | # ubuntu x86 host: /lib/x86_64-linux-gnu(64) /lib/i386-linux-gnu (32) | ||
101 | # on 64 bits, 32 libs in i386-linux-gnu | ||
102 | # let makedefs finds nsl and resolv libs, host CC will link | ||
103 | # the correct libraries | ||
104 | BUILD_SYSROOT_NSL_PATH="$(${CC} -print-search-dirs 2>/dev/null | \ | ||
105 | sed -n '/^libraries: =/s/libraries: =//p' | \ | ||
106 | sed -e 's/:/\n/g' | xargs -n1 readlink -f | \ | ||
107 | grep -v 'gcc\|/[0-9.]\+$' | sort -u)" | ||
108 | if [ -z "$BUILD_SYSROOT_NSL_PATH" ]; then | ||
109 | BUILD_SYSROOT_NSL_PATH="/usr/lib64 /lib64 \ | ||
110 | /lib/x86_64-linux-gnu \ | ||
111 | /usr/lib /lib \ | ||
112 | /lib/i386-linux-gnu" | ||
113 | fi | ||
114 | export BUILD_SYSROOT_NSL_PATH | ||
115 | fi | ||
116 | |||
117 | oe_runmake makefiles | ||
118 | oe_runmake | ||
119 | } | ||
120 | |||
121 | do_install_prepend_virtclass-native() { | ||
122 | export POSTCONF="bin/postconf" | ||
123 | } | ||
124 | |||
125 | SYSTEMD_SERVICE_${PN} = "postfix.service" | ||
126 | SYSTEMD_AUTO_ENABLE = "disable" | ||
127 | |||
128 | do_install () { | ||
129 | sh ./postfix-install 'install_root=${D}' \ | ||
130 | 'config_directory=${sysconfdir}/postfix' \ | ||
131 | 'daemon_directory=${exec_prefix}/libexec/postfix' \ | ||
132 | 'command_directory=${sbindir}' \ | ||
133 | 'queue_directory=${localstatedir}/spool/postfix' \ | ||
134 | 'sendmail_path=${sbindir}/sendmail.postfix' \ | ||
135 | 'newaliases_path=${bindir}/newaliases' \ | ||
136 | 'mailq_path=${bindir}/mailq' \ | ||
137 | 'manpage_directory=${mandir}' \ | ||
138 | 'readme_directory=${datadir}/doc/postfix' \ | ||
139 | 'data_directory=${localstatedir}/lib/postfix' \ | ||
140 | -non-interactive | ||
141 | rm -rf ${D}${localstatedir}/spool/postfix | ||
142 | mv ${D}${sysconfdir}/postfix/main.cf ${D}${sysconfdir}/postfix/sample-main.cf | ||
143 | install -d ${D}${sysconfdir}/init.d | ||
144 | install -m 644 ${WORKDIR}/main.cf_2.0 ${D}${sysconfdir}/postfix/main.cf | ||
145 | install -m 755 ${WORKDIR}/postfix ${D}${sysconfdir}/init.d/postfix | ||
146 | install -m 644 ${WORKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient | ||
147 | |||
148 | install -d ${D}${systemd_unitdir}/system | ||
149 | install -m 0644 ${WORKDIR}/postfix.service ${D}${systemd_unitdir}/system | ||
150 | sed -i 's,/usr/sbin/,${sbindir}/,g' ${D}${systemd_unitdir}/system/postfix.service | ||
151 | |||
152 | install -m 770 -d ${D}${localstatedir}/spool/postfix | ||
153 | chown postfix:postfix ${D}${localstatedir}/spool/postfix | ||
154 | chown postfix:postfix ${D}${localstatedir}/lib/postfix | ||
155 | |||
156 | install -m 2755 -d ${D}${localstatedir}/spool/mail | ||
157 | chown postfix:nogroup ${D}${localstatedir}/spool/mail | ||
158 | install -m 0755 -d ${D}${localstatedir}/lib/postfix | ||
159 | chown postfix:nogroup ${D}${localstatedir}/lib/postfix | ||
160 | install -m 0755 -d ${D}${localstatedir}/spool/postfix | ||
161 | chown root:postfix ${D}${localstatedir}/spool/postfix | ||
162 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/active | ||
163 | chown postfix:root ${D}${localstatedir}/spool/postfix/active | ||
164 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/bounce | ||
165 | chown postfix:root ${D}${localstatedir}/spool/postfix/bounce | ||
166 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/corrupt | ||
167 | chown postfix:root ${D}${localstatedir}/spool/postfix/corrupt | ||
168 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/defer | ||
169 | chown postfix:root ${D}${localstatedir}/spool/postfix/defer | ||
170 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/deferred | ||
171 | chown postfix:root ${D}${localstatedir}/spool/postfix/deferred | ||
172 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/flush | ||
173 | chown postfix:root ${D}${localstatedir}/spool/postfix/flush | ||
174 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/hold | ||
175 | chown postfix:root ${D}${localstatedir}/spool/postfix/hold | ||
176 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/incoming | ||
177 | chown postfix:root ${D}${localstatedir}/spool/postfix/incoming | ||
178 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/saved | ||
179 | chown postfix:root ${D}${localstatedir}/spool/postfix/saved | ||
180 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/trace | ||
181 | chown postfix:root ${D}${localstatedir}/spool/postfix/trace | ||
182 | install -m 0730 -d ${D}${localstatedir}/spool/postfix/maildrop | ||
183 | chown postfix:postdrop ${D}${localstatedir}/spool/postfix/maildrop | ||
184 | install -m 0755 -d ${D}${localstatedir}/spool/postfix/pid | ||
185 | chown root:root ${D}${localstatedir}/spool/postfix/pid | ||
186 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/private | ||
187 | chown postfix:root ${D}${localstatedir}/spool/postfix/private | ||
188 | install -m 0710 -d ${D}${localstatedir}/spool/postfix/public | ||
189 | chown postfix:postdrop ${D}${localstatedir}/spool/postfix/public | ||
190 | install -m 0755 -d ${D}${localstatedir}/spool/vmail | ||
191 | chown vmail:vmail ${D}${localstatedir}/spool/vmail | ||
192 | |||
193 | chown :postdrop ${D}${sbindir}/postqueue | ||
194 | chown :postdrop ${D}${sbindir}/postdrop | ||
195 | chmod g+s ${D}${sbindir}/postqueue | ||
196 | chmod g+s ${D}${sbindir}/postdrop | ||
197 | } | ||
198 | |||
199 | do_install_append_class-native() { | ||
200 | ln -sf ../sbin/sendmail.postfix ${D}${bindir}/newaliases | ||
201 | ln -sf ../sbin/sendmail.postfix ${D}${bindir}/mailq | ||
202 | } | ||
203 | |||
204 | do_install_append_class-target() { | ||
205 | # Remove references to buildmachine paths in target makedefs.out | ||
206 | sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' ${D}/etc/postfix/makedefs.out | ||
207 | } | ||
208 | |||
209 | NATIVE_INSTALL_WORKS = "1" | ||
210 | |||
211 | ALTERNATIVE_${PN} = "sendmail" | ||
212 | ALTERNATIVE_TARGET[sendmail] = "${sbindir}/sendmail.postfix" | ||
213 | ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail" | ||
214 | ALTERNATIVE_PRIORITY = "120" | ||
215 | |||
216 | pkg_postinst_${PN} () { | ||
217 | if [ "x$D" = "x" ]; then | ||
218 | touch /etc/aliases | ||
219 | newaliases | ||
220 | |||
221 | # generate virtual_alias, default is hash | ||
222 | touch /etc/postfix/virtual_alias | ||
223 | postmap /etc/postfix/virtual_alias | ||
224 | else | ||
225 | touch $D/etc/aliases | ||
226 | newaliases -C $D/etc/postfix/main.cf -oA$D/etc/aliases | ||
227 | touch $D/etc/postfix/virtual_alias | ||
228 | postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias | ||
229 | fi | ||
230 | } | ||
231 | |||
232 | # Exclude .debug directories from the main package | ||
233 | FILES_${PN} = "${sysconfdir} ${localstatedir} ${bindir}/* ${sbindir}/* \ | ||
234 | ${exec_prefix}/libexec/postfix/* ${systemd_unitdir}/*" | ||
235 | FILES_${PN}-dbg += "${exec_prefix}/libexec/postfix/.debug" | ||
diff --git a/meta-networking/recipes-daemons/postfix/postfix_2.11.1.bb b/meta-networking/recipes-daemons/postfix/postfix_2.11.1.bb new file mode 100644 index 000000000..8f237dc2e --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/postfix_2.11.1.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | require postfix.inc | ||
2 | |||
3 | SRC_URI += "file://postfix-add-db6-support.patch" | ||
4 | |||
5 | SRC_URI[md5sum] = "56ac1f1a79737c4ac1e24535a122a4a6" | ||
6 | SRC_URI[sha256sum] = "487f98a73b95a5799409caf21ec065efea91c1dcdfb84c038a0e3a265d6489e2" | ||
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 000000000..4967bed1e --- /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 000000000..c64535cac --- /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 000000000..7e2a8e3ce --- /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 000000000..b31f36ce2 --- /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 000000000..c5ff0136d --- /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 000000000..953bbddef --- /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 000000000..1561ed80e --- /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 000000000..01c998c92 --- /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/files/proftpd-sftp.patch b/meta-networking/recipes-daemons/proftpd/files/proftpd-sftp.patch new file mode 100644 index 000000000..8c71263b0 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/proftpd-sftp.patch | |||
@@ -0,0 +1,142 @@ | |||
1 | proftpd/mod_sftp: fix too much memory allocation bug of mod_sftp | ||
2 | |||
3 | This patch fixes the too much memory allocation bug of the mod_sftp by | ||
4 | ensuring both that a) the received response count matches the number of | ||
5 | challenges sent, and b) that the received response count is not too high | ||
6 | (as an additional sanity check); the upper bound is still set to 500. | ||
7 | |||
8 | The patch is picked from: http://bugs.proftpd.org/show_bug.cgi?id=3973 | ||
9 | |||
10 | Upstream-Status: Backport CVE-2013-4359 | ||
11 | |||
12 | diff --git a/contrib/mod_sftp/kbdint.c b/contrib/mod_sftp/kbdint.c | ||
13 | index 0271fb2..de651fa 100644 | ||
14 | --- a/contrib/mod_sftp/kbdint.c | ||
15 | +++ b/contrib/mod_sftp/kbdint.c | ||
16 | @@ -1,6 +1,6 @@ | ||
17 | /* | ||
18 | * ProFTPD - mod_sftp keyboard-interactive driver mgmt | ||
19 | - * Copyright (c) 2008-2009 TJ Saunders | ||
20 | + * Copyright (c) 2008-2013 TJ Saunders | ||
21 | * | ||
22 | * This program is free software; you can redistribute it and/or modify | ||
23 | * it under the terms of the GNU General Public License as published by | ||
24 | @@ -31,6 +31,8 @@ | ||
25 | #include "utf8.h" | ||
26 | #include "kbdint.h" | ||
27 | |||
28 | +#define SFTP_KBDINT_MAX_RESPONSES 500 | ||
29 | + | ||
30 | struct kbdint_driver { | ||
31 | struct kbdint_driver *next, *prev; | ||
32 | |||
33 | @@ -252,8 +254,8 @@ int sftp_kbdint_send_challenge(const char *user, const char *instruction, | ||
34 | return res; | ||
35 | } | ||
36 | |||
37 | -int sftp_kbdint_recv_response(pool *p, unsigned int *count, | ||
38 | - const char ***responses) { | ||
39 | +int sftp_kbdint_recv_response(pool *p, unsigned int expected_count, | ||
40 | + unsigned int *rcvd_count, const char ***responses) { | ||
41 | register unsigned int i; | ||
42 | char *buf; | ||
43 | cmd_rec *cmd; | ||
44 | @@ -264,7 +266,7 @@ int sftp_kbdint_recv_response(pool *p, unsigned int *count, | ||
45 | int res; | ||
46 | |||
47 | if (p == NULL || | ||
48 | - count == NULL || | ||
49 | + rcvd_count == NULL || | ||
50 | responses == NULL) { | ||
51 | errno = EINVAL; | ||
52 | return -1; | ||
53 | @@ -299,6 +301,29 @@ int sftp_kbdint_recv_response(pool *p, unsigned int *count, | ||
54 | |||
55 | resp_count = sftp_msg_read_int(pkt->pool, &buf, &buflen); | ||
56 | |||
57 | + /* Ensure that the number of responses sent by the client is the same | ||
58 | + * as the number of challenges sent, lest a malicious client attempt to | ||
59 | + * trick us into allocating too much memory (Bug#3973). | ||
60 | + */ | ||
61 | + if (resp_count != expected_count) { | ||
62 | + (void) pr_log_writefile(sftp_logfd, MOD_SFTP_VERSION, | ||
63 | + "sent %lu %s, but received %lu %s", (unsigned long) expected_count, | ||
64 | + expected_count != 1 ? "challenges" : "challenge", | ||
65 | + (unsigned long) resp_count, resp_count != 1 ? "responses" : "response"); | ||
66 | + destroy_pool(pkt->pool); | ||
67 | + errno = EPERM; | ||
68 | + return -1; | ||
69 | + } | ||
70 | + | ||
71 | + if (resp_count > SFTP_KBDINT_MAX_RESPONSES) { | ||
72 | + (void) pr_log_writefile(sftp_logfd, MOD_SFTP_VERSION, | ||
73 | + "received too many responses (%lu > max %lu), rejecting", | ||
74 | + (unsigned long) resp_count, (unsigned long) SFTP_KBDINT_MAX_RESPONSES); | ||
75 | + destroy_pool(pkt->pool); | ||
76 | + errno = EPERM; | ||
77 | + return -1; | ||
78 | + } | ||
79 | + | ||
80 | list = make_array(p, resp_count, sizeof(char *)); | ||
81 | for (i = 0; i < resp_count; i++) { | ||
82 | char *resp; | ||
83 | @@ -307,7 +332,7 @@ int sftp_kbdint_recv_response(pool *p, unsigned int *count, | ||
84 | *((char **) push_array(list)) = pstrdup(p, sftp_utf8_decode_str(p, resp)); | ||
85 | } | ||
86 | |||
87 | - *count = (unsigned int) resp_count; | ||
88 | + *rcvd_count = (unsigned int) resp_count; | ||
89 | *responses = ((const char **) list->elts); | ||
90 | return 0; | ||
91 | } | ||
92 | diff --git a/contrib/mod_sftp/mod_sftp.h.in b/contrib/mod_sftp/mod_sftp.h.in | ||
93 | index 3e91390..c547be0 100644 | ||
94 | --- a/contrib/mod_sftp/mod_sftp.h.in | ||
95 | +++ b/contrib/mod_sftp/mod_sftp.h.in | ||
96 | @@ -1,6 +1,6 @@ | ||
97 | /* | ||
98 | * ProFTPD - mod_sftp | ||
99 | - * Copyright (c) 2008-2011 TJ Saunders | ||
100 | + * Copyright (c) 2008-2013 TJ Saunders | ||
101 | * | ||
102 | * This program is free software; you can redistribute it and/or modify | ||
103 | * it under the terms of the GNU General Public License as published by | ||
104 | @@ -174,7 +174,8 @@ int sftp_kbdint_register_driver(const char *name, sftp_kbdint_driver_t *driver); | ||
105 | int sftp_kbdint_unregister_driver(const char *name); | ||
106 | int sftp_kbdint_send_challenge(const char *, const char *, unsigned int, | ||
107 | sftp_kbdint_challenge_t *); | ||
108 | -int sftp_kbdint_recv_response(pool *, unsigned int *, const char ***); | ||
109 | +int sftp_kbdint_recv_response(pool *, unsigned int, unsigned int *, | ||
110 | + const char ***); | ||
111 | |||
112 | /* API for modules that which to register keystores, for the | ||
113 | * SFTPAuthorizedHostKeys and SFTPAuthorizedUserKeys directives. | ||
114 | diff --git a/contrib/mod_sftp_pam.c b/contrib/mod_sftp_pam.c | ||
115 | index 6c32df0..81aa113 100644 | ||
116 | --- a/contrib/mod_sftp_pam.c | ||
117 | +++ b/contrib/mod_sftp_pam.c | ||
118 | @@ -179,22 +179,13 @@ static int sftppam_converse(int nmsgs, PR_PAM_CONST struct pam_message **msgs, | ||
119 | return PAM_CONV_ERR; | ||
120 | } | ||
121 | |||
122 | - if (sftp_kbdint_recv_response(sftppam_driver.driver_pool, &recvd_count, | ||
123 | - &recvd_responses) < 0) { | ||
124 | + if (sftp_kbdint_recv_response(sftppam_driver.driver_pool, list->nelts, | ||
125 | + &recvd_count, &recvd_responses) < 0) { | ||
126 | pr_trace_msg(trace_channel, 3, | ||
127 | "error receiving keyboard-interactive responses: %s", strerror(errno)); | ||
128 | return PAM_CONV_ERR; | ||
129 | } | ||
130 | |||
131 | - /* Make sure that the count of responses matches the challenge count. */ | ||
132 | - if (recvd_count != list->nelts) { | ||
133 | - (void) pr_log_writefile(sftp_logfd, MOD_SFTP_PAM_VERSION, | ||
134 | - "sent %d %s, but received %u %s", nmsgs, | ||
135 | - list->nelts != 1 ? "challenges" : "challenge", recvd_count, | ||
136 | - recvd_count != 1 ? "responses" : "response"); | ||
137 | - return PAM_CONV_ERR; | ||
138 | - } | ||
139 | - | ||
140 | res = calloc(nmsgs, sizeof(struct pam_response)); | ||
141 | if (res == NULL) { | ||
142 | pr_log_pri(PR_LOG_CRIT, "Out of memory!"); | ||
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 000000000..a5e766af5 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb | |||
@@ -0,0 +1,73 @@ | |||
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 = "r4" | ||
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 | file://proftpd-sftp.patch \ | ||
19 | " | ||
20 | |||
21 | SRC_URI[md5sum] = "0871e0b93c9c3c88ca950b6d9a04aed2" | ||
22 | SRC_URI[sha256sum] = "9f659585cea90fc6af34a0ffae4a90e4ed37abe92dbd9b6c311f95a436c961cb" | ||
23 | |||
24 | inherit autotools-brokensep useradd update-rc.d | ||
25 | |||
26 | PACKAGECONFIG ??= "" | ||
27 | PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses,--disable-curses --disable-ncurses,ncurses" | ||
28 | |||
29 | EXTRA_OECONF = "--disable-cap \ | ||
30 | --disable-auth-pam \ | ||
31 | " | ||
32 | |||
33 | # proftpd uses libltdl which currently makes configuring using | ||
34 | # autotools.bbclass a pain... | ||
35 | do_configure () { | ||
36 | oe_runconf | ||
37 | } | ||
38 | |||
39 | FTPUSER = "ftp" | ||
40 | FTPGROUP = "ftp" | ||
41 | |||
42 | do_install () { | ||
43 | oe_runmake DESTDIR=${D} install | ||
44 | rmdir ${D}${libdir}/proftpd ${D}${datadir}/locale | ||
45 | [ -d ${D}${libexecdir} ] && rmdir ${D}${libexecdir} | ||
46 | sed -i '/ *User[ \t]*/s/ftp/${FTPUSER}/' ${D}${sysconfdir}/proftpd.conf | ||
47 | sed -i '/ *Group[ \t]*/s/ftp/${FTPGROUP}/' ${D}${sysconfdir}/proftpd.conf | ||
48 | install -d ${D}${sysconfdir}/init.d | ||
49 | install -m 0755 ${WORKDIR}/proftpd-basic.init ${D}${sysconfdir}/init.d/proftpd | ||
50 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
51 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
52 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
53 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/proftpd | ||
54 | |||
55 | install -d ${D}${sysconfdir}/default | ||
56 | install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/proftpd | ||
57 | |||
58 | # create the pub directory | ||
59 | mkdir -p ${D}/home/${FTPUSER}/pub/ | ||
60 | chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub | ||
61 | } | ||
62 | |||
63 | INITSCRIPT_NAME = "proftpd" | ||
64 | INITSCRIPT_PARAM = "defaults 85 15" | ||
65 | |||
66 | USERADD_PACKAGES = "${PN}" | ||
67 | GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}" | ||
68 | USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \ | ||
69 | --shell /bin/false ${FTPUSER}" | ||
70 | |||
71 | FILES_${PN} += "/home/${FTPUSER}" | ||
72 | |||
73 | RDEPENDS_${PN} += "perl" | ||
diff --git a/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1-rc2.bb b/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1-rc2.bb new file mode 100644 index 000000000..db74e4463 --- /dev/null +++ b/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1-rc2.bb | |||
@@ -0,0 +1,39 @@ | |||
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://README;md5=2452033fe374283f29579898663b1aa8" | ||
10 | |||
11 | DEPENDS = "libpcap" | ||
12 | |||
13 | inherit autotools | ||
14 | |||
15 | # return something like '1.2.3' or '1.2.3/rc1' | ||
16 | # | ||
17 | def get_sub(d): | ||
18 | parts = d.getVar('PV',True).split('-') | ||
19 | try: | ||
20 | return parts[0] + '/' + parts[1] | ||
21 | except: | ||
22 | return parts[0] | ||
23 | |||
24 | SRC_URI = "http://downloads.sourceforge.net/project/ptpd/ptpd/${@get_sub(d)}/ptpd-${PV}.tar.gz" | ||
25 | |||
26 | SRC_URI[md5sum] = "1ef2f1f2825080a865bbce0eb61246d4" | ||
27 | SRC_URI[sha256sum] = "2802aab758649bb222859dfcb62a5d282709ccb4d3f1df3f26f739cc091d0c8d" | ||
28 | |||
29 | S = "${WORKDIR}/ptpd-${PV}" | ||
30 | |||
31 | EXTRA_OEMAKE = "" | ||
32 | |||
33 | EXTRA_OECONF += "--disable-snmp" | ||
34 | |||
35 | do_install() { | ||
36 | install -d ${D}${bindir} ${D}${mandir}/man8 | ||
37 | install -m 0755 ${B}/src/ptpd2 ${D}${bindir} | ||
38 | install -m 0644 ${B}/src/ptpd2.8 ${D}${mandir}/man8 | ||
39 | } | ||
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 000000000..54088b044 --- /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 000000000..5cbbc5fa7 --- /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 000000000..974e6b74b --- /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.default b/meta-networking/recipes-daemons/radvd/files/radvd.default new file mode 100644 index 000000000..7cb73c771 --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/files/radvd.default | |||
@@ -0,0 +1 @@ | |||
OPTIONS="-u radvd" | |||
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 000000000..8b26317ee --- /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/radvd.service b/meta-networking/recipes-daemons/radvd/files/radvd.service new file mode 100644 index 000000000..e60798a6b --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/files/radvd.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Router advertisement daemon for IPv6 | ||
3 | After=network.target | ||
4 | ConditionPathExists=@SYSCONFDIR@/radvd.conf | ||
5 | |||
6 | [Service] | ||
7 | EnvironmentFile=-@SYSCONFDIR@/default/radvd | ||
8 | ExecStart=@SBINDIR@/radvd -n $OPTIONS | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
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 000000000..89256a40e --- /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 000000000..6b595b07f --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/radvd.inc | |||
@@ -0,0 +1,67 @@ | |||
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://radvd.service \ | ||
20 | file://volatiles.03_radvd \ | ||
21 | file://radvd.default" | ||
22 | |||
23 | inherit autotools update-rc.d useradd pkgconfig systemd | ||
24 | |||
25 | SYSTEMD_SERVICE_${PN} = "radvd.service" | ||
26 | SYSTEMD_AUTO_ENABLE = "disable" | ||
27 | |||
28 | do_install_append () { | ||
29 | install -m 0755 -d ${D}${sysconfdir}/init.d \ | ||
30 | ${D}${sysconfdir}/default/volatiles \ | ||
31 | ${D}${docdir}/radvd | ||
32 | # Install init script and volatiles | ||
33 | install -m 0755 ${WORKDIR}/radvd.init ${D}${sysconfdir}/init.d/radvd | ||
34 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
35 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
36 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
37 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/radvd | ||
38 | |||
39 | install -m 0644 ${WORKDIR}/volatiles.03_radvd ${D}${sysconfdir}/default/volatiles/volatiles.03_radvd | ||
40 | |||
41 | # Install systemd service files | ||
42 | install -d ${D}${systemd_unitdir}/system | ||
43 | install -m 0644 ${WORKDIR}/radvd.service ${D}${systemd_unitdir}/system | ||
44 | sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' \ | ||
45 | -e 's#@SBINDIR@#${sbindir}#g' \ | ||
46 | -e 's#@BASE_BINDIR@#${base_bindir}#g' ${D}${systemd_unitdir}/system/radvd.service | ||
47 | |||
48 | # Install default environment file | ||
49 | install -m 0644 ${WORKDIR}/radvd.default ${D}${sysconfdir}/default/radvd | ||
50 | |||
51 | # Documentation | ||
52 | for i in radvd.conf.example README; do \ | ||
53 | install -m 0644 ${S}/$i ${D}${docdir}/radvd; \ | ||
54 | done | ||
55 | } | ||
56 | |||
57 | INITSCRIPT_NAME = "radvd" | ||
58 | INITSCRIPT_PARAMS = "defaults 20 80" | ||
59 | |||
60 | USERADD_PACKAGES = "${PN}" | ||
61 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/radvd/ -M -g nogroup radvd" | ||
62 | |||
63 | pkg_postinst_${PN} () { | ||
64 | if [ -z "$D" -a -x /etc/init.d/populate-volatile.sh ]; then | ||
65 | /etc/init.d/populate-volatile.sh update | ||
66 | fi | ||
67 | } | ||
diff --git a/meta-networking/recipes-daemons/radvd/radvd_1.14.bb b/meta-networking/recipes-daemons/radvd/radvd_1.14.bb new file mode 100644 index 000000000..bf572e3bb --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/radvd_1.14.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | |||
2 | require radvd.inc | ||
3 | |||
4 | SRC_URI[md5sum] = "a257e05bd6a435ef948d3b407726d56f" | ||
5 | SRC_URI[sha256sum] = "3b16dd9ef3d6c8b889cdabfdb16c81db8bd61b0f1fc42f6acc52d3cf300c6d07" | ||
6 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/Add-default-entry-for-cross-compile.patch b/meta-networking/recipes-daemons/squid/files/Add-default-entry-for-cross-compile.patch new file mode 100644 index 000000000..5f845bb4c --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/Add-default-entry-for-cross-compile.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From faa212a4e0aaf442ff58fca50770a8fadc1038e3 Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <faa212a4e0aaf442ff58fca50770a8fadc1038e3.1382041123.git.Jim.Somerville@windriver.com> | ||
3 | From: Jim Somerville <Jim.Somerville@windriver.com> | ||
4 | Date: Thu, 17 Oct 2013 16:17:48 -0400 | ||
5 | Subject: [PATCH 1/1] Add default entry for cross compile | ||
6 | |||
7 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
8 | --- | ||
9 | acinclude/krb5.m4 | 6 +++++- | ||
10 | 1 files changed, 5 insertions(+), 1 deletions(-) | ||
11 | |||
12 | diff --git a/acinclude/krb5.m4 b/acinclude/krb5.m4 | ||
13 | index 5d9ac36..7a072a2 100644 | ||
14 | --- a/acinclude/krb5.m4 | ||
15 | +++ b/acinclude/krb5.m4 | ||
16 | @@ -82,7 +82,11 @@ main(void) | ||
17 | |||
18 | return 0; | ||
19 | } | ||
20 | -]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ]) | ||
21 | +]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ], | ||
22 | +[ | ||
23 | + dnl Can't test in cross compiled env - so assume good | ||
24 | + squid_cv_broken_heimdal_krb5_h=no | ||
25 | +]) | ||
26 | ], | ||
27 | [ | ||
28 | dnl Can't test in cross compiled env - so assume good | ||
29 | -- | ||
30 | 1.7.4.1 | ||
31 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/Change-ksh-reference-in-krb-ldap-helper-to-bash.patch b/meta-networking/recipes-daemons/squid/files/Change-ksh-reference-in-krb-ldap-helper-to-bash.patch new file mode 100644 index 000000000..6591d5c6f --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/Change-ksh-reference-in-krb-ldap-helper-to-bash.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 37da4010f41d936c2c727fc32adab832bdde9bec Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <37da4010f41d936c2c727fc32adab832bdde9bec.1382481765.git.Jim.Somerville@windriver.com> | ||
3 | From: Jim Somerville <Jim.Somerville@windriver.com> | ||
4 | Date: Tue, 22 Oct 2013 18:39:39 -0400 | ||
5 | Subject: [PATCH 1/1] Change ksh reference in krb ldap helper to bash | ||
6 | |||
7 | Very simple cert_tool script with no ksh specifics. | ||
8 | Change it to use bash so a package dependency doesn't | ||
9 | get created to ksh. | ||
10 | |||
11 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
12 | --- | ||
13 | helpers/external_acl/kerberos_ldap_group/cert_tool | 3 ++- | ||
14 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
15 | |||
16 | diff --git a/helpers/external_acl/kerberos_ldap_group/cert_tool b/helpers/external_acl/kerberos_ldap_group/cert_tool | ||
17 | index 9f14959..b61be5d 100644 | ||
18 | --- a/helpers/external_acl/kerberos_ldap_group/cert_tool | ||
19 | +++ b/helpers/external_acl/kerberos_ldap_group/cert_tool | ||
20 | @@ -1,4 +1,5 @@ | ||
21 | -#!/bin/ksh | ||
22 | +#!/bin/bash | ||
23 | +# The above was originally ksh | ||
24 | # | ||
25 | # ----------------------------------------------------------------------------- | ||
26 | # | ||
27 | -- | ||
28 | 1.7.4.1 | ||
29 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch b/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch new file mode 100644 index 000000000..2304c5f1d --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 0d5b337ff5ef7dd48f970f08bd95d6327917cfd1 Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <0d5b337ff5ef7dd48f970f08bd95d6327917cfd1.1382375807.git.Jim.Somerville@windriver.com> | ||
3 | From: Jim Somerville <Jim.Somerville@windriver.com> | ||
4 | Date: Mon, 21 Oct 2013 12:50:44 -0400 | ||
5 | Subject: [PATCH 1/1] Fix flawed dynamic -ldb link test in configure | ||
6 | |||
7 | The test uses dbopen, but just ignores the fact | ||
8 | that this function may not exist in the db version | ||
9 | used. This leads to the dynamic link test failing | ||
10 | and the configure script just making assumptions | ||
11 | about why and setting the need for -ldb incorrectly. | ||
12 | |||
13 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
14 | --- | ||
15 | configure.ac | 12 ++++++++++-- | ||
16 | 1 files changed, 10 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/configure.ac b/configure.ac | ||
19 | index 962a748..42e6a93 100644 | ||
20 | --- a/configure.ac | ||
21 | +++ b/configure.ac | ||
22 | @@ -3051,8 +3051,16 @@ AC_CHECK_DECL(dbopen,,,[ | ||
23 | #include <db.h> | ||
24 | #endif]) | ||
25 | |||
26 | -dnl 1.85 | ||
27 | -SQUID_CHECK_DBOPEN_NEEDS_LIBDB | ||
28 | +if test "x$ac_cv_have_decl_dbopen" = "xyes"; then | ||
29 | + dnl 1.85 | ||
30 | + SQUID_CHECK_DBOPEN_NEEDS_LIBDB | ||
31 | +else | ||
32 | + # dbopen isn't there. So instead of running a compile/link test that | ||
33 | + # uses it and is thus guaranteed to fail, we just assume that we will | ||
34 | + # need to link in the db library, rather than fabricate some other | ||
35 | + # dynamic compile/link test. | ||
36 | + ac_cv_dbopen_libdb="yes" | ||
37 | +fi | ||
38 | if test "x$ac_cv_dbopen_libdb" = "xyes"; then | ||
39 | LIB_DB="-ldb" | ||
40 | fi | ||
41 | -- | ||
42 | 1.7.4.1 | ||
43 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch b/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch new file mode 100644 index 000000000..4ca27444a --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 17e5a28667f667859c48bee25e575a072d39ee1b Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <17e5a28667f667859c48bee25e575a072d39ee1b.1381956170.git.Jim.Somerville@windriver.com> | ||
3 | From: Jim Somerville <Jim.Somerville@windriver.com> | ||
4 | Date: Wed, 16 Oct 2013 16:41:03 -0400 | ||
5 | Subject: [PATCH 1/1] Set up for cross compilation | ||
6 | |||
7 | Set the host compiler to BUILD_CXX so | ||
8 | proper cross compilation can occur. | ||
9 | |||
10 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
11 | --- | ||
12 | configure.ac | 1 + | ||
13 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
14 | |||
15 | diff --git a/configure.ac b/configure.ac | ||
16 | index c2d3033..dda9ed9 100644 | ||
17 | --- a/configure.ac | ||
18 | +++ b/configure.ac | ||
19 | @@ -19,6 +19,7 @@ m4_include([acinclude/lib-checks.m4]) | ||
20 | m4_include([acinclude/ax_cxx_compile_stdcxx_0x.m4]) | ||
21 | m4_include([acinclude/ax_cxx_0x_types.m4]) | ||
22 | |||
23 | +HOSTCXX="$BUILD_CXX" | ||
24 | PRESET_CFLAGS="$CFLAGS" | ||
25 | PRESET_CXXFLAGS="$CXXFLAGS" | ||
26 | PRESET_LDFLAGS="$LDFLAGS" | ||
27 | -- | ||
28 | 1.7.4.1 | ||
29 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch b/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch new file mode 100644 index 000000000..7b6dcc820 --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | Subject: [PATCH] Skip AC_RUN_IFELSE tests | ||
2 | |||
3 | Upstream-Status: Inappropriate [cross compiling specific] | ||
4 | |||
5 | Such tests are not supported in a cross compile | ||
6 | environment. Choose sane defaults. | ||
7 | |||
8 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
9 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
10 | --- | ||
11 | acinclude/krb5.m4 | 10 +++++++++- | ||
12 | acinclude/lib-checks.m4 | 8 ++++++-- | ||
13 | 2 files changed, 15 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/acinclude/krb5.m4 b/acinclude/krb5.m4 | ||
16 | index 946bea8..7a072a2 100644 | ||
17 | --- a/acinclude/krb5.m4 | ||
18 | +++ b/acinclude/krb5.m4 | ||
19 | @@ -82,7 +82,15 @@ main(void) | ||
20 | |||
21 | return 0; | ||
22 | } | ||
23 | -]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ]) | ||
24 | +]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ], | ||
25 | +[ | ||
26 | + dnl Can't test in cross compiled env - so assume good | ||
27 | + squid_cv_broken_heimdal_krb5_h=no | ||
28 | +]) | ||
29 | + ], | ||
30 | + [ | ||
31 | + dnl Can't test in cross compiled env - so assume good | ||
32 | + squid_cv_broken_heimdal_krb5_h=no | ||
33 | ]) | ||
34 | ]) | ||
35 | ]) dnl SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H | ||
36 | diff --git a/acinclude/lib-checks.m4 b/acinclude/lib-checks.m4 | ||
37 | index 2bf98ee..50dba9b 100644 | ||
38 | --- a/acinclude/lib-checks.m4 | ||
39 | +++ b/acinclude/lib-checks.m4 | ||
40 | @@ -128,7 +128,9 @@ AC_DEFUN([SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS],[ | ||
41 | AC_DEFINE(SQUID_SSLGETCERTIFICATE_BUGGY, 1) | ||
42 | AC_MSG_RESULT([yes]) | ||
43 | ], | ||
44 | - []) | ||
45 | + [ | ||
46 | + AC_MSG_RESULT([skipped - can't test in cross-compiled env]) | ||
47 | + ]) | ||
48 | |||
49 | AC_MSG_CHECKING(whether the workaround for SSL_get_certificate works) | ||
50 | AC_RUN_IFELSE([ | ||
51 | @@ -154,7 +156,9 @@ AC_DEFUN([SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS],[ | ||
52 | [ | ||
53 | AC_MSG_RESULT([no]) | ||
54 | ], | ||
55 | -[]) | ||
56 | +[ | ||
57 | + AC_MSG_RESULT([skipped - can't test in cross-compiled env]) | ||
58 | +]) | ||
59 | |||
60 | SQUID_STATE_ROLLBACK(check_SSL_get_certificate) | ||
61 | ]) | ||
62 | -- | ||
63 | 1.7.1 | ||
64 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/run-ptest b/meta-networking/recipes-daemons/squid/files/run-ptest new file mode 100644 index 000000000..de79a293c --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/run-ptest | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | make -C test-suite -k runtest-TESTS | ||
diff --git a/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch b/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch new file mode 100644 index 000000000..9e2ceab88 --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 2192fdbc90b0ff2d5408e8763df200620870deea Mon Sep 17 00:00:00 2001 | ||
2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
3 | Date: Mon, 13 Oct 2014 01:32:37 -0700 | ||
4 | Subject: [PATCH] squid: use serial-tests config needed by ptest | ||
5 | |||
6 | ptest needs buildtest-TESTS and runtest-TESTS targets. | ||
7 | serial-tests is required to generate those targets. | ||
8 | |||
9 | Upstream-Status: Inappropriate [default automake behavior incompatible with ptest] | ||
10 | |||
11 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
12 | --- | ||
13 | configure.ac | 2 +- | ||
14 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
15 | |||
16 | diff --git a/configure.ac b/configure.ac | ||
17 | index 6f7171f..ab9b93e 100644 | ||
18 | --- a/configure.ac | ||
19 | +++ b/configure.ac | ||
20 | @@ -3,7 +3,7 @@ AC_PREREQ(2.61) | ||
21 | AC_CONFIG_HEADERS([include/autoconf.h]) | ||
22 | AC_CONFIG_AUX_DIR(cfgaux) | ||
23 | AC_CONFIG_SRCDIR([src/main.cc]) | ||
24 | -AM_INIT_AUTOMAKE([tar-ustar nostdinc]) | ||
25 | +AM_INIT_AUTOMAKE([tar-ustar nostdinc serial-tests]) | ||
26 | AC_REVISION($Revision$)dnl | ||
27 | AC_PREFIX_DEFAULT(/usr/local/squid) | ||
28 | AM_MAINTAINER_MODE | ||
29 | -- | ||
30 | 1.7.1 | ||
31 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/volatiles.03_squid b/meta-networking/recipes-daemons/squid/files/volatiles.03_squid new file mode 100644 index 000000000..b96865d73 --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/volatiles.03_squid | |||
@@ -0,0 +1,2 @@ | |||
1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
2 | d squid squid 0755 /var/run/squid none | ||
diff --git a/meta-networking/recipes-daemons/squid/squid_3.4.7.bb b/meta-networking/recipes-daemons/squid/squid_3.4.7.bb new file mode 100644 index 000000000..cd10bd042 --- /dev/null +++ b/meta-networking/recipes-daemons/squid/squid_3.4.7.bb | |||
@@ -0,0 +1,66 @@ | |||
1 | SUMMARY = "A fully-featured http proxy and web-cache daemon for Linux" | ||
2 | DESCRIPTION = "A fully-featured http proxy and web-cache daemon for Linux. \ | ||
3 | Squid offers a rich access control, authorization and logging environment to \ | ||
4 | develop web proxy and content serving applications. \ | ||
5 | Squid offers a rich set of traffic optimization options, most of which are \ | ||
6 | enabled by default for simpler installation and high performance. \ | ||
7 | " | ||
8 | HOMEPAGE = "http://www.squid-cache.org" | ||
9 | SECTION = "network" | ||
10 | LICENSE = "GPLv2+" | ||
11 | |||
12 | MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}" | ||
13 | MIN_VER = "${@oe.utils.trim_version("${PV}", 2)}" | ||
14 | |||
15 | SRC_URI = "http://www.squid-cache.org/Versions/v${MAJ_VER}/${MIN_VER}/${BPN}-${PV}.tar.bz2 \ | ||
16 | file://Set-up-for-cross-compilation.patch \ | ||
17 | file://Skip-AC_RUN_IFELSE-tests.patch \ | ||
18 | file://Fix-flawed-dynamic-ldb-link-test-in-configure.patch \ | ||
19 | file://Change-ksh-reference-in-krb-ldap-helper-to-bash.patch \ | ||
20 | file://squid-use-serial-tests-config-needed-by-ptest.patch \ | ||
21 | file://run-ptest \ | ||
22 | file://volatiles.03_squid \ | ||
23 | " | ||
24 | |||
25 | LIC_FILES_CHKSUM = "file://COPYING;md5=c492e2d6d32ec5c1aad0e0609a141ce9 \ | ||
26 | file://COPYRIGHT;md5=2900f50789c498be8e9f1eb23b55cbe9 \ | ||
27 | " | ||
28 | SRC_URI[md5sum] = "9951034b10f7ee0f45a95cfae61c57c2" | ||
29 | SRC_URI[sha256sum] = "7b423f3d3495a317503ca559ea535f80445fd7c4e3c3e268cb7a8c97c61af2b6" | ||
30 | |||
31 | DEPENDS = "libtool krb5 openldap db cyrus-sasl" | ||
32 | |||
33 | inherit autotools useradd ptest | ||
34 | |||
35 | USERADD_PACKAGES = "${PN}" | ||
36 | USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /var/run/squid --shell /bin/false --user-group squid" | ||
37 | |||
38 | PACKAGECONFIG ??= "" | ||
39 | PACKAGECONFIG[libnetfilter-conntrack] = "--with-netfilter-conntrack=${includedir}, --without-netfilter-conntrack, libnetfilter-conntrack" | ||
40 | EXTRA_OECONF += "--with-default-user=squid" | ||
41 | |||
42 | TESTDIR = "test-suite" | ||
43 | do_compile_ptest() { | ||
44 | oe_runmake -C ${TESTDIR} buildtest-TESTS | ||
45 | } | ||
46 | |||
47 | do_install_ptest() { | ||
48 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} | ||
49 | cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} | ||
50 | |||
51 | # do NOT need to rebuild Makefile itself | ||
52 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
53 | } | ||
54 | |||
55 | do_install_append() { | ||
56 | install -d ${D}${sysconfdir}/default/volatiles | ||
57 | install -m 0644 ${WORKDIR}/volatiles.03_squid ${D}${sysconfdir}/default/volatiles/volatiles.03_squid | ||
58 | rmdir "${D}${localstatedir}/run/${BPN}" | ||
59 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/run" | ||
60 | } | ||
61 | |||
62 | FILES_${PN} += "${libdir} ${datadir}/errors ${datadir}/icons" | ||
63 | FILES_${PN}-dbg += "/usr/src/debug" | ||
64 | FILES_${PN}-doc += "${datadir}/*.txt" | ||
65 | |||
66 | RDEPENDS_${PN}-ptest += "make" | ||
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 000000000..b95e8adc2 --- /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 000000000..96b631bf0 --- /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 000000000..ef183d702 --- /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 000000000..ce10ecefe --- /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 000000000..d01c20d38 --- /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 000000000..1dce7fdfe --- /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/fix-writing-emtpy-file.patch b/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch new file mode 100644 index 000000000..452aa05f8 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | [PATCH] fix the empty file writting | ||
2 | |||
3 | Upstream-Status: pending | ||
4 | |||
5 | With the feature that checking the disk filled up, the return | ||
6 | value of function write_behind was checked and used to detect | ||
7 | the disk status. While for empty file, without data being | ||
8 | written, this function will return -1 thus the disk filled up | ||
9 | error was miss-raised. | ||
10 | |||
11 | make write_behind to return 0 if written file is empty, to fix | ||
12 | the this bug. | ||
13 | |||
14 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
15 | --- | ||
16 | common/tftpsubs.c | 5 ++++- | ||
17 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/common/tftpsubs.c b/common/tftpsubs.c | ||
20 | index b4ea3f2..9f6cafc 100644 | ||
21 | --- a/common/tftpsubs.c | ||
22 | +++ b/common/tftpsubs.c | ||
23 | @@ -198,9 +198,12 @@ int write_behind(FILE * file, int convert) | ||
24 | nextone = !nextone; /* incr for next time */ | ||
25 | buf = dp->th_data; | ||
26 | |||
27 | - if (count <= 0) | ||
28 | + if (count < 0) | ||
29 | return -1; /* nak logic? */ | ||
30 | |||
31 | + if (count == 0) | ||
32 | + return 0; | ||
33 | + | ||
34 | if (convert == 0) | ||
35 | return write(fileno(file), buf, count); | ||
36 | |||
37 | -- | ||
38 | 1.9.1 | ||
39 | |||
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 000000000..9e1843635 --- /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 000000000..3f690609a --- /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 000000000..98a86b78b --- /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 000000000..7ae1a8722 --- /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 000000000..6b8ceaaeb --- /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 000000000..85110eb28 --- /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 000000000..08d2b5b7d --- /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 000000000..720cd69de --- /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 000000000..216349d26 --- /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-hpa-bug-fix-on-separated-CR-and-LF.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch new file mode 100644 index 000000000..3e220ec38 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 6ed1eb8829dee351b54e183bc42c007cb306aaa5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Zhang Xiao <xiao.zhang@windriver.com> | ||
3 | Date: Wed, 11 Jun 2014 14:01:16 +0800 | ||
4 | Subject: [PATCH] tftp-hpa: bug fix on separated CR and LF | ||
5 | |||
6 | In ascii mode, if the CR and LF was separated into different transfer | ||
7 | blocks, LF will be just dropped instead of replacing the previous CR. | ||
8 | Add a checking on the first character to fix it. | ||
9 | |||
10 | Upstream-Status: pending | ||
11 | |||
12 | Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com> | ||
13 | --- | ||
14 | common/tftpsubs.c | 8 ++++++++ | ||
15 | 1 file changed, 8 insertions(+) | ||
16 | |||
17 | diff --git a/common/tftpsubs.c b/common/tftpsubs.c | ||
18 | index b4d4ffe..b4ea3f2 100644 | ||
19 | --- a/common/tftpsubs.c | ||
20 | +++ b/common/tftpsubs.c | ||
21 | @@ -207,6 +207,14 @@ int write_behind(FILE * file, int convert) | ||
22 | p = buf; | ||
23 | ct = count; | ||
24 | count = 0; | ||
25 | + | ||
26 | + /* Check the first character together with prevchar */ | ||
27 | + c = *p; | ||
28 | + if ((prevchar == '\r') && (c == '\n')) { | ||
29 | + lseek(fileno(file), -1, SEEK_CUR); | ||
30 | + count++; | ||
31 | + } | ||
32 | + | ||
33 | while (ct--) { /* loop over the buffer */ | ||
34 | c = *p++; /* pick up a character */ | ||
35 | if (prevchar == '\r') { /* if prev char was cr */ | ||
36 | -- | ||
37 | 1.8.5.2.233.g932f7e4 | ||
38 | |||
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 000000000..fe7016396 --- /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 000000000..3f17fd6fc --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb | |||
@@ -0,0 +1,76 @@ | |||
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 | file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \ | ||
28 | file://fix-writing-emtpy-file.patch \ | ||
29 | " | ||
30 | |||
31 | SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" | ||
32 | SRC_URI[sha256sum] = "0a9f88d4c1c02687b4853b02ab5dd8779d4de4ffdb9b2e5c9332841304d1a269" | ||
33 | |||
34 | inherit autotools-brokensep update-rc.d update-alternatives | ||
35 | |||
36 | export AR = "${HOST_PREFIX}ar cq" | ||
37 | |||
38 | EXTRA_OECONF += "--disable-option-checking" | ||
39 | |||
40 | # configure.in has errors | ||
41 | do_configure() { | ||
42 | oe_runconf | ||
43 | } | ||
44 | |||
45 | do_install() { | ||
46 | oe_runmake install INSTALLROOT=${D} | ||
47 | mv ${D}${bindir}/tftp ${D}${bindir}/tftp-hpa | ||
48 | mv ${D}${sbindir}/in.tftpd ${D}${sbindir}/in.tftpd-hpa | ||
49 | |||
50 | install -m 755 -d ${D}${localstatedir}/lib/tftpboot/ | ||
51 | install -d ${D}${sysconfdir}/init.d | ||
52 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/tftpd-hpa | ||
53 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
54 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
55 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
56 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
57 | |||
58 | install -d ${D}${sysconfdir}/default | ||
59 | install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa | ||
60 | } | ||
61 | |||
62 | FILES_${PN} = "${bindir}" | ||
63 | |||
64 | PACKAGES += "tftp-hpa-server" | ||
65 | SUMMARY_tftp-hpa-server = "Server for the Trivial File Transfer Protocol" | ||
66 | FILES_tftp-hpa-server = "${sbindir} ${sysconfdir} ${localstatedir}" | ||
67 | CONFFILES_tftp-hpa-server = "${sysconfdir}/default/tftpd-hpa" | ||
68 | |||
69 | INITSCRIPT_PACKAGES = "tftp-hpa-server" | ||
70 | INITSCRIPT_NAME = "tftpd-hpa" | ||
71 | INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 20 1 ." | ||
72 | |||
73 | ALTERNATIVE_${PN} = "tftp" | ||
74 | ALTERNATIVE_TARGET[tftp] = "${bindir}/tftp-hpa" | ||
75 | ALTERNATIVE_PRIORITY = "50" | ||
76 | |||
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 000000000..d2eb15614 --- /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 000000000..a2ebb5a48 --- /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-brokensep | ||
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 000000000..5f2860e84 --- /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 000000000..d0ec010dc --- /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 000000000..8a602ba37 --- /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 000000000..bb1929480 --- /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 000000000..096142f5d --- /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.service b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service new file mode 100644 index 000000000..e27102026 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service | |||
@@ -0,0 +1,9 @@ | |||
1 | [Unit] | ||
2 | Description=Vsftpd ftp daemon | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | ExecStart=@SBINDIR@/vsftpd | ||
7 | |||
8 | [Install] | ||
9 | WantedBy=multi-user.target | ||
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 000000000..d283e3d26 --- /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.2/makefile-destdir.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-destdir.patch new file mode 100644 index 000000000..1980d09fd --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/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.2/makefile-libs.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-libs.patch new file mode 100644 index 000000000..9a10f722f --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/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.2/makefile-strip.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-strip.patch new file mode 100644 index 000000000..fd3160037 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/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.2/nopam-with-tcp_wrappers.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/nopam-with-tcp_wrappers.patch new file mode 100644 index 000000000..fdcf3a02b --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/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.2/nopam.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/nopam.patch new file mode 100644 index 000000000..cf0d68e27 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/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.2/vsftpd-tcp_wrappers-support.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/vsftpd-tcp_wrappers-support.patch new file mode 100644 index 000000000..69745b3a1 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/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.2.bb b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb new file mode 100644 index 000000000..e4d65eea6 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb | |||
@@ -0,0 +1,106 @@ | |||
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 | file://vsftpd.service \ | ||
20 | " | ||
21 | |||
22 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \ | ||
23 | file://COPYRIGHT;md5=04251b2eb0f298dae376d92454f6f72e \ | ||
24 | file://LICENSE;md5=654df2042d44b8cac8a5654fc5be63eb" | ||
25 | SRC_URI[md5sum] = "8b00c749719089401315bd3c44dddbb2" | ||
26 | SRC_URI[sha256sum] = "be46f0e2c5528fe021fafc8dab1ecfea0c1f183063a06977f8537fcd0b195e56" | ||
27 | |||
28 | |||
29 | PACKAGECONFIG ??= "tcp-wrappers" | ||
30 | PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers" | ||
31 | SRC_URI +="${@base_contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)}" | ||
32 | |||
33 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
34 | RDEPENDS_${PN} += "${@base_contains('DISTRO_FEATURES', 'pam', 'pam-plugin-listfile', '', d)}" | ||
35 | PAMLIB = "${@base_contains('DISTRO_FEATURES', 'pam', '-L${STAGING_BASELIBDIR} -lpam', '', d)}" | ||
36 | NOPAM_SRC ="${@base_contains('PACKAGECONFIG', 'tcp-wrappers', 'file://nopam-with-tcp_wrappers.patch', 'file://nopam.patch', d)}" | ||
37 | SRC_URI += "${@base_contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)}" | ||
38 | |||
39 | inherit update-rc.d useradd systemd | ||
40 | |||
41 | CONFFILES_${PN} = "${sysconfdir}/vsftpd.conf" | ||
42 | LDFLAGS_append =" -lcrypt -lcap" | ||
43 | |||
44 | do_configure() { | ||
45 | # Fix hardcoded /usr, /etc, /var mess. | ||
46 | cat tunables.c|sed s:\"/usr:\"${prefix}:g|sed s:\"/var:\"${localstatedir}:g \ | ||
47 | |sed s:\"/etc:\"${sysconfdir}:g > tunables.c.new | ||
48 | mv tunables.c.new tunables.c | ||
49 | } | ||
50 | |||
51 | do_compile() { | ||
52 | oe_runmake "LIBS=-L${STAGING_LIBDIR} -lcrypt -lcap ${PAMLIB} -lwrap" | ||
53 | } | ||
54 | |||
55 | do_install() { | ||
56 | install -d ${D}${sbindir} | ||
57 | install -d ${D}${mandir}/man8 | ||
58 | install -d ${D}${mandir}/man5 | ||
59 | oe_runmake 'DESTDIR=${D}' install | ||
60 | install -d ${D}${sysconfdir} | ||
61 | install -m 600 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}/vsftpd.conf | ||
62 | install -d ${D}${sysconfdir}/init.d/ | ||
63 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/vsftpd | ||
64 | install -d ${D}/${sysconfdir}/default/volatiles | ||
65 | install -m 644 ${WORKDIR}/volatiles.99_vsftpd ${D}/${sysconfdir}/default/volatiles/99_vsftpd | ||
66 | |||
67 | install -m 600 ${WORKDIR}/vsftpd.ftpusers ${D}${sysconfdir}/ | ||
68 | install -m 600 ${WORKDIR}/vsftpd.user_list ${D}${sysconfdir}/ | ||
69 | if ! test -z "${PAMLIB}" ; then | ||
70 | install -d ${D}${sysconfdir}/pam.d/ | ||
71 | cp ${S}/RedHat/vsftpd.pam ${D}${sysconfdir}/pam.d/vsftpd | ||
72 | sed -i "s:/lib/security:${base_libdir}/security:" ${D}${sysconfdir}/pam.d/vsftpd | ||
73 | sed -i "s:ftpusers:vsftpd.ftpusers:" ${D}${sysconfdir}/pam.d/vsftpd | ||
74 | fi | ||
75 | if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
76 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
77 | echo "d /var/run/vsftpd/empty 0755 root root -" \ | ||
78 | > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf | ||
79 | fi | ||
80 | |||
81 | # Install systemd unit files | ||
82 | install -d ${D}${systemd_unitdir}/system | ||
83 | install -m 0644 ${WORKDIR}/vsftpd.service ${D}${systemd_unitdir}/system | ||
84 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/vsftpd.service | ||
85 | } | ||
86 | |||
87 | INITSCRIPT_PACKAGES = "${PN}" | ||
88 | INITSCRIPT_NAME_${PN} = "vsftpd" | ||
89 | INITSCRIPT_PARAMS_${PN} = "defaults 80" | ||
90 | |||
91 | USERADD_PACKAGES = "${PN}" | ||
92 | USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ftp --no-create-home -g ftp \ | ||
93 | --shell /bin/false ftp " | ||
94 | GROUPADD_PARAM_${PN} = "-r ftp" | ||
95 | |||
96 | SYSTEMD_SERVICE_${PN} = "vsftpd.service" | ||
97 | |||
98 | pkg_postinst_${PN}() { | ||
99 | if [ -z "$D" ]; then | ||
100 | if type systemd-tmpfiles >/dev/null; then | ||
101 | systemd-tmpfiles --create | ||
102 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then | ||
103 | ${sysconfdir}/init.d/populate-volatile.sh update | ||
104 | fi | ||
105 | fi | ||
106 | } | ||