SCCS-vsn: sbin/dump/dumprmt.c 1.7
-static char *sccsid = "@(#)dumprmt.c 1.6 (Berkeley) %G%";
+static char *sccsid = "@(#)dumprmt.c 1.7 (Berkeley) %G%";
#include <sys/param.h>
#include <sys/mtio.h>
#include <sys/param.h>
#include <sys/mtio.h>
#include <netinet/in.h>
#include <stdio.h>
#include <netinet/in.h>
#include <stdio.h>
#include <netdb.h>
#define TS_CLOSED 0
#include <netdb.h>
#define TS_CLOSED 0
rmtgetconn()
{
static struct servent *sp = 0;
rmtgetconn()
{
static struct servent *sp = 0;
+ struct passwd *pw;
+ char *name = "root";
if (sp == 0) {
sp = getservbyname("shell", "tcp");
if (sp == 0) {
sp = getservbyname("shell", "tcp");
- rmtape = rcmd(&rmtpeer, sp->s_port, "root", "root", "/etc/rmt", 0);
+ pw = getpwuid(getuid());
+ if (pw && pw->pw_name)
+ name = pw->pw_name;
+ rmtape = rcmd(&rmtpeer, sp->s_port, name, name, "/etc/rmt", 0);