Business IT - Technology for your business

No. 1 Story

Mobile operators get fixed price spectrum renewal in $3b Government windfall

The Government has offered Australia's three mobile operators, and vividwireless, renewal of their existing spectrum allocated on 15 year licences in the late 90s and early 2000s at set prices, while the Government expects to rake in $3 billion.

read more

Write your own Linux server part one

Business IT - Open Source

dwserv.h


/*
 *  DWSERV
 */

#ifndef __DWSERV_H
#define __DWSERV_H

// You may need to change some of these ...

#define SECRET_PASSWORD "allyourbasearebelongtous"
#define SUCCESS_MSG "Successful"

#define ALIASFILE "/etc/aliases"
#define GROUPFILE "/etc/group"

#define USERADD_PATH "/usr/sbin/useradd"
#define GREP_PATH "/usr/bin/grep"
#define PASSWD_PATH "/bin/passwd"
#define HOME_PATH "/home/"   // Be sure to include the trailing /

#include <arpa/inet.h>
#include <ctype.h>
#include <fcntl.h>
#include <limits.h>
#include <netdb.h>
#include <netinet/in.h>
#include <shadow.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/termios.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <time.h>

#include "StringVector.h"

// Constants and variables

#define MAX_STRING 1024
#define LINELEN 1024
#ifndef BUFSIZ
#define BUFSIZ 1024
#endif
#define MAXPWWAITS 5

// Socket and interface handling routines

void log (const char *format, ...);
int errexit (const char *format, ...);
void process (int ssock, char *Remote, int connections);
void DisplayHelpMessage (int port, int qlen);
void WriteToFD (int filedesc, char *s);
const char *IPtoAddress (struct in_addr ipA);
void reaper (int sig);
char *CurrentDateTime (char *nowtime);
void StripString (char *InMsg, char *Command, char *Data);

// Account handling routines

void GetAliases (char *login, char *OutMsg);
void GetGroup (char *login, char *OutMsg);
void CreateAccount (char *data, char *OutMsg);
void StartProcess (char *command, char *OutMsg);
void SetPassword (char *szUser, char *szPlainPass, char *OutMsg);

// File manipulation routines

bool grep (char *pattern, char *file, StringVector &svec);

#endif



- sponsored feature -

The Death of Traditional BI: What’s Next?

How to Make Business Discovery Work for Your Business IP PABX BUYING GUIDE

Business Discovery takes its cues from consumer apps. Like Google, it encourages us- ers to hunt for and explore data without worrying about or even noticing the underly- ing technology. Their entire experience is working within an intuitive interface to get real-time, self-service results with only minimal training. ...more