~vcs-imports/ipfire/ipfire-2.x

« back to all changes in this revision

Viewing changes to src/misc-progs/launch-ether-wake.c

  • Committer: Daniel Glanzmann
  • Date: 2008-09-26 17:05:28 UTC
  • mto: (1394.1.12)
  • mto: This revision was merged to the branch mainline in revision 1401.
  • Revision ID: git-v1:19ac4d1b6e234e1391b3d406381e3b74e92c40dd
added new useragent thunderbird

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the Wake-on-LAN GUI AddOn
 
2
 *
 
3
 * This program is distributed under the terms of the GNU General Public
 
4
 * Licence.  See the file COPYING for details.
 
5
 *
 
6
 * Copyright (C) 2006-03-03 weizen_42
 
7
 *
 
8
 *
 
9
 */
 
10
 
 
11
#include <stdio.h>
 
12
#include <string.h>
 
13
#include <unistd.h>
 
14
#include <stdlib.h>
 
15
#include <sys/types.h>
 
16
#include <fcntl.h>
 
17
#include "setuid.h"
 
18
 
 
19
 
 
20
#define BUFFER_SIZE 512
 
21
 
 
22
char command[BUFFER_SIZE];
 
23
 
 
24
int main(int argc, char *argv[])
 
25
{
 
26
        if (!(initsetuid()))
 
27
                exit(1);
 
28
 
 
29
  snprintf(command, BUFFER_SIZE-1, "/usr/sbin/etherwake -i %s %s", argv[2], argv[1]);
 
30
  safe_system(command);
 
31
 
 
32
  return(0);
 
33
}