boot, I realized that it would be very useful to have
a umount_disks. So, it is not implemented, along with
updates to the READMEs and some minor tweaks.
- Moved mounting the CDROM in the rescue boot from /cdrom
to /mnt/cdrom (more standard location).
- Reboot in CDROM rescue should now work -- requires -d
option (no write) to work.
- Hopefully fixed all the IPV6/4 problems and buffer
problems with networking in lib. Bugs 190 and 204.
Cleaned up a lot of #ifdefing problems by using routines
in address_conf.c
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1763
91ce42f0-d328-0410-95d8-
f526ca767f89
Kern's ToDo List
- 08 December 2004
+ 17 December 2004
Major development:
Project Developer
- Fix orphanned buffers:
Orphaned buffer: 24 bytes allocated at line 808 of rufus-dir job.c
Orphaned buffer: 40 bytes allocated at line 45 of rufus-dir alist.c
+- Upgrade to MySQL 4.1.1 See:
+ http://dev.mysql.com/doc/mysql/en/Server_SQL_mode.html
+
Regression tests (Jo):
- Add Pool/Storage override regression test.
- Add database test to regression. Test each function like delete,
purge, ...
+- AntiVir can slow down backups on Win32 systems.
+- Win32 systems with FAT32 can be much slower than NTFS for
+ more than 1000 files per directory.
+
1.37 Possibilities:
- Can one write tapes faster with 8192 byte block sizes?
level="disk_to_catalog";
break;
default:
- Jmsg2(jcr, M_FATAL, 0, _("Unimplemented save level %d(%c)\n"), jcr->JobLevel,
+ Jmsg2(jcr, M_FATAL, 0, _("Unimplemented Verify level %d(%c)\n"), jcr->JobLevel,
jcr->JobLevel);
goto bail_out;
}
#include "bacula.h"
+#ifdef HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
static int add_address(dlist **out, IPADDR::i_type type, unsigned short defaultport, int family,
const char *hostname_str, const char *port_str, char **errstr);
const char *IPADDR::get_address(char *outputbuf, int outlen)
{
outputbuf[0] = '\0';
-#if defined(HAVE_INET_NTOP) && defined(HAVE_IPV6)
+#ifdef HAVE_INET_NTOP
+# ifdef HAVE_IPV6
inet_ntop(saddr->sa_family, saddr->sa_family == AF_INET ?
(void*)&(saddr4->sin_addr) : (void*)&(saddr6->sin6_addr),
outputbuf, outlen);
+# else
+ inet_ntop(saddr->sa_family, (void*)&(saddr4->sin_addr), outputbuf, outlen);
+# endif
#else
bstrncpy(outputbuf, inet_ntoa(saddr4->sin_addr), outlen);
#endif
return -1;
}
-int sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len)
+int sockaddr_get_port(const struct sockaddr *client_addr)
+{
+ if (client_addr->sa_family == AF_INET) {
+ return ntohs(((struct sockaddr_in *)client_addr)->sin_port);
+ }
+#ifdef HAVE_IPV6
+ else {
+ return ntohs(((struct sockaddr_in6 *)client_addr)->sin6_port);
+ }
+#endif
+ return -1;
+}
+
+
+char *sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len)
{
#ifdef HAVE_INET_NTOP
/* MA Bug 5 the problem was that i mixed up sockaddr and in_addr */
inet_ntop(sa->sa_family,
+# ifdef HAVE_IPV6
sa->sa_family == AF_INET ?
(void*)&(((struct sockaddr_in*)sa)->sin_addr) :
(void*)&(((struct sockaddr_in6*)sa)->sin6_addr),
+# else
+ (void*)&(((struct sockaddr_in*)sa)->sin_addr) :
+# endif /* HAVE_IPV6 */
buf, len);
#else
bstrncpy(buf, inet_ntoa(((struct sockaddr_in *)sa)->sin_addr), len);
#endif
- return 1;
+ return buf;
}
+
+#ifdef HAVE_OLD_SOCKOPT
+int inet_aton(const char *cp, struct in_addr *inp)
+{
+ struct in_addr inaddr;
+
+ if((inaddr.s_addr = inet_addr(cp)) != INADDR_NONE) {
+ inp->s_addr = inaddr.s_addr;
+ return 1;
+ }
+ return 0;
+}
+#endif
class IPADDR : public SMARTALLOC {
public:
typedef enum { R_SINGLE, R_SINGLE_PORT, R_SINGLE_ADDR, R_MULTIPLE,
- R_DEFAULT, R_EMPTY
+ R_DEFAULT, R_EMPTY
} i_type;
IPADDR(int af);
IPADDR(const IPADDR & src);
extern const char *build_addresses_str(dlist *addrs, char *buf, int blen);
extern int sockaddr_get_port_net_order(const struct sockaddr *sa);
-extern int sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len);
+extern int sockaddr_get_port(const struct sockaddr *sa);
+extern char *sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len);
+#ifdef HAVE_OLD_SOCKOPT
+extern int inet_aton(const char *cp, struct in_addr *inp);
+#endif
fromhost(&request);
if (!hosts_access(&request)) {
V(mutex);
-#ifndef HAVE_INET_NTOP
Jmsg2(NULL, M_SECURITY, 0,
_("Connection from %s:%d refused by hosts.access\n"),
- inet_ntoa(((sockaddr_in *)&cli_addr)->sin_addr),
- ntohs(((sockaddr_in *)&cli_addr)->sin_port));
-#else
- Jmsg2(NULL, M_SECURITY, 0,
- _("Connection from %s:%d refused by hosts.access\n"),
- inet_ntop(clilen == sizeof(sockaddr_in) ? AF_INET : AF_INET6,
- &clilen, buf, clilen),
- ntohs(clilen == sizeof(sockaddr_in) ?
- ((sockaddr_in *)&cli_addr)->sin_port :
- ((sockaddr_in6 *)&cli_addr)->sin6_port));
-#endif
+ sockaddr_to_ascii(&cli_addr, buf, sizeof(buf)),
+ sockaddr_get_port(&cli_addr));
close(newsockfd);
continue;
}
/* see who client is. i.e. who connected to us. */
P(mutex);
-#ifdef HAVE_INET_NTOP
- inet_ntop(clilen == sizeof(sockaddr_in) ? AF_INET : AF_INET6, &clilen,
- buf, sizeof(buf));
-#else
- bstrncpy(buf, inet_ntoa(((sockaddr_in *)&cli_addr)->sin_addr), sizeof(buf)); /* NOT thread safe, use mutex */
-#endif
+ sockaddr_to_ascii(&cli_addr, buf, sizeof(buf));
V(mutex);
BSOCK *bs;
bs = init_bsock(NULL, newsockfd, "client", buf, fd_ptr->port, &cli_addr);
changer = edit_device_codes(jcr, changer, jcr->device->changer_command,
"loaded");
status = run_program(changer, timeout, results);
- Dmsg3(100, "run_prog: %s stat=%d result=%s\n", changer, status, results);
+ Dmsg3(50, "run_prog: %s stat=%d result=%s\n", changer, status, results);
if (status == 0) {
loaded = atoi(results);
if (loaded > 0) {
dcr->VolCatInfo.VolCatName, dcr->VolCatInfo.Slot);
dcr->VolCatInfo.InChanger = false;
dev->VolCatInfo.InChanger = false;
- Dmsg0(100, "update vol info in mount\n");
+ Dmsg0(400, "update vol info in mount\n");
dir_update_volume_info(dcr, true); /* set new status */
}
char add[20];
*omsg = 0;
- Dmsg1(400, "edit_device_codes: %s\n", imsg);
+ Dmsg1(800, "edit_device_codes: %s\n", imsg);
for (p=imsg; *p; p++) {
if (*p == '%') {
switch (*++p) {
add[1] = 0;
str = add;
}
- Dmsg1(400, "add_str %s\n", str);
+ Dmsg1(900, "add_str %s\n", str);
pm_strcat(&omsg, (char *)str);
- Dmsg1(400, "omsg=%s\n", omsg);
+ Dmsg1(800, "omsg=%s\n", omsg);
}
return omsg;
}
/* */
#undef VERSION
#define VERSION "1.37.1"
-#define BDATE "17 December 2004"
-#define LSMDATE "17Dec04"
+#define BDATE "18 December 2004"
+#define LSMDATE "18Dec04"
/* Debug flags */
#undef DEBUG