File: UnixTransport.cs

package info (click to toggle)
aircrack-ng 1%3A1.5.2-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 17,416 kB
  • sloc: ansic: 67,243; cs: 5,392; python: 2,619; sh: 2,102; makefile: 1,001; asm: 569; cpp: 69
file content (37 lines) | stat: -rw-r--r-- 789 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details

using System;
using System.IO;
using Mono.Unix;

namespace NDesk.DBus.Transports
{
	abstract class UnixTransport : Transport
	{
		public override void Open (AddressEntry entry)
		{
			string path;
			bool abstr;

			if (entry.Properties.TryGetValue ("path", out path))
				abstr = false;
			else if (entry.Properties.TryGetValue ("abstract", out path))
				abstr = true;
			else
				throw new Exception ("No path specified for UNIX transport");

			Open (path, abstr);
		}

		public override string AuthString ()
		{
			long uid = UnixUserInfo.GetRealUserId ();

			return uid.ToString ();
		}

		public abstract void Open (string path, bool @abstract);
	}
}